|
|
@ -15,6 +15,7 @@ |
|
|
|
</select> |
|
|
|
<select id="selectWarningById" resultType="com.zc.business.domain.DcWarning"> |
|
|
|
SELECT DISTINCT warning.`id`,warning.`stake_mark`, warning.`direction`, |
|
|
|
warning.duration, |
|
|
|
mark.longitude,mark.latitude,warning.lane,warning.vehicle_type vehicleType, |
|
|
|
warning.`dept_id`,warning.`warning_state`,warning.`warning_time`, |
|
|
|
warning.`user_id`, warning.`warning_source`,warning.`warning_level`, |
|
|
@ -26,7 +27,7 @@ |
|
|
|
</select> |
|
|
|
<select id="selectPerceivedEventsList" resultType="com.zc.business.domain.DcWarning"> |
|
|
|
SELECT warning.`id`,warning.`stake_mark`, warning.`direction`, |
|
|
|
mark.longitude,mark.latitude,warning.lane, |
|
|
|
mark.longitude,mark.latitude,warning.lane,duration, |
|
|
|
warning.`dept_id`,warning.`warning_state`,warning.`warning_time`, |
|
|
|
warning.`user_id`, warning.`warning_source`,warning.`warning_level`, |
|
|
|
warning.`remark`, warning.`create_time`,warning.`update_time`, |
|
|
@ -47,6 +48,7 @@ |
|
|
|
LEFT JOIN dc_road_section as s ON mark.section_id=s.id |
|
|
|
where mark.stake_mark is not null |
|
|
|
group by w.stake_mark |
|
|
|
HAVING number !=0 |
|
|
|
order by number desc |
|
|
|
</select> |
|
|
|
<select id="selectSectionPerceivedNumber" resultType="java.util.HashMap"> |
|
|
@ -58,6 +60,7 @@ |
|
|
|
LEFT JOIN dc_road_section as s ON mark.section_id=s.id |
|
|
|
where mark.stake_mark is not null |
|
|
|
group by w.stake_mark |
|
|
|
HAVING number !=0 |
|
|
|
</select> |
|
|
|
<select id="selectDailyCumulative" resultType="java.util.HashMap"> |
|
|
|
SELECT DATE_FORMAT(create_time, '%Y-%m-%d %H') AS time, COUNT(*) AS number |
|
|
@ -98,7 +101,7 @@ |
|
|
|
FROM dc_warning AS warning |
|
|
|
LEFT JOIN dc_stake_mark AS mark ON warning.stake_mark=mark.stake_mark |
|
|
|
WHERE DATE_FORMAT(warning.create_time,'%Y-%m-%d')=DATE_FORMAT(#{createTime},'%Y-%m-%d') |
|
|
|
AND warning.direction=#{direction} |
|
|
|
AND warning.direction=#{direction} and mark.direction=#{direction} |
|
|
|
AND mark.`section_id`=#{sectionId} |
|
|
|
GROUP BY time |
|
|
|
</select> |
|
|
@ -107,7 +110,7 @@ |
|
|
|
FROM dc_warning as warning |
|
|
|
LEFT JOIN dc_stake_mark AS mark ON warning.stake_mark=mark.stake_mark |
|
|
|
WHERE DATE_FORMAT(warning.create_time,'%Y-%m') =DATE_FORMAT(#{createTime},'%Y-%m') |
|
|
|
AND warning.direction=#{direction} |
|
|
|
AND warning.direction=#{direction} and mark.direction=#{direction} |
|
|
|
and mark.`section_id`=#{sectionId} |
|
|
|
GROUP BY day |
|
|
|
ORDER BY day |
|
|
@ -125,7 +128,7 @@ |
|
|
|
FROM dc_warning as warning |
|
|
|
LEFT JOIN dc_stake_mark AS mark ON warning.stake_mark=mark.stake_mark |
|
|
|
WHERE YEAR(warning.create_time) =DATE_FORMAT(#{createTime},'%Y') |
|
|
|
AND warning.direction=#{direction} |
|
|
|
AND warning.direction=#{direction} and mark.direction=#{direction} |
|
|
|
and mark.`section_id`=#{sectionId} |
|
|
|
GROUP BY QUARTER, MONTH |
|
|
|
ORDER BY QUARTER, MONTH; |
|
|
@ -135,7 +138,7 @@ |
|
|
|
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=mark.stake_mark |
|
|
|
where mark.`section_id`=#{sectionId} AND warning.direction=#{direction} |
|
|
|
where mark.`section_id`=#{sectionId} AND warning.direction=#{direction} and mark.direction=#{direction} |
|
|
|
and DATE_FORMAT(warning.create_time,'%Y')=DATE_FORMAT(#{createTime},'%Y') |
|
|
|
GROUP BY month |
|
|
|
</select> |
|
|
@ -143,7 +146,7 @@ |
|
|
|
SELECT COUNT(*) AS number FROM dc_warning as warning |
|
|
|
LEFT JOIN dc_stake_mark as mark on warning.stake_mark=mark.stake_mark |
|
|
|
where DATE_FORMAT(warning.create_time,'%Y-%m-%d')=DATE_FORMAT(#{createTime},'%Y-%m-%d') |
|
|
|
AND warning.direction=#{direction} |
|
|
|
AND warning.direction=#{direction} and mark.direction=#{direction} |
|
|
|
and mark.`section_id`=#{sectionId} |
|
|
|
</select> |
|
|
|
<select id="selectWarningSectionTypeDay" resultType="java.util.HashMap"> |
|
|
@ -152,7 +155,7 @@ |
|
|
|
FROM dc_warning as warning |
|
|
|
LEFT JOIN dc_stake_mark as mark on warning.stake_mark=mark.stake_mark |
|
|
|
where DATE_FORMAT(warning.create_time,'%Y-%m-%d')=DATE_FORMAT(#{createTime},'%Y-%m-%d') |
|
|
|
AND warning.direction=#{direction} |
|
|
|
AND warning.direction=#{direction} and mark.direction=#{direction} |
|
|
|
and mark.`section_id`=#{sectionId} |
|
|
|
GROUP BY warning_type |
|
|
|
ORDER BY number DESC |
|
|
@ -161,7 +164,7 @@ |
|
|
|
SELECT COUNT(*) AS number FROM dc_warning as warning |
|
|
|
LEFT JOIN dc_stake_mark as mark on warning.stake_mark=mark.stake_mark |
|
|
|
where DATE_FORMAT(warning.create_time,'%Y-%m') =DATE_FORMAT(#{createTime},'%Y-%m') |
|
|
|
AND warning.direction=#{direction} |
|
|
|
AND warning.direction=#{direction} and mark.direction=#{direction} |
|
|
|
and mark.`section_id`=#{sectionId} |
|
|
|
</select> |
|
|
|
<select id="selectWarningSectionTypeMonth" resultType="java.util.HashMap"> |
|
|
@ -169,7 +172,7 @@ |
|
|
|
FROM dc_warning as warning |
|
|
|
LEFT JOIN dc_stake_mark as mark on warning.stake_mark=mark.stake_mark |
|
|
|
where DATE_FORMAT(warning.create_time,'%Y-%m') =DATE_FORMAT(#{createTime},'%Y-%m') |
|
|
|
AND warning.direction=#{direction} |
|
|
|
AND warning.direction=#{direction} and mark.direction=#{direction} |
|
|
|
and mark.`section_id`=#{sectionId} |
|
|
|
GROUP BY warning_type |
|
|
|
ORDER BY number DESC |
|
|
@ -180,7 +183,7 @@ |
|
|
|
FROM dc_warning as warning |
|
|
|
LEFT JOIN dc_stake_mark AS mark ON warning.stake_mark=mark.stake_mark |
|
|
|
WHERE YEAR(warning.create_time) =DATE_FORMAT(#{createTime},'%Y') |
|
|
|
AND warning.direction=#{direction} |
|
|
|
AND warning.direction=#{direction} and mark.direction=#{direction} |
|
|
|
and mark.`section_id`=#{sectionId} |
|
|
|
</select> |
|
|
|
<select id="selectWarningSectionTypeQuarter" resultType="java.util.HashMap"> |
|
|
@ -196,7 +199,7 @@ |
|
|
|
FROM dc_warning as warning |
|
|
|
LEFT JOIN dc_stake_mark AS mark ON warning.stake_mark=mark.stake_mark |
|
|
|
WHERE YEAR(warning.create_time) =DATE_FORMAT(#{createTime},'%Y') |
|
|
|
AND warning.direction=#{direction} |
|
|
|
AND warning.direction=#{direction} and mark.direction=#{direction} |
|
|
|
and mark.`section_id`=#{sectionId} |
|
|
|
GROUP BY QUARTER, warningType |
|
|
|
ORDER BY QUARTER; |
|
|
@ -204,7 +207,7 @@ |
|
|
|
<select id="selectWarningSectionTypeYearCount" resultType="java.lang.String"> |
|
|
|
SELECT COUNT(*) AS number FROM dc_warning as warning |
|
|
|
LEFT JOIN dc_stake_mark AS mark ON warning.stake_mark=mark.stake_mark |
|
|
|
where mark.`section_id`=#{sectionId} AND warning.direction=#{direction} |
|
|
|
where mark.`section_id`=#{sectionId} AND warning.direction=#{direction} and mark.direction=#{direction} |
|
|
|
and DATE_FORMAT(warning.create_time,'%Y')=DATE_FORMAT(#{createTime},'%Y') |
|
|
|
|
|
|
|
</select> |
|
|
@ -212,7 +215,7 @@ |
|
|
|
SELECT 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 mark.`section_id`=#{sectionId} AND warning.direction=#{direction} |
|
|
|
where mark.`section_id`=#{sectionId} AND warning.direction=#{direction} and mark.direction=#{direction} |
|
|
|
and DATE_FORMAT(warning.create_time,'%Y')=DATE_FORMAT(#{createTime},'%Y') |
|
|
|
GROUP BY warningType |
|
|
|
</select> |
|
|
|