Commit 5ab4e94e authored by 耿迪迪's avatar 耿迪迪

安检单提交修改隐患、未安检人统计、安检任务隐患统计修改

parent 444cd7d3
...@@ -294,7 +294,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -294,7 +294,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if> </if>
</delete> </delete>
<update id="updateByInspect"> <update id="updateByInspect">
UPDATE t_danger SET status = 0 UPDATE t_danger SET STATUS = IF(ISNULL(reform_id),0,3)
WHERE inspect_id =#{inspectId} WHERE inspect_id =#{inspectId}
<if test="type &gt; 3"> <if test="type &gt; 3">
and `type` = #{type} and `type` = #{type}
......
...@@ -184,7 +184,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -184,7 +184,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
COUNT(p.id) AS isjian, COUNT(p.id) AS isjian,
</if> </if>
CASE t.type CASE t.type
WHEN 1 THEN (SELECT COUNT(us.id) FROM t_user us WHERE us.task_type = t.task_type) WHEN 1 THEN (SELECT COUNT(us.id) FROM t_user us WHERE us.task_type = t.task_type and us.village in (SELECT re.relation_id FROM t_task_relation_info re WHERE re.task_id = t.id and re.type = '1' ))
WHEN 2 THEN (SELECT COUNT(id) FROM t_business) WHEN 2 THEN (SELECT COUNT(id) FROM t_business)
ELSE (SELECT COUNT(id) FROM t_industry) ELSE (SELECT COUNT(id) FROM t_industry)
END AS allnum END AS allnum
...@@ -259,7 +259,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -259,7 +259,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SELECT SELECT
count(1)AS totalDangerNum, count(1)AS totalDangerNum,
SUM(IF(danger.status=0,1,0))AS toDoNum, SUM(IF(danger.status=0,1,0))AS toDoNum,
SUM(IF(danger.status=2,1,0))AS dealNum SUM(IF(danger.status>2,1,0))AS dealNum
FROM FROM
t_task_inspect inspect,t_danger danger t_task_inspect inspect,t_danger danger
<where> <where>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment