AMarjorPlanMapper.xml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  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.ie.mapper.AMarjorPlanMapper">
  6. <resultMap type="AMarjorPlan" id="AMarjorPlanResult">
  7. <result property="id" column="id" />
  8. <result property="year" column="year" />
  9. <result property="universityId" column="universityId" />
  10. <result property="universityName" column="universityName" />
  11. <result property="level" column="level" />
  12. <result property="majorGroup" column="majorGroup" />
  13. <result property="majorName" column="majorName" />
  14. <result property="majorDirection" column="majorDirection" />
  15. <result property="enrollCode" column="enrollCode" />
  16. <result property="majorEnrollCode" column="majorEnrollCode" />
  17. <result property="examineeType" column="examineeType" />
  18. <result property="planTotal" column="planTotal" />
  19. <result property="lengthOfSchooling" column="lengthOfSchooling" />
  20. <result property="score" column="score" />
  21. <result property="xuefei" column="xuefei" />
  22. <result property="culturalScore" column="culturalScore" />
  23. <result property="profScore" column="profScore" />
  24. <result property="schoolScore" column="schoolScore" />
  25. <result property="chinessScore" column="chinessScore" />
  26. <result property="mathScore" column="mathScore" />
  27. <result property="englishScore" column="englishScore" />
  28. <result property="custCond" column="custCond" />
  29. <result property="comment" column="comment" />
  30. <result property="company" column="company" />
  31. <result property="test" column="test" />
  32. <result property="enrollFormula" column="enrollFormula" />
  33. </resultMap>
  34. <sql id="selectAMarjorPlanVo">
  35. select id, year, universityId, universityName, level, majorGroup, majorName, majorDirection, enrollCode, majorEnrollCode, examineeType, planTotal, xuefei, lengthOfSchooling, score, culturalScore, profScore, schoolScore, chinessScore, mathScore, englishScore, custCond, comment, company, test,enrollFormula from a_marjor_plan
  36. </sql>
  37. <select id="selectListByRuleCond" parameterType="Map" resultMap="AMarjorPlanResult">
  38. SELECT m1.code majorCode, p.id, p.year, p.universityId, p.universityName, p.level, majorGroup, majorName, majorDirection, enrollCode, majorEnrollCode, examineeType, planTotal, xuefei, lengthOfSchooling, score, culturalScore, profScore, schoolScore, chinessScore, mathScore, englishScore, custCond, comment, company
  39. FROM `a_marjor_plan` p
  40. JOIN `b_busi_wish_universities` u ON p.`universityId` = u.`id`
  41. LEFT JOIN `sy_major` m1 ON m1.`name` = p.`majorName` and m1.`exam_type` = p.examineeType
  42. LEFT JOIN `sy_major` m2 ON m1.`parent_code` = m2.`code` and m2.`exam_type` = p.examineeType
  43. LEFT JOIN `sy_major` m3 ON m2.`parent_code` = m3.`code` and m3.`exam_type` = p.examineeType
  44. <where>
  45. <if test="examineeType != null and examineeType != '' "> and (p.`examineeType` IS NULL OR p.`examineeType` = '' OR p.`examineeType` = #{examineeType})</if>
  46. <if test="year != null "> and p.year = #{year}</if>
  47. <if test="universityCode != null and universityCode != ''"> and u.`code` = #{universityCode}</if>
  48. <if test="majorEnrollCodes != null"> AND p.`id` in <foreach item="o" collection="majorEnrollCodes" open="(" separator="," close=")">#{o}</foreach></if>
  49. <choose>
  50. <when test="majorCodes != null"> AND m1.`code` in <foreach item="o" collection="majorCodes" open="(" separator="," close=")">#{o}</foreach></when>
  51. <when test="majorTypes != null"> AND m2.`code` in <foreach item="o" collection="majorTypes" open="(" separator="," close=")">#{o}</foreach></when>
  52. <when test="majorCategory != null and majorCategory != ''"> AND m3.`code` = #{majorCategory} </when>
  53. </choose>
  54. <if test="universityName != null and universityName != ''"> AND u.`name` LIKE CONCAT('%', #{universityName}, '%')</if>
  55. <if test="universityLevel != null"> AND u.`level` in <foreach item="o" collection="universityLevel" open="(" separator="," close=")">#{o}</foreach></if>
  56. <if test="universityType != null"> AND u.`type` in <foreach item="o" collection="universityType" open="(" separator="," close=")">#{o}</foreach></if>
  57. <if test="universityNatureType != null"> AND u.`natureTypeCN` in <foreach item="o" collection="universityNatureType" open="(" separator="," close=")">#{o}</foreach></if>
  58. <if test="universityLocation != null"> AND u.`location` in <foreach item="o" collection="universityLocation" open="(" separator="," close=")">#{o}</foreach></if>
  59. </where>
  60. order by p.universityId,majorName, majorDirection
  61. </select>
  62. <select id="selectAMarjorPlanList" parameterType="AMarjorPlan" resultMap="AMarjorPlanResult">
  63. <include refid="selectAMarjorPlanVo"/>
  64. <where>
  65. <if test="year != null "> and year = #{year}</if>
  66. <if test="universityId != null "> and universityId = #{universityId}</if>
  67. <if test="universityName != null and universityName != ''"> and universityName like concat('%', #{universityName}, '%')</if>
  68. <if test="level != null and level != ''"> and level = #{level}</if>
  69. <if test="majorGroup != null and majorGroup != ''"> and majorGroup = #{majorGroup}</if>
  70. <if test="majorName != null and majorName != ''"> and majorName like concat('%', #{majorName}, '%')</if>
  71. <if test="majorDirection != null and majorDirection != ''"> and majorDirection = #{majorDirection}</if>
  72. <if test="enrollCode != null and enrollCode != ''"> and enrollCode = #{enrollCode}</if>
  73. <if test="majorEnrollCode != null and majorEnrollCode != ''"> and majorEnrollCode = #{majorEnrollCode}</if>
  74. <if test="examineeType != null and examineeType != ''"> and examineeType = #{examineeType}</if>
  75. <if test="planTotal != null "> and planTotal = #{planTotal}</if>
  76. <if test="lengthOfSchooling != null "> and lengthOfSchooling = #{lengthOfSchooling}</if>
  77. <if test="score != null "> and score = #{score}</if>
  78. <if test="culturalScore != null "> and culturalScore = #{culturalScore}</if>
  79. <if test="profScore != null "> and profScore = #{profScore}</if>
  80. <if test="schoolScore != null "> and schoolScore = #{schoolScore}</if>
  81. <if test="chinessScore != null "> and chinessScore = #{chinessScore}</if>
  82. <if test="mathScore != null "> and mathScore = #{mathScore}</if>
  83. <if test="englishScore != null "> and englishScore = #{englishScore}</if>
  84. <if test="custCond != null and custCond != ''"> and custCond = #{custCond}</if>
  85. <if test="comment != null and comment != ''"> and comment = #{comment}</if>
  86. <if test="company != null and company != ''"> and company = #{company}</if>
  87. </where>
  88. </select>
  89. <select id="selectAMarjorPlanById" parameterType="Long" resultMap="AMarjorPlanResult">
  90. <include refid="selectAMarjorPlanVo"/>
  91. where id = #{id}
  92. </select>
  93. <select id="selectMajorCodesByIds" parameterType="String" resultType="String">
  94. SELECT distinct m1.code majorCode
  95. FROM `a_marjor_plan` p
  96. JOIN `sy_major` m1 ON m1.`name` = p.`majorName` and m1.`exam_type` = p.examineeType
  97. where p.id in <foreach item="id" collection="array" open="(" separator="," close=")">#{id}</foreach>
  98. </select>
  99. <insert id="insertAMarjorPlan" parameterType="AMarjorPlan" useGeneratedKeys="true" keyProperty="id">
  100. insert into a_marjor_plan
  101. <trim prefix="(" suffix=")" suffixOverrides=",">
  102. <if test="year != null">year,</if>
  103. <if test="universityId != null">universityId,</if>
  104. <if test="universityName != null">universityName,</if>
  105. <if test="level != null">level,</if>
  106. <if test="majorGroup != null">majorGroup,</if>
  107. <if test="majorName != null">majorName,</if>
  108. <if test="majorDirection != null">majorDirection,</if>
  109. <if test="enrollCode != null">enrollCode,</if>
  110. <if test="majorEnrollCode != null">majorEnrollCode,</if>
  111. <if test="examineeType != null">examineeType,</if>
  112. <if test="planTotal != null">planTotal,</if>
  113. <if test="xuefei != null">xuefei,</if>
  114. <if test="lengthOfSchooling != null">lengthOfSchooling,</if>
  115. <if test="score != null">score,</if>
  116. <if test="culturalScore != null">culturalScore,</if>
  117. <if test="profScore != null">profScore,</if>
  118. <if test="schoolScore != null">schoolScore,</if>
  119. <if test="chinessScore != null">chinessScore,</if>
  120. <if test="mathScore != null">mathScore,</if>
  121. <if test="englishScore != null">englishScore,</if>
  122. <if test="custCond != null">custCond,</if>
  123. <if test="comment != null">comment,</if>
  124. <if test="company != null">company,</if>
  125. <if test="test != null">test,</if>
  126. </trim>
  127. <trim prefix="values (" suffix=")" suffixOverrides=",">
  128. <if test="year != null">#{year},</if>
  129. <if test="universityId != null">#{universityId},</if>
  130. <if test="universityName != null">#{universityName},</if>
  131. <if test="level != null">#{level},</if>
  132. <if test="majorGroup != null">#{majorGroup},</if>
  133. <if test="majorName != null">#{majorName},</if>
  134. <if test="majorDirection != null">#{majorDirection},</if>
  135. <if test="enrollCode != null">#{enrollCode},</if>
  136. <if test="majorEnrollCode != null">#{majorEnrollCode},</if>
  137. <if test="examineeType != null">#{examineeType},</if>
  138. <if test="planTotal != null">#{planTotal},</if>
  139. <if test="xuefei != null">#{xuefei},</if>
  140. <if test="lengthOfSchooling != null">#{lengthOfSchooling},</if>
  141. <if test="score != null">#{score},</if>
  142. <if test="culturalScore != null">#{culturalScore},</if>
  143. <if test="profScore != null">#{profScore},</if>
  144. <if test="schoolScore != null">#{schoolScore},</if>
  145. <if test="chinessScore != null">#{chinessScore},</if>
  146. <if test="mathScore != null">#{mathScore},</if>
  147. <if test="englishScore != null">#{englishScore},</if>
  148. <if test="custCond != null">#{custCond},</if>
  149. <if test="comment != null">#{comment},</if>
  150. <if test="company != null">#{company},</if>
  151. <if test="test != null">#{test},</if>
  152. </trim>
  153. </insert>
  154. <update id="updateAMarjorPlan" parameterType="AMarjorPlan">
  155. update a_marjor_plan
  156. <trim prefix="SET" suffixOverrides=",">
  157. <if test="year != null">year = #{year},</if>
  158. <if test="universityId != null">universityId = #{universityId},</if>
  159. <if test="universityName != null">universityName = #{universityName},</if>
  160. <if test="level != null">level = #{level},</if>
  161. <if test="majorGroup != null">majorGroup = #{majorGroup},</if>
  162. <if test="majorName != null">majorName = #{majorName},</if>
  163. <if test="majorDirection != null">majorDirection = #{majorDirection},</if>
  164. <if test="enrollCode != null">enrollCode = #{enrollCode},</if>
  165. <if test="majorEnrollCode != null">majorEnrollCode = #{majorEnrollCode},</if>
  166. <if test="examineeType != null">examineeType = #{examineeType},</if>
  167. <if test="planTotal != null">planTotal = #{planTotal},</if>
  168. <if test="xuefei != null">xuefei = #{xuefei},</if>
  169. <if test="lengthOfSchooling != null">lengthOfSchooling = #{lengthOfSchooling},</if>
  170. <if test="score != null">score = #{score},</if>
  171. <if test="culturalScore != null">culturalScore = #{culturalScore},</if>
  172. <if test="profScore != null">profScore = #{profScore},</if>
  173. <if test="schoolScore != null">schoolScore = #{schoolScore},</if>
  174. <if test="chinessScore != null">chinessScore = #{chinessScore},</if>
  175. <if test="mathScore != null">mathScore = #{mathScore},</if>
  176. <if test="englishScore != null">englishScore = #{englishScore},</if>
  177. <if test="custCond != null">custCond = #{custCond},</if>
  178. <if test="comment != null">comment = #{comment},</if>
  179. <if test="company != null">company = #{company},</if>
  180. <if test="test != null">test = #{test},</if>
  181. </trim>
  182. where id = #{id}
  183. </update>
  184. <delete id="deleteAMarjorPlanById" parameterType="Long">
  185. delete from a_marjor_plan where id = #{id}
  186. </delete>
  187. <delete id="deleteAMarjorPlanByIds" parameterType="String">
  188. delete from a_marjor_plan where id in
  189. <foreach item="id" collection="array" open="(" separator="," close=")">
  190. #{id}
  191. </foreach>
  192. </delete>
  193. </mapper>