Commit 75f51940 authored by maoying's avatar maoying

修改消防装备查询

parent ce086d02
...@@ -534,30 +534,41 @@ ...@@ -534,30 +534,41 @@
SELECT SELECT
spec.id AS id, spec.id AS id,
spec.org_code AS org_code, spec.org_code AS org_code,
spec.CODE AS CODE, spec.code AS code,
detail.CODE AS equip_code, detail.code AS equip_code,
detail.NAME AS NAME, detail.name AS name,
detail.standard AS model, detail.standard AS model,
detail.maintenance_cycle AS maintenance_cycle, detail.maintenance_cycle AS maintenance_cycle,
manufatcturer.NAME AS manufacturer, manufatcturer.name AS manufacturer,
detail.brand AS detail, detail.brand AS detail,
detail.production_date AS production_date, detail.production_date AS production_date,
sd.amount AS number, sd.amount AS number,
unit.NAME AS unit, unit.name AS unit,
'' AS position3d, warehouse.full_name AS room,
'' AS floor3d,
'' AS is_indoor,
'' AS room,
detail.remark, detail.remark,
detail.creator_id AS create_by, detail.creator_id AS create_by,
spec.create_date AS create_date, spec.create_date AS create_date,
'1' equip_status, (
CASE
WHEN (
SELECT
count(1)
FROM
wl_equipment_specific_alarm a
WHERE
a.equipment_specific_id = spec.id and status = TRUE
) > 0 THEN
0
ELSE
1
END
) AS equip_status,
detail.video AS video_url, detail.video AS video_url,
warehouse.source_id AS risk_source_id, warehouse.source_id AS risk_source_id,
warehouse.full_name AS production_area, warehouse.full_name AS production_area,
( (
SELECT SELECT
GROUP_CONCAT( fe.NAME ) GROUP_CONCAT( fe.name )
FROM FROM
f_equipment_fire_equipment ffe f_equipment_fire_equipment ffe
LEFT JOIN f_equipment fe ON fe.id = ffe.equipment_id LEFT JOIN f_equipment fe ON fe.id = ffe.equipment_id
...@@ -579,33 +590,29 @@ ...@@ -579,33 +590,29 @@
</select> </select>
<select id="findVideoById" resultType="com.yeejoin.amos.fas.business.bo.FireEquipmentBo"> <select id="findVideoById" resultType="com.yeejoin.amos.fas.business.bo.FireEquipmentBo">
SELECT SELECT
risk.*,
video.id AS id, video.id AS id,
video.org_code AS org_code, video.org_code AS org_code,
video.CODE AS CODE, video.`code` AS `code`,
video.CODE AS equip_code, video.`code` AS equip_code,
video.NAME AS NAME, video.`name` AS `name`,
'' AS model, '' AS model,
'' AS maintenance_cycle, '' AS maintenance_cycle,
'' AS manufatcturer, '' AS manufatcturer,
'' AS detail, '' AS detail,
video.create_date AS production_date, video.create_date AS production_date,
'' AS number, 1 AS number,
'' AS unit, '' AS unit,
video.position3d AS position3d, ws.full_name AS room,
risk.floor3d AS floor3d,
risk.is_indoor AS is_indoor,
'' AS room,
video.remark, video.remark,
video.creator_id AS create_by, video.creator_id AS create_by,
video.create_date AS create_date, video.create_date AS create_date,
'1' equip_status, '1' equip_status,
video.url AS video_url, video.url AS video_url,
source.source_id AS risk_source_id, ws.source_id AS risk_source_id,
risk.name AS production_area, ws.full_name AS production_area,
( (
SELECT SELECT
GROUP_CONCAT( fe.NAME ) GROUP_CONCAT( fe.`name` )
FROM FROM
wl_video_important_equipment ffe wl_video_important_equipment ffe
LEFT JOIN f_equipment fe ON fe.id = ffe.important_equipment_id LEFT JOIN f_equipment fe ON fe.id = ffe.important_equipment_id
...@@ -614,11 +621,13 @@ ...@@ -614,11 +621,13 @@
) protectObjNames ) protectObjNames
FROM wl_video video FROM wl_video video
LEFT JOIN wl_video_source source ON source.video_id =video.id LEFT JOIN wl_video_source source ON source.video_id =video.id
LEFT JOIN f_risk_source risk ON risk.id = source.source_id LEFT JOIN wl_warehouse_structure ws ON ws.id = source.source_id
WHERE <where>
<if test="id != null"> <if test="id != null">
video.id = #{id} video.id = #{id}
</if> </if>
</where>
</select> </select>
<!-- <select id="findFireStationById" resultType="com.yeejoin.amos.fas.dao.entity.FireStation">--> <!-- <select id="findFireStationById" resultType="com.yeejoin.amos.fas.dao.entity.FireStation">-->
......
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