TblTaskMapper.xml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  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.system.mapper.TblTaskMapper">
  6. <resultMap type="TblTask" id="TblTaskResult">
  7. <result property="taskId" column="task_id" />
  8. <result property="taskName" column="task_name" />
  9. <result property="taskContent" column="task_content" />
  10. <result property="taskAddr" column="task_addr" />
  11. <result property="taskArea" column="task_area" />
  12. <result property="taskLocation" column="task_location" />
  13. <result property="taskCode" column="task_code" />
  14. <result property="taskType" column="task_type" />
  15. <result property="taskEventType" column="task_event_type" />
  16. <result property="taskEventCategory" column="task_event_category" />
  17. <result property="taskFromRemark" column="task_from_remark" />
  18. <result property="taskAddrRoad" column="task_addr_road" />
  19. <result property="taskOtherId" column="task_other_id" />
  20. <result property="taskTime" column="task_time" />
  21. <result property="createTime" column="create_time" />
  22. <result property="createBy" column="create_by" />
  23. <result property="updateBy" column="update_by" />
  24. <result property="updateTime" column="update_time" />
  25. <result property="taskReqCompleteTime" column="task_req_complete_time" />
  26. <result property="status" column="status" />
  27. <result property="taskCreater" column="task_creater" />
  28. <result property="taskReporter" column="task_reporter" />
  29. <result property="taskPics" column="task_pics" />
  30. <result property="taskVideos" column="task_videos" />
  31. <result property="taskComplainConnect" column="task_complain_connect" />
  32. <result property="remark" column="remark" />
  33. <result property="taskDeptRange" column="task_dept_range" />
  34. <result property="taskFacilitieCode" column="task_facilitie_code" />
  35. </resultMap>
  36. <sql id="selectTblTaskVo">
  37. select task_id, task_name, task_content, task_addr, task_location, task_code, task_type, task_event_type, task_event_category, task_from_remark, task_addr_road, task_other_id, task_time, create_time, task_req_complete_time, update_time,create_by,update_by, status, task_creater, task_reporter, task_pics, task_videos, task_complain_connect, remark,task_dept_range,task_facilitie_code,task_area from tbl_task
  38. </sql>
  39. <select id="selectTblTaskList" parameterType="TblTask" resultMap="TblTaskResult">
  40. <include refid="selectTblTaskVo"/>
  41. <where>
  42. <if test="taskName != null and taskName != ''"> and task_name like concat('%', #{taskName}, '%')</if>
  43. <if test="taskContent != null and taskContent != ''"> and task_content = #{taskContent}</if>
  44. <if test="taskAddr != null and taskAddr != ''"> and task_addr = #{taskAddr}</if>
  45. <if test="taskLocation != null and taskLocation != ''"> and task_location = #{taskLocation}</if>
  46. <if test="taskCode != null and taskCode != ''"> and task_code like concat('%', #{taskCode}, '%')</if>
  47. <if test="taskType != null "> and task_type = #{taskType}</if>
  48. <if test="taskEventType != null "> and task_event_type = #{taskEventType}</if>
  49. <if test="taskEventCategory != null "> and task_event_category = #{taskEventCategory}</if>
  50. <if test="taskFromRemark != null and taskFromRemark != ''"> and task_from_remark = #{taskFromRemark}</if>
  51. <if test="taskAddrRoad != null and taskAddrRoad != ''"> and task_addr_road = #{taskAddrRoad}</if>
  52. <if test="taskOtherId != null and taskOtherId != ''"> and task_other_id = #{taskOtherId}</if>
  53. <if test="taskTime != null "> and task_time = #{taskTime}</if>
  54. <if test="taskReqCompleteTime != null "> and task_req_complete_time = #{taskReqCompleteTime}</if>
  55. <if test="status != null "> and status = #{status}</if>
  56. <if test="taskCreater != null and taskCreater != ''"> and task_creater = #{taskCreater}</if>
  57. <if test="taskReporter != null and taskReporter != ''"> and task_reporter = #{taskReporter}</if>
  58. <if test="taskPics != null and taskPics != ''"> and task_pics = #{taskPics}</if>
  59. <if test="taskVideos != null and taskVideos != ''"> and task_videos = #{taskVideos}</if>
  60. <if test="taskComplainConnect != null and taskComplainConnect != ''"> and task_complain_connect = #{taskComplainConnect}</if>
  61. <if test="taskDeptRange != null and taskDeptRange != ''"> and task_dept_range = #{taskDeptRange}</if>
  62. <if test="taskFacilitieCode != null and taskFacilitieCode != ''"> and task_facilitie_code = #{taskFacilitieCode}</if>
  63. <if test="taskArea != null and taskArea != ''"> and task_area = #{taskArea}</if>
  64. <if test="params.searchkey != null and params.searchkey != ''"> and ( task_content like concat('%', #{params.searchkey}, '%') or task_addr_road like concat('%', #{params.searchkey}, '%'))</if>
  65. <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
  66. and date_format(create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
  67. </if>
  68. <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
  69. and date_format(create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
  70. </if>
  71. <if test="params.userId != null and params.userId != ''"><!-- 派发用户自己的或自己填报的或自己处理的 -->
  72. <![CDATA[
  73. and ( task_reporter = #{params.userId}
  74. OR (task_id in (select c.task_id from (SELECT * FROM tbl_task_log where id in (SELECT MAX(id) AS id FROM tbl_task_log where task_status=-1 GROUP BY task_id )) c where c.log_des->'$.zyfzr'= CAST(#{params.userId} AS SIGNED)))
  75. OR (task_id IN (SELECT c.task_id FROM (SELECT * FROM tbl_task_log where id in (SELECT MAX(id) AS id FROM tbl_task_log where task_status=2 GROUP BY task_id )) c WHERE json_contains(c.log_des-> '$.fzr',#{params.userId}))))
  76. ]]>
  77. </if>
  78. </where>
  79. order by create_time desc
  80. </select>
  81. <select id="selectTblTaskByTaskId" parameterType="Long" resultMap="TblTaskResult">
  82. <include refid="selectTblTaskVo"/>
  83. where task_id = #{taskId}
  84. </select>
  85. <insert id="insertTblTask" parameterType="TblTask" useGeneratedKeys="true" keyProperty="taskId">
  86. insert into tbl_task
  87. <trim prefix="(" suffix=")" suffixOverrides=",">
  88. <if test="taskName != null">task_name,</if>
  89. <if test="taskContent != null">task_content,</if>
  90. <if test="taskAddr != null">task_addr,</if>
  91. <if test="taskLocation != null">task_location,</if>
  92. <if test="taskCode != null">task_code,</if>
  93. <if test="taskType != null">task_type,</if>
  94. <if test="taskEventType != null">task_event_type,</if>
  95. <if test="taskEventCategory != null">task_event_category,</if>
  96. <if test="taskFromRemark != null">task_from_remark,</if>
  97. <if test="taskAddrRoad != null">task_addr_road,</if>
  98. <if test="taskOtherId != null">task_other_id,</if>
  99. <if test="taskTime != null">task_time,</if>
  100. <if test="createTime != null">create_time,</if>
  101. <if test="taskReqCompleteTime != null">task_req_complete_time,</if>
  102. <if test="updateTime != null">update_time,</if>
  103. <if test="createBy != null">create_by,</if>
  104. <if test="updateBy != null">update_by,</if>
  105. <if test="status != null">status,</if>
  106. <if test="taskCreater != null">task_creater,</if>
  107. <if test="taskReporter != null">task_reporter,</if>
  108. <if test="taskPics != null">task_pics,</if>
  109. <if test="taskVideos != null">task_videos,</if>
  110. <if test="taskComplainConnect != null">task_complain_connect,</if>
  111. <if test="remark != null">remark,</if>
  112. <if test="taskDeptRange != null">task_dept_range,</if>
  113. <if test="taskFacilitieCode != null">task_facilitie_code,</if>
  114. <if test="taskArea != null">task_area,</if>
  115. </trim>
  116. <trim prefix="values (" suffix=")" suffixOverrides=",">
  117. <if test="taskName != null">#{taskName},</if>
  118. <if test="taskContent != null">#{taskContent},</if>
  119. <if test="taskAddr != null">#{taskAddr},</if>
  120. <if test="taskLocation != null">#{taskLocation},</if>
  121. <if test="taskCode != null">#{taskCode},</if>
  122. <if test="taskType != null">#{taskType},</if>
  123. <if test="taskEventType != null">#{taskEventType},</if>
  124. <if test="taskEventCategory != null">#{taskEventCategory},</if>
  125. <if test="taskFromRemark != null">#{taskFromRemark},</if>
  126. <if test="taskAddrRoad != null">#{taskAddrRoad},</if>
  127. <if test="taskOtherId != null">#{taskOtherId},</if>
  128. <if test="taskTime != null">#{taskTime},</if>
  129. <if test="createTime != null">#{createTime},</if>
  130. <if test="taskReqCompleteTime != null">#{taskReqCompleteTime},</if>
  131. <if test="updateTime != null">#{updateTime},</if>
  132. <if test="createBy != null">#{createBy},</if>
  133. <if test="updateBy != null">#{updateBy},</if>
  134. <if test="status != null">#{status},</if>
  135. <if test="taskCreater != null">#{taskCreater},</if>
  136. <if test="taskReporter != null">#{taskReporter},</if>
  137. <if test="taskPics != null">#{taskPics},</if>
  138. <if test="taskVideos != null">#{taskVideos},</if>
  139. <if test="taskComplainConnect != null">#{taskComplainConnect},</if>
  140. <if test="remark != null">#{remark},</if>
  141. <if test="taskDeptRange != null">#{taskDeptRange},</if>
  142. <if test="taskFacilitieCode != null">#{taskFacilitieCode},</if>
  143. <if test="taskArea != null">#{taskArea},</if>
  144. </trim>
  145. </insert>
  146. <update id="updateTblTask" parameterType="TblTask">
  147. update tbl_task
  148. <trim prefix="SET" suffixOverrides=",">
  149. <if test="taskName != null">task_name = #{taskName},</if>
  150. <if test="taskContent != null">task_content = #{taskContent},</if>
  151. <if test="taskAddr != null">task_addr = #{taskAddr},</if>
  152. <if test="taskLocation != null">task_location = #{taskLocation},</if>
  153. <if test="taskCode != null">task_code = #{taskCode},</if>
  154. <if test="taskType != null">task_type = #{taskType},</if>
  155. <if test="taskEventType != null">task_event_type = #{taskEventType},</if>
  156. <if test="taskEventCategory != null">task_event_category = #{taskEventCategory},</if>
  157. <if test="taskFromRemark != null">task_from_remark = #{taskFromRemark},</if>
  158. <if test="taskAddrRoad != null">task_addr_road = #{taskAddrRoad},</if>
  159. <if test="taskOtherId != null">task_other_id = #{taskOtherId},</if>
  160. <if test="taskTime != null">task_time = #{taskTime},</if>
  161. <if test="createTime != null">create_time = #{createTime},</if>
  162. <if test="taskReqCompleteTime != null">task_req_complete_time = #{taskReqCompleteTime},</if>
  163. <if test="updateTime != null">update_time = #{updateTime},</if>
  164. <if test="updateBy != null">update_by = #{updateBy},</if>
  165. <if test="createBy != null">create_by = #{createBy},</if>
  166. <if test="status != null">status = #{status},</if>
  167. <if test="taskCreater != null">task_creater = #{taskCreater},</if>
  168. <if test="taskReporter != null">task_reporter = #{taskReporter},</if>
  169. <if test="taskPics != null">task_pics = #{taskPics},</if>
  170. <if test="taskVideos != null">task_videos = #{taskVideos},</if>
  171. <if test="taskComplainConnect != null">task_complain_connect = #{taskComplainConnect},</if>
  172. <if test="remark != null">remark = #{remark},</if>
  173. <if test="taskDeptRange != null">task_dept_range = #{taskDeptRange},</if>
  174. <if test="taskFacilitieCode != null">task_facilitie_code = #{taskFacilitieCode},</if>
  175. <if test="taskArea != null">task_area = #{taskArea},</if>
  176. </trim>
  177. where task_id = #{taskId}
  178. </update>
  179. <delete id="deleteTblTaskByTaskId" parameterType="Long">
  180. delete from tbl_task where task_id = #{taskId}
  181. </delete>
  182. <delete id="deleteTblTaskByTaskIds" parameterType="String">
  183. delete from tbl_task where task_id in
  184. <foreach item="taskId" collection="array" open="(" separator="," close=")">
  185. #{taskId}
  186. </foreach>
  187. </delete>
  188. </mapper>