|
|
@ -83,14 +83,14 @@ |
|
|
|
GROUP BY time |
|
|
|
</select> |
|
|
|
<select id="selectWarningTrendMonth" resultType="java.util.HashMap"> |
|
|
|
SELECT DATE(warning.create_time) AS DAY, COUNT(*) AS number |
|
|
|
SELECT DATE(warning.create_time) AS day, COUNT(*) AS number |
|
|
|
FROM dc_warning as warning |
|
|
|
LEFT JOIN dc_stake_mark AS mark ON warning.stake_mark_id=mark.stake_mark |
|
|
|
WHERE DATE_FORMAT(warning.create_time,'%Y-%m') =DATE_FORMAT(#{createTime},'%Y-%m') |
|
|
|
AND warning.direction=#{direction} |
|
|
|
and mark.`section_id`=#{sectionId} |
|
|
|
GROUP BY DAY |
|
|
|
ORDER BY DAY |
|
|
|
GROUP BY day |
|
|
|
ORDER BY day |
|
|
|
</select> |
|
|
|
<select id="selectWarningTrendQuarter" resultType="java.util.HashMap"> |
|
|
|
SELECT |
|
|
@ -100,7 +100,7 @@ |
|
|
|
WHEN MONTH(warning.create_time) BETWEEN 7 AND 9 THEN '第三季度' |
|
|
|
ELSE '第四季度' |
|
|
|
END AS QUARTER, |
|
|
|
MONTH(warning.create_time) AS MONTH, |
|
|
|
MONTH(warning.create_time) AS month, |
|
|
|
COUNT(*) AS number |
|
|
|
FROM dc_warning as warning |
|
|
|
LEFT JOIN dc_stake_mark AS mark ON warning.stake_mark_id=mark.stake_mark |
|
|
@ -112,14 +112,17 @@ |
|
|
|
|
|
|
|
</select> |
|
|
|
<select id="selectWarningTrendYear" resultType="java.util.HashMap"> |
|
|
|
SELECT YEAR(warning.create_time) AS YEAR, COUNT(*) AS number |
|
|
|
SELECT month(warning.create_time) AS month, COUNT(*) AS number |
|
|
|
FROM dc_warning as warning |
|
|
|
LEFT JOIN dc_stake_mark AS mark ON warning.stake_mark_id=mark.stake_mark |
|
|
|
where mark.`section_id`=#{sectionId} AND warning.direction=#{direction} |
|
|
|
GROUP BY YEAR |
|
|
|
and DATE_FORMAT(warning.create_time,'%Y')=DATE_FORMAT(#{createTime},'%Y') |
|
|
|
GROUP BY month |
|
|
|
</select> |
|
|
|
<select id="selectWarningSectionTypeDay" resultType="java.util.HashMap"> |
|
|
|
SELECT warning.warning_type warningType,COUNT(*) AS number |
|
|
|
SELECT warning.warning_type warningType, |
|
|
|
DATE_FORMAT(warning.create_time, '%Y-%m-%d %H') AS time, |
|
|
|
COUNT(*) AS number |
|
|
|
FROM dc_warning as warning |
|
|
|
LEFT JOIN dc_stake_mark as mark on warning.stake_mark_id=mark.stake_mark |
|
|
|
where DATE_FORMAT(warning.create_time,'%Y-%m-%d')=DATE_FORMAT(#{createTime},'%Y-%m-%d') |
|
|
@ -158,10 +161,12 @@ |
|
|
|
</select> |
|
|
|
<select id="selectWarningSectionTypeYear" resultType="java.util.HashMap"> |
|
|
|
SELECT warning.warning_type warningType, COUNT(*) AS number, |
|
|
|
month(warning.create_time) AS month, |
|
|
|
DATE_FORMAT(warning.create_time, '%Y') as createTime |
|
|
|
FROM dc_warning as warning |
|
|
|
LEFT JOIN dc_stake_mark AS mark ON warning.stake_mark_id=mark.stake_mark |
|
|
|
where mark.`section_id`=#{sectionId} AND warning.direction=#{direction} |
|
|
|
and DATE_FORMAT(warning.create_time,'%Y')=DATE_FORMAT(#{createTime},'%Y') |
|
|
|
GROUP BY warningType |
|
|
|
</select> |
|
|
|
|
|
|
@ -173,10 +178,10 @@ |
|
|
|
</select> |
|
|
|
<select id="selectWarningEscalation" resultType="java.util.HashMap"> |
|
|
|
select org.organization_name,warning.warning_type,warning.warning_subclass, |
|
|
|
warning_title,warning.warning_state,warning. |
|
|
|
warning_source,DATE_FORMAT(warning.create_time,'%Y-%m-%d %H:%m:%s') createTime from dc_warning as warning |
|
|
|
warning_title,warning.warning_state, |
|
|
|
warning. warning_source,DATE_FORMAT(warning.create_time,'%Y-%m-%d %H:%m:%s') createTime from dc_warning as warning |
|
|
|
LEFT JOIN dc_stake_mark as mark on warning.stake_mark_id=mark.stake_mark |
|
|
|
LEFT JOIN dc_organization as org on mark.stake_mark=org.stake_mark_id AND mark.direction=org.direction |
|
|
|
LEFT JOIN dc_organization as org on mark.stake_mark=org.stake_mark_id |
|
|
|
<where> |
|
|
|
<if test="warningState != null and warningState != ''"> and warning.warning_state = #{warningState}</if> |
|
|
|
</where> |
|
|
|