|
@@ -26,38 +26,52 @@ public interface ProEconEarlyWarningMainMapper extends BaseMapper<ProEconEarlyWa
|
|
|
|
|
|
@Delete(" delete from pro_econ_early_warning_main where record_date=#{recorddate} ")
|
|
@Delete(" delete from pro_econ_early_warning_main where record_date=#{recorddate} ")
|
|
public int deleteEarlywarningmain(@Param(value = "recorddate") Date recorddate);
|
|
public int deleteEarlywarningmain(@Param(value = "recorddate") Date recorddate);
|
|
|
|
+//
|
|
|
|
+//
|
|
|
|
+//
|
|
|
|
+//
|
|
|
|
+// @DS("slave")
|
|
|
|
+// @Select(" select t.stationid wpId,t.windturbineid wtId,max(t.num) eventnum from ( " +
|
|
|
|
+// " select stationid,windturbineid,alertvalue,alerttext,SUM(t.num) num from ( " +
|
|
|
|
+// " SELECT a.stationid,a.windturbineid,a.alertvalue,a.alerttext,a.num FROM (select s.stationid,s.windturbineid,s.alertvalue,s.alerttext,count(*) num from ${alerthistory1} h,alarmsnap s where h.snapid =s.id and s.category1='custom' and s.category1='custom' and" +
|
|
|
|
+// " h.messagetype='1' and s.windturbineid is not null and h.alerttime>=#{beginDate} and h.alerttime<=#{endDate}" +
|
|
|
|
+// " group by s.stationid,s.alertvalue,s.alerttext,s.windturbineid order by s.windturbineid,num desc ) a " +
|
|
|
|
+// " UNION ALL " +
|
|
|
|
+// " SELECT b.stationid,b.windturbineid,b.alertvalue,b.alerttext,b.num FROM (select s.stationid,s.windturbineid,s.alertvalue,s.alerttext,count(*) num from ${alerthistory2} h,alarmsnap s where h.snapid =s.id and s.category1='custom' and s.category1='custom' and" +
|
|
|
|
+// " h.messagetype='1' and s.windturbineid is not null and h.alerttime>=#{beginDate} and h.alerttime<=#{endDate}" +
|
|
|
|
+// " group by s.stationid,s.alertvalue,s.alerttext,s.windturbineid order by s.windturbineid,num desc ) b " +
|
|
|
|
+// " ) t group by t.stationid,t.windturbineid,alertvalue,alerttext order by t.windturbineid,num desc" +
|
|
|
|
+// " ) t group by t.stationid,t.windturbineid order by t.stationid,eventnum desc,t.windturbineid ")
|
|
|
|
+// public List<EventVo> getCountOrderNum(@Param(value = "alerthistory1")String alerthistory1, @Param(value = "alerthistory2")String alerthistory2, @Param(value = "beginDate")Date beginDate, @Param(value = "endDate")Date endDate);
|
|
|
|
+//
|
|
|
|
+// @DS("slave")
|
|
|
|
+// @Select(" select wtId,warnId,warnName,sum(eventnum) eventnum from ( " +
|
|
|
|
+// " select a.wtId,a.warnId,a.warnName,a.eventnum FROM ( select s.windturbineid wtId,s.alertvalue warnId,s.alerttext warnName,count(*) eventnum from ${alerthistory1} h,alarmsnap s where h.snapid =s.id and s.category1='custom' and h.messagetype='1' and s.windturbineid is not null and h.alerttime>=#{beginDate} and h.alerttime<=#{endDate} " +
|
|
|
|
+// " group by s.stationid,s.alertvalue,s.alerttext,s.windturbineid order by s.windturbineid,eventnum desc ) a " +
|
|
|
|
+// " UNION ALL " +
|
|
|
|
+// " select b.wtId,b.warnId,b.warnName,b.eventnum FROM ( select s.windturbineid wtId,s.alertvalue warnId,s.alerttext warnName,count(*) eventnum from ${alerthistory2} h,alarmsnap s where h.snapid =s.id and s.category1='custom' and h.messagetype='1' and s.windturbineid is not null and h.alerttime>=#{beginDate} and h.alerttime<=#{endDate} " +
|
|
|
|
+// " group by s.stationid,s.alertvalue,s.alerttext,s.windturbineid order by s.windturbineid,eventnum desc ) b " +
|
|
|
|
+// " ) t group by warnId,warnName,wtId order by wtId,eventnum desc")
|
|
|
|
+// public List<EventVo> getCountMap(@Param(value = "alerthistory1")String alerthistory1,@Param(value = "alerthistory2")String alerthistory2,@Param(value = "beginDate")Date beginDate, @Param(value = "endDate")Date endDate);
|
|
|
|
+// @DS("slave")
|
|
|
|
+// @Select(" select a.id,a.windTurbineId,a.warningId, a.warnDesc, a.stopTime FROM ( select h.id id,s.windturbineid windTurbineId,s.alertvalue warningId,s.alerttext warnDesc,h.alerttime stopTime from from ${alerthistory1} h,alarmsnap s where h.snapid =s.id and s.category1='custom' and h.messagetype='1' and s.windturbineid is not null and h.alerttime>=#{beginDate} and h.alerttime<=#{endDate} order by s.windturbineid,h.alerttime desc) a" +
|
|
|
|
+// " UNION " +
|
|
|
|
+// " select b.id,b.windTurbineId,b.warningId, b.warnDesc, b.stopTime FROM ( select h.id id,s.windturbineid windTurbineId,s.alertvalue warningId,s.alerttext warnDesc,h.alerttime stopTime from from ${alerthistory2} h,alarmsnap s where h.snapid =s.id and s.category1='custom' and h.messagetype='1' and s.windturbineid is not null and h.alerttime>=#{beginDate} and h.alerttime<=#{endDate} b " +
|
|
|
|
+// " order by s.windturbineid,h.alerttime desc)")
|
|
|
|
+// public List<ShutdowneventVo> getEventMap(@Param(value = "alerthistory1")String alerthistory1, @Param(value = "alerthistory2")String alerthistory2, @Param(value = "beginDate")Date beginDate, @Param(value = "endDate")Date endDate);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@DS("slave")
|
|
@DS("slave")
|
|
- @Select(" select t.stationid wpId,t.windturbineid wtId,max(t.num) eventnum from ( " +
|
|
|
|
- " select stationid,windturbineid,alertvalue,alerttext,SUM(t.num) num from ( " +
|
|
|
|
- " SELECT a.stationid,a.windturbineid,a.alertvalue,a.alerttext,a.num FROM (select s.stationid,s.windturbineid,s.alertvalue,s.alerttext,count(*) num from ${alerthistory1} h,alarmsnap s where h.snapid =s.id and s.category1='custom' and s.category1='custom' and" +
|
|
|
|
- " h.messagetype='1' and s.windturbineid is not null and h.alerttime>=#{beginDate} and h.alerttime<=#{endDate}" +
|
|
|
|
- " group by s.stationid,s.alertvalue,s.alerttext,s.windturbineid order by s.windturbineid,num desc ) a " +
|
|
|
|
- " UNION ALL " +
|
|
|
|
- " SELECT b.stationid,b.windturbineid,b.alertvalue,b.alerttext,b.num FROM (select s.stationid,s.windturbineid,s.alertvalue,s.alerttext,count(*) num from ${alerthistory2} h,alarmsnap s where h.snapid =s.id and s.category1='custom' and s.category1='custom' and" +
|
|
|
|
- " h.messagetype='1' and s.windturbineid is not null and h.alerttime>=#{beginDate} and h.alerttime<=#{endDate}" +
|
|
|
|
- " group by s.stationid,s.alertvalue,s.alerttext,s.windturbineid order by s.windturbineid,num desc ) b " +
|
|
|
|
- " ) t group by t.stationid,t.windturbineid,alertvalue,alerttext order by t.windturbineid,num desc" +
|
|
|
|
- " ) t group by t.stationid,t.windturbineid order by t.stationid,eventnum desc,t.windturbineid ")
|
|
|
|
- public List<EventVo> getCountOrderNum(@Param(value = "alerthistory1")String alerthistory1, @Param(value = "alerthistory2")String alerthistory2, @Param(value = "beginDate")Date beginDate, @Param(value = "endDate")Date endDate);
|
|
|
|
|
|
+ @Select("select stationid as wpId,deviceid as wtId,count(*) as eventnum from alarmWt where ts>=#{begin} and ts<=#{end} group by stationid ,deviceid order by wtId,eventnum desc")
|
|
|
|
+ public List<EventVo> getCountOrderNum(@Param(value = "begin")long begin, @Param(value = "end")long end);
|
|
|
|
|
|
@DS("slave")
|
|
@DS("slave")
|
|
- @Select(" select wtId,warnId,warnName,sum(eventnum) eventnum from ( " +
|
|
|
|
- " select a.wtId,a.warnId,a.warnName,a.eventnum FROM ( select s.windturbineid wtId,s.alertvalue warnId,s.alerttext warnName,count(*) eventnum from ${alerthistory1} h,alarmsnap s where h.snapid =s.id and s.category1='custom' and h.messagetype='1' and s.windturbineid is not null and h.alerttime>=#{beginDate} and h.alerttime<=#{endDate} " +
|
|
|
|
- " group by s.stationid,s.alertvalue,s.alerttext,s.windturbineid order by s.windturbineid,eventnum desc ) a " +
|
|
|
|
- " UNION ALL " +
|
|
|
|
- " select b.wtId,b.warnId,b.warnName,b.eventnum FROM ( select s.windturbineid wtId,s.alertvalue warnId,s.alerttext warnName,count(*) eventnum from ${alerthistory2} h,alarmsnap s where h.snapid =s.id and s.category1='custom' and h.messagetype='1' and s.windturbineid is not null and h.alerttime>=#{beginDate} and h.alerttime<=#{endDate} " +
|
|
|
|
- " group by s.stationid,s.alertvalue,s.alerttext,s.windturbineid order by s.windturbineid,eventnum desc ) b " +
|
|
|
|
- " ) t group by warnId,warnName,wtId order by wtId,eventnum desc")
|
|
|
|
- public List<EventVo> getCountMap(@Param(value = "alerthistory1")String alerthistory1,@Param(value = "alerthistory2")String alerthistory2,@Param(value = "beginDate")Date beginDate, @Param(value = "endDate")Date endDate);
|
|
|
|
|
|
+ @Select("select deviceid as wtId,alarmid as warnId,description as warnName,count(*) as eventnum from alarmWt where ts>=#{begin} and ts<=#{end} group by deviceid,alarmid ,description order by wtId,eventnum desc")
|
|
|
|
+ public List<EventVo> getCountMap(@Param(value = "begin")long begin, @Param(value = "end")long end);
|
|
@DS("slave")
|
|
@DS("slave")
|
|
- @Select(" select a.id,a.windTurbineId,a.warningId, a.warnDesc, a.stopTime FROM ( select h.id id,s.windturbineid windTurbineId,s.alertvalue warningId,s.alerttext warnDesc,h.alerttime stopTime from from ${alerthistory1} h,alarmsnap s where h.snapid =s.id and s.category1='custom' and h.messagetype='1' and s.windturbineid is not null and h.alerttime>=#{beginDate} and h.alerttime<=#{endDate} order by s.windturbineid,h.alerttime desc) a" +
|
|
|
|
- " UNION " +
|
|
|
|
- " select b.id,b.windTurbineId,b.warningId, b.warnDesc, b.stopTime FROM ( select h.id id,s.windturbineid windTurbineId,s.alertvalue warningId,s.alerttext warnDesc,h.alerttime stopTime from from ${alerthistory2} h,alarmsnap s where h.snapid =s.id and s.category1='custom' and h.messagetype='1' and s.windturbineid is not null and h.alerttime>=#{beginDate} and h.alerttime<=#{endDate} b " +
|
|
|
|
- " order by s.windturbineid,h.alerttime desc)")
|
|
|
|
- public List<ShutdowneventVo> getEventMap(@Param(value = "alerthistory1")String alerthistory1, @Param(value = "alerthistory2")String alerthistory2, @Param(value = "beginDate")Date beginDate, @Param(value = "endDate")Date endDate);
|
|
|
|
|
|
+ @Select("select deviceid as windTurbineId,alarmid as warningId,description as warnDesc,ts from alarmWt where ts>=#{begin} and ts<=#{end} order by windTurbineId,ts desc")
|
|
|
|
+ public List<ShutdowneventVo> getEventMap( @Param(value = "begin")long begin, @Param(value = "end")long end);
|
|
|
|
|
|
}
|
|
}
|