| | |
| | | <result property="viewTime" column="sub1_view_time"/> |
| | | <result property="viewPosition" column="sub1_view_position"/> |
| | | <result property="clockInTime" column="sub1_clock_in_time"/> |
| | | <result property="viewFlag" column="sub1_view_flag"/> |
| | | </resultMap> |
| | | <resultMap type="ArdAppTaskPic" id="ArdAppTaskPicResult"> |
| | | <result property="id" column="sub2_id"/> |
| | |
| | | c.status as sub1_status, |
| | | c.clock_in_pic_url as sub1_clock_in_pic_url, |
| | | c.view_time as sub1_view_time, |
| | | c.view_position as sub1_view_position |
| | | c.view_position as sub1_view_position, |
| | | c.clock_in_time as sub1_clock_in_time, |
| | | c.view_flag as sub1_view_flag |
| | | 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 |
| | |
| | | <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 --> |
| | | and a.create_time <= to_timestamp(#{params.endTime},'yyyy-MM-DD HH24:MI:ss') |
| | | </if> |
| | | <!-- 数据范围过滤 --> |
| | | ${params.dataScope} |
| | | </where> |
| | | </select> |
| | | <select id="selectArdAppTaskListWithDetailById" parameterType="ArdAppTask" resultMap="ArdAppTaskSubResult"> |
| | |
| | | <if test="text != null">text = #{text},</if> |
| | | <if test="voice != null">voice = #{voice},</if> |
| | | <if test="viewTime != null">view_time = #{viewTime},</if> |
| | | <if test="viewFlag != null">view_flag = #{viewFlag},</if> |
| | | <if test="viewPosition != null">view_position = #{viewPosition},</if> |
| | | <if test="clockInTime != null">clock_in_time = #{clockInTime},</if> |
| | | <if test="taskId != null">task_id = #{taskId},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | | <update id="updateArdAppTaskDetailByTaskId" parameterType="ArdAppTaskDetail"> |
| | | update ard_app_task_detail |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="viewFlag != null">view_flag = #{viewFlag},</if> |
| | | </trim> |
| | | where task_id = #{taskId} |
| | | </update> |
| | | <update id="updateArdAppTaskDetailView" parameterType="ArdAppTaskDetail"> |
| | | update ard_app_task_detail |
| | |
| | | from ard_app_task_detail c |
| | | where c.id = #{id} |
| | | </select> |
| | | <select id="selectNewArdAppTaskByUserId" parameterType="String" resultMap="ArdAppTaskSubResult"> |
| | | <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 ) |
| | | FROM ard_app_task |
| | | A 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} |
| | | </select> |
| | | </mapper> |