BBusiWishLocationSubmitsMapper.xml 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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.BBusiWishLocationSubmitsMapper">
  6. <resultMap type="BBusiWishLocationSubmits" id="BBusiWishLocationSubmitsResult">
  7. <result property="id" column="id" />
  8. <result property="location" column="location" />
  9. <result property="year" column="year" />
  10. <result property="type" column="type" />
  11. <result property="score" column="score" />
  12. <result property="createTime" column="createTime" />
  13. <result property="status" column="status" />
  14. <result property="typeName" column="typeName" />
  15. <result property="course" column="course" />
  16. <result property="courseName" column="courseName" />
  17. <result property="pressureScore" column="pressure_score" />
  18. <result property="pressureRange" column="pressure_range" />
  19. </resultMap>
  20. <sql id="selectBBusiWishLocationSubmitsVo">
  21. select id, location, year, type, typeName, score, course, courseName, pressure_score, pressure_range, createTime, status from b_busi_wish_location_submits
  22. </sql>
  23. <select id="selectBBusiWishLocationSubmitsList" parameterType="BBusiWishLocationSubmits" resultMap="BBusiWishLocationSubmitsResult">
  24. <include refid="selectBBusiWishLocationSubmitsVo" />
  25. <where>
  26. <if test="location != null and location != ''"> and location = #{location}</if>
  27. <if test="year != null and year != ''"> and year = #{year}</if>
  28. <if test="score != null "> and score = #{score}</if>
  29. <if test="type != null "> and type = #{type}</if>
  30. <if test="typeName != null and typeName != '' "> and typeName = #{typeName}</if>
  31. <if test="course != null and course != '' "> and course = #{course}</if>
  32. <if test="pressureScore != null and pressureScore != '' "> and pressure_score = #{pressureScore}</if>
  33. <if test="pressureRange != null and pressureRange != '' "> and pressure_range = #{pressureRange}</if>
  34. <if test="createTime != null "> and createTime = #{createTime}</if>
  35. <if test="status != null "> and status = #{status}</if>
  36. </where>
  37. order by year desc,type asc
  38. </select>
  39. <select id="selectBBusiWishLocationSubmitsById" parameterType="Long" resultMap="BBusiWishLocationSubmitsResult">
  40. <include refid="selectBBusiWishLocationSubmitsVo" />
  41. where id = #{id}
  42. </select>
  43. <select id="locations" resultType="String">
  44. select distinct location from b_busi_wish_location_submits where status &gt; 0
  45. </select>
  46. <select id="years" parameterType="String" resultType="String">
  47. select distinct year from b_busi_wish_location_submits where status &gt; 0
  48. <if test="location!=null and location!=''">
  49. and location = #{location}
  50. </if>
  51. order by year desc
  52. </select>
  53. <select id="yearsNoStatus" parameterType="String" resultType="String">
  54. select distinct year from b_busi_wish_location_submits where 1=1
  55. <if test="location!=null and location!=''">
  56. and location = #{location}
  57. </if>
  58. order by year desc
  59. </select>
  60. <insert id="insertBBusiWishLocationSubmits" parameterType="BBusiWishLocationSubmits" useGeneratedKeys="true" keyProperty="id">
  61. insert into b_busi_wish_location_submits
  62. <trim prefix="(" suffix=")" suffixOverrides=",">
  63. <if test="location != null">location,</if>
  64. <if test="year != null">year,</if>
  65. <if test="type != null">type,</if>
  66. <if test="score != null">score,</if>
  67. <if test="createTime != null">createTime,</if>
  68. <if test="status != null">status,</if>
  69. </trim>
  70. <trim prefix="values (" suffix=")" suffixOverrides=",">
  71. <if test="location != null">#{location},</if>
  72. <if test="year != null">#{year},</if>
  73. <if test="type != null">#{type},</if>
  74. <if test="score != null">#{score},</if>
  75. <if test="createTime != null">#{createTime},</if>
  76. <if test="status != null">#{status},</if>
  77. </trim>
  78. </insert>
  79. <update id="updateBBusiWishLocationSubmits" parameterType="BBusiWishLocationSubmits">
  80. update b_busi_wish_location_submits
  81. <trim prefix="SET" suffixOverrides=",">
  82. <if test="location != null">location = #{location},</if>
  83. <if test="year != null">year = #{year},</if>
  84. <if test="type != null">type = #{type},</if>
  85. <if test="score != null">score = #{score},</if>
  86. <if test="createTime != null">createTime = #{createTime},</if>
  87. <if test="status != null">status = #{status},</if>
  88. </trim>
  89. where id = #{id}
  90. </update>
  91. <delete id="deleteBBusiWishLocationSubmitsById" parameterType="Long">
  92. delete from b_busi_wish_location_submits where id = #{id}
  93. </delete>
  94. <delete id="deleteBBusiWishLocationSubmitsByIds" parameterType="String">
  95. delete from b_busi_wish_location_submits where id in
  96. <foreach item="id" collection="array" open="(" separator="," close=")">
  97. #{id}
  98. </foreach>
  99. </delete>
  100. <select id="batches" resultMap="BBusiWishLocationSubmitsResult">
  101. select year,type,score,typeName,course
  102. from b_busi_wish_location_submits
  103. where status>0 and location= #{location}
  104. and year=(select max(year) from b_busi_wish_location_submits where status>0 and location= #{location}) and course = #{mode}
  105. order by type
  106. </select>
  107. <select id="batchesNoStatus" parameterType="String" resultMap="BBusiWishLocationSubmitsResult">
  108. select year,type,score,typeName,course
  109. from b_busi_wish_location_submits
  110. where 1=1 and location= #{location}
  111. and year=(select max(year) from b_busi_wish_location_submits where 1=1 and location= #{location}) and course = #{mode}
  112. order by type
  113. </select>
  114. <select id="examMajors" parameterType="String" resultMap="BBusiWishLocationSubmitsResult">
  115. select distinct course, courseName
  116. from b_busi_wish_location_submits
  117. where 1=1
  118. <if test="location != null and location != ''"> and location = #{location}</if>
  119. and year=(select max(year) from b_busi_wish_location_submits where 1=1
  120. <if test="location != null and location != ''"> and location = #{location}</if>
  121. )
  122. order by course
  123. </select>
  124. </mapper>