Commit cbcd31bb authored by 黄伟铭's avatar 黄伟铭

国产化修改

parent 73675fa9
......@@ -168,11 +168,11 @@
,#{eventType}
,#{eventNumber}
,#{eventTotalTime}
,#{windowStartTime}
,#{windowEndTime}
,TO_TIMESTAMP(#{windowStartTime} ,'YYYY-MM-DD HH24:MI:SS')
,TO_TIMESTAMP(#{windowEndTime} ,'YYYY-MM-DD HH24:MI:SS')
,#{crossId}
,#{dt}
,#{insertTime}
,TO_TIMESTAMP(#{insertTime},'YYYY-MM-DD HH24:MI:SS')
)
</insert>
......@@ -210,91 +210,98 @@
<!-- 新增表t_analysis_problem_cross_day信息 -->
<insert id="insertAnalysisProblemCrossDay">
<!-- 先设置会话级group_conct的最大长度 -->
SET SESSION group_concat_max_len = 1048576;
SET temp_file_limit = '256MB';
insert into t_analysis_problem_cross_day (id,cross_id,area_id,event_category,event_type,event_number,event_total_time,dt,insert_time,
serious_time_span,serious_duration,time_span_list,week_day,year_week)
select UUID(), a.cross_id, b.area_id,a.category,a.type,count(1) as event_number , sum( TIMESTAMPDIFF(SECOND, a.start_time , a.end_time) ) as duration ,
DATE_FORMAT(DATE_SUB(now(),INTERVAL 1 DAY),'%Y%m%d') as dt , now(),
SUBSTRING_INDEX(
GROUP_CONCAT(
select uuid_generate_v4(),
a.cross_id,
b.area_id,
a.category,
a.type,
count(1) as event_number ,
sum( extract(epoch from (a.end_time - a.start_time)) ) as duration ,
CAST(TO_CHAR(DATE_SUB(now(),INTERVAL 1 DAY),'YYYYMMDD') AS INT4) as dt ,
now(),
SPLIT_PART(
STRING_AGG(
CONCAT(
date_format(a.start_time,'%H:%i:%s'),
TO_CHAR(a.start_time,'HH24:MI:SS'),
'~',
CONCAT(date_format(a.end_time,'%H:%i:%s'))
CONCAT(TO_CHAR(a.end_time,'HH24:MI:SS'))
)
ORDER BY TIMESTAMPDIFF( SECOND, a.start_time, a.end_time ) desc
ORDER BY extract(epoch from (a.end_time - a.start_time)) desc
)
,',',1) as serious_time_span,
max(TIMESTAMPDIFF( SECOND, a.start_time, a.end_time )) as serious_duration,
GROUP_CONCAT(CONCAT(
date_format(a.start_time,'%H:%i:%s'),
max(extract(epoch from (a.end_time - a.start_time)) as serious_duration,
STRING_AGG(CONCAT(
TO_CHAR(a.start_time,'HH24:MI:SS'),
'~',
CONCAT(date_format(a.end_time,'%H:%i:%s'))
CONCAT(TO_CHAR(a.end_time,'HH24:MI:SS'))
)
) time_span_list,
(WEEKDAY(start_time)+1) week_day,
concat(year(start_time),'',(week(start_time)+1)) year_week
(EXTRACT(ISODOW FROM start_time)+1) week_day,
concat(TO_CHAR(start_time,'YYYY'),'',(EXTRACT(WEEKS FROM start_time::date)+1)) year_week
from t_event_info a
left join t_base_cross_info b on a.cross_id = b.id
where dt = DATE_FORMAT(DATE_SUB(now(),INTERVAL 1 DAY),'%Y%m%d') and a.type in (701,702,703,707)
where dt = CAST(TO_CHAR(DATE_SUB(now(),INTERVAL 1 DAY),'YYYYMMDD') AS INT4) and a.type in ('701','702','703','707')
group by a.cross_id, b.area_id,a.category,a.type
ON DUPLICATE KEY UPDATE
id=VALUES(id),
cross_id=VALUES(cross_id),
area_id=VALUES(area_id),
event_category=VALUES(event_category),
event_type=VALUES(event_type),
event_number=VALUES(event_number),
event_total_time=VALUES(event_total_time),
window_start_time=VALUES(window_start_time),
window_end_time=VALUES(window_end_time),
dt=VALUES(dt),
insert_time=VALUES(insert_time),
serious_time_span=VALUES(serious_time_span),
serious_duration=VALUES(serious_duration),
time_span_list=VALUES(time_span_list),
week_day=VALUES(week_day),
year_week=VALUES(year_week)
ON CONFLICT (cross_id,event_type,dt)
DO UPDATE SET
id=excluded.id,
area_id=excluded.area_id,
event_category=excluded.event_category,
event_number=excluded.event_number,
event_total_time=excluded.event_total_time,
window_start_time=excluded.window_start_time,
window_end_time=excluded.window_end_time,
insert_time=excluded.insert_time,
serious_time_span=excluded.serious_time_span,
serious_duration=excluded.serious_duration,
time_span_list=excluded.time_span_list,
week_day=excluded.week_day,
year_week=excluded.year_week
</insert>
<!-- 路口缓行数据天统计 -->
<insert id="insertAnalysisCrossSlowRunDay" parameterType="map">
<!-- 先设置会话级group_conct的最大长度 -->
SET SESSION group_concat_max_len = 1048576;
<!--SET SESSION group_concat_max_len = 1048576; -->
SET temp_file_limit = '256MB';
insert into t_analysis_problem_cross_day (id,cross_id,area_id,event_category,event_type,event_number,event_total_time,dt,insert_time,
serious_time_span,serious_duration,time_span_list,week_day,year_week)
select UUID(),
select uuid_generate_v4(),
a.cross_id,
b.area_id,
a.category,
a.type,
count(1) as event_number , sum( TIMESTAMPDIFF(SECOND, a.start_time , a.end_time) ) as duration ,
dt , now(),
SUBSTRING_INDEX(
GROUP_CONCAT(
count(1) as event_number ,
sum( extract(epoch from (a.end_time - a.start_time)) ) as duration ,
dt ,
now(),
SPLIT_PART(
STRING_AGG(
CONCAT(
date_format(a.start_time,'%H:%i:%s'),
TO_CHAR(a.start_time,'HH24:MI:SS'),
'~',
CONCAT(date_format(a.end_time,'%H:%i:%s'))
)
ORDER BY TIMESTAMPDIFF( SECOND, a.start_time, a.end_time ) desc
CONCAT(TO_CHAR(a.end_time,'HH24:MI:SS'))
),
',' ORDER BY extract(epoch from (a.end_time - a.start_time)) desc
)
,',',1) as serious_time_span,
max(TIMESTAMPDIFF( SECOND, a.start_time, a.end_time )) as serious_duration,
GROUP_CONCAT(
CONCAT(
date_format(a.start_time,'%H:%i:%s'),
max( extract(epoch from (a.end_time - a.start_time))) as serious_duration,
STRING_AGG(CONCAT(
TO_CHAR(a.start_time,'HH24:MI:SS'),
'~',
CONCAT(date_format(a.end_time,'%H:%i:%s'))
)
CONCAT(TO_CHAR(a.end_time,'HH24:MI:SS'))
),','
) time_span_list,
(WEEKDAY(start_time)+1) week_day,
concat(year(start_time),'',(week(start_time)+1)) year_week
(EXTRACT(ISODOW FROM start_time)+1) week_day,
concat(TO_CHAR(start_time,'YYYY'),'',(EXTRACT(WEEKS FROM start_time::date)+1)) year_week
from (
<!-- 路口缓行计算 -->
SELECT
......@@ -307,10 +314,10 @@
FROM
t_cross_dir_data_hist
WHERE
dt = #{dt}
AND `status` = 2
dt = CAST(#{dt} AS INT4)
AND status = 2
GROUP BY
cross_id,
cross_id,dt,
start_time
HAVING
count(*)>=2
......@@ -318,60 +325,60 @@
left join t_base_cross_info b on a.cross_id = b.id
group by a.cross_id, b.area_id,a.category,a.type
ON DUPLICATE KEY UPDATE
id=VALUES(id),
cross_id=VALUES(cross_id),
area_id=VALUES(area_id),
event_category=VALUES(event_category),
event_type=VALUES(event_type),
event_number=VALUES(event_number),
event_total_time=VALUES(event_total_time),
window_start_time=VALUES(window_start_time),
window_end_time=VALUES(window_end_time),
dt=VALUES(dt),
insert_time=VALUES(insert_time),
serious_time_span=VALUES(serious_time_span),
serious_duration=VALUES(serious_duration),
time_span_list=VALUES(time_span_list),
week_day=VALUES(week_day),
year_week=VALUES(year_week)
ON CONFLICT (cross_id,event_type,dt)
DO UPDATE SET
id=excluded.id,
area_id=excluded.area_id,
event_category=excluded.event_category,
event_number=excluded.event_number,
event_total_time=excluded.event_total_time,
window_start_time=excluded.window_start_time,
window_end_time=excluded.window_end_time,
insert_time=excluded.insert_time,
serious_time_span=excluded.serious_time_span,
serious_duration=excluded.serious_duration,
time_span_list=excluded.time_span_list,
week_day=excluded.week_day,
year_week=excluded.year_week
</insert>
<!-- 新增表t_analysis_problem_cross_dir_hour信息 -->
<insert id="insertAnalysisProblemCrossHour">
insert into t_analysis_problem_cross_dir_hour (id,cross_id,area_id,event_category,event_type,dir,event_number,event_total_time,window_start_time,window_end_time,dt,insert_time)
select uuid(), d.cross_id, e.area_id,d.category,d.type,d.dir,count(1) as event_number , sum( TIMESTAMPDIFF(SECOND, d.start_time , d.end_time) ) as duration ,
DATE_FORMAT(DATE_SUB(now(),INTERVAL 1 HOUR),'%Y-%m-%d %H:00:00') as dh1, DATE_FORMAT(now(),'%Y-%m-%d %H:00:00') as dh2,
DATE_FORMAT(now(),'%Y%m%d') as dt , now()
select uuid_generate_v4(),
d.cross_id,
e.area_id,
d.category,
d.type,
d.dir,
count(1) as event_number ,
sum( extract(epoch from (d.end_time - d.start_time) ) as duration ,
TO_TIMESTAMP(CAST(DATE_SUB(now(),INTERVAL 1 HOUR) AS VARCHAR),'YYYY-MM-DD HH24:00:00') as dh1,
TO_TIMESTAMP(CAST(now() AS VARCHAR),'YYYY-MM-DD HH24:00:00') as dh2,
CAST(TO_CHAR(now(),'YYYYMMDD') AS INT4) as dt ,
now()
from
(select DISTINCT b.cross_id,b.category,b.type,b.start_time,b.end_time, SUBSTRING_INDEX( SUBSTRING_INDEX( b.dir, ',', c.help_topic_id + 1 ), ',', -1 ) AS dir
(select DISTINCT b.cross_id,b.category,b.type,b.start_time,b.end_time, unnest(string_to_array(dir, ',')) AS dir
from
(select a.cross_id,a.category,a.type,a.start_time,a.end_time,SUBSTR(a.dir,2,LENGTH(a.dir)-2) as dir
from t_event_info a
where DATE_FORMAT(a.start_time,'%Y-%m-%d %H:%i:%s') >= DATE_FORMAT(DATE_SUB(now(),INTERVAL 1 HOUR),'%Y-%m-%d %H:00:00')
and DATE_FORMAT(a.start_time,'%Y-%m-%d %H:%i:%s') <![CDATA[ < ]]> DATE_FORMAT(now(),'%Y-%m-%d %H:00:00')
and a.type in (701,702,703,707)
where a.start_time >= TO_TIMESTAMP(CAST(DATE_SUB(now(),INTERVAL 1 HOUR) AS VARCHAR),'YYYY-MM-DD HH24:00:00')
and a.start_time <![CDATA[ < ]]> TO_TIMESTAMP(CAST(now() AS VARCHAR),'YYYY-MM-DD HH24:00:00')
and a.type in ('701','702','703','707')
and a.dir is not null
and length(a.dir)>2
) b
INNER JOIN mysql.help_topic c ON c.help_topic_id <![CDATA[ < ]]> (
LENGTH( b.dir ) - LENGTH( REPLACE(b.dir,',','') ) + 1
)) d
) d
left join t_base_cross_info e on d.cross_id = e.id
group by d.cross_id, e.area_id,d.category,d.type,d.dir
ON DUPLICATE KEY UPDATE
id=VALUES(id),
cross_id=VALUES(cross_id),
area_id=VALUES(area_id),
event_category=VALUES(event_category),
event_type=VALUES(event_type),
dir=VALUES(dir),
event_number=VALUES(event_number),
event_total_time=VALUES(event_total_time),
window_start_time=VALUES(window_start_time),
window_end_time=VALUES(window_end_time),
dt=VALUES(dt),
insert_time=VALUES(insert_time)
C
id=excluded.id,
area_id=excluded.area_id,
event_category=excluded.event_category,
event_number=excluded.event_number,
event_total_time=excluded.event_total_time,
window_end_time=excluded.window_end_time,
insert_time=excluded.insert_time
;
</insert>
......@@ -382,20 +389,21 @@
<foreach collection="list" item="item" separator=",">
(
#{item.greenId}, #{item.dirCount}, #{item.crossId}, #{item.status}, #{item.dirType},
#{item.inDir}, #{item.outDir}, #{item.name}, #{item.startTime}, #{item.endTime}
#{item.inDir}, #{item.outDir}, #{item.name}, TO_TIMESTAMP(#{item.startTime},'YYYY-MM-DD HH24:MI:SS'), TO_TIMESTAMP(#{item.endTime},'YYYY-MM-DD HH24:MI:SS')
)
</foreach>
ON DUPLICATE KEY UPDATE
dir_count = VALUES(dir_count),
in_dir = VALUES(in_dir),
out_dir = VALUES(out_dir),
name = VALUES(name)
ON CONFLICT (cross_id,dir_type,status,start_time)
DO UPDATE SET
dir_count = excluded.dir_count,
in_dir = excluded.in_dir,
out_dir = excluded.out_dir,
name = excluded.name
</insert>
<!-- 根据条件查询表t_analysis_problem_cross_day信息 -->
<select id="checkData" resultMap="AnalysisProblemCrossDayMap">
SELECT dt
FROM t_analysis_problem_cross_day
WHERE dt = DATE_FORMAT(DATE_SUB(now(),INTERVAL 1 DAY),'%Y%m%d')
WHERE dt = CAST(TO_CHAR(DATE_SUB(now(),INTERVAL 1 DAY),'YYYYMMDD') AS INT4)
</select>
<select id="selectCountByType" parameterType="map" resultMap="AnalysisProblemCrossDayMap">
......@@ -407,7 +415,7 @@
WHERE
1 = 1
<if test="startTime != null and endTime != ''">
and dt >= #{startTime} AND dt &lt;= #{endTime}
and dt >= CAST(#{startTime} AS INT4) and dt &lt;= CAST(#{endTime} AS INT4)
</if>
<if test="areaId != null and areaId != ''">
and tapcd.area_id = #{areaId}
......@@ -422,7 +430,7 @@
WHERE
1 = 1
<if test="startTime != null and endTime != ''">
and dt >= #{startTime} AND dt &lt;= #{endTime}
and dt >= CAST(#{startTime} AS INT4) and dt &lt;= CAST(#{endTime} AS INT4)
</if>
<if test="areaId != null and areaId != ''">
and tapcd.area_id = #{areaId}
......@@ -440,7 +448,7 @@
WHERE
1 = 1
<if test="startTime != null and endTime != ''">
and dt >= #{startTime} AND dt &lt;= #{endTime}
and dt >= CAST(#{startTime} AS INT4) and dt &lt;= CAST(#{endTime} AS INT4)
</if>
<if test="crossId!=null and crossId!=''">
and tapcd.cross_id = #{crossId}
......@@ -460,7 +468,7 @@
WHERE
1 = 1
<if test="startTime != null and endTime != ''">
and dt >= #{startTime} AND dt &lt;= #{endTime}
and dt >= CAST(#{startTime} AS INT4) and dt &lt;= CAST(#{endTime} AS INT4)
</if>
<if test="crossId != null and crossId != ''">
and t1.cross_id = #{crossId}
......@@ -486,7 +494,7 @@
<if test="greenId !=null and greenId !=''">
and t.green_id = #{greenId}
</if>
and t.dt >= date_format(#{startTime},'%Y%m%d') and t.dt &lt;= date_format(#{endTime},'%Y%m%d')
and t.dt >= CAST(TO_CHAR(#{startTime},'YYYYMMDD') AS INT4) and t.dt &lt;= CAST(TO_CHAR(#{endTime},'YYYYMMDD') AS INT4)
group by status
</select>
<select id="getTrunkLineCrossProblemByDay" resultType="net.wanji.opt.vo2.GreenwaveCrossResultDTO">
......@@ -499,12 +507,12 @@
b.out_dir,
c.name,
b.green_id,
DATE_SUB(CURDATE(), INTERVAL 1 DAY) as startTime,
DATE_SUB(CURDATE(), INTERVAL 1 SECOND) as endTime
DATE_SUB(CURDATE_DATE, INTERVAL 1 DAY) as startTime,
DATE_SUB(CURDATE_DATE, INTERVAL 1 SECOND) as endTime
FROM
( SELECT count(*) AS dir_count, cross_id, dir_type, status FROM t_cross_dir_data_hist
WHERE
start_time BETWEEN DATE_SUB(CURDATE(), INTERVAL 1 DAY) AND DATE_SUB(CURDATE(), INTERVAL 1 SECOND)
start_time BETWEEN DATE_SUB(CURDATE_DATE, INTERVAL 1 DAY) AND DATE_SUB(CURDATE_DATE, INTERVAL 1 SECOND)
GROUP BY cross_id, dir_type, status ) a
LEFT JOIN t_greenwave_cross b ON a.cross_id = b.cross_id
LEFT JOIN t_base_cross_info c ON a.cross_id = c.id
......@@ -522,24 +530,25 @@
b.in_dir,
b.out_dir,
c.name,
#{startTime} as startTime,
#{endTime} as endTime
TO_TIMESTAMP(#{startTime},'YYYY-MM-DD HH24:MI:SS') as startTime,
TO_TIMESTAMP(#{endTime},'YYYY-MM-DD HH24:MI:SS') as endTime
FROM
(
SELECT count(*) AS dir_count, cross_id, dir_type, status
FROM t_cross_dir_data_hist
WHERE
start_time BETWEEN #{startTime} AND #{endTime}
start_time BETWEEN TO_TIMESTAMP(#{startTime},'YYYY-MM-DD HH24:MI:SS') AND TO_TIMESTAMP(#{endTime},'YYYY-MM-DD HH24:MI:SS')
GROUP BY cross_id, dir_type, status
) a
LEFT JOIN t_greenwave_cross b ON a.cross_id = b.cross_id
LEFT JOIN t_base_cross_info c ON a.cross_id = c.id
where ( b.in_dir = a.dir_type OR b.out_dir = a.dir_type )
ON DUPLICATE KEY UPDATE
dir_count = VALUES(dir_count),
in_dir = VALUES(in_dir),
out_dir = VALUES(out_dir),
name = VALUES(name)
ON CONFLICT (cross_id,dir_type,status,start_time)
DO UPDATE SET
dir_count = excluded.dir_count,
in_dir = excluded.in_dir,
out_dir = excluded.out_dir,
name = excluded.name
</insert>
</mapper>
......@@ -185,7 +185,7 @@
WHERE
1=1
<if test="startTime != null and endTime != ''">
and dt >= #{startTime} AND dt &lt;= #{endTime}
and dt >= CAST(#{startTime} AS INT4) and dt &lt;= CAST(#{endTime} AS INT4)
</if>
<if test="crossId != null and crossId != ''">
and t1.cross_id = #{crossId}
......@@ -202,8 +202,8 @@
dir,
t1.cross_id,
sum(event_number)AS event_number ,
DATE_FORMAT(t1.window_start_time,'%H:%i') AS hours_window_start_time ,
DATE_FORMAT(t1.window_start_time, '%Y-%m-%d %H:%i:%s') AS winStartTime,
TO_CHAR(t1.window_start_time,'HH24:MI') AS hours_window_start_time ,
TO_CHAR(t1.window_start_time, 'YYYY-MM-DD HH24:MI:SS') AS winStartTime,
t1.event_type,
t2.label AS typeName
FROM t_analysis_problem_cross_dir_hour t1
......@@ -220,7 +220,7 @@
and t1.event_type = #{eventType}
</if>
GROUP BY
DATE_FORMAT(t1.window_start_time,'%H:%i')
TO_CHAR(t1.window_start_time,'HH24:MI')
ORDER BY event_number desc
limit 1
</select>
......@@ -231,7 +231,7 @@
dir,
t1.cross_id,
sum(event_number)AS event_number ,
DATE_FORMAT(t1.window_start_time,'%H:%i') AS hours_window_start_time,
TO_CHAR(t1.window_start_time,'HH24:MI') AS hours_window_start_time,
t1.event_type,
t2.label AS typeName
FROM t_analysis_problem_cross_dir_hour t1
......@@ -239,7 +239,7 @@
WHERE
1=1
<if test="startTime != null and endTime != ''">
and dt >= #{startTime} AND dt &lt;= #{endTime}
and dt >= CAST(#{startTime} AS INT4) and dt &lt;= CAST(#{endTime} AS INT4)
</if>
<if test="crossId != null and crossId != ''">
and t1.cross_id = #{crossId}
......@@ -301,7 +301,7 @@
and t1.cross_id = #{nextCrossid}
</if>
<if test="startTimeAll != null and endTimeALL !=null ">
and start_time >= #{startTimeAll} AND start_time &lt;= #{endTimeALL}
and start_time >= TO_TIMESTAMP(#{startTimeAll},'YYYY-MM-DD HH24:MI:SS') AND start_time &lt;= TO_TIMESTAMP(#{endTimeALL},'YYYY-MM-DD HH24:MI:SS')
</if>
</select>
<select id="getCrossTurnInfo" parameterType="map" resultType="CrossTurnInfo">
......@@ -326,7 +326,7 @@
and b.cross_id = #{crossId}
</if>
<if test="startTimeAll!=null and endTimeALL!=null ">
AND b.start_time >= #{startTimeAll} and b.start_time &lt;= #{endTimeALL}
AND b.start_time >= TO_TIMESTAMP(#{startTimeAll},'YYYY-MM-DD HH24:MI:SS') AND b.start_time &lt;= TO_TIMESTAMP(#{endTimeALL},'YYYY-MM-DD HH24:MI:SS')
</if>
AND (in_dir,turn_type) in (
<foreach collection="crossTurnInfo" item="pair" open="(" separator="),(" close=")">
......@@ -341,7 +341,7 @@
VALUES
<foreach collection="crossHourOverFlowList" item="item" separator=",">
(#{item.crossId},#{item.overflowDir},#{item.outFlowSum},#{item.outFlowAvg},#{item.nextCrossLaneNum},#{item.nextCrossCapacity},
#{item.lengthToNextCross}, #{item.overflowStartTime}, #{item.overflowEndTime}, #{item.overflowNum}, #{item.dt})
#{item.lengthToNextCross}, TO_TIMESTAMP(#{item.overflowStartTime},'YYYY-MM-DD HH24:MI:SS'), TO_TIMESTAMP(#{item.overflowEndTime},'YYYY-MM-DD HH24:MI:SS'), #{item.overflowNum}, #{item.dt})
</foreach>
</select>
......
......@@ -167,61 +167,55 @@
<!-- 新增表t_analysis_problem_green_day信息 -->
<insert id="insertAnalysisProblemGreenDay">
insert into t_analysis_problem_green_day (id,green_id,area_id,event_category,event_type,event_number,event_total_time,dt,insert_time)
select UUID(), a.green_id, b.area_id,a.category,a.type,count(1) as event_number , sum( TIMESTAMPDIFF(SECOND, a.start_time , a.end_time) ) as duration ,
select uuid_generate_v4(), a.green_id, b.area_id,a.category,a.type,count(1) as event_number ,
sum( extract(epoch from (a.end_time - a.start_time)) ) as duration ,
dt , now()
from t_event_info a
left join t_greenwave_info b on a.green_id = b.id
where dt = DATE_FORMAT(DATE_SUB(now(),INTERVAL 1 DAY),'%Y%m%d') and a.type in (705,706) and a.green_id != ''
where dt = CAST(TO_CHAR(DATE_SUB(now(),INTERVAL 1 DAY),'YYYYMMDD') AS INT4) and a.type in ('705','706') and a.green_id != ''
group by a.green_id, b.area_id,a.category,a.type
ON DUPLICATE KEY UPDATE
id=VALUES(id),
green_id=VALUES(green_id),
area_id=VALUES(area_id),
event_category=VALUES(event_category),
event_type=VALUES(event_type),
event_number=VALUES(event_number),
event_total_time=VALUES(event_total_time),
window_start_time=VALUES(window_start_time),
window_end_time=VALUES(window_end_time),
dt=VALUES(dt),
insert_time=VALUES(insert_time)
ON CONFLICT (green_id,event_type,dt)
DO UPDATE SET
id=excluded.id,
area_id=excluded.area_id,
event_category=excluded.event_category,
event_number=excluded.event_number,
event_total_time=excluded.event_total_time,
window_start_time=excluded.window_start_time,
window_end_time=excluded.window_end_time,
insert_time=excluded.insert_time
</insert>
<!-- 新增表t_analysis_problem_green_hour信息 -->
<insert id="insertAnalysisProblemGreenHour">
insert into t_analysis_problem_green_hour (id,green_id,area_id,event_category,event_type,dir,event_number,event_total_time,window_start_time,window_end_time,dt,insert_time)
select uuid(), d.green_id, e.area_id,d.category,d.type,d.dir,count(1) as event_number , sum( TIMESTAMPDIFF(SECOND, d.start_time , d.end_time) ) as duration ,
DATE_FORMAT(DATE_SUB(now(),INTERVAL 1 HOUR),'%Y-%m-%d %H:00:00') as dh1, DATE_FORMAT(now(),'%Y-%m-%d %H:00:00') as dh2,
DATE_FORMAT(now(),'%Y%m%d') as dt , now()
select uuid_generate_v4(), d.green_id, e.area_id,d.category,d.type,d.dir,count(1) as event_number , sum( TIMESTAMPDIFF(SECOND, d.start_time , d.end_time) ) as duration ,
DATE_FORMAT(DATE_SUB(now(),INTERVAL 1 HOUR),'YYYY-MM-DD HH24:00:00') as dh1, DATE_FORMAT(now(),'YYYY-MM-DD HH24:00:00') as dh2,
DATE_FORMAT(now(),'YYYYMMDD') as dt , now()
from
(select DISTINCT b.green_id,b.category,b.type,b.start_time,b.end_time, SUBSTRING_INDEX( SUBSTRING_INDEX( b.dir, ',', c.help_topic_id + 1 ), ',', -1 ) AS dir
(select DISTINCT b.green_id,b.category,b.type,b.start_time,b.end_time, unnest(string_to_array(dir, ',')) AS dir
from
(select a.green_id,a.category,a.type,a.start_time,a.end_time,SUBSTR(a.dir,2,LENGTH(a.dir)-2) as dir
from t_event_info a
where DATE_FORMAT(a.start_time,'%Y-%m-%d %H:%i:%s') >= DATE_FORMAT(DATE_SUB(now(),INTERVAL 1 HOUR),'%Y-%m-%d %H:00:00')
and DATE_FORMAT(a.start_time,'%Y-%m-%d %H:%i:%s') <![CDATA[ < ]]> DATE_FORMAT(now(),'%Y-%m-%d %H:00:00')
and a.type in (705,706) and a.green_id != ''
where a.start_time >= TO_TIMESTAMP(CAST(DATE_SUB(now(),INTERVAL 1 HOUR) AS VARCHAR),'YYYY-MM-DD HH24:00:00')
and a.start_time <![CDATA[ < ]]> TO_TIMESTAMP(CAST(now() AS VARCHAR),'YYYY-MM-DD HH24:00:00')
and a.type in ('705','706') and a.green_id != ''
and a.dir is not null
and length(a.dir)>2
) b
INNER JOIN mysql.help_topic c ON c.help_topic_id <![CDATA[ < ]]> (
LENGTH( b.dir ) - LENGTH( REPLACE(b.dir,',','') ) + 1
)) d
) d
left join t_greenwave_info e on d.green_id = e.id
group by d.green_id, e.area_id,d.category,d.type,d.dir
ON DUPLICATE KEY UPDATE
id=VALUES(id),
green_id=VALUES(green_id),
area_id=VALUES(area_id),
event_category=VALUES(event_category),
event_type=VALUES(event_type),
dir=VALUES(dir),
event_number=VALUES(event_number),
event_total_time=VALUES(event_total_time),
window_start_time=VALUES(window_start_time),
window_end_time=VALUES(window_end_time),
dt=VALUES(dt),
insert_time=VALUES(insert_time)
ON CONFLICT (dir,green_id,dt,event_type,window_start_time)
DO UPDATE SET
id=excluded.id,
area_id=excluded.area_id,
event_category=excluded.event_category,
dir=excluded.dir,
event_number=excluded.event_number,
event_total_time=excluded.event_total_time,
window_end_time=excluded.window_end_time,
insert_time=excluded.insert_time
;
</insert>
......@@ -229,7 +223,7 @@
<select id="checkData" resultMap="AnalysisProblemGreenDayMap">
SELECT dt
FROM t_analysis_problem_green_day
WHERE dt = DATE_FORMAT(DATE_SUB(now(),INTERVAL 1 DAY),'%Y%m%d')
WHERE dt = cast(to_char(DATE_SUB(now(),INTERVAL 1 DAY),'YYYYMMDD') as int4)
</select>
<select id="getListGreenByProblemSum" parameterType="map" resultMap="AnalysisProblemGreenDayMap">
......@@ -244,7 +238,7 @@
1=1
<if test="startTime!=null and endTime!=''">
<![CDATA[
AND dt>=#{startTime} AND dt<=#{endTime}
AND dt >= CAST(#{startTime} AS INT4) and dt &lt;= CAST(#{endTime} AS INT4)
]]>
</if>
<if test="greenId!=null and greenId!=''">
......@@ -266,7 +260,7 @@
WHERE
1 = 1
<if test="startTime != null and endTime != ''">
and dt >= #{startTime} AND dt &lt;= #{endTime}
and dt >= CAST(#{startTime} AS INT4) and dt &lt;= CAST(#{endTime} AS INT4)
</if>
<if test="greenId != null and greenId != ''">
and t1.green_id = #{greenId}
......
......@@ -165,12 +165,12 @@
,#{eventType}
,#{eventNumber}
,#{eventTotalTime}
,#{windowStartTime}
,#{windowEndTime}
,to_timestamp(#{windowStartTime},'YYYY-MM-DD HH24:MI:SS')
,to_timestamp(#{windowEndTime},'YYYY-MM-DD HH24:MI:SS')
,#{greenId}
,#{dir}
,#{dt}
,#{insertTime}
,o_timestamp(#{insertTime},'YYYY-MM-DD HH24:MI:SS')
)
</insert>
......@@ -178,7 +178,7 @@
SELECT
t1.green_id,
t2.cross_id,
t3.`name` as crossname,
t3.name as crossname,
t2.event_type,
t4.label typeName,
dt,
......@@ -191,7 +191,7 @@
WHERE
1=1
<if test="startTime!=null and endTime!=''">
AND dt>= #{startTime} and dt &lt;= #{endTime}
AND dt >= CAST(#{startTime} AS INT4) and dt &lt;= CAST(#{endTime} AS INT4)
</if>
<if test="greenId!=null and greenId!=''">
AND t1.green_id= #{greenId}
......@@ -207,7 +207,7 @@
dt,
dir,
sum(event_number)AS event_number ,
DATE_FORMAT(t1.window_start_time,'%H:%i') AS hours_window_start_time ,
to_char(t1.window_start_time,'HH24:MI') AS hours_window_start_time ,
t1.event_type,
t2.label AS typeName
FROM t_analysis_problem_green_hour t1
......@@ -245,7 +245,7 @@
WHERE
1=1
<if test="startTime!=null and endTime!=''">
AND dt>= #{startTime} and dt &lt;= #{endTime}
AND dt >= CAST(#{startTime} AS INT4) and dt &lt;= CAST(#{endTime} AS INT4)
</if>
<if test="greenId!=null and greenId!=''">
AND t1.green_id= #{greenId}
......@@ -275,7 +275,7 @@
WHERE
1=1
<if test="startTime!=null and endTime!=null">
AND dt>= #{startTime} and dt &lt;= #{endTime}
AND dt >= CAST(#{startTime} AS INT4) and dt &lt;= CAST(#{endTime} AS INT4)
</if>
GROUP BY
cross_id,
......
......@@ -6,11 +6,11 @@
</select>
<select id="getSpecialDate" resultType="java.util.Map">
SELECT DATE_FORMAT(special_date, '%Y-%m-%d %H:%i:%s') AS special_date, plan_id
SELECT to_char(special_date, 'YYYY-MM-DD HH24:MI:SS') AS special_date, plan_id
FROM t_base_cross_schedules_plan
WHERE cross_id = #{crossId}
<if test="endTime != null and endTime != '' and startTime != null and startTime !='' ">
and special_date between #{startTime} and #{endTime}
and special_date between to_timestamp(#{startTime}, 'YYYY-MM-DD HH24:MI:SS') and to_timestamp(#{endTime}, 'YYYY-MM-DD HH24:MI:SS')
</if>
AND week = 0
</select>
......
......@@ -256,9 +256,9 @@
,#{travelTime}
,#{speed}
,#{yearWeek}
,#{weekStartTime}
,#{weekEndTime}
,#{insertTime}
,to_timestamp(#{weekStartTime}, 'YYYY-MM-DD HH24:MI:SS')
,to_timestamp(#{weekEndTime}, 'YYYY-MM-DD HH24:MI:SS')
,to_timestamp(#{insertTime}, 'YYYY-MM-DD HH24:MI:SS')
,#{congestIndex}
,#{lastWeekCongestIndex},#{lastWeekCapacity},#{lastWeekStopTimes},#{lastWeekDelayTime},#{lastWeekTravelTime},#{lastWeekSpeed}
)
......@@ -297,8 +297,8 @@
#{entity.greenId}
,#{entity.roadDirection}
,#{entity.weekDay}
,#{entity.optimizeStartTime}
,#{entity.optimizeEndTime}
,to_timestamp(#{entity.optimizeStartTime}, 'YYYY-MM-DD HH24:MI:SS')
,to_timestamp(#{entity.optimizeEndTime}, 'YYYY-MM-DD HH24:MI:SS')
,#{entity.stragetyId}
,#{entity.optimizeCount}
,#{entity.optimizeDuration}
......@@ -308,9 +308,9 @@
,#{entity.travelTime}
,#{entity.speed}
,#{entity.yearWeek}
,#{entity.weekStartTime}
,to_timestamp(#{entity.weekStartTime}, 'YYYY-MM-DD HH24:MI:SS')
,#{entity.weekEndTime}
,#{entity.insertTime}
,to_timestamp(#{entity.insertTime}, 'YYYY-MM-DD HH24:MI:SS')
,#{entity.congestIndex}
,#{entity.lastWeekCongestIndex}
,#{entity.lastWeekCapacity}
......@@ -320,32 +320,29 @@
,#{entity.lastWeekSpeed}
)
</foreach>
ON DUPLICATE KEY UPDATE
green_id = VALUES(green_id),
road_direction = VALUES(road_direction),
week_day = VALUES(week_day),
optimize_start_time = VALUES(optimize_start_time),
optimize_end_time = VALUES(optimize_end_time),
stragety_id = VALUES(stragety_id),
optimize_count = VALUES(optimize_count),
optimize_duration = VALUES(optimize_duration),
capacity = VALUES(capacity),
stop_times = VALUES(stop_times),
delay_time = VALUES(delay_time),
delay_time = VALUES(delay_time),
travel_time = VALUES(travel_time),
speed = VALUES(speed),
year_week = VALUES(year_week),
week_start_time = VALUES(week_start_time),
week_end_time = VALUES(week_end_time),
insert_time = VALUES(insert_time),
congest_index = VALUES(congest_index),
last_week_congest_index = VALUES(last_week_congest_index),
last_week_capacity = VALUES(last_week_capacity),
last_week_stop_times = VALUES(last_week_stop_times),
last_week_delay_time = VALUES(last_week_delay_time),
last_week_travel_time = VALUES(last_week_travel_time),
last_week_speed = VALUES(last_week_speed)
ON CONFLICT (year_week,green_id,road_direction,week_day,optimize_start_time)
DO UPDATE SET
optimize_end_time = excluded.optimize_end_time,
stragety_id = excluded.stragety_id,
optimize_count = excluded.optimize_count,
optimize_duration = excluded.optimize_duration,
capacity = excluded.capacity,
stop_times = excluded.stop_times,
delay_time = excluded.delay_time,
delay_time = excluded.delay_time,
travel_time = excluded.travel_time,
speed = excluded.speed,
year_week = excluded.year_week,
week_start_time = excluded.week_start_time,
week_end_time = excluded.week_end_time,
insert_time = excluded.insert_time,
congest_index = excluded.congest_index,
last_week_congest_index = excluded.last_week_congest_index,
last_week_capacity = excluded.last_week_capacity,
last_week_stop_times = excluded.last_week_stop_times,
last_week_delay_time = excluded.last_week_delay_time,
last_week_travel_time = excluded.last_week_travel_time,
last_week_speed = excluded.last_week_speed
</insert>
......
......@@ -37,7 +37,7 @@
from t_analysis_green_wave_congest_time_span
where
year_week=#{yearWeek} and green_id=#{greenId}
and congest_start_time > #{peakStartTime} and congest_end_time &lt; #{peakEndTime}
and congest_start_time > to_timestamp(#{peakStartTime},'YYYY-MM-DD HH24:00:00') and congest_end_time &lt; to_timestamp(#{peakEndTime},'YYYY-MM-DD HH24:00:00')
<!-- and status=3 -->
</select>
......@@ -51,8 +51,8 @@
#{greenId}
,#{roadDirection}
,#{weekDay}
,#{peakStartTime}
,#{peakEndTime}
,to_timestamp(#{peakStartTime},'YYYY-MM-DD HH24:00:00')
,to_timestamp(#{peakEndTime},'YYYY-MM-DD HH24:00:00')
,#{trafficIndex}
,#{status}
,#{travelTime}
......@@ -60,9 +60,9 @@
,#{flow}
,#{peakType}
,#{yearWeek}
,#{weekStartTime}
,#{weekEndTime}
,#{insertTime}
,to_timestamp(#{weekStartTime} ,'YYYY-MM-DD HH24:00:00')
,to_timestamp(#{weekEndTime},'YYYY-MM-DD HH24:00:00')
,to_timestamp(#{insertTime},'YYYY-MM-DD HH24:00:00')
)
</insert>
......
......@@ -240,8 +240,8 @@
) VALUES (
#{crossId}
,#{weekDay}
,#{optimizeStartTime}
,#{optimizeEndTime}
,to_timestamp(#{optimizeStartTime},'YYYY-MM-DD HH24:00:00')
,to_timestamp(#{optimizeEndTime},'YYYY-MM-DD HH24:00:00')
,#{stragetyId}
,#{optimizeCount}
,#{optimizeDuration}
......@@ -250,9 +250,9 @@
,#{delayTime}
,#{maxQueueLength}
,#{yearWeek}
,#{weekStartTime}
,#{weekEndTime}
,#{insertTime}
,to_timestamp(#{weekStartTime},'YYYY-MM-DD HH24:00:00')
,to_timestamp(#{weekEndTime},'YYYY-MM-DD HH24:00:00')
,to_timestamp(#{insertTime},'YYYY-MM-DD HH24:00:00')
,#{lastWeekCapacity}
,#{lastWeekStopTimes}
,#{lastWeekDelayTime}
......@@ -296,8 +296,8 @@
(
#{entity.crossId}
,#{entity.weekDay}
,#{entity.optimizeStartTime}
,#{entity.optimizeEndTime}
,to_timestamp(#{entity.optimizeStartTime},'YYYY-MM-DD HH24:00:00')
,to_timestamp(#{entity.optimizeEndTime},'YYYY-MM-DD HH24:00:00')
,#{entity.stragetyId}
,#{entity.optimizeCount}
,#{entity.optimizeDuration}
......@@ -306,9 +306,9 @@
,#{entity.delayTime}
,#{entity.maxQueueLength}
,#{entity.yearWeek}
,#{entity.weekStartTime}
,#{entity.weekEndTime}
,#{entity.insertTime}
,to_timestamp(#{entity.weekStartTime},'YYYY-MM-DD HH24:00:00')
,to_timestamp(#{entity.weekEndTime},'YYYY-MM-DD HH24:00:00')
,to_timestamp(#{entity.insertTime},'YYYY-MM-DD HH24:00:00')
,#{entity.lastWeekCapacity}
,#{entity.lastWeekStopTimes}
,#{entity.lastWeekDelayTime}
......@@ -322,32 +322,28 @@
,#{entity.lastWeekProblemCount}
)
</foreach>
ON DUPLICATE KEY UPDATE
cross_id = VALUES(cross_id),
week_day = VALUES(week_day),
optimize_start_time = VALUES(optimize_start_time),
optimize_end_time = VALUES(optimize_end_time),
stragety_id = VALUES(stragety_id),
optimize_count = VALUES(optimize_count),
optimize_duration = VALUES(optimize_duration),
capacity = VALUES(capacity),
stop_times = VALUES(stop_times),
delay_time = VALUES(delay_time),
max_queue_length = VALUES(max_queue_length),
year_week = VALUES(year_week),
week_start_time = VALUES(week_start_time),
week_end_time = VALUES(week_end_time),
insert_time = VALUES(insert_time),
last_week_capacity = VALUES(last_week_capacity),
last_week_stop_times = VALUES(last_week_stop_times),
last_week_delay_time = VALUES(last_week_delay_time),
last_week_max_queue_length = VALUES(last_week_max_queue_length),
last_week_speed = VALUES(last_week_speed),
last_week_congest_index = VALUES(last_week_congest_index),
dirs = VALUES(dirs),
problem_count = VALUES(problem_count),
last_week_optimize_count = VALUES(last_week_optimize_count),
last_week_optimize_duration = VALUES(last_week_optimize_duration),
last_week_problem_count = VALUES(last_week_problem_count)
ON CONFLICT (cross_id,year_week,week_day,optimize_start_time,stragety_id)
DO UPDATE SET
optimize_end_time = excluded.optimize_end_time,
optimize_count = excluded.optimize_count,
optimize_duration = excluded.optimize_duration,
capacity = excluded.capacity,
stop_times = excluded.stop_times,
delay_time = excluded.delay_time,
max_queue_length = excluded.max_queue_length,
week_start_time = excluded.week_start_time,
week_end_time = excluded.week_end_time,
insert_time = excluded.insert_time,
last_week_capacity = excluded.last_week_capacity,
last_week_stop_times = excluded.last_week_stop_times,
last_week_delay_time = excluded.last_week_delay_time,
last_week_max_queue_length = excluded.last_week_max_queue_length,
last_week_speed = excluded.last_week_speed,
last_week_congest_index = excluded.last_week_congest_index,
dirs = excluded.dirs,
problem_count = excluded.problem_count,
last_week_optimize_count = excluded.last_week_optimize_count,
last_week_optimize_duration = excluded.last_week_optimize_duration,
last_week_problem_count = excluded.last_week_problem_count
</insert>
</mapper>
......@@ -26,26 +26,27 @@
#{item.maxCongestionPeriod},
#{item.secondCongestionPeriod},
#{item.dayType},
#{item.startTime},
#{item.endTime},
to_timestamp(#{item.startTime},'YYYY-MM-DD HH24:00:00'),
to_timestamp(#{item.endTime},'YYYY-MM-DD HH24:00:00'),
#{item.yearWeek},
#{item.insertTime}
to_timestamp(#{item.insertTime},'YYYY-MM-DD HH24:00:00')
)
</foreach>
ON DUPLICATE KEY UPDATE
congest_index = VALUES(congest_index),
max_congest_index = VALUES(max_congest_index),
congest_count = VALUES(congest_count),
congest_duration = VALUES(congest_duration),
max_congest_duration = VALUES(max_congest_duration),
flow = VALUES(flow),
travel_time = VALUES(travel_time),
speed = VALUES(speed),
max_congestion_period = VALUES(max_congestion_period),
second_congestion_period = VALUES(second_congestion_period),
start_time = VALUES(start_time),
end_time = VALUES(end_time),
insert_time = VALUES(insert_time);
ON CONFLICT (green_id,peak_type,day_type,year_week,road_direction)
DO UPDATE SET
congest_index = excluded.congest_index,
max_congest_index = excluded.max_congest_index,
congest_count = excluded.congest_count,
congest_duration = excluded.congest_duration,
max_congest_duration = excluded.max_congest_duration,
flow = excluded.flow,
travel_time = excluded.travel_time,
speed = excluded.speed,
max_congestion_period = excluded.max_congestion_period,
second_congestion_period = excluded.second_congestion_period,
start_time = excluded.start_time,
end_time = excluded.end_time,
insert_time = excluded.insert_time;
</insert>
<!-- 基本的 CRUD 方法由 MyBatis-Plus 自动生成,无需手动编写 -->
......@@ -54,19 +55,27 @@
select * from t_config_peak_hours;
</select>
<select id="selectGreenWaveWeekDataByTime" resultType="net.wanji.opt.entity.report.GreenWaveWeekData">
SELECT green_id,road_direction,max(traffic_index) max_congest_index,avg(traffic_index) congest_index,sum(status>=3 and status &lt;=4)*60*5 congest_duration,avg(speed) speed,avg(trval_time) travel_time
from t_greenwave_hist where start_time BETWEEN #{startDate} AND #{endDate} AND TIME( start_time ) BETWEEN #{startTime} AND #{endTime} GROUP BY green_id,road_direction
SELECT green_id,road_direction,max(traffic_index) max_congest_index,avg(traffic_index) congest_index,
sum(status>=3 and status &lt;=4)*60*5 congest_duration,avg(speed) speed,avg(trval_time) travel_time
from t_greenwave_hist
where to_timestamp(start_time,'YYYY-MM-DD') BETWEEN to_timestamp(#{startDate},'YYYY-MM-DD') AND to_timestamp(#{endDate},'YYYY-MM-DD')
AND to_timestamp( start_time,'HH24:MI:SS' ) BETWEEN to_timestamp(#{startTime},'HH24:MI:SS' ) AND to_timestamp(#{endTime} ,'HH24:MI:SS' )
GROUP BY green_id,road_direction
</select>
<select id="selectGreenWaveWeekData" resultType="net.wanji.opt.entity.report.GreenWaveWeekData">
SELECT green_id,road_direction,max(traffic_index) max_congest_index,avg(traffic_index) congest_index,sum(status>=3 and status&lt;=4)*60*5 congest_duration,avg(speed) speed,avg(trval_time) travel_time
from t_greenwave_hist where start_time BETWEEN #{startDate} AND #{endDate} GROUP BY green_id,road_direction
SELECT green_id,road_direction,max(traffic_index) max_congest_index,avg(traffic_index) congest_index,
sum(status>=3 and status&lt;=4)*60*5 congest_duration,avg(speed) speed,avg(trval_time) travel_time
from t_greenwave_hist where start_time BETWEEN to_timestamp(#{startDate},'YYYY-MM-DD HH24:MI:SS') AND to_timestamp(#{endDate} ,'YYYY-MM-DD HH24:MI:SS')
GROUP BY green_id,road_direction
</select>
<select id="getFlow" resultType="java.lang.Integer">
SELECT COALESCE(flow, 0) from
(select cross_id from t_greenwave_cross where green_id = #{greenId} and is_key_route = 1 limit 1) cross_data
left join
(SELECT sum(flow) as flow,cross_id from t_cross_dir_data_hist where start_time BETWEEN #{startDate} AND #{endDate} and dir_type = #{dir} GROUP BY cross_id) cross_flow on cross_data.cross_id = cross_flow.cross_id
(SELECT sum(flow) as flow,cross_id from t_cross_dir_data_hist
where start_time BETWEEN to_timestamp(#{startDate},'YYYY-MM-DD HH24:MI:SS') AND to_timestamp(#{endDate} ,'YYYY-MM-DD HH24:MI:SS')
and dir_type = #{dir} GROUP BY cross_id) cross_flow on cross_data.cross_id = cross_flow.cross_id
</select>
<select id="getFlowByTime" resultType="java.lang.Integer">
......@@ -78,7 +87,7 @@
<select id="selectAllByTime" resultType="net.wanji.databus.dao.entity.GreenwaveHistPO">
select * from t_greenwave_hist where start_time BETWEEN #{startDate} AND #{endDate}
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
and TIME( start_time ) BETWEEN #{startTime} AND #{endTime}
and to_timestamp( start_time,'HH24:MI:SS' ) BETWEEN to_timestamp(#{startTime},'HH24:MI:SS' ) AND to_timestamp(#{endTime} ,'HH24:MI:SS' )
</if>
and green_id = #{greenId}
and status >= 3 and status &lt;= 4 and road_direction = #{roadDirection} order by start_time
......
......@@ -115,7 +115,7 @@
DISTINCT
t4.`name` as waveName, t3.`name` as crossName,
t3.id as crossId,
GROUP_CONCAT(t2.daily_plan_details SEPARATOR ', ') AS dailyPlanDetails
STRING_AGG(t2.daily_plan_details , ', ') AS dailyPlanDetails
FROM
t_base_cross_info t3
LEFT JOIN t_strategy_priority_daily_info t2 on t3.id = t2.cross_id
......
......@@ -21,7 +21,7 @@
select
id,event_id,event_desc,type,start_time,end_time,source,wkt,image_url,gmt_create,gmt_modified
from t_event_data
where to_days(#{todayTime}) = to_days(start_time)
where TO_CHAR(#{todayTime},'YYYY-MM-DD') = TO_CHAR(start_time,'YYYY-MM-DD')
order by start_time desc;
</select>
......
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