Files
fad_oa/ruoyi-oa/src/main/resources/mapper/oa/SysOaTaskMapper.xml

81 lines
2.8 KiB
XML
Raw Normal View History

2024-07-07 21:09:28 +08:00
<?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.oa.mapper.SysOaTaskMapper">
<resultMap type="com.ruoyi.oa.domain.SysOaTask" id="SysOaTaskResult">
<result property="taskId" column="task_id"/>
<result property="projectId" column="project_id"/>
<result property="taskTitle" column="task_title"/>
<result property="taskType" column="task_type"/>
<result property="taskGrade" column="task_grade"/>
<result property="collaborator" column="collaborator"/>
<result property="beginTime" column="begin_time"/>
<result property="finishTime" column="finish_time"/>
<result property="content" column="content"/>
<result property="accessory" column="accessory"/>
<result property="remark" column="remark"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
</resultMap>
<!--先删除数据-->
<delete id="deleteSysOaTaskByProjectId" parameterType="Long">
delete from sys_oa_task where project_id = #{projectId}
</delete>
<select id="selectListVoPage" resultType="com.ruoyi.oa.domain.vo.SysOaTaskVo">
SELECT
sot.task_id,
sot.project_id,
sot.create_user_id,
sot.worker_id,
sot.task_title,
sot.task_type,
sot.task_grade,
sot.collaborator,
sot.begin_time,
sot.finish_time,
sot.origin_finish_time,
sot.postponements,
sot.completed_time,
sot.content,
sot.accessory,
sot.rank_number,
sot.remark,
sot.task_rank,
sot.state,
sot.time_gap,
sot.status,
sot.create_by,
sot.create_time,
sot.update_by,
sot.update_time,
sot.del_flag,
sot.own_rank,
sop.project_name,
sop.project_num,
su1.nick_name AS createUserNickName,
su2.nick_name AS workerNickName,
CASE
WHEN sot.completed_time IS NULL
THEN DATEDIFF(NOW(), sot.finish_time)
ELSE 0
END AS overDays
FROM sys_oa_task sot
LEFT JOIN sys_user su1 ON su1.user_id = sot.create_user_id
LEFT JOIN sys_user su2 ON su2.user_id = sot.worker_id
LEFT JOIN sys_oa_project sop ON sop.project_id = sot.project_id
${ew.getCustomSqlSegment}
</select>
2024-07-07 21:09:28 +08:00
</mapper>