GoafTaskMapper.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  3. "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  4. <mapper namespace="com.zhyc.xps.goaf.mapper.GoafTaskMapper">
  5. <resultMap id="GoafTaskMapper" type="com.zhyc.xps.goaf.entity.GoafTask">
  6. <id column="task_id" property="taskId" jdbcType="BIGINT"/>
  7. <result column="oc_id" property="ocId" jdbcType="BIGINT"/>
  8. <result column="goaf_id" property="goafId" jdbcType="BIGINT"/>
  9. <result column="job_id" property="jobId" jdbcType="BIGINT"/>
  10. <result column="check_def_id" property="checkDefId" jdbcType="BIGINT"/>
  11. <result column="checklist_id" property="checklistId" jdbcType="BIGINT"/>
  12. <result column="task_title" property="taskTitle" jdbcType="VARCHAR"/>
  13. <result column="task_desc" property="taskDesc" jdbcType="VARCHAR"/>
  14. <result column="expected_start_date" property="expectedStartDate" jdbcType="DATE"/>
  15. <result column="expected_end_date" property="expectedEndDate" jdbcType="DATE"/>
  16. <result column="handle_account_id" property="handleAccountId" jdbcType="BIGINT"/>
  17. <result column="handle_account_name" property="handleAccountName" jdbcType="VARCHAR"/>
  18. <result column="handle_position_id" property="handlePositionId" jdbcType="BIGINT"/>
  19. <result column="handle_position_name" property="handlePositionName" jdbcType="VARCHAR"/>
  20. <result column="handle_group_id" property="handleGroupId" jdbcType="BIGINT"/>
  21. <result column="handle_group_name" property="handleGroupName" jdbcType="VARCHAR"/>
  22. <result column="status" property="status" jdbcType="BIGINT"/>
  23. </resultMap>
  24. <resultMap id="GoafTaskDtoMapper" type="com.zhyc.xps.goaf.dto.GoafTaskDto">
  25. <id column="task_id" property="taskId" jdbcType="BIGINT"/>
  26. <result column="oc_id" property="ocId" jdbcType="BIGINT"/>
  27. <result column="goaf_id" property="goafId" jdbcType="BIGINT"/>
  28. <result column="job_id" property="jobId" jdbcType="BIGINT"/>
  29. <result column="check_def_id" property="checkDefId" jdbcType="BIGINT"/>
  30. <result column="checklist_id" property="checklistId" jdbcType="BIGINT"/>
  31. <result column="task_title" property="taskTitle" jdbcType="VARCHAR"/>
  32. <result column="task_desc" property="taskDesc" jdbcType="VARCHAR"/>
  33. <result column="expected_start_date" property="expectedStartDate" jdbcType="DATE"/>
  34. <result column="expected_end_date" property="expectedEndDate" jdbcType="DATE"/>
  35. <result column="handle_account_id" property="handleAccountId" jdbcType="BIGINT"/>
  36. <result column="handle_account_name" property="handleAccountName" jdbcType="VARCHAR"/>
  37. <result column="handle_position_id" property="handlePositionId" jdbcType="BIGINT"/>
  38. <result column="handle_position_name" property="handlePositionName" jdbcType="VARCHAR"/>
  39. <result column="handle_group_id" property="handleGroupId" jdbcType="BIGINT"/>
  40. <result column="handle_group_name" property="handleGroupName" jdbcType="VARCHAR"/>
  41. <result column="status" property="status" jdbcType="BIGINT"/>
  42. <result column="goaf_orebelt" property="goafOrebelt" jdbcType="BIGINT"/>
  43. <result column="goaf_orebody" property="goafOrebody" jdbcType="BIGINT"/>
  44. <result column="goaf_oreheight" property="goafOreheight" jdbcType="BIGINT"/>
  45. <result column="goaf_name" property="goafName" jdbcType="VARCHAR"/>
  46. </resultMap>
  47. <select id="getByList" parameterType="java.util.Map" resultMap="GoafTaskDtoMapper">
  48. SELECT A.*,
  49. B.goaf_orebelt,
  50. B.goaf_orebody,
  51. B.goaf_oreheight,
  52. B.goaf_name
  53. FROM goaf_task AS A
  54. LEFT JOIN goaf_baseinfo AS B ON A.goaf_id = B.goaf_id
  55. WHERE A.oc_id = #{ocId ,jdbcType=BIGINT}
  56. <if test="goafId !=null">
  57. AND A.goaf_id = #{goafId ,jdbcType=BIGINT}
  58. </if>
  59. <if test="jobId !=null">
  60. AND A.job_id = #{jobId ,jdbcType=BIGINT}
  61. </if>
  62. <if test="checkDefId !=null">
  63. AND A.check_def_id = #{checkDefId ,jdbcType=BIGINT}
  64. </if>
  65. <if test="taskTitle !=null and taskTitle != '' ">
  66. AND A.task_title like "%"#{taskTitle}"%"
  67. </if>
  68. <if test="handleGroupId !=null">
  69. AND A.handle_group_id = #{handleGroupId ,jdbcType=BIGINT}
  70. </if>
  71. <if test="handleAccountId !=null">
  72. AND A.handle_account_id = #{handleAccountId ,jdbcType=BIGINT}
  73. </if>
  74. <if test="status !=null">
  75. AND A.status = #{status ,jdbcType=BIGINT}
  76. </if>
  77. <if test="expectedStartDate != null and expectedEndDate != null">
  78. <![CDATA[
  79. AND A.expected_end_date >= #{expectedStartDate, jdbcType=TIMESTAMP}
  80. AND A.expected_end_date <= #{expectedEndDate, jdbcType=TIMESTAMP}
  81. ]]>
  82. </if>
  83. </select>
  84. <!--分页查询-->
  85. <select id="getByPage" parameterType="java.util.Map" resultMap="GoafTaskDtoMapper">
  86. SELECT A.*,
  87. B.goaf_orebelt,
  88. B.goaf_orebody,
  89. B.goaf_oreheight,
  90. B.goaf_name
  91. FROM goaf_task AS A
  92. LEFT JOIN goaf_baseinfo AS B ON A.goaf_id = B.goaf_id
  93. WHERE A.oc_id = #{ocId ,jdbcType=BIGINT}
  94. <if test="goafId !=null">
  95. AND A.goaf_id = #{goafId ,jdbcType=BIGINT}
  96. </if>
  97. <if test="jobId !=null">
  98. AND A.job_id = #{jobId ,jdbcType=BIGINT}
  99. </if>
  100. <if test="checkDefId !=null">
  101. AND A.check_def_id = #{checkDefId ,jdbcType=BIGINT}
  102. </if>
  103. <if test="taskTitle !=null and taskTitle != '' ">
  104. AND A.task_title like "%"#{taskTitle}"%"
  105. </if>
  106. <if test="handleGroupId !=null">
  107. AND A.handle_group_id = #{handleGroupId ,jdbcType=BIGINT}
  108. </if>
  109. <if test="handleAccountId !=null">
  110. AND A.handle_account_id = #{handleAccountId ,jdbcType=BIGINT}
  111. </if>
  112. <if test="status !=null">
  113. AND A.status = #{status ,jdbcType=BIGINT}
  114. </if>
  115. <if test="expectedStartDate != null and expectedEndDate != null">
  116. <![CDATA[
  117. AND A.expected_end_date >= #{expectedStartDate, jdbcType=TIMESTAMP}
  118. AND A.expected_end_date <= #{expectedEndDate, jdbcType=TIMESTAMP}
  119. ]]>
  120. </if>
  121. </select>
  122. <select id="getBytaskId" resultMap="GoafTaskMapper">
  123. SELECT *
  124. FROM goaf_task
  125. WHERE task_id = #{taskId, jdbcType=BIGINT}
  126. </select>
  127. <insert id="create" parameterType="com.zhyc.xps.goaf.entity.GoafTask">
  128. insert into goaf_task
  129. <trim prefix="(" suffix=")" suffixOverrides=",">
  130. <if test="taskId != null">
  131. task_id,
  132. </if>
  133. <if test="ocId != null">
  134. oc_id,
  135. </if>
  136. <if test="goafId != null">
  137. goaf_id,
  138. </if>
  139. <if test="jobId != null">
  140. job_id,
  141. </if>
  142. <if test="checkDefId != null">
  143. check_def_id,
  144. </if>
  145. <if test="checklistId != null">
  146. checklist_id,
  147. </if>
  148. <if test="taskTitle != null and taskTitle != ''">
  149. task_title,
  150. </if>
  151. <if test="taskDesc != null and taskDesc != ''">
  152. task_desc,
  153. </if>
  154. <if test="expectedStartDate != null">
  155. expected_start_date,
  156. </if>
  157. <if test="expectedEndDate != null">
  158. expected_end_date,
  159. </if>
  160. <if test="handleAccountId != null">
  161. handle_account_id,
  162. </if>
  163. <if test="handleAccountName != null and handleAccountName != ''">
  164. handle_account_name,
  165. </if>
  166. <if test="handlePositionId != null">
  167. handle_position_id,
  168. </if>
  169. <if test="handlePositionName != null and handlePositionName != ''">
  170. handle_position_name,
  171. </if>
  172. <if test="handleGroupId != null">
  173. handle_group_id,
  174. </if>
  175. <if test="handleGroupName != null and handleGroupName != ''">
  176. handle_group_name,
  177. </if>
  178. <if test="status != null">
  179. status,
  180. </if>
  181. </trim>
  182. <trim prefix="values (" suffix=")" suffixOverrides=",">
  183. <if test="taskId != null">
  184. #{taskId, jdbcType=BIGINT},
  185. </if>
  186. <if test="ocId != null">
  187. #{ocId, jdbcType=BIGINT},
  188. </if>
  189. <if test="goafId != null">
  190. #{goafId, jdbcType=BIGINT},
  191. </if>
  192. <if test="jobId != null">
  193. #{jobId, jdbcType=BIGINT},
  194. </if>
  195. <if test="checkDefId != null">
  196. #{checkDefId, jdbcType=BIGINT},
  197. </if>
  198. <if test="checklistId != null">
  199. #{checklistId, jdbcType=BIGINT},
  200. </if>
  201. <if test="taskTitle != null and taskTitle != ''">
  202. #{taskTitle, jdbcType=VARCHAR},
  203. </if>
  204. <if test="taskDesc != null and taskDesc != ''">
  205. #{taskDesc, jdbcType=VARCHAR},
  206. </if>
  207. <if test="expectedStartDate != null">
  208. #{expectedStartDate, jdbcType=DATE},
  209. </if>
  210. <if test="expectedEndDate != null">
  211. #{expectedEndDate, jdbcType=DATE},
  212. </if>
  213. <if test="handleAccountId != null">
  214. #{handleAccountId, jdbcType=BIGINT},
  215. </if>
  216. <if test="handleAccountName != null and handleAccountName != ''">
  217. #{handleAccountName, jdbcType=VARCHAR},
  218. </if>
  219. <if test="handlePositionId != null">
  220. #{handlePositionId, jdbcType=BIGINT},
  221. </if>
  222. <if test="handlePositionName != null and handlePositionName != ''">
  223. #{handlePositionName, jdbcType=VARCHAR},
  224. </if>
  225. <if test="handleGroupId != null">
  226. #{handleGroupId, jdbcType=BIGINT},
  227. </if>
  228. <if test="handleGroupName != null and handleGroupName != ''">
  229. #{handleGroupName, jdbcType=VARCHAR},
  230. </if>
  231. <if test="status != null">
  232. #{status, jdbcType=BIGINT},
  233. </if>
  234. </trim>
  235. </insert>
  236. <!--Update更新-->
  237. <update id="updatebyjobid" parameterType="com.zhyc.xps.goaf.entity.GoafTask">
  238. UPDATE goaf_task
  239. <trim suffixOverrides=",">
  240. <set>
  241. <if test="status != null">
  242. status = #{status ,jdbcType=BIGINT},
  243. </if>
  244. </set>
  245. </trim>
  246. WHERE job_id = #{jobId ,jdbcType=BIGINT}
  247. </update>
  248. <!--Update更新-->
  249. <update id="update" parameterType="com.zhyc.xps.goaf.entity.GoafTask">
  250. UPDATE goaf_task
  251. status = #{status ,jdbcType=BIGINT}
  252. WHERE oc_id = #{ocId, jdbcType=BIGINT} AND task_id = #{taskId ,jdbcType=BIGINT}
  253. </update>
  254. <delete id="delete" >
  255. DELETE FROM goaf_task
  256. WHERE task_id = #{taskId, jdbcType=BIGINT}
  257. </delete>
  258. <delete id="deletebystatus" parameterType="java.util.Map">
  259. DELETE FROM goaf_task
  260. WHERE oc_id = #{ocId, jdbcType=BIGINT} AND status = #{status, jdbcType=BIGINT}
  261. AND check_def_id = #{checkDefId, jdbcType=BIGINT}
  262. </delete>
  263. </mapper>