<?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.mapper.ReviewSceneChangeTaskMapper"> <resultMap id="BaseResultMap" type="com.ruoyi.domain.ReviewSceneChangeTask"> <id property="id" column="id" jdbcType="BIGINT"/> <result property="taskNo" column="no" jdbcType="VARCHAR"/> <result property="chapter" column="chapter" jdbcType="VARCHAR"/> <result property="standard" column="standard" jdbcType="VARCHAR"/> <result property="keypoint" column="keypoint" jdbcType="VARCHAR"/> <result property="details" column="details" jdbcType="VARCHAR"/> <result property="operation" column="operation" jdbcType="VARCHAR"/> <result property="sort" column="sort" jdbcType="VARCHAR"/> <result property="operationSort" column="operation_sort" jdbcType="VARCHAR"/> <result property="oldText" column="old_text" jdbcType="VARCHAR"/> <result property="newText" column="new_text" jdbcType="VARCHAR"/> <result property="taskInitiator" column="task_initiator" jdbcType="VARCHAR"/> <result property="taskInitiatorDept" column="task_initiator_dept" jdbcType="VARCHAR"/> <result property="taskStatus" column="task_status" jdbcType="VARCHAR"/> <result property="taskResult" column="task_result" jdbcType="VARCHAR"/> <result property="taskBeginTime" column="task_begin_time" jdbcType="TIMESTAMP"/> <result property="taskEndTime" column="task_end_time" jdbcType="TIMESTAMP"/> </resultMap> <resultMap id="ResponseResultMap" type="com.ruoyi.web.response.ReviewSceneChangeTaskResponse"> <id property="id" column="id" jdbcType="BIGINT"/> <result property="taskNo" column="no" jdbcType="VARCHAR"/> <result property="chapter" column="chapter" jdbcType="VARCHAR"/> <result property="standard" column="standard" jdbcType="VARCHAR"/> <result property="keypoint" column="keypoint" jdbcType="VARCHAR"/> <result property="details" column="details" jdbcType="VARCHAR"/> <result property="operation" column="operation" jdbcType="VARCHAR"/> <result property="sort" column="sort" jdbcType="VARCHAR"/> <result property="operationSort" column="operation_sort" jdbcType="VARCHAR"/> <result property="oldText" column="old_text" jdbcType="VARCHAR"/> <result property="newText" column="new_text" jdbcType="VARCHAR"/> <result property="taskInitiator" column="task_initiator" jdbcType="VARCHAR"/> <result property="taskInitiatorDept" column="task_initiator_dept" jdbcType="VARCHAR"/> <result property="taskStatus" column="task_status" jdbcType="VARCHAR"/> <result property="taskResult" column="task_result" jdbcType="VARCHAR"/> <result property="taskBeginTime" column="task_begin_time" jdbcType="TIMESTAMP"/> <result property="taskEndTime" column="task_end_time" jdbcType="TIMESTAMP"/> <result property="decision" column="decision" jdbcType="VARCHAR"/> </resultMap> <select id="findLastChangeByTaskId" resultType="com.ruoyi.domain.ReviewSceneChangeTask"> SELECT * FROM t_review_scene_change_task WHERE id IN ( SELECT MAX(id) FROM t_review_scene_change_task WHERE task_status = 'FINISH' AND task_result = 'PASS' AND id IN (SELECT review_scene_change_task_id FROM t_review_task_inbox WHERE review_task_id = #{taskId} AND is_confirm = 0) GROUP BY review_scene_id ) </select> <select id="findPendingListByUserId" resultType="com.ruoyi.web.response.ReviewSceneChangeTaskResponse"> SELECT sct.*, sctu.decision FROM t_review_scene_change_task sct LEFT JOIN t_review_scene_change_task_user_relation sctu ON sct.id = sctu.task_id WHERE sctu.user_id = #{userId} and sctu.decision IS NULL <if test="request.operationSort != null and request.operationSort != ''"> and sct.operation_sort = #{request.operationSort} </if> <if test="request.type != null and request.type != ''"> and sct.type = #{request.type} </if> <if test="request.keyword != null and request.keyword != ''"> and (sct.old_text like concat('%',#{request.keyword},'%') || sct.new_text like concat('%',#{request.keyword},'%')) </if> order by sct.task_begin_time desc </select> <select id="findFinishListByUserId" resultType="com.ruoyi.web.response.ReviewSceneChangeTaskResponse"> SELECT sct.*, sctu.decision FROM t_review_scene_change_task sct LEFT JOIN t_review_scene_change_task_user_relation sctu ON sct.id = sctu.task_id WHERE sctu.user_id = #{userId} and sctu.decision IS NOT NULL <if test="request.operationSort != null and request.operationSort != ''"> and sct.operation_sort = #{request.operationSort} </if> <if test="request.type != null and request.type != ''"> and sct.type = #{request.type} </if> <if test="request.keyword != null and request.keyword != ''"> and (sct.old_text like concat('%',#{request.keyword},'%') || sct.new_text like concat('%',#{request.keyword},'%')) </if> order by sct.task_begin_time desc </select> <select id="findCreateListByUserId" resultType="com.ruoyi.domain.ReviewSceneChangeTask"> SELECT * FROM t_review_scene_change_task WHERE task_initiator_id = #{userId} <if test="request.operationSort != null and request.operationSort != ''"> and operation_sort = #{request.operationSort} </if> <if test="request.type != null and request.type != ''"> and type = #{request.type} </if> <if test="request.keyword != null and request.keyword != ''"> and (old_text like concat('%',#{request.keyword},'%') || new_text like concat('%',#{request.keyword},'%')) </if> <if test="request.taskStatus != null and request.taskStatus != ''"> and task_status = #{request.taskStatus} </if> order by task_begin_time desc </select> </mapper>