|
@@ -24,29 +24,126 @@ import java.util.List;
|
|
|
*/
|
|
|
public interface ProEconShutdownEvent2Mapper extends BaseMapper<ProEconShutdownEvent2> {
|
|
|
|
|
|
- @Update("update pro_econ_shutdown_event2 set start_time=#{start_time},loss_power=#{loss_power},stop_hours=#{stop_hours} where id=#{id}")
|
|
|
- public int updateShutdownevent2(@Param(value = "start_time") Date start_time, @Param(value = "loss_power")Double loss_power,
|
|
|
- @Param(value = "stop_hours")Double stop_hours, @Param(value = "id")String id);
|
|
|
+
|
|
|
+ @Select({"<script>",
|
|
|
+ "SELECT UPPER(t.name),count(*) FROM pro_econ_shutdown_event2 as s,pro_econ_alarm_configuration as a," +
|
|
|
+ "pro_econ_alarm_type as t where s.warning_id=a.id and UPPER(a.components)=UPPER(t.nem_code) " ,
|
|
|
+ "<where>" ,
|
|
|
+
|
|
|
+ "<if test='wpId != null'>",
|
|
|
+ "and a.station_id like #{wpId}",
|
|
|
+ "</if>",
|
|
|
+ "<if test='modelId != null'>",
|
|
|
+ "and a.model_id=#{modelId}",
|
|
|
+ "</if>",
|
|
|
+ "and s.stop_time >= #{begin}",
|
|
|
+ "and s.stop_time <= #{end}",
|
|
|
+
|
|
|
+ "</where>",
|
|
|
+ " GROUP BY t.name ",
|
|
|
+ "</script>"})
|
|
|
+ List<ProEconShutdownEvent2> queryShutdownEvent2ByType(@Param("wpId") String wpId, @Param("modelId") String modelId,@Param("begin")Date begin, @Param("end") Date end);
|
|
|
+
|
|
|
+ @Select({"<script>",
|
|
|
+ "SELECT DATE(stop_time) AS stop_day, count(*) as times,COALESCE(SUM(s.stop_hours), 0) hours FROM pro_econ_shutdown_event2 as s,pro_econ_alarm_configuration as a," +
|
|
|
+ "pro_econ_alarm_type as t where s.warning_id=a.id " ,
|
|
|
+ "<where>" ,
|
|
|
+
|
|
|
+ "<if test='wpId != null'>",
|
|
|
+ "and a.station_id like #{wpId}",
|
|
|
+ "</if>",
|
|
|
+ "<if test='modelId != null'>",
|
|
|
+ "and a.model_id=#{modelId}",
|
|
|
+ "</if>",
|
|
|
+ "and s.stop_time >= #{begin}",
|
|
|
+ "and s.stop_time <= #{end}",
|
|
|
+
|
|
|
+ "</where>",
|
|
|
+ " GROUP BY stop_day ",
|
|
|
+ "</script>"})
|
|
|
+ List<ProEconShutdownEvent2> queryShutdownEvent2ByDay(@Param("wpId") String wpId, @Param("modelId") String modelId,@Param("begin")Date begin, @Param("end") Date end);
|
|
|
+
|
|
|
+
|
|
|
@Select({"<script>",
|
|
|
- "select * from pro_econ_shutdown_event2 " ,
|
|
|
+ "SELECT TO_CHAR(s.stop_time, 'YYYY-MM') AS year_month, count(*) as times,COALESCE(SUM(s.stop_hours), 0) hours FROM pro_econ_shutdown_event2 as s," +
|
|
|
+ "pro_econ_alarm_configuration as a,pro_econ_alarm_type as t " +
|
|
|
+ "where s.warning_id=a.id and s.warning_id is not null " +
|
|
|
+
|
|
|
"<where>" ,
|
|
|
|
|
|
"<if test='wpId != null'>",
|
|
|
- "and winpowerstation_id= #{wpId}",
|
|
|
+ "and a.station_id like #{wpId}",
|
|
|
"</if>",
|
|
|
- "<if test='description != null'>",
|
|
|
- "and fault_view like #{description}",
|
|
|
+ "<if test='modelId != null'>",
|
|
|
+ "and a.model_id=#{modelId}",
|
|
|
+ "</if>",
|
|
|
+ "and s.stop_time >= #{begin}",
|
|
|
+ "and s.stop_time <= #{end}",
|
|
|
+
|
|
|
+ "</where>",
|
|
|
+ " GROUP BY year_month ",
|
|
|
+ "</script>"})
|
|
|
+ List<ProEconShutdownEvent2> queryShutdownEvent2ByMonth(@Param("wpId") String wpId, @Param("modelId") String modelId,@Param("begin")Date begin, @Param("end") Date end);
|
|
|
+
|
|
|
+ @Select({"<script>",
|
|
|
+ "SELECT '机械故障' AS 故障类型 ,count(*) as times,COALESCE(SUM(s.stop_hours), 0) hours FROM pro_econ_shutdown_event2 as s,pro_econ_alarm_configuration as a," +
|
|
|
+ "pro_econ_alarm_type as t where s.warning_id=a.id and UPPER(a.components)=UPPER(t.nem_code) and " +
|
|
|
+ "s.warning_id is not null " ,
|
|
|
+ "<where>" ,
|
|
|
+
|
|
|
+ "<if test='wpId != null'>",
|
|
|
+ "and a.station_id like #{wpId}",
|
|
|
"</if>",
|
|
|
- "<if test='wtId != null'>",
|
|
|
- "and windturbine_id = #{wtId}",
|
|
|
+ "<if test='modelId != null'>",
|
|
|
+ "and a.model_id=#{modelId}",
|
|
|
"</if>",
|
|
|
- "and ts >= #{begin}",
|
|
|
- "and ts <= #{end}",
|
|
|
+ "and s.stop_time >= #{begin}",
|
|
|
+ "and s.stop_time <= #{end}",
|
|
|
+ "and (t.nem_code='YP' or t.nem_code='LG' or t.nem_code='PHXT' or t.nem_code='BJXT' )",
|
|
|
+ "</where>",
|
|
|
|
|
|
+ "</script>"})
|
|
|
+ List<ProEconShutdownEvent2> queryShutdownEvent2ByJX(@Param("wpId") String wpId, @Param("modelId") String modelId,@Param("begin")Date begin, @Param("end") Date end);
|
|
|
+
|
|
|
+ @Select({"<script>",
|
|
|
+ "SELECT '电气故障' AS 故障类型 ,count(*) as times,COALESCE(SUM(s.stop_hours), 0) hours FROM pro_econ_shutdown_event2 as s,pro_econ_alarm_configuration as a," +
|
|
|
+ "pro_econ_alarm_type as t where s.warning_id=a.id and UPPER(a.components)=UPPER(t.nem_code) and " +
|
|
|
+ "s.warning_id is not null " ,
|
|
|
+ "<where>" ,
|
|
|
+
|
|
|
+ "<if test='wpId != null'>",
|
|
|
+ "and a.station_id like #{wpId}",
|
|
|
+ "</if>",
|
|
|
+ "<if test='modelId != null'>",
|
|
|
+ "and a.model_id=#{modelId}",
|
|
|
+ "</if>",
|
|
|
+ "and s.stop_time >= #{begin}",
|
|
|
+ "and s.stop_time <= #{end}",
|
|
|
+ "and (t.nem_code='FDJ' or t.nem_code='BPQ' or t.nem_code='KZXT' )",
|
|
|
"</where>",
|
|
|
- " order by stop_time desc",
|
|
|
+
|
|
|
"</script>"})
|
|
|
- List<ProEconShutdownEvent2> queryShutdownEvent2(@Param("wpId") String wpId, @Param("wtId") String wtId, @Param("description") String description, @Param("begin")Date begin, @Param("end") Date end);
|
|
|
+ List<ProEconShutdownEvent2> queryShutdownEvent2ByDQ(@Param("wpId") String wpId, @Param("modelId") String modelId,@Param("begin")Date begin, @Param("end") Date end);
|
|
|
+
|
|
|
+
|
|
|
+ @Select({"<script>",
|
|
|
+ "SELECT '其它故障' AS 故障类型 ,count(*) as times,COALESCE(SUM(s.stop_hours), 0) hours FROM pro_econ_shutdown_event2 as s,pro_econ_alarm_configuration as a," +
|
|
|
+ "pro_econ_alarm_type as t where s.warning_id=a.id and UPPER(a.components)=UPPER(t.nem_code) and " +
|
|
|
+ "s.warning_id is not null " ,
|
|
|
+ "<where>" ,
|
|
|
|
|
|
+ "<if test='wpId != null'>",
|
|
|
+ "and a.station_id like #{wpId}",
|
|
|
+ "</if>",
|
|
|
+ "<if test='modelId != null'>",
|
|
|
+ "and a.model_id=#{modelId}",
|
|
|
+ "</if>",
|
|
|
+ "and s.stop_time >= #{begin}",
|
|
|
+ "and s.stop_time <= #{end}",
|
|
|
+ "and (t.nem_code=!='FDJ' and t.nem_code!='BPQ' and t.nem_code!='KZXT' and t.nem_code!='YP' and t.nem_code!='LG' and t.nem_code!='PHXT' and t.nem_code!='BJXT' )",
|
|
|
+ "</where>",
|
|
|
+
|
|
|
+ "</script>"})
|
|
|
+ List<ProEconShutdownEvent2> queryShutdownEvent2ByOther(@Param("wpId") String wpId, @Param("modelId") String modelId,@Param("begin")Date begin, @Param("end") Date end);
|
|
|
|
|
|
}
|