大屏-出入管理

This commit is contained in:
sliang 2024-04-02 19:54:43 +08:00
parent df48e3871c
commit a3da38fc42
7 changed files with 45 additions and 34 deletions

View File

@ -9,6 +9,9 @@ import lombok.Data;
@Data @Data
public class TowerAssInspectDto extends ScreenDto { public class TowerAssInspectDto extends ScreenDto {
@ApiModelProperty("实时检测id")
private String id;
@ApiModelProperty("杆塔id") @ApiModelProperty("杆塔id")
private String gtId; private String gtId;

View File

@ -8,6 +8,9 @@ import lombok.Data;
*/ */
@Data @Data
public class TowerAssInspectVo { public class TowerAssInspectVo {
@ApiModelProperty("实时检测id")
private String id;
@ApiModelProperty("设备id") @ApiModelProperty("设备id")
private String deviceId; private String deviceId;
@ApiModelProperty("设备名称") @ApiModelProperty("设备名称")
@ -43,4 +46,7 @@ public class TowerAssInspectVo {
@ApiModelProperty("状态") @ApiModelProperty("状态")
private String isWarn; private String isWarn;
@ApiModelProperty("时间")
private String time;
} }

View File

@ -40,7 +40,7 @@
gb_code,device_type,td.create_time,td.update_time, gb_code,device_type,td.create_time,td.update_time,
td.del_flag,manufacturer,on_line,t_code,idx,sd.dict_name td.del_flag,manufacturer,on_line,t_code,idx,sd.dict_name
from tb_device td 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 where td.del_flag=0
<if test="keyWord!=null and keyWord!=''"> <if test="keyWord!=null and keyWord!=''">
and (device_name like concat('%',#{keyWord},'%') or and (device_name like concat('%',#{keyWord},'%') or

View File

@ -14,28 +14,31 @@
sum( case when tca.access_type = '2' then 1 else 0 end ) as jrcNUm, sum( case when tca.access_type = '2' then 1 else 0 end ) as jrcNUm,
0 as dyrNum, 0 as dyrNum,
0 as dycNUm 0 as dycNUm
FROM tb_car tb FROM tb_project tp
LEFT JOIN tb_car_access tca on tb.id = tca.car_id LEFT JOIN tb_car tc ON tp.bid_code = tc.bid_code
WHERE to_days(tca.accesss_time) = to_days(NOW()) 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 UNION ALL
SELECT SELECT
0 as jtrNum, 0 as jtrNum,
0 as jrcNUm, 0 as jrcNUm,
sum( case when tca.access_type = '1' then 1 else 0 end ) as dyrNum, 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 sum( case when tca.access_type = '2' then 1 else 0 end ) as dycNUm
FROM tb_car tb FROM tb_project tp
LEFT JOIN tb_car_access tca on tb.id = tca.car_id LEFT JOIN tb_car tc ON tp.bid_code = tc.bid_code
WHERE DATE_FORMAT(tca.accesss_time, '%Y%m') = DATE_FORMAT(NOW(), '%Y%m') 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 ) a
</select> </select>
<select id="getVehicleStatisticsPhoto" resultType="com.securitycontrol.entity.screen.vo.AccessMgeVo"> <select id="getVehicleStatisticsPhoto" resultType="com.securitycontrol.entity.screen.vo.AccessMgeVo">
SELECT tw.warn_content as warnContent, trf.file_name as fileName, trf.file_suffix as fileSuffix , trf.file_id as fileId, trf.file_type as fileType SELECT tw.warn_content as warnContent, trf.file_name as fileName, trf.file_suffix as fileSuffix , trf.file_id as fileId, trf.file_type as fileType
FROM tb_car tb FROM tb_project tp
LEFT JOIN tb_car_access tca on tb.id = tca.car_id LEFT JOIN tb_car tc ON tp.bid_code = tc.bid_code
LEFT JOIN tb_car_access tca on tc.id = tca.car_id
LEFT JOIN tb_warn tw ON tw.source_id = tca.id LEFT JOIN tb_warn tw ON tw.source_id = tca.id
LEFT JOIN tb_resource_file trf on trf.source_id = tw.warn_id LEFT JOIN tb_resource_file trf on trf.source_id = tw.warn_id
WHERE trf.del_flag = '0' AND tca.access_type = #{accessType} WHERE tp.bid_code = #{bidCode} and trf.del_flag = '0' AND tca.access_type = #{accessType}
<if test='timeType=="1"'> <if test='timeType=="1"'>
and to_days(tca.accesss_time) = to_days(NOW()) and to_days(tca.accesss_time) = to_days(NOW())
</if> </if>
@ -81,7 +84,7 @@
FROM tb_work_team twt FROM tb_work_team twt
LEFT JOIN t_team_people ttp on twt.team_id = ttp.team_id LEFT JOIN t_team_people ttp on twt.team_id = ttp.team_id
LEFT JOIN tb_user_access tua ON ttp.user_id = tua.user_id LEFT JOIN tb_user_access tua ON ttp.user_id = tua.user_id
WHERE to_days(tua.access_time) = to_days(NOW()) WHERE twt.bid_code = #{bidCode} and to_days(tua.access_time) = to_days(NOW())
UNION ALL UNION ALL
SELECT SELECT
0 as jtrNum, 0 as jtrNum,
@ -91,7 +94,7 @@
FROM tb_work_team twt FROM tb_work_team twt
LEFT JOIN t_team_people ttp on twt.team_id = ttp.team_id LEFT JOIN t_team_people ttp on twt.team_id = ttp.team_id
LEFT JOIN tb_user_access tua ON ttp.user_id = tua.user_id LEFT JOIN tb_user_access tua ON ttp.user_id = tua.user_id
WHERE DATE_FORMAT(tua.access_time, '%Y%m') = DATE_FORMAT(NOW(), '%Y%m') WHERE twt.bid_code = #{bidCode} and DATE_FORMAT(tua.access_time, '%Y%m') = DATE_FORMAT(NOW(), '%Y%m')
)a )a
</select> </select>
@ -102,7 +105,7 @@
LEFT JOIN tb_user_access tua ON ttp.user_id = tua.user_id 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_warn tw ON tw.people_id = tua.id
LEFT JOIN tb_resource_file trf on trf.source_id = tw.warn_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}
<if test='timeType=="1"'> <if test='timeType=="1"'>
and to_days(tua.access_time) = to_days(NOW()) and to_days(tua.access_time) = to_days(NOW())
</if> </if>

View File

@ -16,7 +16,7 @@
LEFT JOIN sys_build sb ON sb.org_id = tw.org_id 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_project tp ON tp.bid_code = tw.bid_code
LEFT JOIN tb_work_team twt ON twt.team_id = tw.team_id 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}
<if test="orgId !=null and orgId!=''"> <if test="orgId !=null and orgId!=''">
AND sb.org_id = #{orgId} AND sb.org_id = #{orgId}
</if> </if>

