数字督察一体化平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

75 lines
3.0 KiB

<?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.biutag.supervision.mapper.SupTaskMapper">
<select id="queryTask" resultType="com.biutag.supervision.pojo.vo.TaskVo">
select distinct t.id,
t.task_name,
t.sup_depart_name,
t.begin_time,
t.end_time,
t.create_time,
t.task_type,
t.task_status,
a.filter_people_number total_number,
i.supervision_type,
i.task_content,
i.has_sign,
s.requirement,
s.type,
a.summary
from sup_task t
left join sup_task_person p on p.task_id = t.id
left join sup_task_inspection i on t.id = i.task_id
left join sup_task_testing_alcohol a on t.id = a.task_id
left join sup_task_selfexamination s on t.id = s.task_id
left join sup_task_selfexamination_depart d on t.id = d.task_id
${ew.getCustomSqlSegment}
</select>
<select id="queryTaskList" resultType="com.biutag.supervision.pojo.vo.TaskVo">
select t.id,
t.task_name,
t.sup_depart_name,
t.begin_time,
t.end_time,
t.create_time,
t.task_type,
t.task_status,
a.filter_people_number total_number,
i.supervision_type,
i.task_content,
i.has_sign,
s.requirement,
s.type,
a.summary,
count(DISTINCT tp.depart_id) depart_number,
count(tp.id) problem_number
from sup_task t
left join sup_task_person p on p.task_id = t.id
left join sup_task_inspection i on t.id = i.task_id
left join sup_task_testing_alcohol a on t.id = a.task_id
left join sup_task_selfexamination s on t.id = s.task_id
LEFT JOIN sup_task_problem tp on t.id = tp.task_id
${ew.getCustomSqlSegment}
</select>
<select id="queryTaskCount" resultType="com.biutag.supervision.pojo.vo.TaskCountVo">
select sum(CASE WHEN t.task_status = 'todo' THEN 1 ELSE 0 END ) todo_count,
sum(CASE WHEN t.task_status = 'done' THEN 1 ELSE 0 END ) done_count
from
(select t.task_status
from sup_task t
left join sup_task_person p on p.task_id = t.id
left join sup_task_inspection i on t.id = i.task_id
left join sup_task_testing_alcohol a on t.id = a.task_id
left join sup_task_selfexamination s on t.id = s.task_id
left join sup_task_selfexamination_depart d on t.id = d.task_id
${ew.getCustomSqlSegment}) t
</select>
</mapper>