|
|
@ -39,7 +39,7 @@ |
|
|
|
<if test="warningSubclass != null and warningSubclass != ''"> and warning.warning_subclass = #{warningSubclass}</if> |
|
|
|
<if test="warningSource != null and warningSource != ''"> and warning.warning_source = #{warningSource}</if> |
|
|
|
<if test="direction != null and direction != ''"> and warning.direction = #{direction}</if> |
|
|
|
<if test="stakeMark != null and direction != ''"> and warning.stake_mark = #{stakeMark}</if> |
|
|
|
<if test="stakeMark != null and stakeMark != ''"> and warning.stake_mark = #{stakeMark}</if> |
|
|
|
<if test="startTime != null and endTime != null "> |
|
|
|
and warning.warning_time between #{startTime} and #{endTime}</if> |
|
|
|
</where> |
|
|
@ -130,21 +130,15 @@ |
|
|
|
</select> |
|
|
|
<select id="selectWarningTrendQuarter" resultType="java.util.HashMap"> |
|
|
|
SELECT |
|
|
|
CASE |
|
|
|
WHEN MONTH(warning.warning_time) BETWEEN 1 AND 3 THEN '第一季度' |
|
|
|
WHEN MONTH(warning.warning_time) BETWEEN 4 AND 6 THEN '第二季度' |
|
|
|
WHEN MONTH(warning.warning_time) BETWEEN 7 AND 9 THEN '第三季度' |
|
|
|
ELSE '第四季度' |
|
|
|
END AS QUARTER, |
|
|
|
MONTH(warning.warning_time) AS month, |
|
|
|
COUNT(*) AS number |
|
|
|
FROM dc_warning as warning |
|
|
|
LEFT JOIN dc_stake_mark AS mark ON warning.stake_mark=mark.stake_mark |
|
|
|
WHERE YEAR(warning.warning_time) =DATE_FORMAT(#{warningTime},'%Y') |
|
|
|
WHERE QUARTER(warning.warning_time)=#{quarter} |
|
|
|
AND warning.direction=#{direction} and mark.direction=#{direction} |
|
|
|
and mark.`section_id`=#{sectionId} |
|
|
|
GROUP BY QUARTER, MONTH |
|
|
|
ORDER BY QUARTER, MONTH; |
|
|
|
GROUP BY MONTH |
|
|
|
ORDER BY MONTH; |
|
|
|
|
|
|
|
</select> |
|
|
|
<select id="selectWarningTrendYear" resultType="java.util.HashMap"> |
|
|
@ -195,27 +189,21 @@ |
|
|
|
COUNT(*) AS number |
|
|
|
FROM dc_warning as warning |
|
|
|
LEFT JOIN dc_stake_mark AS mark ON warning.stake_mark=mark.stake_mark |
|
|
|
WHERE YEAR(warning.warning_time) =DATE_FORMAT(#{warningTime},'%Y') |
|
|
|
WHERE QUARTER(warning.warning_time)=#{quarter} |
|
|
|
AND warning.direction=#{direction} and mark.direction=#{direction} |
|
|
|
and mark.`section_id`=#{sectionId} |
|
|
|
</select> |
|
|
|
<select id="selectWarningSectionTypeQuarter" resultType="java.util.HashMap"> |
|
|
|
SELECT |
|
|
|
CASE |
|
|
|
WHEN MONTH(warning.warning_time) BETWEEN 1 AND 3 THEN '第一季度' |
|
|
|
WHEN MONTH(warning.warning_time) BETWEEN 4 AND 6 THEN '第二季度' |
|
|
|
WHEN MONTH(warning.warning_time) BETWEEN 7 AND 9 THEN '第三季度' |
|
|
|
ELSE '第四季度' |
|
|
|
END AS QUARTER, |
|
|
|
warning.warning_type warningType, |
|
|
|
COUNT(*) AS number |
|
|
|
FROM dc_warning as warning |
|
|
|
LEFT JOIN dc_stake_mark AS mark ON warning.stake_mark=mark.stake_mark |
|
|
|
WHERE YEAR(warning.warning_time) =DATE_FORMAT(#{warningTime},'%Y') |
|
|
|
WHERE QUARTER(warning.warning_time)=#{quarter} |
|
|
|
AND warning.direction=#{direction} and mark.direction=#{direction} |
|
|
|
and mark.`section_id`=#{sectionId} |
|
|
|
GROUP BY QUARTER, warningType |
|
|
|
ORDER BY QUARTER; |
|
|
|
GROUP BY warningType |
|
|
|
|
|
|
|
</select> |
|
|
|
<select id="selectWarningSectionTypeYearCount" resultType="java.lang.String"> |
|
|
|
SELECT COUNT(*) AS number FROM dc_warning as warning |
|
|
@ -303,19 +291,12 @@ |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="selectWarningMarkQuarterOptimize" resultType="java.util.HashMap"> |
|
|
|
SELECT count( 1 ) sectionNumber, |
|
|
|
CASE |
|
|
|
WHEN MONTH ( w.warning_time ) BETWEEN 1 AND 3 THEN '第一季度' |
|
|
|
WHEN MONTH ( w.warning_time ) BETWEEN 4 AND 6 THEN '第二季度' |
|
|
|
WHEN MONTH ( w.warning_time ) BETWEEN 7 AND 9 THEN '第三季度' |
|
|
|
ELSE '第四季度' |
|
|
|
END AS QUARTER |
|
|
|
SELECT count( 1 ) sectionNumber,m.stake_mark stakeMarkId |
|
|
|
FROM dc_warning w |
|
|
|
LEFT JOIN dc_stake_mark m ON w.stake_mark = m.stake_mark and m.direction=w.direction |
|
|
|
WHERE m.stake_mark IS NOT null and w.direction=#{direction} |
|
|
|
and YEAR(w.warning_time) =DATE_FORMAT(#{warningTime},'%Y') |
|
|
|
GROUP BY QUARTER |
|
|
|
ORDER BY QUARTER; |
|
|
|
and QUARTER(w.warning_time)=#{quarter} and m.`section_id`=#{sectionId} |
|
|
|
GROUP BY stakeMarkId |
|
|
|
</select> |
|
|
|
<select id="selectWarningMarkDayOptimize" resultType="java.util.HashMap"> |
|
|
|
SELECT DISTINCT m.stake_mark stakeMarkId, |
|
|
|