View File

@ -3,35 +3,32 @@
<mapper namespace="com.securitycontrol.screen.mapper.TowerAssInspectMapper"> <mapper namespace="com.securitycontrol.screen.mapper.TowerAssInspectMapper">
<select id="getDeviceList" resultType="com.securitycontrol.entity.screen.vo.TowerAssInspectVo"> <select id="getDeviceList" resultType="com.securitycontrol.entity.screen.vo.TowerAssInspectVo">
select *,case WHEN aa.`status` = '0' THEN '0' when aa.is_warn like '%1%' then '2' else '1' end type from (
SELECT tbd.device_id as deviceId,tbd.device_name as deviceName, SELECT tbd.device_id as deviceId,tbd.device_name as deviceName,
CASE GROUP_CONCAT(tdv.is_warn ) as is_warn,tbd.`status`
WHEN tbd.`status` = '1' AND tdv.is_warn = '1' THEN '2' FROM tb_pro_bd tpb
WHEN tbd.`status` = '1' AND tdv.is_warn = '0' THEN '1' LEFT join tb_bd_device tbd on tbd.bd_id=tpb.id and tbd.del_flag=0
WHEN tbd.`status` = '0' THEN '0' left join tb_device_detail tdd on tdd.device_id=tbd.device_id and tdd.del_flag=0
END type LEFT JOIN t_pro_gt tpg ON tpb.gt_id = tpg.gt_id
FROM t_pro_gt tpg
LEFT JOIN tb_bd_device tbd ON tpg.gt_id = tbd.gt_id
LEFT JOIN tb_device_detail tdd ON tdd.device_id = tbd.device_id
LEFT JOIN tb_device_value tdv ON tdd.id = tdv.attribute_id LEFT JOIN tb_device_value tdv ON tdd.id = tdv.attribute_id
WHERE tpg.gt_id = #{gtId} WHERE tpg.gt_id = #{gtId} and tbd.devic_type = '1901'
group by tpb.id,tbd.device_id
) aa
</select> </select>
<select id="getRealTimeDetection" resultType="com.securitycontrol.entity.screen.vo.TowerAssInspectVo"> <select id="getRealTimeDetection" resultType="com.securitycontrol.entity.screen.vo.TowerAssInspectVo">
SELECT CASE WHEN tdd.data_type = '3331' THEN '1' SELECT tdd.id as id, tdd.mode_name as modeName , tdv.val AS val
WHEN tdd.data_type = '3332' THEN '2'
WHEN tdd.data_type = '3333' THEN '3'
END dataType,
tdv.val AS val
FROM FROM
tb_device_detail tdd tb_device_detail tdd
LEFT JOIN tb_device_value tdv ON tdd.id = tdv.attribute_id LEFT JOIN tb_device_value tdv ON tdd.id = tdv.attribute_id
WHERE device_id = #{deviceId} WHERE device_id = #{deviceId} and tdd.del_flag = '0'
</select> </select>
<select id="getTrend" resultType="com.securitycontrol.entity.screen.vo.TowerAssInspectVo"> <select id="getTrend" resultType="com.securitycontrol.entity.screen.vo.TowerAssInspectVo">
SELECT thdv.create_time as time, thdv.change_val as changeVal FROM tb_device_detail tdd SELECT thdv.create_time as time, thdv.change_val as changeVal
FROM tb_device_detail tdd
LEFT JOIN tb_his_device_value thdv ON tdd.id = thdv.attribute_id LEFT JOIN tb_his_device_value thdv ON tdd.id = thdv.attribute_id
WHERE tdd.device_id = #{deviceId} WHERE tdd.device_id = #{deviceId} AND tdd.id = #{id} and tdd.del_flag = '0'
ORDER BY thdv.create_time DESC ORDER BY thdv.create_time DESC
</select> </select>

View File

@ -140,8 +140,10 @@
</select> </select>
<select id="getGtLists" resultType="com.securitycontrol.entity.system.vo.SelectVo"> <select id="getGtLists" resultType="com.securitycontrol.entity.system.vo.SelectVo">
SELECT gt_id AS gtId,gt_name AS name FROM t_pro_gt tpg SELECT tpg.gt_id AS gtId,tpg.gt_name AS name
WHERE tpg.bid_code = #{bidCode} FROM tb_pro_bd tpb
LEFT JOIN t_pro_gt tpg ON tpb.gt_id = tpg.gt_id
WHERE tpb.gt_id is not null AND tpb.gt_id !='' AND tpb.bid_code = #{bidCode}
</select> </select>
<!--项目下拉选--> <!--项目下拉选-->
<select id="getProjectList" resultType="com.securitycontrol.entity.system.vo.SelectVo"> <select id="getProjectList" resultType="com.securitycontrol.entity.system.vo.SelectVo">