|
@@ -1,11 +1,11 @@
|
|
|
package com.gyee.failurestatistics.mapper.auto;
|
|
package com.gyee.failurestatistics.mapper.auto;
|
|
|
|
|
|
|
|
|
|
+import com.baomidou.dynamic.datasource.annotation.DS;
|
|
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
|
import com.gyee.failurestatistics.model.auto.ProEconEarlyWarningMain;
|
|
import com.gyee.failurestatistics.model.auto.ProEconEarlyWarningMain;
|
|
|
import com.gyee.failurestatistics.vo.EventVo;
|
|
import com.gyee.failurestatistics.vo.EventVo;
|
|
|
import com.gyee.failurestatistics.vo.ShutdowneventVo;
|
|
import com.gyee.failurestatistics.vo.ShutdowneventVo;
|
|
|
import org.apache.ibatis.annotations.Delete;
|
|
import org.apache.ibatis.annotations.Delete;
|
|
|
-import org.apache.ibatis.annotations.Insert;
|
|
|
|
|
import org.apache.ibatis.annotations.Param;
|
|
import org.apache.ibatis.annotations.Param;
|
|
|
import org.apache.ibatis.annotations.Select;
|
|
import org.apache.ibatis.annotations.Select;
|
|
|
|
|
|
|
@@ -28,9 +28,9 @@ public interface ProEconEarlyWarningMainMapper extends BaseMapper<ProEconEarlyWa
|
|
|
public int deleteEarlywarningmain(@Param(value = "recorddate") Date recorddate);
|
|
public int deleteEarlywarningmain(@Param(value = "recorddate") Date recorddate);
|
|
|
|
|
|
|
|
|
|
|
|
|
- @Insert(" INSERT INTO pro_econ_early_warning_main(id,record_date,wp_id,wp_name,wt_id,wt_name,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},#{record_date},#{wp_id,jdbcType=VARCHAR},#{wp_name,jdbcType=VARCHAR},#{wt_id,jdbcType=VARCHAR},#{wt_name,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(ProEconEarlyWarningMain earlywarningmain);
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+ @DS("slave")
|
|
|
@Select(" select t.stationid wpId,t.windturbineid wtId,max(t.num) eventnum from ( " +
|
|
@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,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" +
|
|
" 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" +
|
|
@@ -44,7 +44,7 @@ public interface ProEconEarlyWarningMainMapper extends BaseMapper<ProEconEarlyWa
|
|
|
" ) t group by t.stationid,t.windturbineid order by t.stationid,eventnum desc,t.windturbineid ")
|
|
" ) 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);
|
|
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(" 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} " +
|
|
" 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 " +
|
|
" group by s.stationid,s.alertvalue,s.alerttext,s.windturbineid order by s.windturbineid,eventnum desc ) a " +
|
|
@@ -53,7 +53,7 @@ public interface ProEconEarlyWarningMainMapper extends BaseMapper<ProEconEarlyWa
|
|
|
" group by s.stationid,s.alertvalue,s.alerttext,s.windturbineid order by s.windturbineid,eventnum desc ) b " +
|
|
" 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")
|
|
" ) 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);
|
|
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" +
|
|
@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 " +
|
|
" 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 " +
|
|
" 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 " +
|