BBusiWishXkcxMapper.xml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.ruoyi.syzy.mapper.BBusiWishXkcxMapper">
  6. <resultMap type="BBusiWishXkcx" id="BBusiWishXkcxResult">
  7. <result property="id" column="id" />
  8. <result property="year" column="year" />
  9. <result property="customerCode" column="customer_code" />
  10. <result property="location" column="location" />
  11. <result property="level" column="level" />
  12. <result property="marjorId" column="marjorId" />
  13. <result property="universityId" column="universityId" />
  14. <result property="universityName" column="universityName" />
  15. <result property="marjorName" column="marjorName" />
  16. <result property="marjorBelongs" column="marjorBelongs" />
  17. <result property="marjorDirection" column="marjorDirection" />
  18. <result property="courseRemark0" column="courseRemark0" />
  19. <result property="courseRemark1" column="courseRemark1" />
  20. <result property="course0" column="course0" />
  21. <result property="course1" column="course1" />
  22. <result property="course2" column="course2" />
  23. <result property="score" column="score" />
  24. <result property="seat" column="seat" />
  25. <result property="num" column="num" />
  26. <result property="numReal" column="numReal" />
  27. <result property="scoreRealTop" column="scoreRealTop" />
  28. <result property="seatRealTop" column="seatRealTop" />
  29. <result property="scoreRealAverage" column="scoreRealAverage" />
  30. <result property="seatRealAverage" column="seatRealAverage" />
  31. <result property="createTime" column="createTime" />
  32. <result property="status" column="status" />
  33. <result property="roundId" column="roundId" />
  34. <result property="roundName" column="roundName" />
  35. </resultMap>
  36. <sql id="selectBBusiWishXkcxVo">
  37. select id, year, location, level, marjorId, universityId, universityName, marjorName, marjorBelongs, marjorDirection, courseRemark0, courseRemark1, course0, course1, course2,
  38. score, seat, num, numReal, scoreRealTop, seatRealTop, scoreRealAverage, seatRealAverage, createTime, status from b_busi_wish_xkcx
  39. </sql>
  40. <select id="selectBusiWishXkcxForRecommend" parameterType="list" resultMap="BBusiWishXkcxResult">
  41. SELECT distinct wx.course0, wx.course1, wx.course2, wx.`marjorName`
  42. FROM b_busi_wish_xkcx wx
  43. <where> wx.`course0` != '' AND
  44. <foreach item="c" collection="list" open="(" separator="OR" close=")">
  45. wx.`marjorName` = #{c.marjorName} AND <foreach item="o" collection="c.belongs" open="(" separator="OR" close=")"> wx.`marjorBelongs` LIKE #{o} </foreach>
  46. </foreach>
  47. </where>
  48. </select>
  49. <select id="selectBusiWishXkcxByCustomer2" parameterType="map" resultMap="BBusiWishXkcxResult">
  50. SELECT cx.`customerCode` customer_code,cx.`round_id` roundId, bx.`universityId`, bx.`universityName`, bx.`level`, bx.`marjorName`, bx.`marjorBelongs`, bx.`course0`, bx.`course1`, bx.`course2`
  51. FROM `b_customer_xkcx` cx
  52. JOIN `b_busi_wish_xkcx` bx ON cx.`submitId` = bx.`id`
  53. WHERE cx.`customerCode` in <foreach item="id" collection="customerCodes" open="(" separator="," close=")">#{id}</foreach> and cx.`is_select_course` = 1
  54. </select>
  55. <select id="selectBusiWishXkcxByCustomer" parameterType="map" resultMap="BBusiWishXkcxResult">
  56. SELECT cx.`customerCode` customer_code,cx.`round_id` roundId, bx.`universityId`, bx.`universityName`, mc.code `marjorId`, bx.`marjorName`, bx.`marjorBelongs`, bx.`course0`, bx.`course1`, bx.`course2`
  57. FROM `b_customer_xkcx` cx
  58. JOIN `b_busi_wish_xkcx` bx ON cx.`submitId` = bx.`id`
  59. JOIN `sy_major` mc ON mc.`name` = bx.`marjorName` AND mc.`type` = bx.`level` AND mc.`level` = 2
  60. WHERE cx.`customerCode` in <foreach item="id" collection="customerCodes" open="(" separator="," close=")">#{id}</foreach> and cx.`is_select_course` = 1
  61. </select>
  62. <select id="selectBBusiWishXkcxList" parameterType="BBusiWishXkcx" resultMap="BBusiWishXkcxResult">
  63. <include refid="selectBBusiWishXkcxVo" />
  64. <where>
  65. <if test="year != null and year != ''"> and year = #{year}</if>
  66. <if test="location != null and location != ''"> and location = #{location}</if>
  67. <if test="level != null and level != ''"> and level = #{level}</if>
  68. <if test="marjorId != null and marjorId != ''"> and marjorId = #{marjorId}</if>
  69. <if test="universityId != null and universityId != ''"> and universityId = #{universityId}</if>
  70. <if test="universityName != null and universityName != ''"> and universityName like concat('%', #{universityName}, '%')</if>
  71. <if test="marjorName != null and marjorName != ''"> and marjorName like concat('%', #{marjorName}, '%')</if>
  72. <if test="marjorBelongs != null and marjorBelongs != ''"> and marjorBelongs = #{marjorBelongs}</if>
  73. <if test="marjorDirection != null and marjorDirection != ''"> and marjorDirection = #{marjorDirection}</if>
  74. <if test="courseRemark0 != null and courseRemark0 != ''"> and courseRemark0 = #{courseRemark0}</if>
  75. <if test="courseRemark1 != null and courseRemark1 != ''"> and courseRemark1 = #{courseRemark1}</if>
  76. <if test="course0 != null and course0 != ''"> and course0 = #{course0}</if>
  77. <if test="course1 != null and course1 != ''"> and course1 = #{course1}</if>
  78. <if test="course2 != null and course2 != ''"> and course2 = #{course2}</if>
  79. <if test="score != null "> and score = #{score}</if>
  80. <if test="seat != null "> and seat = #{seat}</if>
  81. <if test="num != null "> and num = #{num}</if>
  82. <if test="numReal != null "> and numReal = #{numReal}</if>
  83. <if test="scoreRealTop != null "> and scoreRealTop = #{scoreRealTop}</if>
  84. <if test="seatRealTop != null "> and seatRealTop = #{seatRealTop}</if>
  85. <if test="scoreRealAverage != null "> and scoreRealAverage = #{scoreRealAverage}</if>
  86. <if test="seatRealAverage != null "> and seatRealAverage = #{seatRealAverage}</if>
  87. <if test="createTime != null "> and createTime = #{createTime}</if>
  88. <if test="status != null "> and status = #{status}</if>
  89. </where>
  90. </select>
  91. <select id="listByCourses" parameterType="String" resultMap="BBusiWishXkcxResult">
  92. <include refid="selectBBusiWishXkcxVo" />
  93. ${qw}
  94. <!--order by (SELECT code from b_busi_wish_universities t2 where t2.id=universityId) asc-->
  95. </select>
  96. <!--<select id="listByCourses_COUNT" parameterType="String" resultMap="BBusiWishXkcxResult">
  97. SELECT count(0) FROM b_busi_wish_xkcx
  98. ${qw}
  99. </select>-->
  100. <select id="listByCourses2" parameterType="BCustomerXkcx" resultMap="BBusiWishXkcxResult">
  101. select bbwx.*,concat(msr.year,' ',msr.name) roundName from b_customer_xkcx bcx
  102. LEFT JOIN b_busi_wish_xkcx bbwx on bcx.submitId = bbwx.id
  103. LEFT JOIN mxjb_selected_round msr on msr.round_id = bcx.round_id
  104. <where>
  105. <if test="customerCode != null and customerCode != ''"> and bcx.customerCode = #{customerCode}</if>
  106. <if test="submitId != null "> and bcx.submitId = #{submitId}</if>
  107. <if test="createTime != null "> and bcx.createTime = #{createTime}</if>
  108. <if test="status != null "> and bcx.status = #{status}</if>
  109. <if test="isSelectCourse != null "> and bcx.is_select_course = #{isSelectCourse}</if>
  110. <if test="roundId != null "> and bcx.round_id = #{roundId}</if>
  111. </where>
  112. </select>
  113. <select id="selectBBusiWishXkcxRandom" parameterType="Integer" resultMap="BBusiWishXkcxResult">
  114. select * from b_busi_wish_xkcx WHERE
  115. `location` = '湖南'
  116. AND `level` = '本科' AND `year` =2024
  117. and (
  118. course0='历史'
  119. or
  120. course0='物理'
  121. )
  122. and universityId in ( SELECT t2.id FROM `b_busi_wish_universities` t2 WHERE t2.`yjsy` =2 and t2.`level` LIKE '%本科%')
  123. order by rand() LIMIT #{count}
  124. </select>
  125. <select id="selectBBusiWishXkcxById" parameterType="Long" resultMap="BBusiWishXkcxResult">
  126. <include refid="selectBBusiWishXkcxVo" />
  127. where id = #{id}
  128. </select>
  129. <select id="selectBBusiWishXkcxYears" parameterType="String" resultType="Integer">
  130. SELECT DISTINCT year from b_busi_wish_xkcx where location =#{location} ORDER by year desc
  131. </select>
  132. <insert id="insertBBusiWishXkcx" parameterType="BBusiWishXkcx" useGeneratedKeys="true" keyProperty="id">
  133. insert into b_busi_wish_xkcx
  134. <trim prefix="(" suffix=")" suffixOverrides=",">
  135. <if test="year != null and year != ''">year,</if>
  136. <if test="location != null">location,</if>
  137. <if test="level != null">level,</if>
  138. <if test="marjorId != null">marjorId,</if>
  139. <if test="universityId != null">universityId,</if>
  140. <if test="universityName != null">universityName,</if>
  141. <if test="marjorName != null">marjorName,</if>
  142. <if test="marjorBelongs != null">marjorBelongs,</if>
  143. <if test="marjorDirection != null">marjorDirection,</if>
  144. <if test="courseRemark0 != null">courseRemark0,</if>
  145. <if test="courseRemark1 != null">courseRemark1,</if>
  146. <if test="course0 != null">course0,</if>
  147. <if test="course1 != null">course1,</if>
  148. <if test="course2 != null">course2,</if>
  149. <if test="score != null">score,</if>
  150. <if test="seat != null">seat,</if>
  151. <if test="num != null">num,</if>
  152. <if test="numReal != null">numReal,</if>
  153. <if test="scoreRealTop != null">scoreRealTop,</if>
  154. <if test="seatRealTop != null">seatRealTop,</if>
  155. <if test="scoreRealAverage != null">scoreRealAverage,</if>
  156. <if test="seatRealAverage != null">seatRealAverage,</if>
  157. <if test="createTime != null">createTime,</if>
  158. <if test="status != null">status,</if>
  159. </trim>
  160. <trim prefix="values (" suffix=")" suffixOverrides=",">
  161. <if test="year != null and year != ''">#{year},</if>
  162. <if test="location != null">#{location},</if>
  163. <if test="level != null">#{level},</if>
  164. <if test="marjorId != null">#{marjorId},</if>
  165. <if test="universityId != null">#{universityId},</if>
  166. <if test="universityName != null">#{universityName},</if>
  167. <if test="marjorName != null">#{marjorName},</if>
  168. <if test="marjorBelongs != null">#{marjorBelongs},</if>
  169. <if test="marjorDirection != null">#{marjorDirection},</if>
  170. <if test="courseRemark0 != null">#{courseRemark0},</if>
  171. <if test="courseRemark1 != null">#{courseRemark1},</if>
  172. <if test="course0 != null">#{course0},</if>
  173. <if test="course1 != null">#{course1},</if>
  174. <if test="course2 != null">#{course2},</if>
  175. <if test="score != null">#{score},</if>
  176. <if test="seat != null">#{seat},</if>
  177. <if test="num != null">#{num},</if>
  178. <if test="numReal != null">#{numReal},</if>
  179. <if test="scoreRealTop != null">#{scoreRealTop},</if>
  180. <if test="seatRealTop != null">#{seatRealTop},</if>
  181. <if test="scoreRealAverage != null">#{scoreRealAverage},</if>
  182. <if test="seatRealAverage != null">#{seatRealAverage},</if>
  183. <if test="createTime != null">#{createTime},</if>
  184. <if test="status != null">#{status},</if>
  185. </trim>
  186. </insert>
  187. <update id="updateBBusiWishXkcx" parameterType="BBusiWishXkcx">
  188. update b_busi_wish_xkcx
  189. <trim prefix="SET" suffixOverrides=",">
  190. <if test="year != null and year != ''">year = #{year},</if>
  191. <if test="location != null">location = #{location},</if>
  192. <if test="level != null">level = #{level},</if>
  193. <if test="marjorId != null">marjorId = #{marjorId},</if>
  194. <if test="universityId != null">universityId = #{universityId},</if>
  195. <if test="universityName != null">universityName = #{universityName},</if>
  196. <if test="marjorName != null">marjorName = #{marjorName},</if>
  197. <if test="marjorBelongs != null">marjorBelongs = #{marjorBelongs},</if>
  198. <if test="marjorDirection != null">marjorDirection = #{marjorDirection},</if>
  199. <if test="courseRemark0 != null">courseRemark0 = #{courseRemark0},</if>
  200. <if test="courseRemark1 != null">courseRemark1 = #{courseRemark1},</if>
  201. <if test="course0 != null">course0 = #{course0},</if>
  202. <if test="course1 != null">course1 = #{course1},</if>
  203. <if test="course2 != null">course2 = #{course2},</if>
  204. <if test="score != null">score = #{score},</if>
  205. <if test="seat != null">seat = #{seat},</if>
  206. <if test="num != null">num = #{num},</if>
  207. <if test="numReal != null">numReal = #{numReal},</if>
  208. <if test="scoreRealTop != null">scoreRealTop = #{scoreRealTop},</if>
  209. <if test="seatRealTop != null">seatRealTop = #{seatRealTop},</if>
  210. <if test="scoreRealAverage != null">scoreRealAverage = #{scoreRealAverage},</if>
  211. <if test="seatRealAverage != null">seatRealAverage = #{seatRealAverage},</if>
  212. <if test="createTime != null">createTime = #{createTime},</if>
  213. <if test="status != null">status = #{status},</if>
  214. </trim>
  215. where id = #{id}
  216. </update>
  217. <delete id="deleteBBusiWishXkcxById" parameterType="Long">
  218. delete from b_busi_wish_xkcx where id = #{id}
  219. </delete>
  220. <delete id="deleteBBusiWishXkcxByIds" parameterType="String">
  221. delete from b_busi_wish_xkcx where id in
  222. <foreach item="id" collection="array" open="(" separator="," close=")">
  223. #{id}
  224. </foreach>
  225. </delete>
  226. </mapper>