代码调整

This commit is contained in:
2022-11-10 10:36:08 +08:00
parent 6a3a05d45f
commit 75563a8e24
169 changed files with 1138 additions and 7595 deletions

View File

@@ -2,6 +2,7 @@ package com.njcn.event.mapper.distribution;
import com.njcn.event.pojo.param.UniversalFrontEndParam;
import com.njcn.event.pojo.po.RmpEventDetailPO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@@ -23,4 +24,34 @@ public interface PwRmpEventDetailMapper {
* @date 2022/10/31
*/
List<RmpEventDetailPO> getPwRmpEventDetail(UniversalFrontEndParam param);
/**
* 获取暂态事件明细
*
* @param monitorIds 监测点id
* @param eventType 暂态指标类型
* @param startTime 开始时间
* @param endTime 结束时间
* @return 暂态事件明细
*/
List<RmpEventDetailPO> getDetailsOfTransientEvents(@Param("monitorIds") List<String> monitorIds,
@Param("eventType") List<String> eventType,
@Param("startTime") String startTime,
@Param("endTime") String endTime);
/***
* 与上面的方法区别是日期精确到月 yy-MM
* @author jianghaifei
* @date 2022-10-31 16:27
* @param monitorIds
* @param eventType
* @param startTime
* @param endTime
* @return java.util.List<com.njcn.event.pojo.po.RmpEventDetailPO>
*/
List<RmpEventDetailPO> getDetailsOfTransientEventsByMonth(@Param("monitorIds") List<String> monitorIds,
@Param("eventType") List<String> eventType,
@Param("startTime") String startTime,
@Param("endTime") String endTime);
}

View File

