bug调整

This commit is contained in:
2024-01-18 11:03:38 +08:00
parent d09d4e7533
commit bd08389a05
2 changed files with 58 additions and 44 deletions

View File

@@ -24,33 +24,41 @@
select count(ed.event_id) "count",
ed.measurement_point_id "id"
from r_mp_event_detail ed
where
ed.measurement_point_id in
<foreach collection="lineIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
<if test="startTime != null and startTime != ''">
and date_format(ed.start_time,'%y%m%d') &gt;= date_format(#{startTime},'%y%m%d')
</if>
<if test="endTime != null and endTime != ''">
and date_format(ed.start_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
</if>
<where>
<if test="lineIds != null and lineIds.size()>0" >
ed.measurement_point_id in
<foreach collection="lineIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="startTime != null and startTime != ''">
and date_format(ed.start_time,'%y%m%d') &gt;= date_format(#{startTime},'%y%m%d')
</if>
<if test="endTime != null and endTime != ''">
and date_format(ed.start_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
</if>
</where>
group by ed.measurement_point_id
</select>
<select id="getTimeCount" resultType="java.util.Map">
select
date(ed.start_time) "day", count(*) "count"
from r_mp_event_detail ed where ed.measurement_point_id in
<foreach collection="lineIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
<if test="startTime != null and startTime != ''">
and date_format(ed.start_time,'%y%m%d') &gt;= date_format(#{startTime},'%y%m%d')
</if>
<if test="endTime != null and endTime != ''">
and date_format(ed.start_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
</if>
from r_mp_event_detail ed
<where>
<if test="lineIds != null and lineIds.size()>0" >
ed.measurement_point_id in
<foreach collection="lineIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="startTime != null and startTime != ''">
and date_format(ed.start_time,'%y%m%d') &gt;= date_format(#{startTime},'%y%m%d')
</if>
<if test="endTime != null and endTime != ''">
and date_format(ed.start_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
</if>
</where>
group by day
</select>
@@ -75,17 +83,20 @@
count(ed.event_id) "count"
from r_mp_event_detail ed
left join sys_dict_data sdd on ed.event_type = sdd.id and sdd.code = 'Voltage_Dip'
where
ed.measurement_point_id in
<foreach collection="lineIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
<if test="startTime != null and startTime != ''">
and date_format(ed.start_time,'%y%m%d') &gt;= date_format(#{startTime},'%y%m%d')
</if>
<if test="endTime != null and endTime != ''">
and date_format(ed.start_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
</if>
<where>
<if test="lineIds != null and lineIds.size()>0" >
ed.measurement_point_id in
<foreach collection="lineIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="startTime != null and startTime != ''">
and date_format(ed.start_time,'%y%m%d') &gt;= date_format(#{startTime},'%y%m%d')
</if>
<if test="endTime != null and endTime != ''">
and date_format(ed.start_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
</if>
</where>
</select>
<select id="getMiddleDown" resultType="com.njcn.device.pq.pojo.vo.EventVO">
@@ -98,17 +109,20 @@
ed.duration
from r_mp_event_detail ed
left join pq_line pl on pl.id = ed.measurement_point_id
where
ed.measurement_point_id in
<foreach collection="lineIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
<if test="startTime != null and startTime != ''">
and date_format(ed.start_time,'%y%m%d') &gt;= date_format(#{startTime},'%y%m%d')
</if>
<if test="endTime != null and endTime != ''">
and date_format(ed.start_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
</if>
<where>
<if test="lineIds != null and lineIds.size()>0" >
ed.measurement_point_id in
<foreach collection="lineIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="startTime != null and startTime != ''">
and date_format(ed.start_time,'%y%m%d') &gt;= date_format(#{startTime},'%y%m%d')
</if>
<if test="endTime != null and endTime != ''">
and date_format(ed.start_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
</if>
</where>
order by ed.start_time desc
</select>

View File

@@ -232,7 +232,7 @@ public class LargeScreenServiceImpl implements LargeScreenService {
}
}
// 输出返回结果的Map集合中的每一个键值对
resultMap.entrySet().forEach(System.out::println);
// resultMap.entrySet().forEach(System.out::println);
for (LocalDate s : resultMap.keySet()) {
DownTimeVO downTimeVO = new DownTimeVO();
downTimeVO.setTime(s.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));