From a3da38fc42f04bdd645fd7e18f00baec2f6f1fef Mon Sep 17 00:00:00 2001 From: sliang <1589399930@qq.com> Date: Tue, 2 Apr 2024 19:54:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=A7=E5=B1=8F-=E5=87=BA=E5=85=A5=E7=AE=A1?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/screen/dto/TowerAssInspectDto.java | 3 ++ .../entity/screen/vo/TowerAssInspectVo.java | 6 ++++ .../main/resources/mapper/DeviceMapper.xml | 2 +- .../main/resources/mapper/AccessMgeMapper.xml | 27 ++++++++------- .../main/resources/mapper/AlarmMgeMapper.xml | 2 +- .../mapper/TowerAssInspectMapper.xml | 33 +++++++++---------- .../resources/mapper/base/SelectMapper.xml | 6 ++-- 7 files changed, 45 insertions(+), 34 deletions(-) diff --git a/securitycontrol-commons/securitycontrol-commons-entity/src/main/java/com/securitycontrol/entity/screen/dto/TowerAssInspectDto.java b/securitycontrol-commons/securitycontrol-commons-entity/src/main/java/com/securitycontrol/entity/screen/dto/TowerAssInspectDto.java index 7820d4d..878b203 100644 --- a/securitycontrol-commons/securitycontrol-commons-entity/src/main/java/com/securitycontrol/entity/screen/dto/TowerAssInspectDto.java +++ b/securitycontrol-commons/securitycontrol-commons-entity/src/main/java/com/securitycontrol/entity/screen/dto/TowerAssInspectDto.java @@ -9,6 +9,9 @@ import lombok.Data; @Data public class TowerAssInspectDto extends ScreenDto { + @ApiModelProperty("实时检测id") + private String id; + @ApiModelProperty("杆塔id") private String gtId; diff --git a/securitycontrol-commons/securitycontrol-commons-entity/src/main/java/com/securitycontrol/entity/screen/vo/TowerAssInspectVo.java b/securitycontrol-commons/securitycontrol-commons-entity/src/main/java/com/securitycontrol/entity/screen/vo/TowerAssInspectVo.java index 3f8431a..88ae13d 100644 --- a/securitycontrol-commons/securitycontrol-commons-entity/src/main/java/com/securitycontrol/entity/screen/vo/TowerAssInspectVo.java +++ b/securitycontrol-commons/securitycontrol-commons-entity/src/main/java/com/securitycontrol/entity/screen/vo/TowerAssInspectVo.java @@ -8,6 +8,9 @@ import lombok.Data; */ @Data public class TowerAssInspectVo { + @ApiModelProperty("实时检测id") + private String id; + @ApiModelProperty("设备id") private String deviceId; @ApiModelProperty("设备名称") @@ -43,4 +46,7 @@ public class TowerAssInspectVo { @ApiModelProperty("状态") private String isWarn; + @ApiModelProperty("时间") + private String time; + } diff --git a/securitycontrol-model/securitycontrol-background/src/main/resources/mapper/DeviceMapper.xml b/securitycontrol-model/securitycontrol-background/src/main/resources/mapper/DeviceMapper.xml index cc66064..5d0942a 100644 --- a/securitycontrol-model/securitycontrol-background/src/main/resources/mapper/DeviceMapper.xml +++ b/securitycontrol-model/securitycontrol-background/src/main/resources/mapper/DeviceMapper.xml @@ -40,7 +40,7 @@ gb_code,device_type,td.create_time,td.update_time, td.del_flag,manufacturer,on_line,t_code,idx,sd.dict_name from tb_device td - left join sys_dict sd on sd.dict_code=td.device_type and sd.p_code=1800 + left join sys_dict sd on sd.dict_code=td.device_type and sd.p_code= 1800 where td.del_flag=0 and (device_name like concat('%',#{keyWord},'%') or diff --git a/securitycontrol-model/securitycontrol-screen/src/main/resources/mapper/AccessMgeMapper.xml b/securitycontrol-model/securitycontrol-screen/src/main/resources/mapper/AccessMgeMapper.xml index 5e1d6c0..deec1d2 100644 --- a/securitycontrol-model/securitycontrol-screen/src/main/resources/mapper/AccessMgeMapper.xml +++ b/securitycontrol-model/securitycontrol-screen/src/main/resources/mapper/AccessMgeMapper.xml @@ -14,28 +14,31 @@ sum( case when tca.access_type = '2' then 1 else 0 end ) as jrcNUm, 0 as dyrNum, 0 as dycNUm - FROM tb_car tb - LEFT JOIN tb_car_access tca on tb.id = tca.car_id - WHERE to_days(tca.accesss_time) = to_days(NOW()) + FROM tb_project tp + LEFT JOIN tb_car tc ON tp.bid_code = tc.bid_code + LEFT JOIN tb_car_access tca on tc.id = tca.car_id + WHERE tp.bid_code = #{bidCode} and to_days(tca.accesss_time) = to_days(NOW()) UNION ALL SELECT 0 as jtrNum, 0 as jrcNUm, sum( case when tca.access_type = '1' then 1 else 0 end ) as dyrNum, sum( case when tca.access_type = '2' then 1 else 0 end ) as dycNUm - FROM tb_car tb - LEFT JOIN tb_car_access tca on tb.id = tca.car_id - WHERE DATE_FORMAT(tca.accesss_time, '%Y%m') = DATE_FORMAT(NOW(), '%Y%m') + FROM tb_project tp + LEFT JOIN tb_car tc ON tp.bid_code = tc.bid_code + LEFT JOIN tb_car_access tca on tc.id = tca.car_id + WHERE tp.bid_code = #{bidCode} and DATE_FORMAT(tca.accesss_time, '%Y%m') = DATE_FORMAT(NOW(), '%Y%m') ) a @@ -102,7 +105,7 @@ LEFT JOIN tb_user_access tua ON ttp.user_id = tua.user_id LEFT JOIN tb_warn tw ON tw.people_id = tua.id LEFT JOIN tb_resource_file trf on trf.source_id = tw.warn_id - WHERE trf.del_flag = '0' AND tua.access_type = #{accessType} + WHERE twt.bid_code = #{bidCode} and trf.del_flag = '0' AND tua.access_type = #{accessType} and to_days(tua.access_time) = to_days(NOW()) diff --git a/securitycontrol-model/securitycontrol-screen/src/main/resources/mapper/AlarmMgeMapper.xml b/securitycontrol-model/securitycontrol-screen/src/main/resources/mapper/AlarmMgeMapper.xml index 3077a7c..e7c910a 100644 --- a/securitycontrol-model/securitycontrol-screen/src/main/resources/mapper/AlarmMgeMapper.xml +++ b/securitycontrol-model/securitycontrol-screen/src/main/resources/mapper/AlarmMgeMapper.xml @@ -16,7 +16,7 @@ LEFT JOIN sys_build sb ON sb.org_id = tw.org_id LEFT JOIN tb_project tp ON tp.bid_code = tw.bid_code LEFT JOIN tb_work_team twt ON twt.team_id = tw.team_id - where tw.warn_type = #{warnType} + where tw.bid_code = #{bidCode} and tw.warn_type = #{warnType} AND sb.org_id = #{orgId} diff --git a/securitycontrol-model/securitycontrol-screen/src/main/resources/mapper/TowerAssInspectMapper.xml b/securitycontrol-model/securitycontrol-screen/src/main/resources/mapper/TowerAssInspectMapper.xml index 003f9f1..1cdfa7c 100644 --- a/securitycontrol-model/securitycontrol-screen/src/main/resources/mapper/TowerAssInspectMapper.xml +++ b/securitycontrol-model/securitycontrol-screen/src/main/resources/mapper/TowerAssInspectMapper.xml @@ -3,35 +3,32 @@ diff --git a/securitycontrol-model/securitycontrol-system/src/main/resources/mapper/base/SelectMapper.xml b/securitycontrol-model/securitycontrol-system/src/main/resources/mapper/base/SelectMapper.xml index 39bd695..9412347 100644 --- a/securitycontrol-model/securitycontrol-system/src/main/resources/mapper/base/SelectMapper.xml +++ b/securitycontrol-model/securitycontrol-system/src/main/resources/mapper/base/SelectMapper.xml @@ -140,8 +140,10 @@