RealExamCollectionMapper.xml 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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.sim.mapper.RealExamCollectionMapper">
  6. <resultMap type="RealExamCollection" id="RealExamCollectionResult">
  7. <result property="examCollectionId" column="exam_collection_id"/>
  8. <result property="simType" column="sim_type"/>
  9. <result property="questionSettingMethod" column="question_setting_method"/>
  10. <result property="examCollectionType" column="exam_collection_type"/>
  11. <result property="examCollectionState" column="exam_collection_state"/>
  12. <result property="examCollectionName" column="exam_collection_name"/>
  13. <result property="taskId" column="task_id"/>
  14. <result property="limitDuration" column="limit_duration"/>
  15. <result property="startTime" column="start_time"/>
  16. <result property="endTime" column="end_time"/>
  17. <result property="createUserId" column="create_user_id"/>
  18. <result property="createBy" column="create_by"/>
  19. <result property="createTime" column="create_time"/>
  20. <result property="updateBy" column="update_by"/>
  21. <result property="updateTime" column="update_time"/>
  22. <result property="remark" column="remark"/>
  23. </resultMap>
  24. <sql id="selectRealExamCollectionVo">
  25. select exam_collection_id,
  26. sim_type,
  27. question_setting_method,
  28. exam_collection_type,
  29. exam_collection_state,
  30. exam_collection_name,
  31. task_id,
  32. limit_duration,
  33. start_time,
  34. end_time,
  35. create_user_id,
  36. create_by,
  37. create_time,
  38. update_by,
  39. update_time,
  40. remark
  41. from sim_real_exam_collection
  42. </sql>
  43. <select id="selectRealExamCollectionList" parameterType="RealExamCollection" resultMap="RealExamCollectionResult">
  44. <include refid="selectRealExamCollectionVo"/>
  45. <where>
  46. <if test="simType != null and simType != ''">and sim_type = #{simType}</if>
  47. <if test="questionSettingMethod != null and questionSettingMethod != ''">and question_setting_method =
  48. #{questionSettingMethod}
  49. </if>
  50. <if test="examCollectionType != null and examCollectionType != ''">and exam_collection_type =
  51. #{examCollectionType}
  52. </if>
  53. <if test="examCollectionState != null and examCollectionState != ''">and exam_collection_state =
  54. #{examCollectionState}
  55. </if>
  56. <if test="examCollectionName != null and examCollectionName != ''">and exam_collection_name like
  57. concat('%', #{examCollectionName}, '%')
  58. </if>
  59. <if test="taskId != null ">and task_id = #{taskId}</if>
  60. <if test="limitDuration != null ">and limit_duration = #{limitDuration}</if>
  61. <if test="startTime != null ">and start_time = #{startTime}</if>
  62. <if test="endTime != null ">and end_time = #{endTime}</if>
  63. <if test="createUserId != null ">and create_user_id = #{createUserId}</if>
  64. </where>
  65. </select>
  66. <select id="selectRealExamCollectionByExamCollectionId" parameterType="Long" resultMap="RealExamCollectionResult">
  67. <include refid="selectRealExamCollectionVo"/>
  68. where exam_collection_id = #{examCollectionId}
  69. </select>
  70. <insert id="insertRealExamCollection" parameterType="RealExamCollection" useGeneratedKeys="true"
  71. keyProperty="examCollectionId">
  72. <selectKey keyProperty="examCollectionId" order="AFTER" resultType="java.lang.Long">
  73. select LAST_INSERT_ID()
  74. </selectKey>
  75. insert into sim_real_exam_collection
  76. <trim prefix="(" suffix=")" suffixOverrides=",">
  77. <if test="simType != null and simType != ''">sim_type,</if>
  78. <if test="questionSettingMethod != null and questionSettingMethod != ''">question_setting_method,</if>
  79. <if test="examCollectionType != null and examCollectionType != ''">exam_collection_type,</if>
  80. <if test="examCollectionState != null">exam_collection_state,</if>
  81. <if test="examCollectionName != null and examCollectionName != ''">exam_collection_name,</if>
  82. <if test="taskId != null">task_id,</if>
  83. <if test="limitDuration != null">limit_duration,</if>
  84. <if test="startTime != null">start_time,</if>
  85. <if test="endTime != null">end_time,</if>
  86. <if test="createUserId != null">create_user_id,</if>
  87. <if test="createBy != null">create_by,</if>
  88. <if test="createTime != null">create_time,</if>
  89. <if test="updateBy != null">update_by,</if>
  90. <if test="updateTime != null">update_time,</if>
  91. <if test="remark != null">remark,</if>
  92. </trim>
  93. <trim prefix="values (" suffix=")" suffixOverrides=",">
  94. <if test="simType != null and simType != ''">#{simType},</if>
  95. <if test="questionSettingMethod != null and questionSettingMethod != ''">#{questionSettingMethod},</if>
  96. <if test="examCollectionType != null and examCollectionType != ''">#{examCollectionType},</if>
  97. <if test="examCollectionState != null">#{examCollectionState},</if>
  98. <if test="examCollectionName != null and examCollectionName != ''">#{examCollectionName},</if>
  99. <if test="taskId != null">#{taskId},</if>
  100. <if test="limitDuration != null">#{limitDuration},</if>
  101. <if test="startTime != null">#{startTime},</if>
  102. <if test="endTime != null">#{endTime},</if>
  103. <if test="createUserId != null">#{createUserId},</if>
  104. <if test="createBy != null">#{createBy},</if>
  105. <if test="createTime != null">#{createTime},</if>
  106. <if test="updateBy != null">#{updateBy},</if>
  107. <if test="updateTime != null">#{updateTime},</if>
  108. <if test="remark != null">#{remark},</if>
  109. </trim>
  110. </insert>
  111. <update id="updateRealExamCollection" parameterType="RealExamCollection">
  112. update sim_real_exam_collection
  113. <trim prefix="SET" suffixOverrides=",">
  114. <if test="simType != null and simType != ''">sim_type = #{simType},</if>
  115. <if test="questionSettingMethod != null and questionSettingMethod != ''">question_setting_method =
  116. #{questionSettingMethod},
  117. </if>
  118. <if test="examCollectionType != null and examCollectionType != ''">exam_collection_type =
  119. #{examCollectionType},
  120. </if>
  121. <if test="examCollectionState != null">exam_collection_state = #{examCollectionState},</if>
  122. <if test="examCollectionName != null and examCollectionName != ''">exam_collection_name =
  123. #{examCollectionName},
  124. </if>
  125. <if test="taskId != null">task_id = #{taskId},</if>
  126. <if test="limitDuration != null">limit_duration = #{limitDuration},</if>
  127. <if test="startTime != null">start_time = #{startTime},</if>
  128. <if test="endTime != null">end_time = #{endTime},</if>
  129. <if test="createUserId != null">create_user_id = #{createUserId},</if>
  130. <if test="createBy != null">create_by = #{createBy},</if>
  131. <if test="createTime != null">create_time = #{createTime},</if>
  132. <if test="updateBy != null">update_by = #{updateBy},</if>
  133. <if test="updateTime != null">update_time = #{updateTime},</if>
  134. <if test="remark != null">remark = #{remark},</if>
  135. </trim>
  136. where exam_collection_id = #{examCollectionId}
  137. </update>
  138. <delete id="deleteRealExamCollectionByExamCollectionId" parameterType="Long">
  139. delete
  140. from sim_real_exam_collection
  141. where exam_collection_id = #{examCollectionId}
  142. </delete>
  143. <delete id="deleteRealExamCollectionByExamCollectionIds" parameterType="String">
  144. delete from sim_real_exam_collection where exam_collection_id in
  145. <foreach item="examCollectionId" collection="array" open="(" separator="," close=")">
  146. #{examCollectionId}
  147. </foreach>
  148. </delete>
  149. </mapper>