|
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.gyee.alarm.model.auto.ProEconShutdownEvent2;
|
|
import com.gyee.alarm.model.auto.ProEconShutdownEvent2;
|
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
import com.gyee.alarm.model.vo.AlarmTsVo;
|
|
import com.gyee.alarm.model.vo.AlarmTsVo;
|
|
|
|
+import com.gyee.alarm.model.vo.ShutdownEventVo;
|
|
import org.apache.ibatis.annotations.Param;
|
|
import org.apache.ibatis.annotations.Param;
|
|
import org.apache.ibatis.annotations.Select;
|
|
import org.apache.ibatis.annotations.Select;
|
|
import org.apache.ibatis.annotations.Update;
|
|
import org.apache.ibatis.annotations.Update;
|
|
@@ -26,10 +27,10 @@ public interface ProEconShutdownEvent2Mapper extends BaseMapper<ProEconShutdownE
|
|
|
|
|
|
|
|
|
|
@Select({"<script>",
|
|
@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) " ,
|
|
|
|
|
|
+ "SELECT UPPER(t.name) as name,count(*) as times FROM pro_econ_shutdown_event2 as s,pro_econ_alarm_configuration as a," +
|
|
|
|
+ "pro_econ_alarm_type as t " ,
|
|
"<where>" ,
|
|
"<where>" ,
|
|
-
|
|
|
|
|
|
+ " s.warning_id=a.id and s.warning_id is not null and UPPER(a.components)=UPPER(t.nem_code) ",
|
|
"<if test='wpId != null'>",
|
|
"<if test='wpId != null'>",
|
|
"and a.station_id like #{wpId}",
|
|
"and a.station_id like #{wpId}",
|
|
"</if>",
|
|
"</if>",
|
|
@@ -42,13 +43,13 @@ public interface ProEconShutdownEvent2Mapper extends BaseMapper<ProEconShutdownE
|
|
"</where>",
|
|
"</where>",
|
|
" GROUP BY t.name ",
|
|
" GROUP BY t.name ",
|
|
"</script>"})
|
|
"</script>"})
|
|
- List<ProEconShutdownEvent2> queryShutdownEvent2ByType(@Param("wpId") String wpId, @Param("modelId") String modelId,@Param("begin")Date begin, @Param("end") Date end);
|
|
|
|
|
|
+ List<ShutdownEventVo> queryShutdownEvent2ByType(@Param("wpId") String wpId, @Param("modelId") String modelId,@Param("begin")Date begin, @Param("end") Date end);
|
|
|
|
|
|
@Select({"<script>",
|
|
@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 " ,
|
|
|
|
|
|
+ "SELECT DATE(stop_time) AS stoptime, 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>" ,
|
|
"<where>" ,
|
|
-
|
|
|
|
|
|
+ " s.warning_id=a.id and s.warning_id is not null ",
|
|
"<if test='wpId != null'>",
|
|
"<if test='wpId != null'>",
|
|
"and a.station_id like #{wpId}",
|
|
"and a.station_id like #{wpId}",
|
|
"</if>",
|
|
"</if>",
|
|
@@ -59,18 +60,18 @@ public interface ProEconShutdownEvent2Mapper extends BaseMapper<ProEconShutdownE
|
|
"and s.stop_time <= #{end}",
|
|
"and s.stop_time <= #{end}",
|
|
|
|
|
|
"</where>",
|
|
"</where>",
|
|
- " GROUP BY stop_day ",
|
|
|
|
|
|
+ " GROUP BY stoptime ",
|
|
"</script>"})
|
|
"</script>"})
|
|
- List<ProEconShutdownEvent2> queryShutdownEvent2ByDay(@Param("wpId") String wpId, @Param("modelId") String modelId,@Param("begin")Date begin, @Param("end") Date end);
|
|
|
|
|
|
+ List<ShutdownEventVo> queryShutdownEvent2ByDay(@Param("wpId") String wpId, @Param("modelId") String modelId,@Param("begin")Date begin, @Param("end") Date end);
|
|
|
|
|
|
|
|
|
|
@Select({"<script>",
|
|
@Select({"<script>",
|
|
- "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," +
|
|
|
|
|
|
+ "SELECT TO_CHAR(s.stop_time, 'YYYY-MM') AS stoptime, 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 " +
|
|
"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>" ,
|
|
|
|
|
|
|
|
|
|
+ "<where>" ,
|
|
|
|
+ " s.warning_id=a.id and s.warning_id is not null ",
|
|
"<if test='wpId != null'>",
|
|
"<if test='wpId != null'>",
|
|
"and a.station_id like #{wpId}",
|
|
"and a.station_id like #{wpId}",
|
|
"</if>",
|
|
"</if>",
|
|
@@ -81,16 +82,15 @@ public interface ProEconShutdownEvent2Mapper extends BaseMapper<ProEconShutdownE
|
|
"and s.stop_time <= #{end}",
|
|
"and s.stop_time <= #{end}",
|
|
|
|
|
|
"</where>",
|
|
"</where>",
|
|
- " GROUP BY year_month ",
|
|
|
|
|
|
+ " GROUP BY stoptime ",
|
|
"</script>"})
|
|
"</script>"})
|
|
- List<ProEconShutdownEvent2> queryShutdownEvent2ByMonth(@Param("wpId") String wpId, @Param("modelId") String modelId,@Param("begin")Date begin, @Param("end") Date end);
|
|
|
|
|
|
+ List<ShutdownEventVo> queryShutdownEvent2ByMonth(@Param("wpId") String wpId, @Param("modelId") String modelId,@Param("begin")Date begin, @Param("end") Date end);
|
|
|
|
|
|
@Select({"<script>",
|
|
@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 " ,
|
|
|
|
|
|
+ "SELECT '机械故障' AS name ,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>" ,
|
|
"<where>" ,
|
|
-
|
|
|
|
|
|
+ " s.warning_id=a.id and UPPER(a.components)=UPPER(t.nem_code) and s.warning_id is not null ",
|
|
"<if test='wpId != null'>",
|
|
"<if test='wpId != null'>",
|
|
"and a.station_id like #{wpId}",
|
|
"and a.station_id like #{wpId}",
|
|
"</if>",
|
|
"</if>",
|
|
@@ -103,14 +103,13 @@ public interface ProEconShutdownEvent2Mapper extends BaseMapper<ProEconShutdownE
|
|
"</where>",
|
|
"</where>",
|
|
|
|
|
|
"</script>"})
|
|
"</script>"})
|
|
- List<ProEconShutdownEvent2> queryShutdownEvent2ByJX(@Param("wpId") String wpId, @Param("modelId") String modelId,@Param("begin")Date begin, @Param("end") Date end);
|
|
|
|
|
|
+ List<ShutdownEventVo> queryShutdownEvent2ByJX(@Param("wpId") String wpId, @Param("modelId") String modelId,@Param("begin")Date begin, @Param("end") Date end);
|
|
|
|
|
|
@Select({"<script>",
|
|
@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 " ,
|
|
|
|
|
|
+ "SELECT '电气故障' AS name ,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>" ,
|
|
"<where>" ,
|
|
-
|
|
|
|
|
|
+ " s.warning_id=a.id and UPPER(a.components)=UPPER(t.nem_code) and s.warning_id is not null ",
|
|
"<if test='wpId != null'>",
|
|
"<if test='wpId != null'>",
|
|
"and a.station_id like #{wpId}",
|
|
"and a.station_id like #{wpId}",
|
|
"</if>",
|
|
"</if>",
|
|
@@ -123,15 +122,14 @@ public interface ProEconShutdownEvent2Mapper extends BaseMapper<ProEconShutdownE
|
|
"</where>",
|
|
"</where>",
|
|
|
|
|
|
"</script>"})
|
|
"</script>"})
|
|
- List<ProEconShutdownEvent2> queryShutdownEvent2ByDQ(@Param("wpId") String wpId, @Param("modelId") String modelId,@Param("begin")Date begin, @Param("end") Date end);
|
|
|
|
|
|
+ List<ShutdownEventVo> queryShutdownEvent2ByDQ(@Param("wpId") String wpId, @Param("modelId") String modelId,@Param("begin")Date begin, @Param("end") Date end);
|
|
|
|
|
|
|
|
|
|
@Select({"<script>",
|
|
@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 " ,
|
|
|
|
|
|
+ "SELECT '其它故障' AS name ,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>" ,
|
|
"<where>" ,
|
|
-
|
|
|
|
|
|
+ " s.warning_id=a.id and UPPER(a.components)=UPPER(t.nem_code) and s.warning_id is not null ",
|
|
"<if test='wpId != null'>",
|
|
"<if test='wpId != null'>",
|
|
"and a.station_id like #{wpId}",
|
|
"and a.station_id like #{wpId}",
|
|
"</if>",
|
|
"</if>",
|
|
@@ -140,10 +138,10 @@ public interface ProEconShutdownEvent2Mapper extends BaseMapper<ProEconShutdownE
|
|
"</if>",
|
|
"</if>",
|
|
"and s.stop_time >= #{begin}",
|
|
"and s.stop_time >= #{begin}",
|
|
"and s.stop_time <= #{end}",
|
|
"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' )",
|
|
|
|
|
|
+ "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>",
|
|
"</where>",
|
|
|
|
|
|
"</script>"})
|
|
"</script>"})
|
|
- List<ProEconShutdownEvent2> queryShutdownEvent2ByOther(@Param("wpId") String wpId, @Param("modelId") String modelId,@Param("begin")Date begin, @Param("end") Date end);
|
|
|
|
|
|
+ List<ShutdownEventVo> queryShutdownEvent2ByOther(@Param("wpId") String wpId, @Param("modelId") String modelId, @Param("begin")Date begin, @Param("end") Date end);
|
|
|
|
|
|
}
|
|
}
|