|
@@ -23,6 +23,44 @@ import java.util.List;
|
|
|
public interface EarlywarningmainMapper extends BaseMapper<Earlywarningmain> {
|
|
|
|
|
|
|
|
|
+// @Delete(" delete from Earlywarningmain where recodedate=#{recodedate} ")
|
|
|
+// public int deleteEarlywarningmain(@Param(value = "recodedate") Date recodedate);
|
|
|
+//
|
|
|
+//
|
|
|
+// @Insert(" INSERT INTO Earlywarningmain(id,recodedate,wpid,wpname,wtid,wtname,day3top1,day3top2,day3top3,day7top1,day7top2,day7top3,day15top1,day15top2,day15top3,month1top1,month1top2,month1top3,day3top1name,day3top2name,day3top3name,day7top1name,day7top2name,day7top3name,day15top1name,day15top2name,day15top3name,month1top1name,month1top2name,month1top3name,month1topnum,day7topnum,day15topnum,day3topnum,synthesistopnum,day1top1,day1top2,day1top3,day1top1name,day1top2name,day1top3name,day1topnum) VALUES(#{id,jdbcType=VARCHAR},#{recodedate},#{wpid,jdbcType=VARCHAR},#{wpname,jdbcType=VARCHAR},#{wtid,jdbcType=VARCHAR},#{wtname,jdbcType=VARCHAR},#{day3top1,jdbcType=INTEGER},#{day3top2,jdbcType=INTEGER},#{day3top3,jdbcType=INTEGER},#{day7top1,jdbcType=INTEGER},#{day7top2,jdbcType=INTEGER},#{day7top3,jdbcType=INTEGER},#{day15top1,jdbcType=INTEGER},#{day15top2,jdbcType=INTEGER},#{day15top3,jdbcType=INTEGER},#{month1top1,jdbcType=INTEGER},#{month1top2,jdbcType=INTEGER},#{month1top3,jdbcType=INTEGER},#{day3top1name,jdbcType=VARCHAR},#{day3top2name,jdbcType=VARCHAR},#{day3top3name,jdbcType=VARCHAR},#{day7top1name,jdbcType=VARCHAR},#{day7top2name,jdbcType=VARCHAR},#{day7top3name,jdbcType=VARCHAR},#{day15top1name,jdbcType=VARCHAR},#{day15top2name,jdbcType=VARCHAR},#{day15top3name,jdbcType=VARCHAR},#{month1top1name,jdbcType=VARCHAR},#{month1top2name,jdbcType=VARCHAR},#{month1top3name,jdbcType=VARCHAR},#{month1topnum,jdbcType=INTEGER},#{day7topnum,jdbcType=INTEGER},#{day15topnum,jdbcType=INTEGER},#{day3topnum,jdbcType=INTEGER},#{synthesistopnum,jdbcType=INTEGER},#{day1top1,jdbcType=INTEGER},#{day1top2,jdbcType=INTEGER},#{day1top3,jdbcType=INTEGER},#{day1top1name,jdbcType=VARCHAR},#{day1top2name,jdbcType=VARCHAR},#{day1top3name,jdbcType=VARCHAR},#{day1topnum,jdbcType=INTEGER})")
|
|
|
+// public int insertEarlywarningmain(Earlywarningmain earlywarningmain);
|
|
|
+//
|
|
|
+// @Select(" select t.stationid wpId,t.windturbineid wtId,max(t.num) eventnum from ( " +
|
|
|
+// " select stationid,windturbineid,alertvalue,alerttext,SUM(t.num) num from ( " +
|
|
|
+// " SELECT stationid,windturbineid,alertvalue,alerttext,num FROM (select s.stationid,s.windturbineid,s.alertvalue,s.alerttext,count(*) num from ${alerthistory1} h,alarmsnap s where to_NUMBER(h.snapid) =to_NUMBER(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 )" +
|
|
|
+// " UNION ALL " +
|
|
|
+// " SELECT stationid,windturbineid,alertvalue,alerttext,num FROM (select s.stationid,s.windturbineid,s.alertvalue,s.alerttext,count(*) num from ${alerthistory2} h,alarmsnap s where to_NUMBER(h.snapid) =to_NUMBER(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 )" +
|
|
|
+// " ) 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 wtId,warnId,warnName,sum(eventnum) eventnum from ( " +
|
|
|
+// " select wtId,warnId,warnName,eventnum FROM ( select s.windturbineid wtId,s.alertvalue warnId,s.alerttext warnName,count(*) eventnum from ${alerthistory1} h,alarmsnap s where to_NUMBER(h.snapid) =to_NUMBER(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 )" +
|
|
|
+// " UNION ALL " +
|
|
|
+// " select wtId,warnId,warnName,eventnum FROM ( select s.windturbineid wtId,s.alertvalue warnId,s.alerttext warnName,count(*) eventnum from ${alerthistory2} h,alarmsnap s where to_NUMBER(h.snapid) =to_NUMBER(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 )" +
|
|
|
+// " ) 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 id,windTurbineId,warningId, warnDesc, 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 to_NUMBER(h.snapid) =to_NUMBER(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)" +
|
|
|
+// " UNION " +
|
|
|
+// " select id,windTurbineId,warningId, warnDesc, 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 to_NUMBER(h.snapid) =to_NUMBER(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)")
|
|
|
+// public List<ShutdowneventVo> getEventMap(@Param(value = "alerthistory1")String alerthistory1,@Param(value = "alerthistory2")String alerthistory2,@Param(value = "beginDate")Date beginDate, @Param(value = "endDate")Date endDate);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
@Delete(" delete from Earlywarningmain where recodedate=#{recodedate} ")
|
|
|
public int deleteEarlywarningmain(@Param(value = "recodedate") Date recodedate);
|
|
|
|
|
@@ -32,30 +70,30 @@ public interface EarlywarningmainMapper extends BaseMapper<Earlywarningmain> {
|
|
|
|
|
|
@Select(" select t.stationid wpId,t.windturbineid wtId,max(t.num) eventnum from ( " +
|
|
|
" select stationid,windturbineid,alertvalue,alerttext,SUM(t.num) num from ( " +
|
|
|
- " SELECT stationid,windturbineid,alertvalue,alerttext,num FROM (select s.stationid,s.windturbineid,s.alertvalue,s.alerttext,count(*) num from ${alerthistory1} h,alarmsnap s where to_NUMBER(h.snapid) =to_NUMBER(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 )" +
|
|
|
+ " 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 stationid,windturbineid,alertvalue,alerttext,num FROM (select s.stationid,s.windturbineid,s.alertvalue,s.alerttext,count(*) num from ${alerthistory2} h,alarmsnap s where to_NUMBER(h.snapid) =to_NUMBER(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 )" +
|
|
|
+ " 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 wtId,warnId,warnName,sum(eventnum) eventnum from ( " +
|
|
|
- " select wtId,warnId,warnName,eventnum FROM ( select s.windturbineid wtId,s.alertvalue warnId,s.alerttext warnName,count(*) eventnum from ${alerthistory1} h,alarmsnap s where to_NUMBER(h.snapid) =to_NUMBER(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 )" +
|
|
|
+ " 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 wtId,warnId,warnName,eventnum FROM ( select s.windturbineid wtId,s.alertvalue warnId,s.alerttext warnName,count(*) eventnum from ${alerthistory2} h,alarmsnap s where to_NUMBER(h.snapid) =to_NUMBER(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 )" +
|
|
|
+ " 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 id,windTurbineId,warningId, warnDesc, 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 to_NUMBER(h.snapid) =to_NUMBER(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)" +
|
|
|
+ @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 id,windTurbineId,warningId, warnDesc, 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 to_NUMBER(h.snapid) =to_NUMBER(s.id) and s.category1='custom' and h.messagetype=1 and s.windturbineid is not null and h.alerttime>=#{beginDate} and h.alerttime<=#{endDate} " +
|
|
|
+ " 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);
|
|
|
|