@@ -17,4 +17,70 @@
FROM
r_mp_event_detail
</select>
<select id="getDetailsOfTransientEvents" resultType="com.njcn.event.pojo.po.RmpEventDetailPO">
SELECT
event_id as eventId,
measurement_point_id as measurementPointId,
Event_Type as eventType,
start_time as startTime,
Duration as duration,
feature_amplitude as featureAmplitude,
phase as phase,
event_describe as eventDescribe,
wave_path as wavePath
FROM
r_mp_event_detail
WHERE
measurement_point_id IN
<foreach collection="monitorIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
<if test="eventType != null and eventType.size() >0">
AND Event_Type IN
<foreach collection="eventType" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="startTime != null and startTime != ''">
AND DATE_FORMAT(start_time, '%Y-%m-%d') &gt;= DATE_FORMAT(#{startTime}, '%Y-%m-%d')
</if>
<if test="endTime != null and endTime != ''">
AND DATE_FORMAT(start_time, '%Y-%m-%d') &lt;= DATE_FORMAT(#{endTime}, '%Y-%m-%d')
</if>
</select>
<!-- 获取暂态事件明细 与上面的方法区别是日期精确到月 yy-MM -->
<select id="getDetailsOfTransientEventsByMonth" resultType="com.njcn.event.pojo.po.RmpEventDetailPO">
SELECT
event_id as eventId,
measurement_point_id as measurementPointId,
Event_Type as eventType,
start_time as startTime,
Duration as duration,
feature_amplitude as featureAmplitude,
phase as phase,
event_describe as eventDescribe,
wave_path as wavePath
FROM
r_mp_event_detail
WHERE
measurement_point_id IN
<foreach collection="monitorIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
<if test="eventType != null and eventType.size() >0">
AND Event_Type IN
<foreach collection="eventType" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="startTime != null and startTime != ''">
AND DATE_FORMAT(start_time, '%Y-%m') &gt;= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
AND DATE_FORMAT(start_time, '%Y-%m') &lt;= #{endTime}
</if>
</select>
</mapper>

View File

@@ -30,4 +30,19 @@ public interface RmpEventDetailMapper extends BaseMapper<RmpEventDetailVO> {
@Param("eventType") List<String> eventType,
@Param("startTime") String startTime,
@Param("endTime") String endTime);
/***
* 与上面的方法区别是日期精确到月 yy-MM
* @author jianghaifei
* @date 2022-10-31 16:27
* @param monitorIds
* @param eventType
* @param startTime
* @param endTime
* @return java.util.List<com.njcn.event.pojo.po.RmpEventDetailPO>
*/
List<RmpEventDetailPO> getDetailsOfTransientEventsByMonth(@Param("monitorIds") List<String> monitorIds,
@Param("eventType") List<String> eventType,
@Param("startTime") String startTime,
@Param("endTime") String endTime);
}

View File

@@ -387,12 +387,24 @@
#{type}
</foreach>
<if test="startTime != null and startTime != ''">
AND DATE_FORMAT(start_time, '%Y-%m-%d') &gt;= DATE_FORMAT(#{startTime}, '%Y-%m-%d')
</if>
<if test="endTime != null and endTime != ''">
AND DATE_FORMAT(start_time, '%Y-%m-%d') &lt;= DATE_FORMAT(#{endTime}, '%Y-%m-%d')
</if>
<choose>
<when test="dateType != null and dateType == 3">
<if test="startTime != null and startTime != ''">
AND DATE_FORMAT(start_time, '%Y-%m') &gt;= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
AND DATE_FORMAT(start_time, '%Y-%m') &lt;= #{endTime}
</if>
</when>
<when test="dateType != null and dateType == 5">
<if test="startTime != null and startTime != ''">
AND DATE_FORMAT(start_time, '%Y-%m-%d') &gt;= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
AND DATE_FORMAT(start_time, '%Y-%m-%d') &lt;= #{endTime}
</if>
</when>
</choose>
)
r
</select>
@@ -426,12 +438,24 @@
#{type}
</foreach>
<if test="startTime != null and startTime != ''">
AND DATE_FORMAT(start_time, '%Y-%m-%d') &gt;= DATE_FORMAT(#{startTime}, '%Y-%m-%d')
</if>
<if test="endTime != null and endTime != ''">
AND DATE_FORMAT(start_time, '%Y-%m-%d') &lt;= DATE_FORMAT(#{endTime}, '%Y-%m-%d')
</if>
<choose>
<when test="dateType != null and dateType == 3">
<if test="startTime != null and startTime != ''">
AND DATE_FORMAT(start_time, '%Y-%m') &gt;= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
AND DATE_FORMAT(start_time, '%Y-%m') &lt;= #{endTime}
</if>
</when>
<when test="dateType != null and dateType == 5">
<if test="startTime != null and startTime != ''">
AND DATE_FORMAT(start_time, '%Y-%m-%d') &gt;= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
AND DATE_FORMAT(start_time, '%Y-%m-%d') &lt;= #{endTime}
</if>
</when>
</choose>
)
r
</select>

View File

@@ -32,4 +32,37 @@
AND DATE_FORMAT(start_time, '%Y-%m-%d') &lt;= DATE_FORMAT(#{endTime}, '%Y-%m-%d')
</if>
</select>
<!-- 获取暂态事件明细 与上面的方法区别是日期精确到月 yy-MM -->
<select id="getDetailsOfTransientEventsByMonth" resultType="com.njcn.event.pojo.po.RmpEventDetailPO">
SELECT
event_id as eventId,
measurement_point_id as measurementPointId,
Event_Type as eventType,
start_time as startTime,
Duration as duration,
feature_amplitude as featureAmplitude,
phase as phase,
event_describe as eventDescribe,
wave_path as wavePath
FROM
r_mp_event_detail
WHERE
measurement_point_id IN
<foreach collection="monitorIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
<if test="eventType != null and eventType.size() >0">
AND Event_Type IN
<foreach collection="eventType" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="startTime != null and startTime != ''">
AND DATE_FORMAT(start_time, '%Y-%m') &gt;= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
AND DATE_FORMAT(start_time, '%Y-%m') &lt;= #{endTime}
</if>
</select>
</mapper>