BBusiWishUniversitySubmitsMapper.xml 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  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.BBusiWishUniversitySubmitsMapper">
  6. <resultMap type="BBusiWishUniversitySubmits" id="BBusiWishUniversitySubmitsResult">
  7. <result property="id" column="id" />
  8. <result property="universityId" column="universityId" />
  9. <result property="universityName" column="universityName" />
  10. <result property="universityNameText" column="universityNameText" />
  11. <result property="year" column="year" />
  12. <result property="location" column="location" />
  13. <result property="batch" column="batch" />
  14. <result property="type" column="type" />
  15. <result property="level" column="level" />
  16. <result property="score" column="score" />
  17. <result property="seat" column="seat" />
  18. <result property="num" column="num" />
  19. <result property="numReal" column="numReal" />
  20. <result property="createTime" column="createTime" />
  21. <result property="status" column="status" />
  22. <result property="universityName" column="universityName" />
  23. <result property="universityCode" column="universityCode" />
  24. <result property="collegeCode" column="collegeCode" />
  25. <result property="batchName" column="batchName" />
  26. <result property="liberalScience" column="liberalScience" />
  27. <result property="course" column="course" />
  28. <result property="collegeRemark" column="collegeRemark" />
  29. </resultMap>
  30. <sql id="selectBBusiWishUniversitySubmitsVo">
  31. select id, universityId, year, location, batch, type, level, score, seat, num, numReal, createTime, status,
  32. universityName,universityCode,collegeCode,batchName,liberalScience,course,collegeRemark
  33. from b_busi_wish_university_submits
  34. </sql>
  35. <select id="query" parameterType="String" resultType="com.alibaba.fastjson.JSONObject">
  36. ${sql}
  37. </select>
  38. <select id="levels" resultType="String">
  39. select distinct level from b_busi_wish_university_submits where 1=1
  40. <if test="location!=null and location!=''">
  41. and location = #{location}
  42. </if>
  43. <if test="year!=null">
  44. and year = #{year}
  45. </if>
  46. </select>
  47. <select id="types" resultType="String">
  48. select distinct type from b_busi_wish_university_submits where 1=1
  49. <if test="location!=null and location!=''">
  50. and location = #{location}
  51. </if>
  52. <if test="year!=null">
  53. and year = #{year}
  54. </if>
  55. </select>
  56. <select id="years" resultType="String">
  57. select distinct year from b_busi_wish_university_submits where 1=1
  58. <if test="location!=null and location!=''">
  59. and location = #{location}
  60. </if>
  61. <if test="type!=null and type!=''">
  62. and type = #{type}
  63. </if>
  64. <if test="level!=null and level!=''">
  65. and level = #{level}
  66. </if>
  67. order by year desc
  68. </select>
  69. <select id="yearsStatus" resultType="String">
  70. select distinct year from b_busi_wish_university_submits where status &gt; 0
  71. <if test="location!=null and location!=''">
  72. and location = #{location}
  73. </if>
  74. <if test="type!=null and type!=''">
  75. and type = #{type}
  76. </if>
  77. <choose><when test="level!=null and level=='本科批'">and SUBSTRING(level, 1, 2) = SUBSTRING(#{level}, 1, 2)</when><when test="level!=null">and level = #{level}</when></choose>
  78. order by year desc
  79. </select>
  80. <select id="search" parameterType="Map" resultMap="BBusiWishUniversitySubmitsResult">
  81. select a.id, a.universityId, a.year, b.location as location, a.batch, a.type, a.level as level,
  82. a.score, a.seat, a.num, a.numReal, a.createTime, a.status,
  83. a.universityCode,a.collegeCode,a.batchName,a.liberalScience,a.course,a.collegeRemark,
  84. a.universityName as universityName, a.universityNameText as universityNameText
  85. from b_busi_wish_university_submits a
  86. LEFT JOIN b_busi_wish_universities b ON a.universityId = b.id
  87. where a.status &gt;= 0 and b.status &gt; 0
  88. <if test="univerName != null and univerName != ''"> and (a.universityName like concat('%', #{univerName}, '%') or a.universityNameText like concat('%', #{univerName}, '%'))</if>
  89. <if test="universityId != null"> and b.id = #{universityId}</if>
  90. <if test="code != null and code != ''"> and b.code = #{code}</if>
  91. <if test="location != null and location != ''"> and b.location = #{location}</if>
  92. <if test="level != null and level != ''"> and a.level like concat('%', #{level}, '%')</if>
  93. <if test="type != null and type != ''"> and a.type = #{type} </if>
  94. <if test="year != null and year != ''"> and a.year = #{year} </if>
  95. <if test="spro != null and spro != ''"> and a.location = #{spro} </if>
  96. order by b.code asc,a.score desc
  97. </select>
  98. <select id="selectBBusiWishUniversitySubmitsList" parameterType="BBusiWishUniversitySubmits" resultMap="BBusiWishUniversitySubmitsResult">
  99. <include refid="selectBBusiWishUniversitySubmitsVo" />
  100. <where>
  101. <if test="universityId != null and universityId != ''"> and universityId = #{universityId}</if>
  102. <if test="year != null and year != ''"> and year = #{year}</if>
  103. <if test="location != null and location != ''"> and location = #{location}</if>
  104. <if test="batch != null "> and batch = #{batch}</if>
  105. <if test="type != null and type != ''"> and type = #{type}</if>
  106. <if test="level != null and level != ''"> and level = #{level}</if>
  107. <if test="score != null "> and score = #{score}</if>
  108. <if test="seat != null "> and seat = #{seat}</if>
  109. <if test="num != null "> and num = #{num}</if>
  110. <if test="numReal != null "> and numReal = #{numReal}</if>
  111. <if test="createTime != null "> and createTime = #{createTime}</if>
  112. <if test="status != null "> and status = #{status}</if>
  113. </where>
  114. </select>
  115. <select id="selectBBusiWishUniversitySubmitsById" parameterType="Long" resultMap="BBusiWishUniversitySubmitsResult">
  116. <include refid="selectBBusiWishUniversitySubmitsVo" />
  117. where id = #{id}
  118. </select>
  119. <select id="selectBBusiWishUniversitySubmitsByCond" parameterType="map" resultMap="BBusiWishUniversitySubmitsResult">
  120. <include refid="selectBBusiWishUniversitySubmitsVo" />
  121. where`location` = #{location} AND `year` = #{year} AND `level` = #{level} AND liberalScience = #{liberalScience}
  122. and universityId in <foreach item="id" collection="universityIds" open="(" separator="," close=")">#{id}</foreach>
  123. </select>
  124. <insert id="insertBBusiWishUniversitySubmits" parameterType="BBusiWishUniversitySubmits" useGeneratedKeys="true" keyProperty="id">
  125. insert into b_busi_wish_university_submits
  126. <trim prefix="(" suffix=")" suffixOverrides=",">
  127. <if test="universityId != null">universityId,</if>
  128. <if test="year != null and year != ''">year,</if>
  129. <if test="location != null">location,</if>
  130. <if test="batch != null">batch,</if>
  131. <if test="type != null">type,</if>
  132. <if test="level != null">level,</if>
  133. <if test="score != null">score,</if>
  134. <if test="seat != null">seat,</if>
  135. <if test="num != null">num,</if>
  136. <if test="numReal != null">numReal,</if>
  137. <if test="createTime != null">createTime,</if>
  138. <if test="status != null">status,</if>
  139. </trim>
  140. <trim prefix="values (" suffix=")" suffixOverrides=",">
  141. <if test="universityId != null">#{universityId},</if>
  142. <if test="year != null and year != ''">#{year},</if>
  143. <if test="location != null">#{location},</if>
  144. <if test="batch != null">#{batch},</if>
  145. <if test="type != null">#{type},</if>
  146. <if test="level != null">#{level},</if>
  147. <if test="score != null">#{score},</if>
  148. <if test="seat != null">#{seat},</if>
  149. <if test="num != null">#{num},</if>
  150. <if test="numReal != null">#{numReal},</if>
  151. <if test="createTime != null">#{createTime},</if>
  152. <if test="status != null">#{status},</if>
  153. </trim>
  154. </insert>
  155. <update id="updateBBusiWishUniversitySubmits" parameterType="BBusiWishUniversitySubmits">
  156. update b_busi_wish_university_submits
  157. <trim prefix="SET" suffixOverrides=",">
  158. <if test="universityId != null">universityId = #{universityId},</if>
  159. <if test="year != null and year != ''">year = #{year},</if>
  160. <if test="location != null">location = #{location},</if>
  161. <if test="batch != null">batch = #{batch},</if>
  162. <if test="type != null">type = #{type},</if>
  163. <if test="level != null">level = #{level},</if>
  164. <if test="score != null">score = #{score},</if>
  165. <if test="seat != null">seat = #{seat},</if>
  166. <if test="num != null">num = #{num},</if>
  167. <if test="numReal != null">numReal = #{numReal},</if>
  168. <if test="createTime != null">createTime = #{createTime},</if>
  169. <if test="status != null">status = #{status},</if>
  170. </trim>
  171. where id = #{id}
  172. </update>
  173. <delete id="deleteBBusiWishUniversitySubmitsById" parameterType="Long">
  174. delete from b_busi_wish_university_submits where id = #{id}
  175. </delete>
  176. <delete id="deleteBBusiWishUniversitySubmitsByIds" parameterType="String">
  177. delete from b_busi_wish_university_submits where id in
  178. <foreach item="id" collection="array" open="(" separator="," close=")">
  179. #{id}
  180. </foreach>
  181. </delete>
  182. </mapper>