MxjbSelectedRoundMapper.xml 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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.mxjb.mapper.MxjbSelectedRoundMapper">
  6. <resultMap type="MxjbSelectedRound" id="MxjbSelectedRoundResult">
  7. <result property="roundId" column="round_id" />
  8. <result property="schoolId" column="school_id" />
  9. <result property="year" column="year" />
  10. <result property="round" column="round" />
  11. <result property="name" column="name" />
  12. <result property="beginTime" column="begin_time" />
  13. <result property="endTime" column="end_time" />
  14. <result property="groupIds" column="group_ids" />
  15. <result property="state" column="state" />
  16. <result property="modelId" column="model_id" />
  17. <result property="generation" column="generation" />
  18. <result property="preferenceCount" column="preference_count" />
  19. <result property="rankInvisible" column="rank_invisible" />
  20. <result property="scoreInvisible" column="score_invisible" />
  21. <result property="enableEsign" column="enable_esign" />
  22. <result property="enablePaperSign" column="enable_paper_sign" />
  23. <result property="enablePushForceAdjust" column="enable_push_force_adjust" />
  24. <result property="dispatchStatus" column="dispatch_status" />
  25. <result property="activeDate" column="active_date" />
  26. <result property="teacherDone" column="teacher_done" />
  27. <result property="studentDone" column="student_done" />
  28. </resultMap>
  29. <sql id="selectMxjbSelectedRoundVo">
  30. select round_id, school_id, year, round, name, begin_time, end_time, group_ids, state, model_id, generation, preference_count, rank_invisible, score_invisible, enable_esign, enable_paper_sign, enable_push_force_adjust, dispatch_status, active_date, teacher_done, student_done, active_date from mxjb_selected_round
  31. </sql>
  32. <select id="selectSelectedRoundLatest" parameterType="map" resultMap="MxjbSelectedRoundResult">
  33. <include refid="selectMxjbSelectedRoundVo"/>
  34. where school_id = #{schoolId} and year = #{year} and begin_time &lt;= #{date}
  35. order by begin_time desc
  36. limit 1
  37. </select>
  38. <select id="selectMxjbSelectedRoundList" parameterType="MxjbSelectedRound" resultMap="MxjbSelectedRoundResult">
  39. <include refid="selectMxjbSelectedRoundVo"/>
  40. <where>
  41. <if test="schoolId != null "> and school_id = #{schoolId}</if>
  42. <if test="year != null "> and year = #{year}</if>
  43. <if test="round != null "> and round = #{round}</if>
  44. <if test="name != null "> and name = #{name}</if>
  45. <if test="beginTime != null "> and begin_time = #{beginTime}</if>
  46. <if test="endTime != null "> and end_time = #{endTime}</if>
  47. <if test="groupIds != null and groupIds != ''"> and group_ids = #{groupIds}</if>
  48. <if test="state != null and state != ''"> and state = #{state}</if>
  49. <if test="modelId != null "> and model_id = #{modelId}</if>
  50. <if test="generation != null "> and generation = #{generation}</if>
  51. <if test="preferenceCount != null "> and preference_count = #{preferenceCount}</if>
  52. <if test="rankInvisible != null "> and rank_invisible = #{rankInvisible}</if>
  53. <if test="scoreInvisible != null "> and score_invisible = #{scoreInvisible}</if>
  54. <if test="enableEsign != null "> and enable_esign = #{enableEsign}</if>
  55. <if test="enablePaperSign != null "> and enable_paper_sign = #{enablePaperSign}</if>
  56. <if test="enablePushForceAdjust != null "> and enable_push_force_adjust = #{enablePushForceAdjust}</if>
  57. <if test="dispatchStatus != null and dispatchStatus != ''"> and dispatch_status = #{dispatchStatus}</if>
  58. <if test="activeDate != null"> and active_date = #{activeDate}</if>
  59. <if test="teacherDone != null"> and teacher_done = #{teacherDone}</if>
  60. <if test="studentDone != null"> and student_done = #{studentDone}</if>
  61. </where>
  62. order by begin_time desc
  63. </select>
  64. <select id="selectMxjbSelectedRoundById" parameterType="Integer" resultMap="MxjbSelectedRoundResult">
  65. <include refid="selectMxjbSelectedRoundVo"/>
  66. where round_id = #{roundId}
  67. </select>
  68. <insert id="insertMxjbSelectedRound" parameterType="MxjbSelectedRound" useGeneratedKeys="true" keyProperty="roundId">
  69. insert into mxjb_selected_round
  70. <trim prefix="(" suffix=")" suffixOverrides=",">
  71. <if test="schoolId != null">school_id,</if>
  72. <if test="year != null">year,</if>
  73. <if test="round != null">round,</if>
  74. <if test="name != null">name,</if>
  75. <if test="beginTime != null">begin_time,</if>
  76. <if test="endTime != null">end_time,</if>
  77. <if test="groupIds != null">group_ids,</if>
  78. <if test="state != null">state,</if>
  79. <if test="modelId != null">model_id,</if>
  80. <if test="generation != null">generation,</if>
  81. <if test="preferenceCount != null">preference_count,</if>
  82. <if test="rankInvisible != null">rank_invisible,</if>
  83. <if test="scoreInvisible != null">score_invisible,</if>
  84. <if test="enableEsign != null">enable_esign,</if>
  85. <if test="enablePaperSign != null">enable_paper_sign,</if>
  86. <if test="enablePushForceAdjust != null">enable_push_force_adjust,</if>
  87. <if test="dispatchStatus != null">dispatch_status,</if>
  88. <if test="activeDate != null">active_date,</if>
  89. <if test="teacherDone != null">teacher_done,</if>
  90. <if test="studentDone != null">student_done,</if>
  91. </trim>
  92. <trim prefix="values (" suffix=")" suffixOverrides=",">
  93. <if test="schoolId != null">#{schoolId},</if>
  94. <if test="year != null">#{year},</if>
  95. <if test="round != null">#{round},</if>
  96. <if test="name != null">#{name},</if>
  97. <if test="beginTime != null">#{beginTime},</if>
  98. <if test="endTime != null">#{endTime},</if>
  99. <if test="groupIds != null">#{groupIds},</if>
  100. <if test="state != null">#{state},</if>
  101. <if test="modelId != null">#{modelId},</if>
  102. <if test="generation != null">#{generation},</if>
  103. <if test="preferenceCount != null">#{preferenceCount},</if>
  104. <if test="rankInvisible != null">#{rankInvisible},</if>
  105. <if test="scoreInvisible != null">#{scoreInvisible},</if>
  106. <if test="enableEsign != null">#{enableEsign},</if>
  107. <if test="enablePaperSign != null">#{enablePaperSign},</if>
  108. <if test="enablePushForceAdjust != null">#{enablePushForceAdjust},</if>
  109. <if test="dispatchStatus != null">#{dispatchStatus},</if>
  110. <if test="activeDate != null">#{activeDate},</if>
  111. <if test="teacherDone != null">#{teacherDone},</if>
  112. <if test="studentDone != null">#{studentDone},</if>
  113. </trim>
  114. </insert>
  115. <update id="updateMxjbSelectedRound" parameterType="MxjbSelectedRound">
  116. update mxjb_selected_round
  117. <trim prefix="SET" suffixOverrides=",">
  118. <if test="schoolId != null">school_id = #{schoolId},</if>
  119. <if test="year != null">year = #{year},</if>
  120. <if test="round != null">round = #{round},</if>
  121. <if test="name != null">name = #{name},</if>
  122. <if test="beginTime != null">begin_time = #{beginTime},</if>
  123. <if test="endTime != null">end_time = #{endTime},</if>
  124. <if test="groupIds != null">group_ids = #{groupIds},</if>
  125. <if test="state != null">state = #{state},</if>
  126. <if test="modelId != null">model_id = #{modelId},</if>
  127. <if test="generation != null">generation = #{generation},</if>
  128. <if test="preferenceCount != null">preference_count = #{preferenceCount},</if>
  129. <if test="rankInvisible != null">rank_invisible = #{rankInvisible},</if>
  130. <if test="scoreInvisible != null">score_invisible = #{scoreInvisible},</if>
  131. <if test="enableEsign != null">enable_esign = #{enableEsign},</if>
  132. <if test="enablePaperSign != null">enable_paper_sign = #{enablePaperSign},</if>
  133. <if test="enablePushForceAdjust != null">enable_push_force_adjust = #{enablePushForceAdjust},</if>
  134. <if test="dispatchStatus != null">dispatch_status = #{dispatchStatus},</if>
  135. <if test="activeDate != null">active_date = #{activeDate},</if>
  136. <if test="teacherDone != null">teacher_done = #{teacherDone},</if>
  137. <if test="studentDone != null">student_done = #{studentDone},</if>
  138. </trim>
  139. where round_id = #{roundId}
  140. </update>
  141. <delete id="deleteMxjbSelectedRoundById" parameterType="Integer">
  142. delete from mxjb_selected_round where round_id = #{roundId}
  143. </delete>
  144. <delete id="deleteMxjbSelectedRoundByIds" parameterType="String">
  145. delete from mxjb_selected_round where round_id in
  146. <foreach item="roundId" collection="array" open="(" separator="," close=")">
  147. #{roundId}
  148. </foreach>
  149. </delete>
  150. </mapper>