@@ -28,19 +28,19 @@ public interface SysSummaryMapper extends BaseMapper<SysSummary> {
...
@@ -28,19 +28,19 @@ public interface SysSummaryMapper extends BaseMapper<SysSummary> {
@Select(value="select id from sys_summary where mdcode =#{mdcode} ")
@Select(value="select id from sys_summary where mdcode =#{mdcode} ")
List<Integer>getcode(Stringmdcode);
List<Integer>getcode(Stringmdcode);
@Select(value="select a.id as id ,a.title as title from sys_summary a JOIN sys_devicetype b on a.type=b.type where b.must = '1' and a.name=#{tailingno} "+
@Select(value="select a.id as id ,a.title as title from sys_summary a JOIN tab_devicetype b on a.type=b.type where b.must = '1' and a.name=#{tailingno} "+
"UNION\n"+
"UNION\n"+
"select a.id as id,a.title as title from sys_summary a JOIN sys_devicetype b on a.type=b.type where a.deviceid in (select equipno FROM tb_drybeachequipinfor where tailingid = #{tailingno}) ORDER BY id DESC")
"select a.id as id,a.title as title from sys_summary a JOIN tab_devicetype b on a.type=b.type where a.deviceid in (select equipno FROM tb_drybeachequipinfor where tailingid = #{tailingno}) ORDER BY id DESC")
@Select(value="select a.id as id ,a.title as title from sys_summary a JOIN sys_devicetype b on a.type=b.type where b.must = '2' and a.name = #{tailingno}")
@Select(value="select a.id as id ,a.title as title from sys_summary a JOIN tab_devicetype b on a.type=b.type where b.must = '2' and a.name = #{tailingno}")
@Select(value="SELECT * FROM `sys_summary` where type!='t_14' and name =#{tailingno}\n"+
@Select(value="SELECT * FROM `sys_summary` where type!='t_14' and name =#{tailingno}\n"+
"UNION\n"+
"UNION\n"+
"SELECT a.* FROM `sys_summary` a JOIN monitorvideo b ON a.id = b.v_sumid where name =#{tailingno}\n"+
"SELECT a.* FROM `sys_summary` a JOIN monitorvideo b ON a.id = b.v_sumid where name =#{tailingno}\n"+
"UNION\n"+
"UNION\n"+
"select a.* from sys_summary a JOIN sys_devicetype b on a.type=b.type where a.deviceid in (select equipno FROM tb_drybeachequipinfor where tailingid =#{tailingno}) ORDER BY id DESC")
"select a.* from sys_summary a JOIN tab_devicetype b on a.type=b.type where a.deviceid in (select equipno FROM tb_drybeachequipinfor where tailingid =#{tailingno}) ORDER BY id DESC")
@@ -48,13 +48,13 @@ public interface SysSummaryMapper extends BaseMapper<SysSummary> {
...
@@ -48,13 +48,13 @@ public interface SysSummaryMapper extends BaseMapper<SysSummary> {
"UNION\n"+
"UNION\n"+
"SELECT a.* FROM `sys_summary` a JOIN monitorvideo b ON a.id = b.v_sumid where name =#{tailingno}\n"+
"SELECT a.* FROM `sys_summary` a JOIN monitorvideo b ON a.id = b.v_sumid where name =#{tailingno}\n"+
"UNION\n"+
"UNION\n"+
"select a.* from sys_summary a JOIN sys_devicetype b on a.type=b.type where a.deviceid in (select equipno FROM tb_drybeachequipinfor where tailingid =#{tailingno}) ORDER BY id DESC) r where r.title like CONCAT(CONCAT('%', #{searchValue}), '%')")
"select a.* from sys_summary a JOIN tab_devicetype b on a.type=b.type where a.deviceid in (select equipno FROM tb_drybeachequipinfor where tailingid =#{tailingno}) ORDER BY id DESC) r where r.title like CONCAT(CONCAT('%', #{searchValue}), '%')")
@Select(value = "select a.* from sys_summary a JOIN sys_devicetype b on a.type=b.type where a.deviceid in (select equipno FROM tb_drybeachequipinfor where tailingid =#{tailingno}) ORDER BY id DESC")
@Select(value = "select a.* from sys_summary a JOIN tab_devicetype b on a.type=b.type where a.deviceid in (select equipno FROM tb_drybeachequipinfor where tailingid =#{tailingno}) ORDER BY id DESC")
@@ -31,7 +31,10 @@ public interface DrybeachequipinforMapper extends BaseMapper<Drybeachequipinfor>
...
@@ -31,7 +31,10 @@ public interface DrybeachequipinforMapper extends BaseMapper<Drybeachequipinfor>
@Select(value="select b.tailingno as value ,b.tailingname as name FROM `tab_user_tailpon` a join tb_tailpondinfor b on a.tailingno=b.tailingno where a.username=#{username}")
@Select(value="select b.tailingno as value ,b.tailingname as name FROM `tab_user_tailpon` a join tb_tailpondinfor b on a.tailingno=b.tailingno where a.username=#{username}")
ArrayList<Dic>gettailingid(Stringusername);
ArrayList<Dic>gettailingid(Stringusername);
@Select(value="select code as value ,name from sys_devicetype where must ='0' or type='t_8' ")
@Select(value="select tailingno as value ,tailingname as name from tb_tailpondinfor")
ArrayList<Dic>gettailingid();
@Select(value="select code as value ,name from tab_devicetype where must ='0' or type='t_8' ")
ArrayList<Dic>getdevicetype();
ArrayList<Dic>getdevicetype();
@Select(value="select equipno from tb_drybeachequipinfor where tailingid = #{tailingid}")
@Select(value="select equipno from tb_drybeachequipinfor where tailingid = #{tailingid}")
...
@@ -62,7 +65,7 @@ public interface DrybeachequipinforMapper extends BaseMapper<Drybeachequipinfor>
...
@@ -62,7 +65,7 @@ public interface DrybeachequipinforMapper extends BaseMapper<Drybeachequipinfor>
"SELECT count(distinct sensorid)AS `online` from tb_sl_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 count(distinct sensorid)AS `online` from tb_sl_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}")
@@ -36,7 +36,7 @@ public interface TabAbnormalMapper extends BaseMapper<Abnormal> {
...
@@ -36,7 +36,7 @@ public interface TabAbnormalMapper extends BaseMapper<Abnormal> {
"sum(case when alarmlevel =2 then 1 else 0 end )as \"orange\",\n"+
"sum(case when alarmlevel =2 then 1 else 0 end )as \"orange\",\n"+
"sum(case when alarmlevel =3 then 1 else 0 end )as \"yellow\",\n"+
"sum(case when alarmlevel =3 then 1 else 0 end )as \"yellow\",\n"+
"sum(case when alarmlevel =4 then 1 else 0 end )as \"blue\" \n"+
"sum(case when alarmlevel =4 then 1 else 0 end )as \"blue\" \n"+
"FROM (SELECT * from tab_abnormal where DATE_FORMAT(time,'%y') =DATE_FORMAT(NOW(),'%y') ) a right join (SELECT tdr.equipno as equipno ,tdr.devicetype as `code` ,ssd.`name` as `name` FROM `tb_drybeachequipinfor` tdr join sys_devicetype ssd on tdr.devicetype =ssd.`code` WHERE tdr.tailingid=#{tailno}) b on a.equipno= b.equipno GROUP BY b.code")
"FROM (SELECT * from tab_abnormal where DATE_FORMAT(time,'%y') =DATE_FORMAT(NOW(),'%y') ) a right join (SELECT tdr.equipno as equipno ,tdr.devicetype as `code` ,ssd.`name` as `name` FROM `tb_drybeachequipinfor` tdr join tab_devicetype ssd on tdr.devicetype =ssd.`code` WHERE tdr.tailingid=#{tailno}) b on a.equipno= b.equipno GROUP BY b.code")
@Select(value="select count(a.equipno) as count ,b.equipname,b.equipno ,\n"+
@Select(value="select count(a.equipno) as count ,b.equipname,b.equipno ,\n"+
...
@@ -53,7 +53,7 @@ public interface TabAbnormalMapper extends BaseMapper<Abnormal> {
...
@@ -53,7 +53,7 @@ public interface TabAbnormalMapper extends BaseMapper<Abnormal> {
"sum(case when alarmlevel =2 then 1 else 0 end )as \"2\",\n"+
"sum(case when alarmlevel =2 then 1 else 0 end )as \"2\",\n"+
"sum(case when alarmlevel =3 then 1 else 0 end )as \"3\",\n"+
"sum(case when alarmlevel =3 then 1 else 0 end )as \"3\",\n"+
"sum(case when alarmlevel =4 then 1 else 0 end )as \"4\" \n"+
"sum(case when alarmlevel =4 then 1 else 0 end )as \"4\" \n"+
"FROM (SELECT * from tab_abnormal where DATE_FORMAT(time,'%y') =DATE_FORMAT(NOW(),'%y') and state = 1) a right join (SELECT tdr.equipno as equipno ,tdr.devicetype as `code` ,ssd.`name` as `name` FROM `tb_drybeachequipinfor` tdr join sys_devicetype ssd on tdr.devicetype =ssd.`code` WHERE tdr.tailingid=#{tailno}) b on a.equipno= b.equipno GROUP BY b.code")
"FROM (SELECT * from tab_abnormal where DATE_FORMAT(time,'%y') =DATE_FORMAT(NOW(),'%y') and state = 1) a right join (SELECT tdr.equipno as equipno ,tdr.devicetype as `code` ,ssd.`name` as `name` FROM `tb_drybeachequipinfor` tdr join tab_devicetype ssd on tdr.devicetype =ssd.`code` WHERE tdr.tailingid=#{tailno}) b on a.equipno= b.equipno GROUP BY b.code")
@@ -73,7 +73,7 @@ public interface TabAbnormalMapper extends BaseMapper<Abnormal> {
...
@@ -73,7 +73,7 @@ public interface TabAbnormalMapper extends BaseMapper<Abnormal> {
"\telse ta.alarmlevel\n"+
"\telse ta.alarmlevel\n"+
" end\n"+
" end\n"+
" as alarmlevel\n"+
" as alarmlevel\n"+
" from (select * from tab_abnormal ORDER BY alarmlevel DESC) ta RIGHT join (SELECT tdr.equipno as equipno ,tdr.devicetype as `code` ,ssd.`name` as `name` FROM `tb_drybeachequipinfor` tdr join sys_devicetype ssd on tdr.devicetype =ssd.`code` WHERE tdr.tailingid=#{tailno}) sd on sd.`equipno`=ta.equipno GROUP BY sd.`code`")
" from (select * from tab_abnormal ORDER BY alarmlevel DESC) ta RIGHT join (SELECT tdr.equipno as equipno ,tdr.devicetype as `code` ,ssd.`name` as `name` FROM `tb_drybeachequipinfor` tdr join tab_devicetype ssd on tdr.devicetype =ssd.`code` WHERE tdr.tailingid=#{tailno}) sd on sd.`equipno`=ta.equipno GROUP BY sd.`code`")