JobTaskRecordMapper.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  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.supervision.jobTask.mapper.JobTaskRecordMapper">
  6. <resultMap type="JobTaskRecord" id="JobTaskRecordResult">
  7. <result property="id" column="id" />
  8. <result property="workName" column="work_name" />
  9. <result property="workNum" column="work_num" />
  10. <result property="workType" column="work_type" />
  11. <result property="publishUnit" column="publish_unit" />
  12. <result property="publishPeople" column="publish_people" />
  13. <result property="workAnnexName" column="work_annex_name" />
  14. <result property="workAnnex" column="work_annex" />
  15. <result property="workDetail" column="work_detail" />
  16. <result property="workRemark" column="work_remark" />
  17. <result property="workStartTime" column="work_start_time" />
  18. <result property="workEndTime" column="work_end_time" />
  19. <result property="workPriority" column="work_priority" />
  20. <result property="executorUnit" column="executor_unit" typeHandler="com.supervision.common.handler.ListToStringHandler" />
  21. <result property="executorPeople" column="executor_people" typeHandler="com.supervision.common.handler.ListToStringHandler"/>
  22. <result property="createBy" column="create_by" />
  23. <result property="createTime" column="create_time" />
  24. </resultMap>
  25. <sql id="selectJobTaskRecordVo">
  26. select id, work_name, work_num, work_type, publish_unit, publish_people,work_annex_name, work_annex, work_detail, work_remark, work_start_time, work_end_time, work_priority,executor_unit, executor_people,create_by, create_time from job_task_record
  27. </sql>
  28. <select id="selectJobTaskRecordList" parameterType="JobTaskRecord" resultMap="JobTaskRecordResult">
  29. <include refid="selectJobTaskRecordVo"/>
  30. <where>
  31. <if test="workName != null and workName != ''"> and work_name like concat('%', #{workName}, '%')</if>
  32. <if test="workNum != null and workNum != ''"> and work_num = #{workNum}</if>
  33. <if test="workType != null and workType != ''"> and work_type = #{workType}</if>
  34. <if test="publishPeople != null and publishPeople != ''"> and publish_people = #{publishPeople}</if>
  35. <if test="workStartTime != null "> and work_start_time = #{workStartTime}</if>
  36. <if test="workPriority != null and workPriority != ''"> and work_priority = #{workPriority}</if>
  37. </where>
  38. order by work_priority ASC,create_time DESC
  39. </select>
  40. <select id="syselectJobTaskRecordList" resultType="com.supervision.jobTask.domain.vo.JobTaskRecordVo">
  41. SELECT
  42. j.id AS id,
  43. j.work_name AS workName,
  44. j.work_num AS workNum,
  45. j.work_type AS workType,
  46. j.publish_people AS publishPeople,
  47. j.work_annex_name AS workAnnexName,
  48. j.work_annex AS workAnnex,
  49. j.work_detail AS workDetail,
  50. j.work_remark AS workRemark,
  51. j.work_start_time AS workStartTime,
  52. j.work_end_time AS workEndTime,
  53. j.work_priority AS workPriority,
  54. e.executor_people AS executorPeople,
  55. e.work_rate AS workRate,
  56. e.work_finish_time AS workFinishTime,
  57. e.work_feedback_file_name AS workFeedbackFileName,
  58. e.work_feedback_file_url AS workFeedbackFileUrl,
  59. e.work_feedback_remark AS workFeedbackRemark
  60. FROM
  61. job_task_record j,job_task_record_executor e
  62. WHERE e.work_id = j.id
  63. AND e.executor_people = #{nickName}
  64. AND e.work_rate != 100
  65. ORDER BY
  66. j.work_priority
  67. </select>
  68. <select id="selectJobTaskRecordById" parameterType="Integer" resultMap="JobTaskRecordResult">
  69. <include refid="selectJobTaskRecordVo"/>
  70. where id = #{id}
  71. </select>
  72. <select id="selectJobTaskList" resultType="com.supervision.jobTask.domain.vo.JobTaskRecordVo">
  73. SELECT
  74. j.id AS id,
  75. j.work_name AS workName,
  76. j.work_num AS workNum,
  77. j.work_type AS workType,
  78. j.publish_people AS publishPeople,
  79. j.work_annex_name AS workAnnexName,
  80. j.work_annex AS workAnnex,
  81. j.work_detail AS workDetail,
  82. j.work_remark AS workRemark,
  83. j.work_start_time AS workStartTime,
  84. j.work_end_time AS workEndTime,
  85. j.work_priority AS workPriority,
  86. e.executor_people AS executorPeople,
  87. e.work_rate AS workRate,
  88. e.work_finish_time AS workFinishTime,
  89. e.work_feedback_file_name AS workFeedbackFileName,
  90. e.work_feedback_file_url AS workFeedbackFileUrl,
  91. e.work_feedback_remark AS workFeedbackRemark
  92. FROM
  93. job_task_record j,job_task_record_executor e
  94. WHERE e.work_id = j.id and e.executor_people = #{nickName}
  95. <if test="startTime != null and endTime != null">and j.work_start_time BETWEEN #{startTime} AND #{endTime}</if>
  96. ORDER BY
  97. j.work_priority,j.work_start_time
  98. </select>
  99. <select id="selectJobTask" resultType="com.supervision.jobTask.domain.vo.JobTaskRecordVo">
  100. SELECT
  101. j.id AS id,
  102. j.work_name AS workName,
  103. j.work_num AS workNum,
  104. j.work_type AS workType,
  105. j.publish_people AS publishPeople,
  106. j.work_annex_name AS workAnnexName,
  107. j.work_annex AS workAnnex,
  108. j.work_detail AS workDetail,
  109. j.work_remark AS workRemark,
  110. j.work_start_time AS workStartTime,
  111. j.work_end_time AS workEndTime,
  112. j.work_priority AS workPriority,
  113. e.executor_people AS executorPeople,
  114. e.work_rate AS workRate,
  115. e.work_finish_time AS workFinishTime,
  116. e.work_feedback_file_name AS workFeedbackFileName,
  117. e.work_feedback_file_url AS workFeedbackFileUrl,
  118. e.work_feedback_remark AS workFeedbackRemark
  119. FROM
  120. job_task_record j,job_task_record_executor e
  121. WHERE e.work_id = j.id
  122. AND e.executor_people = #{nickName}
  123. AND j.id = #{workId}
  124. ORDER BY
  125. j.work_priority
  126. </select>
  127. <insert id="insertJobTaskRecord" parameterType="JobTaskRecord" useGeneratedKeys="true" keyProperty="id">
  128. insert into job_task_record
  129. <trim prefix="(" suffix=")" suffixOverrides=",">
  130. <if test="workName != null">work_name,</if>
  131. <if test="workNum != null">work_num,</if>
  132. <if test="workType != null">work_type,</if>
  133. <if test="publishUnit != null">publish_unit,</if>
  134. <if test="publishPeople != null">publish_people,</if>
  135. <if test="workAnnexName != null">work_annex_name,</if>
  136. <if test="workAnnex != null">work_annex,</if>
  137. <if test="workDetail != null">work_detail,</if>
  138. <if test="workRemark != null">work_remark,</if>
  139. <if test="workStartTime != null">work_start_time,</if>
  140. <if test="workEndTime != null">work_end_time,</if>
  141. <if test="workPriority != null">work_priority,</if>
  142. <if test="executorUnit != null">executor_unit,</if>
  143. <if test="executorPeople != null">executor_people,</if>
  144. <if test="createBy != null">create_by,</if>
  145. <if test="createTime != null">create_time,</if>
  146. </trim>
  147. <trim prefix="values (" suffix=")" suffixOverrides=",">
  148. <if test="workName != null">#{workName},</if>
  149. <if test="workNum != null">#{workNum},</if>
  150. <if test="workType != null">#{workType},</if>
  151. <if test="publishUnit != null">#{publishUnit},</if>
  152. <if test="publishPeople != null">#{publishPeople},</if>
  153. <if test="workAnnexName != null">#{workAnnexName},</if>
  154. <if test="workAnnex != null">#{workAnnex},</if>
  155. <if test="workDetail != null">#{workDetail},</if>
  156. <if test="workRemark != null">#{workRemark},</if>
  157. <if test="workStartTime != null">#{workStartTime},</if>
  158. <if test="workEndTime != null">#{workEndTime},</if>
  159. <if test="workPriority != null">#{workPriority},</if>
  160. <if test="executorUnit != null">#{executorUnit,typeHandler=com.supervision.common.handler.ListToStringHandler},</if>
  161. <if test="executorPeople != null">#{executorPeople,typeHandler=com.supervision.common.handler.ListToStringHandler},</if>
  162. <if test="createBy != null">#{createBy},</if>
  163. <if test="createTime != null">#{createTime},</if>
  164. </trim>
  165. </insert>
  166. <update id="updateJobTaskRecord" parameterType="JobTaskRecord">
  167. update job_task_record
  168. <trim prefix="SET" suffixOverrides=",">
  169. <if test="workName != null">work_name = #{workName},</if>
  170. <if test="workNum != null">work_num = #{workNum},</if>
  171. <if test="workType != null">work_type = #{workType},</if>
  172. <if test="publishUnit != null">publish_unit = #{publishUnit},</if>
  173. <if test="publishPeople != null">publish_people = #{publishPeople},</if>
  174. <if test="workAnnexName != null">work_annex_name = #{workAnnexName},</if>
  175. <if test="workAnnex != null">work_annex = #{workAnnex},</if>
  176. <if test="workDetail != null">work_detail = #{workDetail},</if>
  177. <if test="workRemark != null">work_remark = #{workRemark},</if>
  178. <if test="workStartTime != null">work_start_time = #{workStartTime},</if>
  179. <if test="workEndTime != null">work_end_time = #{workEndTime},</if>
  180. <if test="workPriority != null">work_priority = #{workPriority},</if>
  181. <if test="executorUnit != null">executor_unit = #{executorUnit,typeHandler=com.supervision.common.handler.ListToStringHandler},</if>
  182. <if test="executorPeople != null">executor_people = #{executorPeople,typeHandler=com.supervision.common.handler.ListToStringHandler},</if>
  183. <if test="createBy != null">create_by = #{createBy},</if>
  184. <if test="createTime != null">create_time = #{createTime},</if>
  185. </trim>
  186. where id = #{id}
  187. </update>
  188. <delete id="deleteJobTaskRecordById" parameterType="Integer">
  189. delete from job_task_record where id = #{id}
  190. </delete>
  191. <delete id="deleteJobTaskRecordByIds" parameterType="String">
  192. delete from job_task_record where id in
  193. <foreach item="id" collection="array" open="(" separator="," close=")">
  194. #{id}
  195. </foreach>
  196. </delete>
  197. </mapper>