BBusiWishUniversitySubmitMarjorsMapper.xml 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  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.BBusiWishUniversitySubmitMarjorsMapper">
  6. <resultMap type="BBusiWishUniversitySubmitMarjors" id="BBusiWishUniversitySubmitMarjorsResult">
  7. <result property="id" column="id" />
  8. <result property="year" column="year" />
  9. <result property="location" column="location" />
  10. <result property="level" column="level" />
  11. <result property="type" column="type" />
  12. <result property="marjorId" column="marjorId" />
  13. <result property="universityId" column="universityId" />
  14. <result property="universityCode" column="universityCode" />
  15. <result property="universityName" column="universityName" />
  16. <result property="universityNameText" column="universityNameText" />
  17. <result property="marjorCode" column="marjorCode" />
  18. <result property="marjorName" column="marjorName" />
  19. <result property="marjorNameText" column="marjorNameText" />
  20. <result property="marjorBelongs" column="marjorBelongs" />
  21. <result property="marjorDirection" column="marjorDirection" />
  22. <result property="specialProject" column="specialProject" />
  23. <result property="courseRemark0" column="courseRemark0" />
  24. <result property="courseRemark1" column="courseRemark1" />
  25. <result property="course0" column="course0" />
  26. <result property="course1" column="course1" />
  27. <result property="course2" column="course2" />
  28. <result property="score" column="score" />
  29. <result property="corrScore" column="corrScore" />
  30. <result property="seat" column="seat" />
  31. <result property="corrSeat" column="corrSeat" />
  32. <result property="num" column="num" />
  33. <result property="numReal" column="numReal" />
  34. <result property="scoreRealTop" column="scoreRealTop" />
  35. <result property="seatRealTop" column="seatRealTop" />
  36. <result property="scoreRealAverage" column="scoreRealAverage" />
  37. <result property="seatRealAverage" column="seatRealAverage" />
  38. <result property="createTime" column="createTime" />
  39. <result property="status" column="status" />
  40. <result property="collegeCode" column="collegeCode" />
  41. <result property="course" column="course" />
  42. <result property="liberalScience" column="liberalScience" />
  43. <result property="batch" column="batch" />
  44. <result property="groups" column="groups" />
  45. <result property="groupsName" column="groupsName" />
  46. <result property="xuezhi" column="xuezhi" />
  47. </resultMap>
  48. <sql id="selectBBusiWishUniversitySubmitMarjorsVo">
  49. select id, year, location, batch, level, type, marjorId, universityId, universityName, marjorCode, marjorName, marjorNameText, marjorBelongs, marjorDirection, specialProject, courseRemark0, courseRemark1, course0, course1,
  50. course2, score, corrScore, seat, corrSeat, num, numReal, scoreRealTop, seatRealTop, scoreRealAverage, seatRealAverage, createTime, status,
  51. universityCode,collegeCode,course,liberalScience,`groups`,`groupsName`, xuezhi
  52. from b_busi_wish_university_submit_marjors
  53. </sql>
  54. <select id="selectYearTypes" parameterType="map" resultMap="BBusiWishUniversitySubmitMarjorsResult">
  55. SELECT DISTINCT `year`, `type` FROM `b_busi_wish_university_submit_marjors`
  56. <where> location = #{location} AND `year` &gt;= #{year} AND `year` &lt;= #{currYear} AND liberalScience = #{liberalScience}
  57. </where>
  58. </select>
  59. <select id="selectWishUniversitySubmitMarjorsGroups" parameterType="map" resultMap="BBusiWishUniversitySubmitMarjorsResult">
  60. SELECT m.`id`, m.`universityId`, m.`collegeCode`, m.`year`, m.`location`, m.`batch`, m.`liberalScience`, m.`level`, m.`type`, m.`marjorName`, m.`marjorBelongs`, m.`marjorDirection`, m.`specialProject`, m.`numReal`, m.`score`, m.`seat`
  61. FROM `b_busi_wish_university_submit_marjors` m
  62. <where>
  63. <if test="ids != null"> and m.id in <foreach item="id" collection="ids" open="(" separator="," close=")">#{id}</foreach></if>
  64. <if test="location != null and location != ''"> and m.`location` = #{location}</if>
  65. <if test="year != null"> AND m.`year` &gt;= #{year}</if>
  66. <if test="currYear != null != ''"> AND m.`year` &lt;= #{currYear}</if>
  67. <if test="liberalScience != null "> and m.`liberalScience` = #{liberalScience} </if>
  68. <if test="level != null and level != ''"> and m.`level` = #{level}</if>
  69. <if test="universityIds != null"> AND m.`universityId` in <foreach item="o" collection="universityIds" open="(" separator="," close=")">#{o}</foreach></if>
  70. <if test="collegeCodes != null"> AND m.`collegeCode` in <foreach item="o" collection="collegeCodes" open="(" separator="," close=")">#{o}</foreach></if>
  71. </where>
  72. </select>
  73. <select id="selectWishUniversitySubmitMarjorsByRank" parameterType="map" resultMap="BBusiWishUniversitySubmitMarjorsResult">
  74. SELECT m.`year`, m.`marjorName`, m.`marjorDirection`, m.`specialProject`, m.`universityId`, m.`type`
  75. FROM `b_busi_wish_university_submit_marjors` m
  76. JOIN `b_busi_wish_universities` u ON m.`universityId` = u.`id`
  77. <where> m.`location` = #{location} AND m.`year` = #{year} AND m.level = #{level} AND m.liberalScience = #{liberalScience} and m.`seat` &gt;= #{lowestRank}
  78. <if test="highestRank != null"> and m.`seat` &lt; #{highestRank} </if>
  79. <if test="majors != null"> and m.`marjorName` in <foreach item="o" collection="majors" open="(" separator="," close=")">#{o}</foreach></if>
  80. <if test="uIds != null"> and u.`id` in <foreach item="o" collection="uIds" open="(" separator="," close=")">#{o}</foreach></if>
  81. <if test="uName != null and uName != ''"> and u.`name` like concat('%', #{uName}, '%')</if>
  82. <if test="uCode != null and uCode != ''"> and u.`code` = #{uCode}</if>
  83. <if test="uManagerType != null and uManagerType != ''"> and u.`managerType` = #{uManagerType}</if>
  84. <if test="uLocations != null"> and u.location in <foreach item="o" collection="uLocations" open="(" separator="," close=")">#{o}</foreach></if>
  85. <if test="uTypes != null"> and <foreach item="o" collection="uTypes" open="(" separator=" OR " close=")">u.`type` like concat('%', #{o}, '%')</foreach></if>
  86. <if test="uLevels != null"> and u.`level` in <foreach item="o" collection="uLevels" open="(" separator="," close=")">#{o}</foreach></if>
  87. <if test="uNatureTypeCNs != null"> and <foreach item="o" collection="uNatureTypeCNs" open="(" separator=" OR " close=")">u.`natureTypeCN` like concat('%', #{o}, '%')</foreach></if>
  88. <if test="uFeatureses"> and <foreach item="o" collection="uFeatureses" open="(" separator=" OR " close=")">u.`features` like concat('%', #{o}, '%')</foreach></if>
  89. </where>
  90. </select>
  91. <select id="selectBBusiWishUniversitySubmitMarjorsList" parameterType="BBusiWishUniversitySubmitMarjors" resultMap="BBusiWishUniversitySubmitMarjorsResult">
  92. <include refid="selectBBusiWishUniversitySubmitMarjorsVo" />
  93. <where>
  94. <if test="year != null and year != ''"> and year = #{year}</if>
  95. <if test="location != null and location != ''"> and location = #{location}</if>
  96. <if test="level != null and level != ''"> and level = #{level}</if>
  97. <if test="type != null and type != ''"> and type = #{type}</if>
  98. <if test="marjorId != null and marjorId != ''"> and marjorId = #{marjorId}</if>
  99. <if test="universityId != null and universityId != ''"> and universityId = #{universityId}</if>
  100. <if test="universityCode != null and universityCode != ''"> and universityCode = #{universityCode}</if>
  101. <if test="universityName != null and universityName != ''"> and universityName like concat('%', #{universityName}, '%')</if>
  102. <if test="marjorName != null and marjorName != ''"> and marjorName like concat('%', #{marjorName}, '%')</if>
  103. <if test="marjorNameText != null and marjorNameText != ''"> and marjorNameText like concat('%', #{marjorNameText}, '%')</if>
  104. <if test="marjorBelongs != null and marjorBelongs != ''"> and marjorBelongs = #{marjorBelongs}</if>
  105. <if test="marjorDirection != null and marjorDirection != ''"> and marjorDirection like concat('%', #{marjorDirection}, '%')</if>
  106. <if test="specialProject != null and specialProject != ''"> and specialProject like concat('%', #{specialProject}, '%')</if>
  107. <if test="courseRemark0 != null and courseRemark0 != ''"> and courseRemark0 = #{courseRemark0}</if>
  108. <if test="courseRemark1 != null and courseRemark1 != ''"> and courseRemark1 = #{courseRemark1}</if>
  109. <if test="course0 != null and course0 != ''"> and course0 = #{course0}</if>
  110. <if test="course1 != null and course1 != ''"> and course1 = #{course1}</if>
  111. <if test="course2 != null and course2 != ''"> and course2 = #{course2}</if>
  112. <if test="score != null "> and score = #{score}</if>
  113. <if test="seat != null "> and seat = #{seat}</if>
  114. <if test="num != null "> and num = #{num}</if>
  115. <if test="numReal != null "> and numReal = #{numReal}</if>
  116. <if test="scoreRealTop != null "> and scoreRealTop = #{scoreRealTop}</if>
  117. <if test="seatRealTop != null "> and seatRealTop = #{seatRealTop}</if>
  118. <if test="scoreRealAverage != null "> and scoreRealAverage = #{scoreRealAverage}</if>
  119. <if test="seatRealAverage != null "> and seatRealAverage = #{seatRealAverage}</if>
  120. <if test="createTime != null "> and createTime = #{createTime}</if>
  121. <if test="status != null "> and status = #{status}</if>
  122. <if test="collegeCode != null and collegeCode != ''"> and collegeCode = #{collegeCode}</if>
  123. <if test="course != null and course != ''"> and course = #{course}</if>
  124. <if test="liberalScience != null "> and liberalScience = #{liberalScience}</if>
  125. </where>
  126. order by collegeCode, batch, marjorCode, year desc
  127. </select>
  128. <select id="selectBBusiWishUniversitySubmitMarjorsById" parameterType="Long" resultMap="BBusiWishUniversitySubmitMarjorsResult">
  129. <include refid="selectBBusiWishUniversitySubmitMarjorsVo" />
  130. where id = #{id}
  131. </select>
  132. <select id="selectBBusiWishUniversitySubmitMarjorsByIds" parameterType="Long" resultMap="BBusiWishUniversitySubmitMarjorsResult">
  133. <include refid="selectBBusiWishUniversitySubmitMarjorsVo" />
  134. where id in
  135. <foreach item="id" collection="list" open="(" separator="," close=")">
  136. #{id}
  137. </foreach>
  138. </select>
  139. <select id="search" parameterType="Map" resultMap="BBusiWishUniversitySubmitMarjorsResult">
  140. select a.id, a.year, b.location as location, a.level as level, a.type, a.marjorId, a.universityId,
  141. a.universityName as universityName, a.universityNameText as universityNameText, a.marjorCode, a.marjorName,a.marjorNameText,
  142. a.marjorBelongs, a.marjorDirection, a.specialProject, a.courseRemark0, a.courseRemark1, a.course0, a.course1,
  143. a.course2, a.score, a.seat, a.num, a.numReal, a.scoreRealTop, a.seatRealTop, a.scoreRealAverage,
  144. a.seatRealAverage, a.createTime, a.status ,a.universityCode,a.collegeCode,a.course,a.liberalScience
  145. from b_busi_wish_university_submit_marjors a
  146. left JOIN b_busi_wish_universities b on a.universityId = b.id
  147. where a.status &gt; 0 and b.status &gt; 0
  148. <if test="univerName != null and univerName != ''"> and a.universityName like concat('%', #{univerName}, '%')</if>
  149. <if test="universityNameText != null and universityNameText != ''"> and a.universityNameText like concat('%', #{universityNameText}, '%')</if>
  150. <if test="universityId != null"> and b.id = #{universityId}</if>
  151. <if test="code != null and code != ''"> and b.code = #{code}</if>
  152. <if test="location != null and location != ''"> and b.location = #{location}</if>
  153. <if test="level != null and level != ''"> and a.level like concat('%', #{level}, '%')</if>
  154. <if test="collegeCode != null and collegeCode != ''"> and a.collegeCode like concat('%', #{collegeCode}, '%')</if>
  155. <if test="type != null and type != ''"> and a.type = #{type} </if>
  156. <if test="year != null and year != ''"> and a.year = #{year} </if>
  157. <if test="batch != null">
  158. and a.batch = #{batch}
  159. <!-- and a.universityId in(select universityId from b_busi_wish_university_submits where batch= #{batch} )-->
  160. </if>
  161. <if test="spro != null and spro != ''"> and a.location = #{spro}</if>
  162. order by a.universityNameText, a.score desc
  163. </select>
  164. <select id="locations" resultType="String"> <!-- where status &gt; 0 -->
  165. select distinct location from b_busi_wish_university_submit_marjors
  166. </select>
  167. <select id="levels" resultType="String"> <!-- where status &gt; 0 -->
  168. select distinct level from b_busi_wish_university_submit_marjors
  169. <where>
  170. <if test="location!=null and location!=''">and location = #{location}</if>
  171. <if test="year!=null">and year = #{year}</if>
  172. </where>
  173. order by batch asc
  174. </select>
  175. <select id="types" resultType="String">
  176. select distinct type from b_busi_wish_university_submit_marjors where status &gt; 0
  177. <if test="location!=null and location!=''">
  178. and location = #{location}
  179. </if>
  180. <if test="year!=null">
  181. and year = #{year}
  182. </if>
  183. </select>
  184. <select id="years" resultType="String">
  185. select distinct year from b_busi_wish_university_submit_marjors where status &gt; 0
  186. <if test="location!=null and location!=''">
  187. and location = #{location}
  188. </if>
  189. <if test="type!=null and type!=''">
  190. and type = #{type}
  191. </if>
  192. <if test="level!=null and level!=''">
  193. and level = #{level}
  194. </if>
  195. order by year desc
  196. </select>
  197. <select id="getUniversityNameText" resultType="String">
  198. SELECT distinct universityNameText from b_busi_wish_university_submit_marjors where status &gt; 0 and (universityNameText is not null or universityNameText != '')
  199. and universityCode = #{universityCode} and location = #{location} and year = #{year} and type = #{type}
  200. <if test="level!=null and level!=''">
  201. and level = #{level}
  202. </if>
  203. </select>
  204. <select id="query" parameterType="String" resultMap="BBusiWishUniversitySubmitMarjorsResult">
  205. ${sql}
  206. </select>
  207. <insert id="insertBBusiWishUniversitySubmitMarjors" parameterType="BBusiWishUniversitySubmitMarjors" useGeneratedKeys="true" keyProperty="id">
  208. insert into b_busi_wish_university_submit_marjors
  209. <trim prefix="(" suffix=")" suffixOverrides=",">
  210. <if test="year != null and year != ''">year,</if>
  211. <if test="location != null">location,</if>
  212. <if test="level != null">level,</if>
  213. <if test="type != null">type,</if>
  214. <if test="marjorId != null">marjorId,</if>
  215. <if test="universityId != null">universityId,</if>
  216. <if test="universityName != null">universityName,</if>
  217. <if test="marjorCode != null">marjorCode,</if>
  218. <if test="marjorName != null">marjorName,</if>
  219. <if test="marjorNameText != null">marjorNameText,</if>
  220. <if test="marjorBelongs != null">marjorBelongs,</if>
  221. <if test="marjorDirection != null">marjorDirection,</if>
  222. <if test="specialProject != null">specialProject,</if>
  223. <if test="courseRemark0 != null">courseRemark0,</if>
  224. <if test="courseRemark1 != null">courseRemark1,</if>
  225. <if test="course0 != null">course0,</if>
  226. <if test="course1 != null">course1,</if>
  227. <if test="course2 != null">course2,</if>
  228. <if test="score != null">score,</if>
  229. <if test="seat != null">seat,</if>
  230. <if test="num != null">num,</if>
  231. <if test="numReal != null">numReal,</if>
  232. <if test="scoreRealTop != null">scoreRealTop,</if>
  233. <if test="seatRealTop != null">seatRealTop,</if>
  234. <if test="scoreRealAverage != null">scoreRealAverage,</if>
  235. <if test="seatRealAverage != null">seatRealAverage,</if>
  236. <if test="createTime != null">createTime,</if>
  237. <if test="status != null">status,</if>
  238. </trim>
  239. <trim prefix="values (" suffix=")" suffixOverrides=",">
  240. <if test="year != null and year != ''">#{year},</if>
  241. <if test="location != null">#{location},</if>
  242. <if test="level != null">#{level},</if>
  243. <if test="type != null">#{type},</if>
  244. <if test="marjorId != null">#{marjorId},</if>
  245. <if test="universityId != null">#{universityId},</if>
  246. <if test="universityName != null">#{universityName},</if>
  247. <if test="marjorCode != null">#{marjorCode},</if>
  248. <if test="marjorName != null">#{marjorName},</if>
  249. <if test="marjorNameText != null">#{marjorNameText},</if>
  250. <if test="marjorBelongs != null">#{marjorBelongs},</if>
  251. <if test="marjorDirection != null">#{marjorDirection},</if>
  252. <if test="specialProject != null">#{specialProject},</if>
  253. <if test="courseRemark0 != null">#{courseRemark0},</if>
  254. <if test="courseRemark1 != null">#{courseRemark1},</if>
  255. <if test="course0 != null">#{course0},</if>
  256. <if test="course1 != null">#{course1},</if>
  257. <if test="course2 != null">#{course2},</if>
  258. <if test="score != null">#{score},</if>
  259. <if test="seat != null">#{seat},</if>
  260. <if test="num != null">#{num},</if>
  261. <if test="numReal != null">#{numReal},</if>
  262. <if test="scoreRealTop != null">#{scoreRealTop},</if>
  263. <if test="seatRealTop != null">#{seatRealTop},</if>
  264. <if test="scoreRealAverage != null">#{scoreRealAverage},</if>
  265. <if test="seatRealAverage != null">#{seatRealAverage},</if>
  266. <if test="createTime != null">#{createTime},</if>
  267. <if test="status != null">#{status},</if>
  268. </trim>
  269. </insert>
  270. <update id="updateBBusiWishUniversitySubmitMarjors" parameterType="BBusiWishUniversitySubmitMarjors">
  271. update b_busi_wish_university_submit_marjors
  272. <trim prefix="SET" suffixOverrides=",">
  273. <if test="year != null and year != ''">year = #{year},</if>
  274. <if test="location != null">location = #{location},</if>
  275. <if test="level != null">level = #{level},</if>
  276. <if test="type != null">type = #{type},</if>
  277. <if test="marjorId != null">marjorId = #{marjorId},</if>
  278. <if test="universityId != null">universityId = #{universityId},</if>
  279. <if test="universityName != null">universityName = #{universityName},</if>
  280. <if test="marjorCode != null">marjorCode = #{marjorCode},</if>
  281. <if test="marjorName != null">marjorName = #{marjorName},</if>
  282. <if test="marjorNameText != null">marjorNameText = #{marjorNameText},</if>
  283. <if test="marjorBelongs != null">marjorBelongs = #{marjorBelongs},</if>
  284. <if test="marjorDirection != null">marjorDirection = #{marjorDirection},</if>
  285. <if test="specialProject != null">specialProject = #{specialProject},</if>
  286. <if test="courseRemark0 != null">courseRemark0 = #{courseRemark0},</if>
  287. <if test="courseRemark1 != null">courseRemark1 = #{courseRemark1},</if>
  288. <if test="course0 != null">course0 = #{course0},</if>
  289. <if test="course1 != null">course1 = #{course1},</if>
  290. <if test="course2 != null">course2 = #{course2},</if>
  291. <if test="score != null">score = #{score},</if>
  292. <if test="seat != null">seat = #{seat},</if>
  293. <if test="num != null">num = #{num},</if>
  294. <if test="numReal != null">numReal = #{numReal},</if>
  295. <if test="scoreRealTop != null">scoreRealTop = #{scoreRealTop},</if>
  296. <if test="seatRealTop != null">seatRealTop = #{seatRealTop},</if>
  297. <if test="scoreRealAverage != null">scoreRealAverage = #{scoreRealAverage},</if>
  298. <if test="seatRealAverage != null">seatRealAverage = #{seatRealAverage},</if>
  299. <if test="createTime != null">createTime = #{createTime},</if>
  300. <if test="status != null">status = #{status},</if>
  301. </trim>
  302. where id = #{id}
  303. </update>
  304. <delete id="deleteBBusiWishUniversitySubmitMarjorsById" parameterType="Long">
  305. delete from b_busi_wish_university_submit_marjors where id = #{id}
  306. </delete>
  307. <delete id="deleteBBusiWishUniversitySubmitMarjorsByIds" parameterType="String">
  308. delete from b_busi_wish_university_submit_marjors where id in
  309. <foreach item="id" collection="array" open="(" separator="," close=")">
  310. #{id}
  311. </foreach>
  312. </delete>
  313. </mapper>