|
|
@ -87,9 +87,17 @@ |
|
|
|
where DATE_FORMAT(create_time,'%Y-%m-%d')=DATE_FORMAT(#{createTime},'%Y-%m-%d') |
|
|
|
</select> |
|
|
|
<select id="selectWarningStateDay" resultType="java.util.HashMap"> |
|
|
|
SELECT warning_state warningState,COUNT(*) AS number FROM dc_warning |
|
|
|
where DATE_FORMAT(create_time,'%Y-%m-%d')=DATE_FORMAT(#{createTime},'%Y-%m-%d') |
|
|
|
GROUP BY warning_state |
|
|
|
select t1.warningState,t1.warningStateName,IFNULL(t2.num,0)number from |
|
|
|
(select '1' as warningState,'上报' as warningStateName |
|
|
|
UNION ALL select '2' as warningState,'已完成' as warningStateName |
|
|
|
UNION ALL select '3' as warningState,'已终止' as warningStateName |
|
|
|
UNION ALL select '4' as warningState,'自动结束' as warningStateName) t1 |
|
|
|
LEFT JOIN |
|
|
|
(SELECT warning_state warningState,count(*) num |
|
|
|
from dc_warning |
|
|
|
where DATE_FORMAT(create_time,'%Y-%m-%d')=DATE_FORMAT(now(),'%Y-%m-%d') |
|
|
|
GROUP BY warning_state)t2 |
|
|
|
on t1.warningState=t2.warningState |
|
|
|
</select> |
|
|
|
<select id="selectWarningTypeDay" resultType="java.util.HashMap"> |
|
|
|
SELECT warning_type warningType,COUNT(*) AS number FROM dc_warning |
|
|
|