123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper
- PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.ruoyi.system.mapper.TblTaskMapper">
-
- <resultMap type="TblTask" id="TblTaskResult">
- <result property="taskId" column="task_id" />
- <result property="taskName" column="task_name" />
- <result property="taskContent" column="task_content" />
- <result property="taskAddr" column="task_addr" />
- <result property="taskArea" column="task_area" />
- <result property="taskLocation" column="task_location" />
- <result property="taskCode" column="task_code" />
- <result property="taskType" column="task_type" />
- <result property="taskEventType" column="task_event_type" />
- <result property="taskEventCategory" column="task_event_category" />
- <result property="taskFromRemark" column="task_from_remark" />
- <result property="taskAddrRoad" column="task_addr_road" />
- <result property="taskOtherId" column="task_other_id" />
- <result property="taskTime" column="task_time" />
- <result property="createTime" column="create_time" />
- <result property="createBy" column="create_by" />
- <result property="updateBy" column="update_by" />
- <result property="updateTime" column="update_time" />
- <result property="taskReqCompleteTime" column="task_req_complete_time" />
- <result property="status" column="status" />
- <result property="taskCreater" column="task_creater" />
- <result property="taskReporter" column="task_reporter" />
- <result property="taskPics" column="task_pics" />
- <result property="taskVideos" column="task_videos" />
- <result property="taskComplainConnect" column="task_complain_connect" />
- <result property="remark" column="remark" />
- <result property="taskDeptRange" column="task_dept_range" />
- <result property="taskFacilitieCode" column="task_facilitie_code" />
- </resultMap>
- <sql id="selectTblTaskVo">
- 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
- </sql>
- <select id="selectTblTaskList" parameterType="TblTask" resultMap="TblTaskResult">
- <include refid="selectTblTaskVo"/>
- <where>
- <if test="taskName != null and taskName != ''"> and task_name like concat('%', #{taskName}, '%')</if>
- <if test="taskContent != null and taskContent != ''"> and task_content = #{taskContent}</if>
- <if test="taskAddr != null and taskAddr != ''"> and task_addr = #{taskAddr}</if>
- <if test="taskLocation != null and taskLocation != ''"> and task_location = #{taskLocation}</if>
- <if test="taskCode != null and taskCode != ''"> and task_code like concat('%', #{taskCode}, '%')</if>
- <if test="taskType != null "> and task_type = #{taskType}</if>
- <if test="taskEventType != null "> and task_event_type = #{taskEventType}</if>
- <if test="taskEventCategory != null "> and task_event_category = #{taskEventCategory}</if>
- <if test="taskFromRemark != null and taskFromRemark != ''"> and task_from_remark = #{taskFromRemark}</if>
- <if test="taskAddrRoad != null and taskAddrRoad != ''"> and task_addr_road = #{taskAddrRoad}</if>
- <if test="taskOtherId != null and taskOtherId != ''"> and task_other_id = #{taskOtherId}</if>
- <if test="taskTime != null "> and task_time = #{taskTime}</if>
- <if test="taskReqCompleteTime != null "> and task_req_complete_time = #{taskReqCompleteTime}</if>
- <if test="status != null "> and status = #{status}</if>
- <if test="taskCreater != null and taskCreater != ''"> and task_creater = #{taskCreater}</if>
- <if test="taskReporter != null and taskReporter != ''"> and task_reporter = #{taskReporter}</if>
- <if test="taskPics != null and taskPics != ''"> and task_pics = #{taskPics}</if>
- <if test="taskVideos != null and taskVideos != ''"> and task_videos = #{taskVideos}</if>
- <if test="taskComplainConnect != null and taskComplainConnect != ''"> and task_complain_connect = #{taskComplainConnect}</if>
- <if test="taskDeptRange != null and taskDeptRange != ''"> and task_dept_range = #{taskDeptRange}</if>
- <if test="taskFacilitieCode != null and taskFacilitieCode != ''"> and task_facilitie_code = #{taskFacilitieCode}</if>
- <if test="taskArea != null and taskArea != ''"> and task_area = #{taskArea}</if>
- <if test="params.searchkey != null and params.searchkey != ''"> and ( task_content like concat('%', #{params.searchkey}, '%') or task_addr_road like concat('%', #{params.searchkey}, '%'))</if>
- <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
- and date_format(create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
- </if>
- <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
- and date_format(create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
- </if>
- <if test="params.userId != null and params.userId != ''"><!-- 派发用户自己的或自己填报的或自己处理的 -->
- <![CDATA[
- and ( task_reporter = #{params.userId}
- 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)))
- 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}))))
- ]]>
- </if>
- </where>
- order by create_time desc
- </select>
-
- <select id="selectTblTaskByTaskId" parameterType="Long" resultMap="TblTaskResult">
- <include refid="selectTblTaskVo"/>
- where task_id = #{taskId}
- </select>
-
- <insert id="insertTblTask" parameterType="TblTask" useGeneratedKeys="true" keyProperty="taskId">
- insert into tbl_task
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="taskName != null">task_name,</if>
- <if test="taskContent != null">task_content,</if>
- <if test="taskAddr != null">task_addr,</if>
- <if test="taskLocation != null">task_location,</if>
- <if test="taskCode != null">task_code,</if>
- <if test="taskType != null">task_type,</if>
- <if test="taskEventType != null">task_event_type,</if>
- <if test="taskEventCategory != null">task_event_category,</if>
- <if test="taskFromRemark != null">task_from_remark,</if>
- <if test="taskAddrRoad != null">task_addr_road,</if>
- <if test="taskOtherId != null">task_other_id,</if>
- <if test="taskTime != null">task_time,</if>
- <if test="createTime != null">create_time,</if>
- <if test="taskReqCompleteTime != null">task_req_complete_time,</if>
- <if test="updateTime != null">update_time,</if>
- <if test="createBy != null">create_by,</if>
- <if test="updateBy != null">update_by,</if>
- <if test="status != null">status,</if>
- <if test="taskCreater != null">task_creater,</if>
- <if test="taskReporter != null">task_reporter,</if>
- <if test="taskPics != null">task_pics,</if>
- <if test="taskVideos != null">task_videos,</if>
- <if test="taskComplainConnect != null">task_complain_connect,</if>
- <if test="remark != null">remark,</if>
- <if test="taskDeptRange != null">task_dept_range,</if>
- <if test="taskFacilitieCode != null">task_facilitie_code,</if>
- <if test="taskArea != null">task_area,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="taskName != null">#{taskName},</if>
- <if test="taskContent != null">#{taskContent},</if>
- <if test="taskAddr != null">#{taskAddr},</if>
- <if test="taskLocation != null">#{taskLocation},</if>
- <if test="taskCode != null">#{taskCode},</if>
- <if test="taskType != null">#{taskType},</if>
- <if test="taskEventType != null">#{taskEventType},</if>
- <if test="taskEventCategory != null">#{taskEventCategory},</if>
- <if test="taskFromRemark != null">#{taskFromRemark},</if>
- <if test="taskAddrRoad != null">#{taskAddrRoad},</if>
- <if test="taskOtherId != null">#{taskOtherId},</if>
- <if test="taskTime != null">#{taskTime},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="taskReqCompleteTime != null">#{taskReqCompleteTime},</if>
- <if test="updateTime != null">#{updateTime},</if>
- <if test="createBy != null">#{createBy},</if>
- <if test="updateBy != null">#{updateBy},</if>
- <if test="status != null">#{status},</if>
- <if test="taskCreater != null">#{taskCreater},</if>
- <if test="taskReporter != null">#{taskReporter},</if>
- <if test="taskPics != null">#{taskPics},</if>
- <if test="taskVideos != null">#{taskVideos},</if>
- <if test="taskComplainConnect != null">#{taskComplainConnect},</if>
- <if test="remark != null">#{remark},</if>
- <if test="taskDeptRange != null">#{taskDeptRange},</if>
- <if test="taskFacilitieCode != null">#{taskFacilitieCode},</if>
- <if test="taskArea != null">#{taskArea},</if>
- </trim>
- </insert>
- <update id="updateTblTask" parameterType="TblTask">
- update tbl_task
- <trim prefix="SET" suffixOverrides=",">
- <if test="taskName != null">task_name = #{taskName},</if>
- <if test="taskContent != null">task_content = #{taskContent},</if>
- <if test="taskAddr != null">task_addr = #{taskAddr},</if>
- <if test="taskLocation != null">task_location = #{taskLocation},</if>
- <if test="taskCode != null">task_code = #{taskCode},</if>
- <if test="taskType != null">task_type = #{taskType},</if>
- <if test="taskEventType != null">task_event_type = #{taskEventType},</if>
- <if test="taskEventCategory != null">task_event_category = #{taskEventCategory},</if>
- <if test="taskFromRemark != null">task_from_remark = #{taskFromRemark},</if>
- <if test="taskAddrRoad != null">task_addr_road = #{taskAddrRoad},</if>
- <if test="taskOtherId != null">task_other_id = #{taskOtherId},</if>
- <if test="taskTime != null">task_time = #{taskTime},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="taskReqCompleteTime != null">task_req_complete_time = #{taskReqCompleteTime},</if>
- <if test="updateTime != null">update_time = #{updateTime},</if>
- <if test="updateBy != null">update_by = #{updateBy},</if>
- <if test="createBy != null">create_by = #{createBy},</if>
- <if test="status != null">status = #{status},</if>
- <if test="taskCreater != null">task_creater = #{taskCreater},</if>
- <if test="taskReporter != null">task_reporter = #{taskReporter},</if>
- <if test="taskPics != null">task_pics = #{taskPics},</if>
- <if test="taskVideos != null">task_videos = #{taskVideos},</if>
- <if test="taskComplainConnect != null">task_complain_connect = #{taskComplainConnect},</if>
- <if test="remark != null">remark = #{remark},</if>
- <if test="taskDeptRange != null">task_dept_range = #{taskDeptRange},</if>
- <if test="taskFacilitieCode != null">task_facilitie_code = #{taskFacilitieCode},</if>
- <if test="taskArea != null">task_area = #{taskArea},</if>
- </trim>
- where task_id = #{taskId}
- </update>
- <delete id="deleteTblTaskByTaskId" parameterType="Long">
- delete from tbl_task where task_id = #{taskId}
- </delete>
- <delete id="deleteTblTaskByTaskIds" parameterType="String">
- delete from tbl_task where task_id in
- <foreach item="taskId" collection="array" open="(" separator="," close=")">
- #{taskId}
- </foreach>
- </delete>
- </mapper>
|