@@ -151,7 +151,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
task.admin_id,
task.create_time,
task.remarks,
us.nick_name AS nickname
us.nick_name AS nickname,
(SELECT GROUP_CONCAT(re.relation_id) FROM t_task_relation_info re WHERE re.task_id = task.id AND re.type = '1')as beyondVillage
FROM
t_task task
LEFT JOIN sys_user us ON us.user_id = task.admin_id
...
...
@@ -209,10 +210,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
t.type,
IF(type=1,(SELECT COUNT(1) FROM t_community),0) AS coummunityNum,
(case type
when 1 then IF(ISNULL(t.task_type),(select count(1) from t_user u),(select count(1) from t_user u WHERE u.task_type = t.task_type))
when 3 then (select count(1) from t_industry)
else (select count(1) from t_business)
end)as totalInspectNum
when 1 then
IF(ISNULL(t.task_type),
(select count(1) from t_user u where u.village in (select re.relation_id from t_task_relation_info re where re.task_id = t.id and re.type = '1')),
(select count(1) from t_user u WHERE u.task_type = t.task_type and u.village in (select re.relation_id from t_task_relation_info re where re.task_id = t.id and re.type = '1'))
)
when 3 then (select count(1) from t_industry)
else (select count(1) from t_business)
end)as totalInspectNum
FROM
t_task t
<where>
...
...
@@ -245,6 +250,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
) ti ON us.id = ti.receive_id
<where>
<iftest="taskType != null and taskType != ''">us.task_type = #{taskType}</if>
<iftest="type == 1">
and us.village in (SELECT re.relation_id FROM t_task_relation_info re WHERE re.task_id = #{taskId} and re.type = '1' )