Commit b76f1ad8 authored by KeYong's avatar KeYong

Merge branch 'develop_3.7.2.2' of…

Merge branch 'develop_3.7.2.2' of http://36.40.66.175:5000/station/YeeAmosFireAutoSysRoot into develop_3.7.2.2
parents 1833255c 9c3b5a5d
...@@ -19,6 +19,8 @@ import org.springframework.messaging.Message; ...@@ -19,6 +19,8 @@ import org.springframework.messaging.Message;
import org.springframework.messaging.MessageChannel; import org.springframework.messaging.MessageChannel;
import org.springframework.messaging.MessageHandler; import org.springframework.messaging.MessageHandler;
import java.util.UUID;
/** /**
* @author keyong * @author keyong
* @title: WebMqttSubscribe * @title: WebMqttSubscribe
...@@ -76,7 +78,7 @@ public class WebMqttSubscribe { ...@@ -76,7 +78,7 @@ public class WebMqttSubscribe {
@Bean @Bean
public MessageProducer inbound() { public MessageProducer inbound() {
adapter = new MqttPahoMessageDrivenChannelAdapter(clientId, mqttPahoClientFactory(), defaultTopic); adapter = new MqttPahoMessageDrivenChannelAdapter(clientId+ UUID.randomUUID(), mqttPahoClientFactory(), defaultTopic);
adapter.setConverter(new DefaultPahoMessageConverter()); adapter.setConverter(new DefaultPahoMessageConverter());
adapter.setQos(0); adapter.setQos(0);
adapter.setOutputChannel(mqttInputChannel()); adapter.setOutputChannel(mqttInputChannel());
......
...@@ -6,30 +6,26 @@ ...@@ -6,30 +6,26 @@
<select id="getSafetyIndexWeek" resultType="java.util.HashMap"> <select id="getSafetyIndexWeek" resultType="java.util.HashMap">
<![CDATA[ <![CDATA[
SELECT distinct temp1.*,IFNULL(S.safety_index,0) as value SELECT distinct temp1.*, IFNULL(S.safety_index, 0) as value
FROM ( FROM (
SELECT @s :=@s + 1 as `index`, DATE(DATE_SUB(CURRENT_DATE, INTERVAL @s DAY)) AS date SELECT @s := @s + 1 as `index`, DATE (DATE_SUB(CURRENT_DATE, INTERVAL @s DAY)) AS date
FROM mysql.help_topic,(SELECT @s := 0) temp FROM mysql.help_topic, (SELECT @s := 0) temp
) temp1 ) temp1
left join f_safety_index_change_log S on S.collect_date = temp1.date left join f_safety_index_change_log S
on S.collect_date = temp1.date
where temp1.index < 8 where temp1.index < 8
ORDER BY temp1.date ORDER BY temp1.date
]]> ]]>
</select> </select>
<select id="countUpperRiskPoint" resultType="long"> <select id="countUpperRiskPoint" resultType="long">
SELECT SELECT count(DISTINCT frcl.risk_source_id)
count(DISTINCT frcl.risk_source_id) FROM (
FROM SELECT a.id,
(
SELECT
a.id,
a.risk_source_id a.risk_source_id
FROM FROM `f_rpn_change_log` a,
`f_rpn_change_log` a,
`f_risk_source` b `f_risk_source` b
WHERE WHERE a.type = #{type}
a.type = #{type}
and a.risk_source_id = b.id and a.risk_source_id = b.id
and b.org_code = #{orgCode} and b.org_code = #{orgCode}
and date_format(a.create_date, '%Y-%m-%d') = #{date} and date_format(a.create_date, '%Y-%m-%d') = #{date}
...@@ -37,12 +33,9 @@ ...@@ -37,12 +33,9 @@
) as frcl ) as frcl
</select> </select>
<select id="countCheckException" resultType="long"> <select id="countCheckException" resultType="long">
SELECT SELECT count(distinct pc.point_id)
count(distinct pc.point_id) FROM p_check pc
FROM WHERE DATE_FORMAT(pc.check_time, '%Y-%m-%d') = #{date}
p_check pc
WHERE
DATE_FORMAT(pc.check_time, '%Y-%m-%d') = #{date}
AND ( AND (
pc.org_code = #{orgCode} pc.org_code = #{orgCode}
OR pc.org_code LIKE CONCAT(#{orgCode}, '-%') OR pc.org_code LIKE CONCAT(#{orgCode}, '-%')
...@@ -51,68 +44,55 @@ ...@@ -51,68 +44,55 @@
</select> </select>
<select id="countFireException" resultType="long"> <select id="countFireException" resultType="long">
SELECT SELECT count(1)
count(1) FROM wl_equipment_specific_alarm a
FROM WHERE status = 1
wl_equipment_specific_alarm a
WHERE
status = 1
AND org_code = #{orgCode} AND org_code = #{orgCode}
AND type = 'BREAKDOWN' AND type = 'BREAKDOWN'
AND date_format(a.update_date, '%Y-%m-%d') = #{date} AND date_format(a.update_date, '%Y-%m-%d') = #{date}
</select> </select>
<select id="getAllErrorRiskPoint" resultType="com.yeejoin.amos.fas.business.bo.RiskPointRpnChangeBo"> <select id="getAllErrorRiskPoint" resultType="com.yeejoin.amos.fas.business.bo.RiskPointRpnChangeBo">
SELECT SELECT rcl.id,
rcl.id,
rcl.create_date AS changeDate, rcl.create_date AS changeDate,
rs.risk_level_id AS riskLevelId, rs.risk_level_id AS riskLevelId,
rs.`name` rs.`name`
FROM FROM (
( SELECT risk_source_id,
SELECT
risk_source_id,
MAX(create_date) create_date, MAX(create_date) create_date,
MAX(id) id MAX(id) id
FROM FROM f_rpn_change_log
f_rpn_change_log WHERE type = '0'
WHERE
type = '0'
AND DATE_FORMAT(create_date, '%Y-%m-%d') = #{date} AND DATE_FORMAT(create_date, '%Y-%m-%d') = #{date}
group by risk_source_id group by risk_source_id
) rcl ) rcl
LEFT JOIN f_risk_source rs ON rs.id = rcl.risk_source_id LEFT JOIN f_risk_source rs ON rs.id = rcl.risk_source_id
WHERE rs.risk_level_id is not NULL WHERE rs.risk_level_id is not NULL
AND (rs.org_code = #{orgCode} OR rs.org_code like CONCAT(#{orgCode},'-%')) AND (rs.org_code = #{orgCode} OR rs.org_code like CONCAT(#{orgCode}, '-%'))
</select> </select>
<select id="getAllErrorPatrolPoint" resultType="com.yeejoin.amos.fas.business.bo.CheckErrorBo"> <select id="getAllErrorPatrolPoint" resultType="com.yeejoin.amos.fas.business.bo.CheckErrorBo">
SELECT SELECT pc.point_id id,
pc.point_id id,
pc.point_name 'name', pc.point_name 'name',
pc.`is_ok` as status, pc.`is_ok` as status,
max(pc.check_time) as changeDate max(pc.check_time) as changeDate
FROM FROM p_check pc
p_check pc WHERE DATE_FORMAT(pc.check_time, '%Y-%m-%d') = #{date}
WHERE
DATE_FORMAT(pc.check_time, '%Y-%m-%d') = #{date}
AND ( AND (
pc.org_code = #{orgCode} pc.org_code = #{orgCode}
OR pc.org_code LIKE CONCAT(#{orgCode}, '-%') OR pc.org_code LIKE CONCAT(#{orgCode}, '-%')
) )
AND pc.`is_ok` = '2' AND pc.`is_ok` = '2'
GROUP BY pc.point_id,pc.`is_ok`,pc.point_name GROUP BY pc.point_id, pc.`is_ok`, pc.point_name
</select> </select>
<select id="getAllFaultAlarm" resultType="com.yeejoin.amos.fas.business.bo.CheckErrorBo"> <select id="getAllFaultAlarm" resultType="com.yeejoin.amos.fas.business.bo.CheckErrorBo">
select select ala.id,
ala.id,
ala.equipment_specific_name as name, ala.equipment_specific_name as name,
cate.name as status, cate.name as status,
ala.update_date as changeDate ala.update_date as changeDate
from from wl_equipment_specific_alarm as ala
wl_equipment_specific_alarm as ala
left join wl_equipment_specific as spe on ala.equipment_specific_id = spe.id left join wl_equipment_specific as spe on ala.equipment_specific_id = spe.id
left join wl_equipment_detail as det on spe.equipment_detail_id = det.id left join wl_equipment_detail as det on spe.equipment_detail_id = det.id
left join wl_equipment as equ on equ.id = det.equipment_id left join wl_equipment as equ on equ.id = det.equipment_id
...@@ -126,94 +106,80 @@ ...@@ -126,94 +106,80 @@
<select id="getStatisticsCheck" resultType="java.util.HashMap"> <select id="getStatisticsCheck" resultType="java.util.HashMap">
<![CDATA[ <![CDATA[
SELECT SELECT (
( SELECT ifnull(sum(`p_plan_task`.`point_num`), 0)
SELECT FROM `p_plan_task`
ifnull( sum( `p_plan_task`.`point_num` ), 0 ) WHERE (
FROM `p_plan_task`.`check_date` LIKE concat(curdate(), '%'))) AS `point_num`,
`p_plan_task`
WHERE
( (
`p_plan_task`.`check_date` LIKE concat( curdate(), '%' ))) AS `point_num`,( SELECT ifnull(sum(`p_plan_task`.`point_num`), 0)
SELECT FROM `p_plan_task`
ifnull( sum( `p_plan_task`.`point_num` ), 0 ) WHERE ((
FROM
`p_plan_task`
WHERE
((
`p_plan_task`.`finish_status` = 3 `p_plan_task`.`finish_status` = 3
) )
AND ( AND (
`p_plan_task`.`check_date` LIKE concat( curdate(), '%' )))) AS `miss_num`,( `p_plan_task`.`check_date` LIKE concat(curdate(), '%')))) AS `miss_num`,
SELECT
count( 1 ) AS `total_num`
FROM
( (
SELECT SELECT count(1) AS `total_num`
`b`.`id` AS `id` FROM (
FROM SELECT `b`.`id` AS `id`
`p_plan_task_detail` `b` FROM `p_plan_task_detail` `b`
LEFT JOIN `p_plan_task` `a` ON `a`.`id` = `b`.`task_no` LEFT JOIN `p_plan_task` `a` ON `a`.`id` = `b`.`task_no`
LEFT JOIN `p_point` `d` ON `d`.`id` = `b`.`point_id` LEFT JOIN `p_point` `d` ON `d`.`id` = `b`.`point_id`
LEFT JOIN p_check c ON c.plan_task_detail_id = b.id LEFT JOIN p_check c ON c.plan_task_detail_id = b.id
WHERE WHERE `b`.`is_finish` = 1
`b`.`is_finish` = 1 AND c.is_ok = 1 AND `a`.`check_date` = curdate() AND c.is_ok = 1
ORDER BY AND `a`.`check_date` = curdate()
`b`.`id` ORDER BY `b`.`id`
) `t` ) AS `ok_num`,( ) `t`) AS `ok_num`,
SELECT
count( 1 ) AS `total_num`
FROM
( (
SELECT SELECT count(1) AS `total_num`
`b`.`id` AS `id` FROM (
FROM SELECT `b`.`id` AS `id`
`p_plan_task_detail` `b` FROM `p_plan_task_detail` `b`
LEFT JOIN `p_plan_task` `a` ON `a`.`id` = `b`.`task_no` LEFT JOIN `p_plan_task` `a` ON `a`.`id` = `b`.`task_no`
LEFT JOIN `p_point` `d` ON `d`.`id` = `b`.`point_id` LEFT JOIN `p_point` `d` ON `d`.`id` = `b`.`point_id`
LEFT JOIN p_check c ON c.plan_task_detail_id = b.id LEFT JOIN p_check c ON c.plan_task_detail_id = b.id
WHERE WHERE `b`.`is_finish` = 1
`b`.`is_finish` = 1 AND c.is_ok = 2 AND `a`.`check_date` = curdate() AND c.is_ok = 2
ORDER BY AND `a`.`check_date` = curdate()
`b`.`id` ORDER BY `b`.`id`
) `t` ) AS `notOk_num`,( ) `t`) AS `notOk_num`,
SELECT (
ifnull( sum( `p_plan_task`.`point_num` ), 0 ) SELECT ifnull(sum(`p_plan_task`.`point_num`), 0)
FROM FROM `p_plan_task`
`p_plan_task` WHERE ((
WHERE
((
`p_plan_task`.`finish_status` = 0 `p_plan_task`.`finish_status` = 0
) )
AND ( AND (
`p_plan_task`.`check_date` LIKE concat( curdate(), '%' )))) AS `notStart_num` `p_plan_task`.`check_date` LIKE concat(curdate(), '%')))) AS `notStart_num`
]]> ]]>
</select> </select>
<select id="getRiskErrorTop5" resultType="com.yeejoin.amos.fas.business.bo.SafetyExecuteBo"> <select id="getRiskErrorTop5" resultType="com.yeejoin.amos.fas.business.bo.SafetyExecuteBo">
SELECT n.id,r.code,r.name as label,r.id as pointId,'risk' as type,n.create_date as changeDate SELECT n.id, r.code, r.name as label, r.id as pointId, 'risk' as type, n.create_date as changeDate
FROM f_rpn_change_log n FROM f_rpn_change_log n
LEFT JOIN f_risk_source r ON r.id = n.risk_source_id LEFT JOIN f_risk_source r ON r.id = n.risk_source_id
WHERE n.type = 0 WHERE n.type = 0
ORDER BY n.create_date desc ORDER BY n.create_date desc limit 0,5
limit 0,5
</select> </select>
<select id="getCheckErrorTop5" resultType="com.yeejoin.amos.fas.business.bo.SafetyExecuteBo"> <select id="getCheckErrorTop5" resultType="com.yeejoin.amos.fas.business.bo.SafetyExecuteBo">
SELECT p.id,I.point_no as code, SELECT p.id,
IF(p.is_ok = '2', CONCAT(I.name,' 不合格') ,CONCAT(I.name,' 漏检') ) as label, I.point_no as code,
p.point_id,'patrol' as type,p.check_time as changeDate IF(p.is_ok = '2', CONCAT(I.name, ' 不合格'), CONCAT(I.name, ' 漏检')) as label,
p.point_id,
'patrol' as type,
p.check_time as changeDate
FROM p_check p FROM p_check p
left join p_point I ON I.id = p.point_id left join p_point I ON I.id = p.point_id
where p.is_ok IN ('2', '3') where p.is_ok IN ('2', '3')
AND I.is_delete = 0 AND I.is_delete = 0
ORDER BY p.check_time desc ORDER BY p.check_time desc limit 0,5
limit 0,5
</select> </select>
<select id="getFireAlarmTop5" resultType="com.yeejoin.amos.fas.business.bo.SafetyExecuteBo"> <select id="getFireAlarmTop5" resultType="com.yeejoin.amos.fas.business.bo.SafetyExecuteBo">
SELECT SELECT ala.id,
ala.id,
ala.equipment_specific_id AS pointId, ala.equipment_specific_id AS pointId,
'monitorEquipment' AS type, 'monitorEquipment' AS type,
spe.`code`, spe.`code`,
...@@ -224,7 +190,7 @@ ...@@ -224,7 +190,7 @@
'(', '(',
ala.equipment_specific_name, ala.equipment_specific_name,
')', ')',
IF ( IF(
( (
ISNULL(ws.full_name) ISNULL(ws.full_name)
AND ISNULL(sd.description) AND ISNULL(sd.description)
...@@ -240,46 +206,45 @@ ...@@ -240,46 +206,45 @@
) )
) AS label, ) AS label,
ala.update_date AS changeDate ala.update_date AS changeDate
FROM FROM wl_equipment_specific_alarm AS ala
wl_equipment_specific_alarm AS ala
LEFT JOIN wl_equipment_specific AS spe ON ala.equipment_specific_id = spe.id LEFT JOIN wl_equipment_specific AS spe ON ala.equipment_specific_id = spe.id
LEFT JOIN wl_stock_detail sd ON sd.equipment_specific_id = spe.id LEFT JOIN wl_stock_detail sd ON sd.equipment_specific_id = spe.id
LEFT JOIN wl_warehouse_structure ws ON ws.id = sd.warehouse_structure_id LEFT JOIN wl_warehouse_structure ws ON ws.id = sd.warehouse_structure_id
WHERE WHERE ala.`status` = 1
ala.`status` = 1
AND ( AND (
ala.type = 'FIREALARM' ala.type = 'FIREALARM'
) )
ORDER BY ORDER BY ala.update_date DESC LIMIT 0,5
ala.update_date DESC
LIMIT 0,5
</select> </select>
<select id="getEquipStatusTop5" resultType="com.yeejoin.amos.fas.business.bo.SafetyExecuteBo"> <select id="getEquipStatusTop5" resultType="com.yeejoin.amos.fas.business.bo.SafetyExecuteBo">
SELECT
wlesi.id, SELECT *
from (
SELECT wlesi.id,
wlesi.`value` `status`, wlesi.`value` `status`,
wles.code, wles.code,
wlesi.update_date changeDate, wlesi.update_date changeDate,
CONCAT(ed.NAME, ' ', wlei.NAME,IF((ISNULL(ws.full_name) AND ISNULL(sd.description)),'',CONCAT( CONCAT(ed.NAME, ' ', wlei.NAME,
IF((ISNULL(ws.full_name) AND ISNULL(sd.description)), '', CONCAT(
'【', '【',
IFNULL(ws.full_name, ''), IFNULL(ws.full_name, ''),
' ', ' ',
IFNULL(sd.description, ''), IFNULL(sd.description, ''),
'】' '】'
))) label ))) label
FROM FROM wl_equipment_specific_index wlesi
wl_equipment_specific_index wlesi
LEFT JOIN wl_equipment_index wlei ON wlesi.equipment_index_id = wlei.id LEFT JOIN wl_equipment_index wlei ON wlesi.equipment_index_id = wlei.id
LEFT JOIN wl_equipment_specific wles ON wlesi.equipment_specific_id = wles.id LEFT JOIN wl_equipment_specific wles ON wlesi.equipment_specific_id = wles.id
LEFT JOIN wl_equipment_detail ed ON ed.id = wles.equipment_detail_id LEFT JOIN wl_equipment_detail ed ON ed.id = wles.equipment_detail_id
LEFT JOIN wl_stock_detail sd ON sd.equipment_specific_id = wles.id LEFT JOIN wl_stock_detail sd ON sd.equipment_specific_id = wles.id
LEFT JOIN wl_warehouse_structure ws ON ws.id = sd.warehouse_structure_id LEFT JOIN wl_warehouse_structure ws ON ws.id = sd.warehouse_structure_id
WHERE WHERE wlei.is_alarm = false
wlei.is_alarm = false and wlei.type_code in
ORDER BY ('Action', 'Reset', 'FeedBack', 'StartStop', 'Tripping', 'Control', 'Normal', 'WYStartStop')
wlesi.update_date DESC ORDER BY wlesi.update_date DESC LIMIT 0,5
LIMIT 0,5 ) a
where a.label is not null
</select> </select>
<select id="initViewErrorNode" resultType="com.yeejoin.amos.fas.business.vo.View3dNodeVo"> <select id="initViewErrorNode" resultType="com.yeejoin.amos.fas.business.vo.View3dNodeVo">
...@@ -369,7 +334,7 @@ ...@@ -369,7 +334,7 @@
LEFT JOIN f_risk_level rl ON rl.id = r.risk_level_id LEFT JOIN f_risk_level rl ON rl.id = r.risk_level_id
WHERE WHERE
r.is_region = 'FALSE' r.is_region = 'FALSE'
<if test = "dataLevel != null and dataLevel != ''" > <if test="dataLevel != null and dataLevel != ''">
AND rl. level = #{dataLevel} AND rl. level = #{dataLevel}
</if> </if>
UNION ALL UNION ALL
...@@ -627,7 +592,8 @@ ...@@ -627,7 +592,8 @@
</select> </select>
<select id="retrieveAll" resultType="java.util.HashMap"> <select id="retrieveAll" resultType="java.util.HashMap">
select *,'{ "x": 0, "y": 0, "z": 0 }' rotationDTO,'{ "x": 1, "y": 1, "z": 1 }' scaleDTO select *,'{ "x": 0, "y": 0, "z": 0 }' rotationDTO,'{ "x": 1, "y": 1, "z": 1 }' scaleDTO
from (select concat('riskSource-',r.id) as id,concat(r.id) as originId,r.name,r.code,r.ue4_location as ue4Location,r.ue4_rotation as ue4Rotation ,'riskSource' as type,r.org_code as orgCode, from (select concat('riskSource-',r.id) as id,concat(r.id) as originId,r.name,r.code,r.ue4_location as
ue4Location,r.ue4_rotation as ue4Rotation ,'riskSource' as type,r.org_code as orgCode,
rl.level as level,rl.name as levelStr,r.is_indoor as isIndoor,'风险点' as typeName,'riskSource' as typeCode, rl.level as level,rl.name as levelStr,r.is_indoor as isIndoor,'风险点' as typeName,'riskSource' as typeCode,
CASE CASE
WHEN ( WHEN (
...@@ -664,8 +630,10 @@ ...@@ -664,8 +630,10 @@
AND rl.level = #{dataLevel} AND rl.level = #{dataLevel}
</if> </if>
UNION all UNION all
select concat('patrol-',p.id) as id,concat(p.id) as originId,p.name,p.point_no as code,p.ue4_location as ue4Location,p.ue4_rotation as ue4Rotation ,'patrol' as type,p.org_code as orgCode, select concat('patrol-',p.id) as id,concat(p.id) as originId,p.name,p.point_no as code,p.ue4_location as
p.status as level,CONCAT('level_',p.status) as levelStr,p.is_indoor as isIndoor,'巡检点' as typeName,'patrol' as typeCode, ue4Location,p.ue4_rotation as ue4Rotation ,'patrol' as type,p.org_code as orgCode,
p.status as level,CONCAT('level_',p.status) as levelStr,p.is_indoor as isIndoor,'巡检点' as typeName,'patrol' as
typeCode,
CASE CASE
WHEN ( WHEN (
ISNULL(p.coordinates) || LENGTH(trim(p.coordinates)) <![CDATA[ <]]> 1 ISNULL(p.coordinates) || LENGTH(trim(p.coordinates)) <![CDATA[ <]]> 1
...@@ -703,7 +671,8 @@ ...@@ -703,7 +671,8 @@
left join f_risk_source r on r.id = p.risk_source_id left join f_risk_source r on r.id = p.risk_source_id
WHERE is_delete = FALSE WHERE is_delete = FALSE
UNION all UNION all
select concat('impEquipment-',e.id) as id,concat(e.id) as originId,e.name,e.code,e.ue4_location as ue4Location,e.ue4_rotation as ue4Rotation ,'impEquipment' as type,e.org_code as orgCode, select concat('impEquipment-',e.id) as id,concat(e.id) as originId,e.name,e.code,e.ue4_location as
ue4Location,e.ue4_rotation as ue4Rotation ,'impEquipment' as type,e.org_code as orgCode,
0 as level,'level_0' as levelStr,e.is_indoor as isIndoor,'重点设备' as typeName,'impEquipment' as typeCode, 0 as level,'level_0' as levelStr,e.is_indoor as isIndoor,'重点设备' as typeName,'impEquipment' as typeCode,
CASE CASE
WHEN ( WHEN (
...@@ -736,8 +705,10 @@ ...@@ -736,8 +705,10 @@
from f_equipment e from f_equipment e
left join f_risk_source r on r.id = e.risk_source_id left join f_risk_source r on r.id = e.risk_source_id
UNION all UNION all
select concat('monitorEquipment-',m.id) as id,concat(m.id) as originId,det.name,m.code as code,'' as ue4Location,'' as ue4Rotation ,'monitorEquipment' as type,m.org_code as orgCode, select concat('monitorEquipment-',m.id) as id,concat(m.id) as originId,det.name,m.code as code,'' as
null as level , concat('level_',null) as levelStr,null as isIndoor,'探测器' as typeName,'monitorEquipment' as typeCode, ue4Location,'' as ue4Rotation ,'monitorEquipment' as type,m.org_code as orgCode,
null as level , concat('level_',null) as levelStr,null as isIndoor,'探测器' as typeName,'monitorEquipment' as
typeCode,
CASE CASE
WHEN ( WHEN (
ISNULL(null) || LENGTH(trim(null)) <![CDATA[ <]]> 1 ISNULL(null) || LENGTH(trim(null)) <![CDATA[ <]]> 1
...@@ -779,7 +750,8 @@ ...@@ -779,7 +750,8 @@
where substr(m.equipment_code ,1,4) = '9204' where substr(m.equipment_code ,1,4) = '9204'
group By m.code group By m.code
UNION all UNION all
select concat('video-',vi.id) as id,concat(vi.id) as originId,vi.name,vi.code,null as ue4Location,null as ue4Rotation ,'video' as type,vi.org_code as orgCode, select concat('video-',vi.id) as id,concat(vi.id) as originId,vi.name,vi.code,null as ue4Location,null as
ue4Rotation ,'video' as type,vi.org_code as orgCode,
null as level , concat('level_',null) as levelStr,null as isIndoor,'摄像头' as typeName,'video' as typeCode, null as level , concat('level_',null) as levelStr,null as isIndoor,'摄像头' as typeName,'video' as typeCode,
CASE CASE
WHEN ( WHEN (
...@@ -814,7 +786,8 @@ ...@@ -814,7 +786,8 @@
LEFT JOIN wl_warehouse_structure AS ws ON ws.id = vis.source_id LEFT JOIN wl_warehouse_structure AS ws ON ws.id = vis.source_id
group by vi.id group by vi.id
UNION all UNION all
select concat('hydrant-',spe.id) as id,concat(spe.id) as originId,det.name,spe.code as code,null as ue4Location,null as ue4Rotation ,'hydrant' as type,spe.org_code as orgCode, select concat('hydrant-',spe.id) as id,concat(spe.id) as originId,det.name,spe.code as code,null as
ue4Location,null as ue4Rotation ,'hydrant' as type,spe.org_code as orgCode,
0 as level , 'level_0' as levelStr,null as isIndoor,'消防栓' as typeName,'fireEquipment' as typeCode, 0 as level , 'level_0' as levelStr,null as isIndoor,'消防栓' as typeName,'fireEquipment' as typeCode,
CASE CASE
WHEN ( WHEN (
...@@ -899,7 +872,8 @@ ...@@ -899,7 +872,8 @@
a.instance_id) s a.instance_id) s
LEFT JOIN f_risk_source r ON s.instanceId = r.source_id LEFT JOIN f_risk_source r ON s.instanceId = r.source_id
UNION all UNION all
select concat('fireCar-',car.id) as id,concat(car.id) as originId,car.name,car.car_num as code,null as ue4Location,null as ue4Rotation, 'fireCar' as type,car.org_code as orgCode, select concat('fireCar-',car.id) as id,concat(car.id) as originId,car.name,car.car_num as code,null as
ue4Location,null as ue4Rotation, 'fireCar' as type,car.org_code as orgCode,
0 as level , 'level_0' as levelStr,null as isIndoor,'消防车' as typeName,'fireEquipment' as typeCode, 0 as level , 'level_0' as levelStr,null as isIndoor,'消防车' as typeName,'fireEquipment' as typeCode,
CASE CASE
WHEN ( WHEN (
...@@ -933,8 +907,10 @@ ...@@ -933,8 +907,10 @@
left join wl_equipment as equ on car.equipment_id = equ.id left join wl_equipment as equ on car.equipment_id = equ.id
left join wl_equipment_category as cat on equ.category_id = cat.id left join wl_equipment_category as cat on equ.category_id = cat.id
UNION all UNION all
select concat('extinguisher-',spe.id) as id,concat(spe.id) as originId,det.name,spe.code as code,null as ue4Location,null as ue4Rotation,'extinguisher' as type,spe.org_code as orgCode, select concat('extinguisher-',spe.id) as id,concat(spe.id) as originId,det.name,spe.code as code,null as
null as level , concat('level_',null) as levelStr,null as isIndoor,'灭火器' as typeName,'fireEquipment' as typeCode, ue4Location,null as ue4Rotation,'extinguisher' as type,spe.org_code as orgCode,
null as level , concat('level_',null) as levelStr,null as isIndoor,'灭火器' as typeName,'fireEquipment' as
typeCode,
CASE CASE
WHEN ( WHEN (
ISNULL(null) || LENGTH(trim(null)) <![CDATA[ <]]> 1 ISNULL(null) || LENGTH(trim(null)) <![CDATA[ <]]> 1
...@@ -974,7 +950,8 @@ ...@@ -974,7 +950,8 @@
UNION all UNION all
select select
concat('fireChamber-',s.instanceId) as id, concat('fireChamber-',s.instanceId) as id,
concat(s.instanceId) as originId,s.name,s.code,null as ue4Location,null as ue4Rotation,'fireChamber' as type,s.orgCode, concat(s.instanceId) as originId,s.name,s.code,null as ue4Location,null as ue4Rotation,'fireChamber' as
type,s.orgCode,
0 as level , 'level_0' as levelStr,null as isIndoor,'泡沫间' as typeName,'fireEquipment' as typeCode, 0 as level , 'level_0' as levelStr,null as isIndoor,'泡沫间' as typeName,'fireEquipment' as typeCode,
null as positionDTO, null as positionDTO,
s.name as label, s.name as label,
...@@ -1021,7 +998,8 @@ ...@@ -1021,7 +998,8 @@
UNION all UNION all
select select
concat('fireFoamRoom-',s.instanceId) as id, concat('fireFoamRoom-',s.instanceId) as id,
concat(s.instanceId) as originId,s.name,s.code,null as ue4Location,null as ue4Rotation,'fireFoamRoom' as type,s.orgCode, concat(s.instanceId) as originId,s.name,s.code,null as ue4Location,null as ue4Rotation,'fireFoamRoom' as
type,s.orgCode,
0 as level , 'level_0' as levelStr,null as isIndoor,'消防室' as typeName,'fireEquipment' as typeCode, 0 as level , 'level_0' as levelStr,null as isIndoor,'消防室' as typeName,'fireEquipment' as typeCode,
null as positionDTO, null as positionDTO,
s.name as label, s.name as label,
...@@ -1503,8 +1481,7 @@ ...@@ -1503,8 +1481,7 @@
LIMIT ${start},${length} LIMIT ${start},${length}
</select> </select>
<select id="getPlanAlarmInfo" resultType="com.yeejoin.amos.fas.business.bo.FirePlanAlarmBo"> <select id="getPlanAlarmInfo" resultType="com.yeejoin.amos.fas.business.bo.FirePlanAlarmBo">
SELECT SELECT '4' stationId,
'4' stationId,
cod.batch_No, cod.batch_No,
cod.equipment_Name AS deviceName, cod.equipment_Name AS deviceName,
fe.`code` AS deviceId, fe.`code` AS deviceId,
...@@ -1514,7 +1491,7 @@ ...@@ -1514,7 +1491,7 @@
cod.fire_Equipment_Name AS FiredeviceName, cod.fire_Equipment_Name AS FiredeviceName,
wesa.create_date AS warningTime, wesa.create_date AS warningTime,
IF ( IF(
ISNULL(wesa.id), ISNULL(wesa.id),
'', '',
CONCAT( CONCAT(
...@@ -1526,15 +1503,11 @@ ...@@ -1526,15 +1503,11 @@
wesa.equipment_specific_index_name wesa.equipment_specific_index_name
) )
) AS warningInfo ) AS warningInfo
FROM FROM `contingency_original_data` cod
`contingency_original_data` cod
LEFT JOIN f_equipment fe ON fe.id = cod.equipment_Id LEFT JOIN f_equipment fe ON fe.id = cod.equipment_Id
LEFT JOIN wl_equipment_specific wes ON wes.id = cod.fire_Equipment_Id LEFT JOIN wl_equipment_specific wes ON wes.id = cod.fire_Equipment_Id
LEFT JOIN wl_equipment_specific_alarm wesa ON wesa.equipment_specific_id = wes.id LEFT JOIN wl_equipment_specific_alarm wesa ON wesa.equipment_specific_id = wes.id
WHERE WHERE cod.batch_No = #{batchNo}
cod.batch_No = #{batchNo} ORDER BY wesa.create_date DESC LIMIT 1
ORDER BY
wesa.create_date DESC
LIMIT 1
</select> </select>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment