|
@@ -94,7 +94,8 @@
|
|
|
SELECT /*+ GROUP_OPT_FLAG(1)*/ p.monthsta as monthsta,sum(p.fre) as frequency,p.monthstaString as monthstaString
|
|
|
from
|
|
|
(SELECT /*+ GROUP_OPT_FLAG(1)*/
|
|
|
- DATE_FORMAT(a.alarm_time,'%Y年%m月') as monthstaString,
|
|
|
+ translate(to_char(a.alarm_time, 'yyyy-mm#'),'-#','年月')
|
|
|
+ /*DATE_FORMAT(a.alarm_time,'%Y年%m月')*/ as monthstaString,
|
|
|
MONTH(a.alarm_time) as monthsta,
|
|
|
count(DISTINCT a.alarm_id) as fre
|
|
|
FROM
|
|
@@ -121,7 +122,8 @@
|
|
|
SELECT p.daysta as monthsta,sum(p.fre) as frequency,p.daystaString as monthstaString
|
|
|
from
|
|
|
(SELECT
|
|
|
- DATE_FORMAT(a.alarm_time,'%Y年%m月%d日') as daystaString,
|
|
|
+ translate(to_char(a.alarm_time, 'yyyy-mm-dd#'),'-#','年月日')
|
|
|
+ /*DATE_FORMAT(a.alarm_time,'%Y年%m月%d日')*/ as daystaString,
|
|
|
DAY(a.alarm_time) as daysta,
|
|
|
count(DISTINCT a.alarm_id) as fre
|
|
|
FROM
|
|
@@ -212,10 +214,15 @@
|
|
|
and line_dir = #{lineDir}
|
|
|
</if>
|
|
|
<if test="beginAlarmTime != null and beginAlarmTime != ''">
|
|
|
- and date_format(alarm_time,'%Y-%m-%d %H:%i:%S') >= date_format(#{beginAlarmTime},'%Y-%m-%d %H:%i:%S')
|
|
|
+ and TO_CHAR(alarm_time, 'YYYY-MM-DD HH24:MI:SS') >= TO_CHAR(#{beginAlarmTime}, 'YYYY-MM-DD
|
|
|
+ HH24:MI:SS')
|
|
|
+ -- and date_format(alarm_time,'%Y-%m-%d %H:%i:%S') >= date_format(#{beginAlarmTime},'%Y-%m-%d
|
|
|
+ %H:%i:%S')
|
|
|
</if>
|
|
|
<if test="endAlarmTime != null and endAlarmTime != ''">
|
|
|
- AND date_format(alarm_time,'%Y-%m-%d %H:%i:%S') <= date_format(#{endAlarmTime},'%Y-%m-%d %H:%i:%S')
|
|
|
+ and TO_CHAR(alarm_time, 'YYYY-MM-DD HH24:MI:SS') <= TO_CHAR(#{endAlarmTime}, 'YYYY-MM-DD HH24:MI:SS')
|
|
|
+ -- AND date_format(alarm_time,'%Y-%m-%d %H:%i:%S') <= date_format(#{endAlarmTime},'%Y-%m-%d
|
|
|
+ %H:%i:%S')
|
|
|
</if>
|
|
|
</where>
|
|
|
order by alarm_time desc
|