@Select("SELECT * FROM (SELECT * FROM `tb_db_data` ORDER BY time DESC)a where sensorid=#{deviceid} and time>=#{start} and time <=#{end}GROUP BY DATE_FORMAT(a.time,'%y-%m-%d')")
@Select(value="SELECT a.*,CASE WHEN b.alarmlevel IS NULL THEN 0 ELSE b.alarmlevel END AS alarmlevel from `tb_db_data` a left join tab_abnormal b on a.time =b.time ${ew.customSqlSegment} ")
@Select("select a.* from tb_db_data a join (select max(time) as time ,sensorid from tb_db_data GROUP BY sensorid,DATE_FORMAT( time, '%y-%m-%d' ))b on a.time =b.time and a.sensorid=b.sensorid where a.sensorid=#{deviceid} and a.time>=#{start} and a.time <=#{end}GROUP BY DATE_FORMAT(a.time,'%y-%m-%d')")
@Select(value="SELECT r.* from(select b.eqdanwei as eqdanwei,b.equipno equipno,b.equipname as sensorname,a.lenth as `lenth`,a.angle as angle ,a.safeheight as safeheight ,DATE_FORMAT(a.time,'%y-%m-%d %H:%m:%m') as time from tb_db_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno where a.datasource =1 and b.tailingid=#{tailingid} ORDER BY time DESC) r GROUP BY r.sensorname")
@Select(value="select b.eqdanwei as eqdanwei,b.equipno equipno,b.equipname as sensorname,a.lenth as `lenth`,a.angle as angle ,a.safeheight as safeheight ,DATE_FORMAT(a.time,'%Y-%m-%d %H:%i:%m') as time from tb_db_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno join (select max(time) as time ,sensorid from tb_db_data GROUP BY sensorid) c on a.time =c.time and a.sensorid=c.sensorid where a.datasource =1 and b.tailingid=#{tailingid} ORDER BY time DESC")
@Select("SELECT * FROM (SELECT * FROM `tb_dm_data` ORDER BY time DESC)a where sensorid=#{sensorid} and time>=#{start} and time <=#{end}GROUP BY DATE_FORMAT(a.time,'%y-%m-%d')")
@Select("select a.* from tb_dm_data a join (select max(time) as time ,sensorid from tb_dm_data GROUP BY sensorid,DATE_FORMAT( time, '%y-%m-%d' ))b on a.time =b.time and a.sensorid=b.sensorid where a.sensorid=#{sensorid} and a.time>=#{start} and a.time <=#{end}GROUP BY DATE_FORMAT(a.time,'%y-%m-%d')")
@Select(value="SELECT r.* from(select b.eqdanwei as eqdanwei,b.equipname as sensorname,b.equipno equipno,a.dispA as dispA,a.dispB as dispB , DATE_FORMAT(a.time,'%y-%m-%d %H:%m:%m') as time from tb_dm_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno where a.datasource =1 and b.tailingid=#{tailingid} ORDER BY time DESC) r GROUP BY r.sensorname")
@Select(value="select b.eqdanwei as eqdanwei,b.equipname as sensorname,b.equipno equipno,a.dispA as dispA,a.dispB as dispB , DATE_FORMAT(a.time,'%Y-%m-%d %H:%i:%m') as time from tb_dm_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno join (select max(time) as time ,sensorid from tb_dm_data GROUP BY sensorid) c on a.time =c.time and a.sensorid=c.sensorid where a.datasource =1 and b.tailingid=#{tailingid} ORDER BY time DESC ")
@Select("SELECT a.disp_x as dispx ,a.disp_y as dispy,a.disp_h as disph ,a.time as time FROM (SELECT * FROM `tb_mp_data` ORDER BY time DESC)a where sensorid=#{deviceid} and time>=#{start} and time <=#{end}GROUP BY DATE_FORMAT(a.time,'%y-%m-%d')")
@Select("SELECT a.disp_x as dispx ,a.disp_y as dispy,a.disp_h as disph ,a.time as time FROM `tb_mp_data` a join(select max(time) as time ,sensorid from tb_mp_data GROUP BY sensorid,DATE_FORMAT( time, '%y-%m-%d' ))b on a.time =b.time and a.sensorid=b.sensorid where a.sensorid=#{deviceid} and a.time>=#{start} and a.time <=#{end}GROUP BY DATE_FORMAT(a.time,'%y-%m-%d')")
@Select(value="SELECT r.* from(select b.eqdanwei as eqdanwei,b.equipno equipno,b.equipname as sensorname,a.disp_x as disp_x , a.disp_y as disp_y ,a.disp_h as disp_h ,DATE_FORMAT(a.time,'%y-%m-%d %H:%m:%m') as time from tb_mp_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno where a.datasource =1 and b.tailingid=#{tailingid} ORDER BY time DESC) r GROUP BY r.sensorname")
@Select(value="select b.eqdanwei as eqdanwei,b.equipno equipno,b.equipname as sensorname,a.disp_x as disp_x , a.disp_y as disp_y ,a.disp_h as disp_h ,DATE_FORMAT(a.time,'%Y-%m-%d %H:%i:%m') as time from tb_mp_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno join (select max(time) as time ,sensorid from tb_mp_data GROUP BY sensorid) c on a.time =c.time and a.sensorid=c.sensorid where a.datasource =1 and b.tailingid=#{tailingid} ORDER BY time DESC")
@Select("SELECT * FROM (SELECT * FROM `tb_psl_data` ORDER BY time DESC)a where sensorid=#{deviceid} and time>=#{start} and time <=#{end}GROUP BY DATE_FORMAT(a.time,'%y-%m-%d')")
@Select("select a.* from tb_psl_data a join (select max(time) as time ,sensorid from tb_psl_data GROUP BY sensorid,DATE_FORMAT( time, '%y-%m-%d' ))b on a.time =b.time and a.sensorid=b.sensorid where a.sensorid=#{deviceid} and a.time>=#{start} and a.time <=#{end}GROUP BY DATE_FORMAT(a.time,'%y-%m-%d')")
@Select(value="SELECT r.* from(select b.eqdanwei as eqdanwei,b.equipno equipno,b.equipname as sensorname,a.pslvalue as `value`, DATE_FORMAT(a.time,'%y-%m-%d %H:%m:%m')as time from tb_psl_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno where a.datasource =1 and b.tailingid=#{tailingid} ORDER BY time DESC) r GROUP BY r.sensorname")
@Select(value="select b.eqdanwei as eqdanwei,b.equipno equipno,b.equipname as sensorname,a.pslvalue as `value`, DATE_FORMAT(a.time,'%Y-%m-%d %H:%i:%m')as time from tb_psl_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno join (select max(time) as time ,sensorid from tb_psl_data GROUP BY sensorid) c on a.time =c.time and a.sensorid=c.sensorid where a.datasource =1 and b.tailingid=#{tailingid} ORDER BY time DESC")
@Select(value="SELECT r.* from(select b.eqdanwei as eqdanwei,b.equipno equipno,b.equipname as sensorname,a.rainfall as `rainfall` ,DATE_FORMAT(a.time,'%y-%m-%d %H:%m:%m') as time from tb_rg_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno where a.datasource =1 and b.tailingid=#{tailingid} ORDER BY time DESC) r GROUP BY r.sensorname")
@Select(value="select b.eqdanwei as eqdanwei,b.equipno equipno,b.equipname as sensorname,a.rainfall as `rainfall` ,DATE_FORMAT(a.time,'%Y-%m-%d %H:%i:%m') as time from tb_rg_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno join (select max(time) as time ,sensorid from tb_rg_data GROUP BY sensorid) c on a.time =c.time and a.sensorid=c.sensorid where a.datasource =1 and b.tailingid=#{tailingid} ORDER BY time DESC")
@Select("SELECT * FROM (SELECT * FROM `tb_sl_data` ORDER BY time DESC)a where sensorid=#{deviceid} and time>=#{start} and time <=#{end}GROUP BY DATE_FORMAT(a.time,'%y-%m-%d')")
@Select("select a.* from tb_sl_data a join (select max(time) as time ,sensorid from tb_sl_data GROUP BY sensorid,DATE_FORMAT( time, '%y-%m-%d' ))b on a.time =b.time and a.sensorid=b.sensorid where sensorid=#{deviceid} and a.time>=#{start} and a.time <=#{end}GROUP BY DATE_FORMAT(a.time,'%y-%m-%d')")
@Select(value="SELECT r.* from(select b.eqdanwei as eqdanwei,b.equipno equipno,b.equipname as sensorname,a.sllvalue as `value`, DATE_FORMAT(a.time,'%y-%m-%d %H:%m:%m') as time from tb_sl_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno where a.datasource =1 and b.tailingid=#{tailingid} ORDER BY time DESC) r GROUP BY r.sensorname")
@Select(value="select b.eqdanwei as eqdanwei,b.equipno equipno,b.equipname as sensorname,a.sllvalue as `value`, DATE_FORMAT(a.time,'%Y-%m-%d %H:%i:%m') as time from tb_sl_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno join (select max(time) as time ,sensorid from tb_sl_data GROUP BY sensorid) c on a.time =c.time and a.sensorid=c.sensorid where a.datasource =1 and b.tailingid=#{tailingid} ORDER BY time DESC")
@Select("SELECT * FROM (SELECT * FROM `tb_st_data` ORDER BY time DESC)a where sensorid=#{deviceid} and time>=#{start} and time <=#{end}GROUP BY DATE_FORMAT(a.time,'%y-%m-%d')")
@Select("select a.* from tb_sl_data a join (select max(time) as time ,sensorid from tb_sl_data GROUP BY sensorid,DATE_FORMAT( time, '%y-%m-%d' ))b on a.time =b.time and a.sensorid=b.sensorid where a.sensorid=#{deviceid} and a.time>=#{start} and a.time <=#{end}GROUP BY DATE_FORMAT(a.time,'%y-%m-%d')")
@Select(value="SELECT r.* from(select b.eqdanwei as eqdanwei,b.equipno equipno,b.equipname as sensorname,a.stage as stage,a.depth as depth ,DATE_FORMAT(a.time,'%y-%m-%d %H:%m:%m') as time from tb_st_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno where a.datasource =1 and b.tailingid=#{tailingid} ORDER BY time DESC) r GROUP BY r.sensorname")
@Select(value="select b.eqdanwei as eqdanwei,b.equipno equipno,b.equipname as sensorname,a.stage as stage,a.depth as depth ,DATE_FORMAT(a.time,'%Y-%m-%d %H:%i:%m') as time from tb_st_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno join (select max(time) as time ,sensorid from tb_sl_data GROUP BY sensorid) c on a.time =c.time and a.sensorid=c.sensorid where a.datasource =1 and b.tailingid=#{tailingid} ORDER BY time DESC")
@Select("SELECT * FROM (SELECT * FROM `tb_wpb_data` ORDER BY time DESC)a where sensorid=#{deviceid} and time>=#{start} and time <=#{end}GROUP BY DATE_FORMAT(a.time,'%y-%m-%d')")
@Select("select a.* from tb_wpb_data a join (select max(time) as time ,sensorid from tb_wpb_data GROUP BY sensorid,DATE_FORMAT( time, '%y-%m-%d' ))b on a.time =b.time and a.sensorid=b.sensorid where a.sensorid=#{deviceid} and a.time>=#{start} and a.time <=#{end}GROUP BY DATE_FORMAT(a.time,'%y-%m-%d')")
@Select(value="SELECT r.* from(select b.eqdanwei as eqdanwei,b.equipno equipno,b.equipname as sensorname,a.value as `value` ,DATE_FORMAT(a.time,'%y-%m-%d %H:%m:%m') as time from tb_wpb_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno where a.datasource =1 and b.tailingid=#{tailingid} ORDER BY time DESC) r GROUP BY r.sensorname")
@Select(value="select b.eqdanwei as eqdanwei,b.equipno equipno,b.equipname as sensorname,a.value as `value` ,DATE_FORMAT(a.time,'%Y-%m-%d %H:%i:%m') as time from tb_wpb_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno join (select max(time) as time ,sensorid from tb_wpb_data GROUP BY sensorid) c on a.time =c.time and a.sensorid=c.sensorid where a.datasource =1 and b.tailingid=#{tailingid} ORDER BY time DESC")
@Select("SELECT * FROM (SELECT * FROM `tb_wt_data` ORDER BY time DESC)a where sensorid=#{deviceid} and time>=#{start} and time <=#{end}GROUP BY DATE_FORMAT(a.time,'%y-%m-%d')")
@Select("select a.* from tb_wt_data a join (select max(time) as time ,sensorid from tb_wt_data GROUP BY sensorid,DATE_FORMAT( time, '%y-%m-%d' ))b on a.time =b.time and a.sensorid=b.sensorid where a.sensorid=#{deviceid} and a.time>=#{start} and a.time <=#{end}GROUP BY DATE_FORMAT(a.time,'%y-%m-%d')")
@Select(value="SELECT r.* from(select b.eqdanwei as eqdanwei,b.equipno equipno,b.equipname as sensorname,a.stage as `stage` ,DATE_FORMAT(a.time,'%y-%m-%d %H:%m:%m') as time from tb_wt_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno where a.datasource =1 and b.tailingid=#{tailingid} ORDER BY time DESC) r GROUP BY r.sensorname")
@Select(value="select b.eqdanwei as eqdanwei,b.equipno equipno,b.equipname as sensorname,a.stage as `stage` ,DATE_FORMAT(a.time,'%Y-%m-%d %H:%i:%m') as time from tb_wt_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno join (select max(time) as time ,sensorid from tb_wt_data GROUP BY sensorid) c on a.time =c.time and a.sensorid=c.sensorid where a.datasource =1 and b.tailingid=#{tailingid} ORDER BY time DESC")
@@ -25,7 +25,7 @@ public interface SysSelectMapper extends BaseMapper<SysSelect> {
...
@@ -25,7 +25,7 @@ public interface SysSelectMapper extends BaseMapper<SysSelect> {
@Select(value="select sumid from sys_select where mdcode=#{mdcode} and tailno=#{tailno}")
@Select(value="select sumid from sys_select where mdcode=#{mdcode} and tailno=#{tailno}")
List<Integer>getcode(Stringmdcode,Stringtailno);
List<Integer>getcode(Stringmdcode,Stringtailno);
@Select("select ss.id as id,sy.title as sumtitle,sy.ranges as `range` , sy.requrl as requrl,sy.type as type,sy.subitem as subitem ,ss.mdcode as mdcode ,sy.deviceid as deviceid ,sy.`values` as `values` from sys_select ss JOIN sys_summary sy on sy.id=ss.sumid where ss.tailno=#{tailno}")
@Select("select ss.id as id,sy.title as sumtitle,sy.ranges as `range` , sy.requrl as requrl,sy.type as type,sy.subitem as subitem ,ss.mdcode as mdcode ,sy.deviceid as deviceid ,sy.`values` as `values`, te.city_weather as city_weather from sys_select ss JOIN sys_summary sy on sy.id=ss.sumid left join tab_devtype_extend te on sy.id=te.e_sumid where ss.tailno=#{tailno}")
List<Children>getchildren(Stringtailno);
List<Children>getchildren(Stringtailno);
@Select(value="SELECT a.id as id ,a.mdcode as mdcode ,a.sumid as sumid , a.tailno as tailno, b.title as sumtitle FROM sys_select a join sys_summary b on a.sumid=b.id where a.tailno=#{gettailno}")
@Select(value="SELECT a.id as id ,a.mdcode as mdcode ,a.sumid as sumid , a.tailno as tailno, b.title as sumtitle FROM sys_select a join sys_summary b on a.sumid=b.id where a.tailno=#{gettailno}")
@@ -43,7 +44,7 @@ public interface DrybeachequipinforMapper extends BaseMapper<Drybeachequipinfor>
...
@@ -43,7 +44,7 @@ public interface DrybeachequipinforMapper extends BaseMapper<Drybeachequipinfor>
@Select(value="select equipno as value ,equipname as name from tb_drybeachequipinfor")
@Select(value="select equipno as value ,equipname as name from tb_drybeachequipinfor")
ArrayList<HashMap<String,String>>getDryCode();
ArrayList<HashMap<String,String>>getDryCode();
@Select(value="select count(id) from tb_drybeachequipinfor where tailingid=#{tailingid}")
@Select(value="select count(id) from tb_drybeachequipinfor where tailingid=#{tailingid} and equipname!='基准点'")
intgetallcount(Stringequipno);
intgetallcount(Stringequipno);
@Select("SELECT count(distinct sensorid)AS `online` from tb_db_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno WHERE a.time >=DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 DAY),'%Y-%m-%d') and b.tailingid=#{tailingid}"+
@Select("SELECT count(distinct sensorid)AS `online` from tb_db_data a join tb_drybeachequipinfor b on a.sensorid=b.equipno WHERE a.time >=DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 DAY),'%Y-%m-%d') and b.tailingid=#{tailingid}"+
...
@@ -73,16 +74,16 @@ public interface DrybeachequipinforMapper extends BaseMapper<Drybeachequipinfor>
...
@@ -73,16 +74,16 @@ public interface DrybeachequipinforMapper extends BaseMapper<Drybeachequipinfor>
@Select(value="select equipno from tb_drybeachequipinfor where tailingid =#{tailno}")
@Select(value="select equipno from tb_drybeachequipinfor where tailingid =#{tailno}")
List<String>getequipno(Stringtailno);
List<String>getequipno(Stringtailno);
@Select(value="select equipno as id ,equipname as name from tb_drybeachequipinfor where tailingid =#{tailno}")
@Select(value="select equipno as id ,equipname as name from tb_drybeachequipinfor where tailingid =#{tailno} and equipname !='基准点'")
"select equipno, equipname, onelevelalarm, twolevelalarm, threelevelalarm, fourlevelalarm from tb_drybeachequipinfor where tailingid = #{tailingid}"+
"select equipno, equipname, onelevelalarm, twolevelalarm, threelevelalarm, fourlevelalarm,eqdanwei as unit from tb_drybeachequipinfor where tailingid = #{tailingid}"+
" <if test='searchValue!=\"\" and searchValue!=null '>\n"+
" <if test='searchValue!=\"\" and searchValue!=null '>\n"+
" and equipname like CONCAT('%',#{searchValue},'%')\n"+
" and equipname like CONCAT('%',#{searchValue},'%')\n"+
@Select(value="select ta.equipno as equipno , ta.evalue as evalue , ta.alarmlevel as alarmlevel ,td.equipname ,td.eqdanwei as eqdanwei ,DATE_FORMAT(ta.time,'%Y-%m-%d %H:%i:%s') as time from tab_abnormal ta join tb_drybeachequipinfor td on ta.equipno = td.equipno where ta.state='1' and td.tailingid=#{tailingid} ORDER BY ta.time DESC")
@Select(value="select ta.equipno as equipno , ta.evalue as evalue , ta.alarmlevel as alarmlevel ,td.equipname ,td.eqdanwei as eqdanwei ,DATE_FORMAT(ta.time,'%Y-%m-%d %H:%i:%s') as time from tab_abnormal ta join tb_drybeachequipinfor td on ta.equipno = td.equipno where ta.state='1' and td.tailingid=#{tailingid} ORDER BY ta.time DESC")
@Select(value="select b.equipname as equipname,a.id as id,a.equipno,DATE_FORMAT(a.time,'%Y-%m-%d %H:%i:%m') as time,a.evalue,a.alarmlevel,b.eqdanwei as unit from `tab_abnormal` a join tb_drybeachequipinfor b on a.equipno =b.equipno where ifselect=0 and a.state = 1 and b.tailingid = #{tailingid} ")