BBusiWishUniversitySubmitRecruitPlanMapper.xml 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390
  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.BBusiWishUniversitySubmitRecruitPlanMapper">
  6. <resultMap type="BBusiWishUniversitySubmitRecruitPlan" id="BBusiWishUniversitySubmitRecruitPlanResult">
  7. <result property="id" column="id" />
  8. <result property="collegeCode" column="collegeCode" />
  9. <result property="year" column="year" />
  10. <result property="location" column="location" />
  11. <result property="batch" column="batch" />
  12. <result property="level" column="level" />
  13. <result property="liberalScience" column="liberalScience" />
  14. <result property="type" column="type" />
  15. <result property="marjorId" column="marjorId" />
  16. <result property="universityId" column="universityId" />
  17. <result property="universityCode" column="universityCode" />
  18. <result property="universityName" column="universityName" />
  19. <result property="universityNameText" column="universityNameText" />
  20. <result property="marjorCode" column="marjorCode" />
  21. <result property="marjorName" column="marjorName" />
  22. <result property="marjorNameText" column="marjorNameText" />
  23. <result property="marjorBelongs" column="marjorBelongs" />
  24. <result property="marjorDirection" column="marjorDirection" />
  25. <result property="specialProject" column="specialProject" />
  26. <result property="createTime" column="createTime" />
  27. <result property="status" column="status" />
  28. <result property="majorCount" column="majorCount" />
  29. <result property="stats" column="stats" typeHandler="com.ruoyi.mxjb.handlers.SubmitYearsStatsHandler" />
  30. <result property="planCount" column="planCount" />
  31. <result property="planType" column="planType" />
  32. <result property="xuefei" column="xuefei" />
  33. <result property="xuezhi" column="xuezhi" />
  34. <result property="course" column="course" />
  35. <result property="groups" column="groups" />
  36. <result property="groupsName" column="groupsName" />
  37. <result property="enrollFluctuate" column="enrollFluctuate" />
  38. </resultMap>
  39. <sql id="selectBBusiWishUniversitySubmitRecruitPlanVo">
  40. select id, collegeCode, year, location, batch, level, liberalScience, type, marjorId, universityId, universityCode, universityName, universityNameText, marjorCode, marjorName, marjorNameText, marjorBelongs, marjorDirection, specialProject, createTime, status, planCount, planType, xuefei, xuezhi, course ,`groups`,`groupsName` from b_busi_wish_university_submit_recruit_plan
  41. </sql>
  42. <select id="selectWishUniversitySubmitPlanForMatch" parameterType="map" resultMap="BBusiWishUniversitySubmitRecruitPlanResult">
  43. SELECT ms.match_type planType, pg.`plan_id` id, pg.`group_id` `majorCount`, ms.`year`, rp.`level`, rp.`type`, ms.`manual_id` liberalScience, ms.`submit_ids` `groups`, ms.`status`, ms.suggest_id `batch`,
  44. rp.`specialProject`, rp.`universityName`, rp.`marjorName`, rp.`xuezhi`, rp.`marjorDirection`, rp.collegeCode
  45. FROM `b_busi_wish_university_submit_recruit_plan` rp
  46. JOIN `b_busi_wish_universities` u ON rp.`universityId` = u.`id`
  47. JOIN `b_busi_wish_university_match_plan_group` pg ON pg.`plan_id` = rp.`id`
  48. JOIN `b_busi_wish_university_match_submit` ms ON pg.`location` = ms.`location` AND pg.`group_id` = ms.`group_id` AND ms.year = #{year}
  49. AND <choose><when test="forMany">ms.`match_type` != '预置' AND (ms.`submit_cnt` &gt; 1 OR ms.`group_status` &gt; 1 OR rp.`marjorName` LIKE '%试验班%')</when><otherwise>(ms.`match_type` = '预置' OR ms.`submit_cnt` = 1 AND ms.`group_status` = 1 AND rp.`marjorName` NOT LIKE '%试验班%')</otherwise></choose>
  50. <where> rp.`location` = #{location} AND rp.`year` = #{planYear}
  51. <if test="batch != null and batch != ''"> and rp.`batch` = #{batch}</if>
  52. <if test="level != null and level != ''"> and rp.`level` = #{level}</if>
  53. <if test="type != null and type != ''"> and rp.`type` = #{type}</if>
  54. <if test="collegeCode != null and collegeCode != ''"> and rp.`collegeCode` = #{collegeCode}</if>
  55. <if test="marjorBelongs != null and marjorBelongs != ''"> and rp.`marjorBelongs` = #{marjorBelongs}</if>
  56. <if test="universityCode != null and universityCode != ''"> and rp.`universityCode` = #{universityCode}</if>
  57. <if test="universityName != null and universityName != ''"> and rp.`universityName` like concat('%', #{universityName}, '%')</if>
  58. <if test="marjorName != null and marjorName != ''"> and rp.`marjorName` like concat('%', #{marjorName}, '%')</if>
  59. </where>
  60. ORDER BY IF(u.`rankingOfEdu` = 0, 999, u.`rankingOfEdu`), u.`id`, ms.`year`, rp.`type`, rp.`marjorName`, rp.`level`, rp.id
  61. </select>
  62. <!-- AND (ps.`course` IS NULL OR ps.`course` LIKE concat(#{course0}, '%')) CASE WHEN ps.`course` IS NULL THEN TRUE WHEN ps.`course` LIKE '%和%' THEN ps.`course` LIKE concat('%',#{course1},'%') AND ps.`course` LIKE concat('%',#{course2},'%') ELSE ps.`course` LIKE concat('%',#{course1},'%') OR ps.`course` LIKE concat('%',#{course2},'%') END -->
  63. <select id="selectWishUniversitySubmitPlanGroups" parameterType="map" resultMap="BBusiWishUniversitySubmitRecruitPlanResult">
  64. SELECT DISTINCT mc.`collegeCode`, mc.`universityId`, mc.`marjorCount` majorCount, mc.`planCount`, mc.`stats`,
  65. <choose><when test="newSpecialGroup">mc.uCode `specialProject`</when><otherwise>mc.`specialProject`</otherwise></choose>, mc.universityName, mc.`uCode` universityCode
  66. FROM `b_busi_wish_university_marjors_plan_submit` ps
  67. JOIN `b_busi_wish_university_marjors_college` mc ON mc.`id` = ps.`marjorCollegeId`
  68. JOIN `b_busi_wish_universities` u ON mc.`universityId` = u.`id`
  69. LEFT JOIN `b_busi_wish_university_submit_marjors` m ON m.`id` = <choose><when test="sameYear">ps.`plan_submit_id`</when><otherwise>ps.`submit_id`</otherwise></choose> and m.`year` = #{year}
  70. <where>ps.`location` = #{location} AND ps.level = #{level} AND ps.liberalScience = #{liberalScience} and ps.`year` = #{planYear}
  71. <!-- <if test="lowestRank != null"> AND <choose><when test="sameYear"> mc.`curr_seat` </when><otherwise> mc.`seat` </otherwise></choose> &gt; #{lowestRank}</if>
  72. <if test="highestRank != null"> AND <choose><when test="sameYear"> mc.`curr_seat` </when><otherwise> mc.`seat` </otherwise></choose> &lt;= #{highestRank} </if>
  73. <if test="lowestScore != null"> AND <choose><when test="sameYear"> mc.`curr_score` </when><otherwise> mc.`score` </otherwise></choose> &gt;= #{lowestScore}</if>
  74. <if test="highestScore != null"> AND <choose><when test="sameYear"> mc.`curr_score` </when><otherwise> mc.`score` </otherwise></choose> &lt; #{highestScore} </if> -->
  75. <!-- <if test="course0 != null and course0 != ''"> AND (ps.`course0` IS NULL OR ps.`course0` = '' OR ps.`course0` = #{course0})</if>
  76. <if test="course0 != null and course1 != null and course2 != null"> AND (ps.`course1` IS NULL OR ps.`course1` = '' OR FIND_IN_SET(#{course0}, ps.`course1`) + FIND_IN_SET(#{course1}, ps.`course1`) + FIND_IN_SET(#{course2}, ps.`course1`) > 0)</if>
  77. <if test="course0 != null and course1 != null and course2 != null"> AND (ps.`course2` IS NULL OR ps.`course2` = '' OR LENGTH(ps.`course2`) - LENGTH(REPLACE(ps.`course2`, ',', '')) + 1 = IF(FIND_IN_SET(#{course0}, ps.`course2`), 1, 0) + IF(FIND_IN_SET(#{course1}, ps.`course2`), 1, 0) + IF(FIND_IN_SET(#{course2}, ps.`course2`), 1, 0))</if>
  78. <if test="collect != null"> and <choose><when test="collect"> mc.`stats` like '%"collect":1%' </when><otherwise> mc.`stats` not like '%"collect":1%' </otherwise></choose></if> -->
  79. <choose><when test="uName != null and uName != ''"> and (u.`name` like concat('%', #{uName}, '%') or m.`marjorName` like concat('%', #{uName}, '%')
  80. <if test="sinoForeign != null"> and m.`sinoForeign` = #{sinoForeign}</if>
  81. <!-- <choose>
  82. <when test="specialProjectNation != null and specialProjectLocal != null and specialProjectNation and specialProjectLocal">
  83. and ps.`specialProject` in ('地方专项', '地方专项计划', '国家专项计划', '国家专项')
  84. </when>
  85. <otherwise>
  86. <if test="specialProjectNation != null"> <choose><when test="specialProjectNation"> and ps.`specialProject` in ('国家专项','国家专项计划')</when><otherwise> and ps.`specialProject` not in ('国家专项', '国家专项计划')</otherwise></choose></if>
  87. <if test="specialProjectLocal != null"> <choose><when test="specialProjectLocal"> and ps.`specialProject` in ('地方专项','地方专项计划')</when><otherwise> and ps.`specialProject` not in ('地方专项','地方专项计划')</otherwise></choose></if>
  88. </otherwise>
  89. </choose> -->
  90. <if test="majors != null"> and m.`marjorName` in <foreach item="o" collection="majors" open="(" separator="," close=")">#{o}</foreach></if>)
  91. </when><otherwise>
  92. <if test="sinoForeign != null"> and m.`sinoForeign` = #{sinoForeign}</if>
  93. <!-- <choose>
  94. <when test="specialProjectNation != null and specialProjectLocal != null and specialProjectNation and specialProjectLocal">
  95. and ps.`specialProject` in ('地方专项', '地方专项计划', '国家专项计划', '国家专项')
  96. </when>
  97. <otherwise>
  98. <if test="specialProjectNation != null"> <choose><when test="specialProjectNation"> and ps.`specialProject` in ('国家专项','国家专项计划')</when><otherwise> and ps.`specialProject` not in ('国家专项', '国家专项计划')</otherwise></choose></if>
  99. <if test="specialProjectLocal != null"> <choose><when test="specialProjectLocal"> and ps.`specialProject` in ('地方专项','地方专项计划')</when><otherwise> and ps.`specialProject` not in ('地方专项','地方专项计划')</otherwise></choose></if>
  100. </otherwise>
  101. </choose> -->
  102. <if test="majors != null"> and m.`marjorName` in <foreach item="o" collection="majors" open="(" separator="," close=")">#{o}</foreach></if>
  103. </otherwise></choose>
  104. <if test="lowestRank != null"> AND if(m.`id` is null, ps.`corrSeat`, m.`corrSeat`) &gt; #{lowestRank}</if>
  105. <if test="highestRank != null"> AND if(m.`id` is null, ps.`corrSeat`, m.`corrSeat`) &lt;= #{highestRank} </if>
  106. <if test="lowestScore != null"> AND if(m.`id` is null, ps.`corrScore`, m.`corrScore`) &gt;= #{lowestScore}</if>
  107. <if test="highestScore != null"> AND if(m.`id` is null, ps.`corrScore`, m.`corrScore`) &lt; #{highestScore} </if>
  108. <if test="specialProjects != null"> and ps.`specialProject` in <foreach item="o" collection="specialProjects" open="(" separator="," close=")">#{o}</foreach></if>
  109. <!-- <if test="specialProjectExcl != null and specialProjectExcl"> and (ps.`specialProject` is null or ps.`specialProject` = '') </if> -->
  110. <if test="uIds != null"> and u.`id` in <foreach item="o" collection="uIds" open="(" separator="," close=")">#{o}</foreach></if>
  111. <if test="uCode != null and uCode != ''"> and u.`code` = #{uCode}</if>
  112. <if test="uManagerType != null and uManagerType != ''"> and u.`managerType` = #{uManagerType}</if>
  113. <if test="uLocations != null"> and u.location in <foreach item="o" collection="uLocations" open="(" separator="," close=")">#{o}</foreach></if>
  114. <!-- <if test="uTypes != null"> and <foreach item="o" collection="uTypes" open="(" separator=" OR " close=")">u.`type` like concat('%', #{o}, '%')</foreach></if>-->
  115. <if test="uTypes != null">and u.type in <foreach item="o" collection="uTypes" open="(" separator="," close=")">#{o}</foreach></if>
  116. <if test="uLevels != null"> and u.`level` in <foreach item="o" collection="uLevels" open="(" separator="," close=")">#{o}</foreach></if>
  117. <if test="uNatureTypeCNs != null"> and <foreach item="o" collection="uNatureTypeCNs" open="(" separator=" OR " close=")">u.`natureTypeCN` like concat('%', #{o}, '%')</foreach></if>
  118. <if test="uFeatureses"> and <foreach item="o" collection="uFeatureses" open="(" separator=" OR " close=")">u.`features` like concat('%', #{o}, '%')</foreach></if>
  119. </where>ORDER BY
  120. <choose><when test="uName != null and uName != ''">IF(mc.`matchCount` = 0, 1, 0),</when><otherwise></otherwise></choose>
  121. <choose><when test="sameYear">IF(mc.`curr_score` IS NULL, ps.`corrScore`, mc.`curr_score`) DESC, IF(u.`rankingOfEdu` > 0, u.`rankingOfEdu`, 9999), u.`code`, ps.plan_id</when>
  122. <otherwise>IF(mc.`score` IS NULL, ps.`score`, mc.`score`) DESC, IF(u.`rankingOfEdu` > 0, u.`rankingOfEdu`, 9999), u.`code`, ps.plan_id</otherwise></choose>
  123. </select>
  124. <!-- <select id="selectWishUniversityPlanSubmitPlanGroups" parameterType="map" resultMap="BBusiWishUniversitySubmitRecruitPlanResult">-->
  125. <!-- SELECT DISTINCT mc.`collegeCode`, mc.`universityId`, mc.`marjorCount` majorCount, mc.`planCount`, mc.`stats`, m.`type`, ps.`course`, m.`specialProject`-->
  126. <!-- FROM `b_busi_wish_university_submit_marjors` m-->
  127. <!-- JOIN `b_busi_wish_universities` u ON m.`universityId` = u.`id`-->
  128. <!-- JOIN `b_busi_wish_university_marjors_plan_submit` ps ON ps.`plan_submit_id` = m.`id`-->
  129. <!-- JOIN `b_busi_wish_university_marjors_college` mc ON mc.`id` = ps.`marjorCollegeId`-->
  130. <!-- <where>m.`location` = #{location} AND m.`year` = #{year} AND m.level = #{level} AND m.liberalScience = #{liberalScience}-->
  131. <!-- <if test="lowestRank != null"> AND <choose><when test="sameYear"> mc.`curr_seat` </when><otherwise> mc.`seat` </otherwise></choose> &gt; #{lowestRank}</if>-->
  132. <!-- <if test="highestRank != null"> AND <choose><when test="sameYear"> mc.`curr_seat` </when><otherwise> mc.`seat` </otherwise></choose> &lt;= #{highestRank} </if>-->
  133. <!-- <if test="course0 != null and course0 != ''"> AND (ps.`course0` IS NULL OR ps.`course0` = '' OR ps.`course0` = #{course0})</if>-->
  134. <!-- <if test="course0 != null and course1 != null and course2 != null"> AND (ps.`course1` IS NULL OR ps.`course1` = '' OR FIND_IN_SET(#{course0}, ps.`course1`) + FIND_IN_SET(#{course1}, ps.`course1`) + FIND_IN_SET(#{course2}, ps.`course1`) > 0)</if>-->
  135. <!-- <if test="course0 != null and course1 != null and course2 != null"> AND (ps.`course2` IS NULL OR ps.`course2` = '' OR LENGTH(ps.`course2`) - LENGTH(REPLACE(ps.`course2`, ',', '')) + 1 = IF(FIND_IN_SET(#{course0}, ps.`course2`), 1, 0) + IF(FIND_IN_SET(#{course1}, ps.`course2`), 1, 0) + IF(FIND_IN_SET(#{course2}, ps.`course2`), 1, 0))</if>-->
  136. <!-- <if test="sinoForeign != null"> and m.`sinoForeign` = #{sinoForeign}</if>-->
  137. <!-- <if test="specialProjectNation != null"> <choose><when test="specialProjectNation"> and m.`specialProject` = '国家专项'</when><otherwise> and m.`specialProject` != '国家专项'</otherwise></choose></if>-->
  138. <!-- <if test="specialProjectLocal != null"> <choose><when test="specialProjectLocal"> and m.`specialProject` not in ('', '国家专项')</when><otherwise> and m.`specialProject` in ('', '国家专项')</otherwise></choose></if>-->
  139. <!-- &lt;!&ndash; <if test="collect != null"> and m.collect = #{collect}</if> &ndash;&gt;-->
  140. <!-- <if test="collect != null"> and <choose><when test="collect"> mc.`stats` like '%"collect":1%' </when><otherwise> mc.`stats` not like '%"collect":1%' </otherwise></choose></if>-->
  141. <!-- <if test="majors != null"> and m.`marjorName` in <foreach item="o" collection="majors" open="(" separator="," close=")">#{o}</foreach></if>-->
  142. <!-- <if test="uIds != null"> and u.`id` in <foreach item="o" collection="uIds" open="(" separator="," close=")">#{o}</foreach></if>-->
  143. <!-- <if test="uName != null and uName != ''"> and u.`name` like concat('%', #{uName}, '%')</if>-->
  144. <!-- <if test="uCode != null and uCode != ''"> and u.`code` = #{uCode}</if>-->
  145. <!-- <if test="uManagerType != null and uManagerType != ''"> and u.`managerType` = #{uManagerType}</if>-->
  146. <!-- <if test="uLocations != null"> and u.location in <foreach item="o" collection="uLocations" open="(" separator="," close=")">#{o}</foreach></if>-->
  147. <!-- <if test="uTypes != null"> and <foreach item="o" collection="uTypes" open="(" separator=" OR " close=")">u.`type` like concat('%', #{o}, '%')</foreach></if>-->
  148. <!-- <if test="uLevels != null"> and u.`level` in <foreach item="o" collection="uLevels" open="(" separator="," close=")">#{o}</foreach></if>-->
  149. <!-- <if test="uNatureTypeCNs != null"> and <foreach item="o" collection="uNatureTypeCNs" open="(" separator=" OR " close=")">u.`natureTypeCN` like concat('%', #{o}, '%')</foreach></if>-->
  150. <!-- <if test="uFeatureses"> and <foreach item="o" collection="uFeatureses" open="(" separator=" OR " close=")">u.`features` like concat('%', #{o}, '%')</foreach></if>-->
  151. <!-- </where>-->
  152. <!-- <choose><when test="sameYear"> ORDER BY mc.`curr_score` DESC </when><otherwise> ORDER BY mc.`score` DESC </otherwise></choose>, u.`rankingOfEdu`-->
  153. <!-- </select>-->
  154. <select id="selectWishUniversitySubmitPlanGroupDetails" parameterType="map" resultMap="BBusiWishUniversitySubmitRecruitPlanResult">
  155. SELECT rp.`id`, rp.`universityId`, rp.`universityCode`, rp.`marjorCode` marjorId, rp.`collegeCode`, rp.`marjorName`, rp.`marjorNameText`, rp.`marjorBelongs`, rp.`marjorDirection`, rp.`specialProject`, rp.`planCount`, rp.`xuezhi`, rp.`xuefei`, rp.`type`, ps.`stats`, ps.enrollFluctuate
  156. FROM `b_busi_wish_university_marjors_plan_submit` ps
  157. JOIN `b_busi_wish_university_submit_recruit_plan` rp ON ps.`plan_id` = rp.`id`
  158. WHERE ps.`universityId` = #{universityId} and ps.`location` = #{location} AND ps.`year` = #{year} AND ps.level = #{level} AND ps.liberalScience = #{liberalScience} AND ps.`collegeCode` = #{collegeCode}
  159. <choose><when test="uCode != null and uCode != ''">AND (ps.`uCode` = #{uCode} or ps.`marjorCollegeId` = #{uCode})</when><otherwise>AND (ps.`uCode` = '' or ps.`uCode` is null)</otherwise></choose>
  160. </select>
  161. <!-- p.`location`, p.`batch`, p.`liberalScience`, p.`level`, p.`type` -->
  162. <select id="selectWishUniversitySubmitRecruitGroups" parameterType="map" resultMap="BBusiWishUniversitySubmitRecruitPlanResult">
  163. SELECT p.`id`, p.`universityId`, p.`collegeCode`, p.`marjorId`, p.`marjorName`, p.`marjorNameText`, p.`marjorBelongs`, p.`year`, p.`marjorDirection`, p.`specialProject`, p.`planCount`, p.`xuezhi`, p.`xuefei`, p.`type`, p.`course`, p.`groupsName`
  164. FROM `b_busi_wish_university_submit_recruit_plan` p
  165. <where>
  166. <if test="ids != null"> and p.id in <foreach item="id" collection="ids" open="(" separator="," close=")">#{id}</foreach></if>
  167. <if test="location != null and location != ''"> and p.`location` = #{location}</if>
  168. <if test="year != null"> AND p.`year` &gt;= #{year}</if>
  169. <if test="currYear != null != ''"> AND p.`year` &lt;= #{currYear}</if>
  170. <if test="liberalScience != null "> and p.`liberalScience` = #{liberalScience}</if>
  171. <if test="level != null and level != ''"> and p.`level` = #{level}</if>
  172. <if test="universityIds != null"> AND p.`universityId` in <foreach item="o" collection="universityIds" open="(" separator="," close=")">#{o}</foreach></if>
  173. <if test="collegeCodes != null"> AND p.`collegeCode` in <foreach item="o" collection="collegeCodes" open="(" separator="," close=")">#{o}</foreach></if>
  174. </where>
  175. </select>
  176. <select id="selectBBusiWishUniversitySubmitRecruitPlanList" parameterType="BBusiWishUniversitySubmitRecruitPlan" resultMap="BBusiWishUniversitySubmitRecruitPlanResult">
  177. <include refid="selectBBusiWishUniversitySubmitRecruitPlanVo"/>
  178. <where>
  179. <if test="collegeCode != null and collegeCode != ''"> and collegeCode = #{collegeCode}</if>
  180. <if test="year != null and year != ''"> and year = #{year}</if>
  181. <if test="location != null and location != ''"> and location = #{location}</if>
  182. <if test="batch != null "> and batch = #{batch}</if>
  183. <if test="level != null and level != ''"> and level like concat('%', #{level},'%')</if>
  184. <if test="liberalScience != null "> and liberalScience = #{liberalScience}</if>
  185. <if test="type != null and type != ''"> and type = #{type}</if>
  186. <if test="marjorId != null and marjorId != ''"> and marjorId = #{marjorId}</if>
  187. <if test="universityId != null and universityId != ''"> and universityId = #{universityId}</if>
  188. <if test="universityCode != null and universityCode != ''"> and universityCode = #{universityCode}</if>
  189. <if test="universityName != null and universityName != ''"> and universityName like concat('%', #{universityName}, '%')</if>
  190. <if test="universityNameText != null and universityNameText != ''"> and universityNameText like concat('%', #{universityNameText}, '%')</if>
  191. <if test="marjorName != null and marjorName != ''"> and marjorName like concat('%', #{marjorName}, '%')</if>
  192. <if test="marjorNameText != null and marjorNameText != ''"> and marjorNameText like concat('%', #{marjorNameText}, '%')</if>
  193. <if test="marjorBelongs != null and marjorBelongs != ''"> and marjorBelongs = #{marjorBelongs}</if>
  194. <if test="marjorDirection != null and marjorDirection != ''"> and marjorDirection like concat('%', #{marjorDirection}, '%')</if>
  195. <if test="specialProject != null and specialProject != ''"> and specialProject = #{specialProject}</if>
  196. <if test="createTime != null "> and createTime = #{createTime}</if>
  197. <if test="status != null "> and status = #{status}</if>
  198. <if test="planCount != null and planCount != ''"> and planCount = #{planCount}</if>
  199. <if test="planType != null and planType != ''"> and planType = #{planType}</if>
  200. <if test="xuefei != null and xuefei != ''"> and xuefei = #{xuefei}</if>
  201. <if test="xuezhi != null and xuezhi != ''"> and xuezhi = #{xuezhi}</if>
  202. </where>
  203. order by collegeCode, batch, marjorCode, year desc
  204. </select>
  205. <select id="selectSubmitRecruitsData" parameterType="String" resultType="String">
  206. SELECT DISTINCT type from b_busi_wish_university_submit_recruit_plan where status &gt; 0
  207. and location = #{location}
  208. <choose>
  209. <when test="year != null and year != ''">
  210. and year = #{year}
  211. </when>
  212. <otherwise>
  213. and year=(SELECT max(`year`) from b_busi_wish_university_submit_recruit_plan where `location`= #{location})
  214. </otherwise>
  215. </choose>
  216. </select>
  217. <select id="selectSubmitRecruitsMaxYearByLocation" parameterType="String" resultType="Integer">
  218. SELECT max(year) from b_busi_wish_university_submit_recruit_plan where status &gt; 0
  219. and location = #{location}
  220. </select>
  221. <select id="getUniversityNameText" resultType="String">
  222. SELECT distinct universityNameText from b_busi_wish_university_submit_recruit_plan where status &gt; 0
  223. and universityCode = #{universityCode} and location = #{location} and year = #{year} and type = #{type}
  224. <if test="level!=null and level!=''">
  225. and level = #{level}
  226. </if>
  227. order by universityNameText asc
  228. </select>
  229. <select id="selectBBusiWishUniversitySubmitRecruitPlanById" parameterType="Long" resultMap="BBusiWishUniversitySubmitRecruitPlanResult">
  230. <include refid="selectBBusiWishUniversitySubmitRecruitPlanVo"/>
  231. where id = #{id}
  232. </select>
  233. <select id="levels" resultType="String">
  234. select distinct level from b_busi_wish_university_submit_recruit_plan where status &gt; 0
  235. <if test="location!=null and location!=''">
  236. and location = #{location}
  237. </if>
  238. <if test="year!=null">
  239. and year = #{year}
  240. </if>
  241. order by batch asc
  242. </select>
  243. <select id="types" resultType="String">
  244. select distinct type from b_busi_wish_university_submit_recruit_plan where status &gt; 0
  245. <if test="location!=null and location!=''">
  246. and location = #{location}
  247. </if>
  248. <if test="year!=null">
  249. and year = #{year}
  250. </if>
  251. order by liberalScience desc
  252. </select>
  253. <select id="years" resultType="String">
  254. select distinct year from b_busi_wish_university_submit_recruit_plan where status &gt; 0
  255. <if test="location!=null and location!=''">
  256. and location = #{location}
  257. </if>
  258. <if test="type!=null and type!=''">
  259. and type = #{type}
  260. </if>
  261. <if test="level!=null and level!=''">
  262. and level = #{level}
  263. </if>
  264. order by year desc
  265. </select>
  266. <select id="specialProjects" resultMap="BBusiWishUniversitySubmitRecruitPlanResult">
  267. select distinct location, year, specialProject from b_busi_wish_university_submit_recruit_plan where specialProject != ''
  268. <if test="location!=null and location!=''">
  269. and location = #{location}
  270. </if>
  271. <if test="year!=null">
  272. and year &gt;= #{year}
  273. </if>
  274. </select>
  275. <insert id="insertBBusiWishUniversitySubmitRecruitPlan" parameterType="BBusiWishUniversitySubmitRecruitPlan" useGeneratedKeys="true" keyProperty="id">
  276. insert into b_busi_wish_university_submit_recruit_plan
  277. <trim prefix="(" suffix=")" suffixOverrides=",">
  278. <if test="collegeCode != null">collegeCode,</if>
  279. <if test="year != null and year != ''">year,</if>
  280. <if test="location != null">location,</if>
  281. <if test="batch != null">batch,</if>
  282. <if test="level != null">level,</if>
  283. <if test="liberalScience != null">liberalScience,</if>
  284. <if test="type != null">type,</if>
  285. <if test="marjorId != null">marjorId,</if>
  286. <if test="universityId != null">universityId,</if>
  287. <if test="universityCode != null">universityCode,</if>
  288. <if test="universityName != null">universityName,</if>
  289. <if test="marjorCode != null">marjorCode,</if>
  290. <if test="marjorName != null">marjorName,</if>
  291. <if test="marjorNameText != null">marjorNameText,</if>
  292. <if test="marjorBelongs != null">marjorBelongs,</if>
  293. <if test="marjorDirection != null">marjorDirection,</if>
  294. <if test="specialProject != null">specialProject,</if>
  295. <if test="createTime != null">createTime,</if>
  296. <if test="status != null">status,</if>
  297. <if test="planCount != null">planCount,</if>
  298. <if test="planType != null">planType,</if>
  299. <if test="xuefei != null">xuefei,</if>
  300. <if test="xuezhi != null">xuezhi,</if>
  301. <if test="course != null">course,</if>
  302. </trim>
  303. <trim prefix="values (" suffix=")" suffixOverrides=",">
  304. <if test="collegeCode != null">#{collegeCode},</if>
  305. <if test="year != null and year != ''">#{year},</if>
  306. <if test="location != null">#{location},</if>
  307. <if test="batch != null">#{batch},</if>
  308. <if test="level != null">#{level},</if>
  309. <if test="liberalScience != null">#{liberalScience},</if>
  310. <if test="type != null">#{type},</if>
  311. <if test="marjorId != null">#{marjorId},</if>
  312. <if test="universityId != null">#{universityId},</if>
  313. <if test="universityCode != null">#{universityCode},</if>
  314. <if test="universityName != null">#{universityName},</if>
  315. <if test="marjorCode != null">#{marjorCode},</if>
  316. <if test="marjorName != null">#{marjorName},</if>
  317. <if test="marjorNameText != null">#{marjorNameText},</if>
  318. <if test="marjorBelongs != null">#{marjorBelongs},</if>
  319. <if test="marjorDirection != null">#{marjorDirection},</if>
  320. <if test="specialProject != null">#{specialProject},</if>
  321. <if test="createTime != null">#{createTime},</if>
  322. <if test="status != null">#{status},</if>
  323. <if test="planCount != null">#{planCount},</if>
  324. <if test="planType != null">#{planType},</if>
  325. <if test="xuefei != null">#{xuefei},</if>
  326. <if test="xuezhi != null">#{xuezhi},</if>
  327. <if test="course != null">#{course},</if>
  328. </trim>
  329. </insert>
  330. <update id="updateBBusiWishUniversitySubmitRecruitPlan" parameterType="BBusiWishUniversitySubmitRecruitPlan">
  331. update b_busi_wish_university_submit_recruit_plan
  332. <trim prefix="SET" suffixOverrides=",">
  333. <if test="collegeCode != null">collegeCode = #{collegeCode},</if>
  334. <if test="year != null and year != ''">year = #{year},</if>
  335. <if test="location != null">location = #{location},</if>
  336. <if test="batch != null">batch = #{batch},</if>
  337. <if test="level != null">level = #{level},</if>
  338. <if test="liberalScience != null">liberalScience = #{liberalScience},</if>
  339. <if test="type != null">type = #{type},</if>
  340. <if test="marjorId != null">marjorId = #{marjorId},</if>
  341. <if test="universityId != null">universityId = #{universityId},</if>
  342. <if test="universityCode != null">universityCode = #{universityCode},</if>
  343. <if test="universityName != null">universityName = #{universityName},</if>
  344. <if test="marjorCode != null">marjorCode = #{marjorCode},</if>
  345. <if test="marjorName != null">marjorName = #{marjorName},</if>
  346. <if test="marjorNameText != null">marjorNameText = #{marjorNameText},</if>
  347. <if test="marjorBelongs != null">marjorBelongs = #{marjorBelongs},</if>
  348. <if test="marjorDirection != null">marjorDirection = #{marjorDirection},</if>
  349. <if test="specialProject != null">specialProject = #{specialProject},</if>
  350. <if test="createTime != null">createTime = #{createTime},</if>
  351. <if test="status != null">status = #{status},</if>
  352. <if test="planCount != null">planCount = #{planCount},</if>
  353. <if test="planType != null">planType = #{planType},</if>
  354. <if test="xuefei != null">xuefei = #{xuefei},</if>
  355. <if test="xuezhi != null">xuezhi = #{xuezhi},</if>
  356. <if test="course != null">course = #{course},</if>
  357. </trim>
  358. where id = #{id}
  359. </update>
  360. <delete id="deleteBBusiWishUniversitySubmitRecruitPlanById" parameterType="Long">
  361. delete from b_busi_wish_university_submit_recruit_plan where id = #{id}
  362. </delete>
  363. <delete id="deleteBBusiWishUniversitySubmitRecruitPlanByIds" parameterType="String">
  364. delete from b_busi_wish_university_submit_recruit_plan where id in
  365. <foreach item="id" collection="array" open="(" separator="," close=")">
  366. #{id}
  367. </foreach>
  368. </delete>
  369. </mapper>