From b8bb71260434558a94a61b7e24c6a0895949d102 Mon Sep 17 00:00:00 2001 From: zhangnaisong <2434969829@qq.com> Date: 星期四, 05 十月 2023 18:53:26 +0800 Subject: [PATCH] 应急预案提交 --- ard-work/src/main/resources/mapper/app/ArdAppTaskMapper.xml | 64 +++++++++++++++++++++---------- 1 files changed, 43 insertions(+), 21 deletions(-) diff --git a/ard-work/src/main/resources/mapper/app/ArdAppTaskMapper.xml b/ard-work/src/main/resources/mapper/app/ArdAppTaskMapper.xml index 8d800fb..def4551 100644 --- a/ard-work/src/main/resources/mapper/app/ArdAppTaskMapper.xml +++ b/ard-work/src/main/resources/mapper/app/ArdAppTaskMapper.xml @@ -6,6 +6,7 @@ <resultMap type="ArdAppTask" id="ArdAppTaskResult"> <result property="id" column="id"/> + <result property="type" column="type"/> <result property="name" column="name"/> <result property="text" column="text"/> <result property="voice" column="voice"/> @@ -27,7 +28,12 @@ <!-- <collection property="ardAppTaskDetailList" notNullColumn="sub1_id" javaType="java.util.List"--> <!-- resultMap="ArdAppTaskDetailResult"/>--> </resultMap> - + <resultMap id="ArdAppTaskSub1Result" type="ArdAppTask" extends="ArdAppTaskResult"> + <collection property="ardAppTaskPicList" notNullColumn="sub2_id" javaType="java.util.List" + resultMap="ArdAppTaskPicResult"/> + <collection property="ardAppTaskDetailList" notNullColumn="sub1_id" javaType="java.util.List" + resultMap="ArdAppTaskDetailResult"/> + </resultMap> <resultMap type="ArdAppTaskDetail" id="ArdAppTaskDetailResult"> <result property="id" column="sub1_id"/> <result property="name" column="sub1_name"/> @@ -53,6 +59,7 @@ <sql id="selectArdAppTaskVo"> select c.id, + c.type, c.name, c.text, c.voice, @@ -61,15 +68,14 @@ c.create_by, c.create_time, c.update_by, - c.update_time, - c.view_time, - c.view_position + c.update_time from ard_app_task c left join sys_dept d on d.dept_id = c.dept_id left join sys_user u on u.user_id = c.user_id </sql> <sql id="selectArdAppTaskDto"> select a.id, + a.type, a.name, a.text, a.voice, @@ -95,7 +101,8 @@ c.view_time as sub1_view_time, c.view_position as sub1_view_position, c.clock_in_time as sub1_clock_in_time, - c.view_flag as sub1_view_flag + c.view_flag as sub1_view_flag, + c.task_id as sub1_task_id from ard_app_task a left join ard_app_task_pic b on b.task_id = a.id left join ard_app_task_detail c on c.task_id = a.id @@ -104,19 +111,19 @@ <select id="selectArdAppTaskList" parameterType="ArdAppTask" resultMap="ArdAppTaskResult"> <include refid="selectArdAppTaskVo"/> <where> - <if test="name != null and name != ''">and name like '%'||#{name}||'%'</if> - <if test="text != null and text != ''">and text = #{text}</if> - <if test="voice != null and voice != ''">and voice = #{voice}</if> + <if test="type != null and type != ''">and c.type = #{type}</if> + <if test="name != null and name != ''">and c.name like '%'||#{name}||'%'</if> + <if test="text != null and text != ''">and c.text = #{text}</if> + <if test="voice != null and voice != ''">and c.voice = #{voice}</if> <if test="params.beginTime != null and params.beginTime != ''"><!-- 寮�濮嬫椂闂存绱� --> - and create_time >= to_timestamp(#{params.beginTime},'yyyy-MM-DD HH24:MI:ss') + and c.create_time >= to_timestamp(#{params.beginTime},'yyyy-MM-DD HH24:MI:ss') </if> <if test="params.endTime != null and params.endTime != ''"><!-- 缁撴潫鏃堕棿妫�绱� --> - and create_time <= to_timestamp(#{params.endTime},'yyyy-MM-DD HH24:MI:ss') + and c.create_time <= to_timestamp(#{params.endTime},'yyyy-MM-DD HH24:MI:ss') </if> - <if test="userId != null and userId != ''">and user_id = #{userId}</if> - <!-- 鏁版嵁鑼冨洿杩囨护 --> - ${params.dataScope} + <if test="userId != null and userId != ''">and c.user_id = #{userId}</if> </where> + order by c.create_time desc </select> <select id="selectArdAppTaskListWithDetail" parameterType="ArdAppTask" resultMap="ArdAppTaskSubResult"> @@ -156,24 +163,37 @@ </if> </where> </select> - - <select id="selectArdAppTaskById" parameterType="String" resultMap="ArdAppTaskSubResult"> + <select id="selectArdAppTaskDetailListByTaskId" resultType="ArdAppTaskDetail"> + select * from ard_app_task_detail where task_id=#{taskId} + </select> + <select id="selectArdAppTaskById" parameterType="String" resultMap="ArdAppTaskSub1Result"> <include refid="selectArdAppTaskDto"/> where a.id = #{id} </select> <select id="selectArdAppTaskDetailListByIdAndUserId" resultType="ArdAppTaskDetail"> - select * from ard_app_task_detail d - where d.task_id = #{id} and d.user_id = #{detailUserId} + select * + from ard_app_task_detail d + where d.task_id = #{id} + and d.user_id = #{detailUserId} </select> <select id="selectArdAppTaskPicListById" resultType="ArdAppTaskPic"> - select * from ard_app_task_pic d where d.task_id = #{id} + select * + from ard_app_task_pic d + where d.task_id = #{id} </select> + <select id="selectArdAppTaskDetailUserIdsByTaskId" parameterType="String" resultType="java.lang.String"> + select DISTINCT(user_id) + from ard_app_task_detail + where task_id = #{taskId} + </select> + <insert id="insertArdAppTask" parameterType="ArdAppTask"> insert into ard_app_task <trim prefix="(" suffix=")" suffixOverrides=","> <if test="id != null">id,</if> + <if test="type != null">type,</if> <if test="name != null">name,</if> <if test="text != null">text,</if> <if test="voice != null">voice,</if> @@ -186,6 +206,7 @@ </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="id != null">#{id},</if> + <if test="type != null">#{type},</if> <if test="name != null">#{name},</if> <if test="text != null">#{text},</if> <if test="voice != null">#{voice},</if> @@ -201,6 +222,7 @@ <update id="updateArdAppTask" parameterType="ArdAppTask"> update ard_app_task <trim prefix="SET" suffixOverrides=","> + <if test="type != null">type = #{type},</if> <if test="name != null">name = #{name},</if> <if test="text != null">text = #{text},</if> <if test="voice != null">voice = #{voice},</if> @@ -325,15 +347,15 @@ from ard_app_task_detail c where c.id = #{id} </select> - <select id="selectNewArdAppTaskByUserId" parameterType="String" resultMap="ArdAppTaskSubResult"> + <select id="selectNewArdAppTaskByUserId" parameterType="String" resultMap="ArdAppTaskSub1Result"> <include refid="selectArdAppTaskDto"/> where c.user_id = #{userId} AND c.view_flag is null order by create_time desc limit 1 </select> <select id="selectUnreadArdAppTaskCount" resultType="Integer"> - SELECT COUNT(A.ID) + SELECT COUNT(DISTINCT A.ID) FROM ard_app_task A - LEFT JOIN ard_app_task_detail C ON C.task_id = A.ID + LEFT JOIN ard_app_task_detail C ON C.task_id = A.ID WHERE C.view_time IS NULL AND C.view_flag = '1' AND C.user_id = #{userId} -- Gitblit v1.9.3