Commit a89e1576 authored by maoying's avatar maoying

修改设备点位,设备表相关sql

parent 49c52f4a
...@@ -2,8 +2,9 @@ ...@@ -2,8 +2,9 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.fas.business.dao.mapper.PlanVisual3dMapper"> <mapper namespace="com.yeejoin.amos.fas.business.dao.mapper.PlanVisual3dMapper">
<!--查询--> <!--查询 0-设备类;1-耗材类;2-视频监控;3-灭火器材'-->
<select id="getResourceListByType" resultType="java.util.HashMap"> <select id="getResourceListByType" resultType="java.util.HashMap">
SELECT SELECT
rs.id as `key` , rs.id as `key` ,
rs.id AS `value`, rs.id AS `value`,
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<mapper namespace="com.yeejoin.amos.fas.business.dao.mapper.AlarmMapper"> <mapper namespace="com.yeejoin.amos.fas.business.dao.mapper.AlarmMapper">
<!----> <!---->
<select id="countPageData" resultType="long"> <select id="countPageData" resultType="long">
SELECT <!-- SELECT
count(a.id) AS total_num count(a.id) AS total_num
FROM `f_alarm` a FROM `f_alarm` a
inner join inner join
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<trim prefix="WHERE" prefixOverrides="AND "> <trim prefix="WHERE" prefixOverrides="AND ">
<if test="beginDate!=null"> and a.alarm_time >= #{beginDate} </if> <if test="beginDate!=null"> and a.alarm_time >= #{beginDate} </if>
<if test="endDate!=null"> and a.alarm_time <![CDATA[<=]]> #{endDate} </if> <if test="endDate!=null"> and a.alarm_time <![CDATA[<=]]> #{endDate} </if>
</trim> </trim> -->
</select> </select>
<select id="countAlarmData" resultType="long"> <select id="countAlarmData" resultType="long">
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
</select> </select>
<!--分页查询 --> <!--分页查询 -->
<select id="getAlarmMapperPage" resultType="java.util.HashMap"> <select id="getAlarmMapperPage" resultType="java.util.HashMap">
SELECT <!-- SELECT
a.id, a.id,
sa.code, sa.code,
sa.equip_code as equipCode, sa.equip_code as equipCode,
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
<choose> <choose>
<when test="pageSize==-1"></when> <when test="pageSize==-1"></when>
<when test="pageSize!=-1">limit #{offset},#{pageSize}</when> <when test="pageSize!=-1">limit #{offset},#{pageSize}</when>
</choose> </choose> -->
</select> </select>
......
...@@ -115,7 +115,7 @@ ...@@ -115,7 +115,7 @@
<select id="queryForFireEquipmentHistoryCount" resultType="long"> <select id="queryForFireEquipmentHistoryCount" resultType="long">
SELECT <!-- SELECT
count(1) count(1)
FROM FROM
( (
...@@ -159,12 +159,12 @@ ...@@ -159,12 +159,12 @@
</if> </if>
<if test="startTime!=null"> <if test="startTime!=null">
AND d.create_date BETWEEN '${startTime}' AND '${endTime}' AND d.create_date BETWEEN '${startTime}' AND '${endTime}'
</if> </if> -->
</select> </select>
<select id="queryForFireEquipmentHistory" resultType="map"> <select id="queryForFireEquipmentHistory" resultType="map">
SELECT <!-- SELECT
d.* d.*
FROM FROM
( (
...@@ -220,7 +220,7 @@ ...@@ -220,7 +220,7 @@
</if> </if>
ORDER BY d.create_date desc ORDER BY d.create_date desc
LIMIT ${start},${length} LIMIT ${start},${length}
-->
</select> </select>
...@@ -326,7 +326,7 @@ ...@@ -326,7 +326,7 @@
</select> </select>
<select id="findAllEquipPointInfo" resultType="com.yeejoin.amos.fas.business.vo.EquipCommunicationData"> <select id="findAllEquipPointInfo" resultType="com.yeejoin.amos.fas.business.vo.EquipCommunicationData">
SELECT <!-- SELECT
p.`code` pointCode, p.`code` pointCode,
p.`name` pointName, p.`name` pointName,
f.`name` equimentName, f.`name` equimentName,
...@@ -342,11 +342,11 @@ ...@@ -342,11 +342,11 @@
LEFT JOIN f_fire_equipment e ON e.id = p.fire_equipment_id LEFT JOIN f_fire_equipment e ON e.id = p.fire_equipment_id
LEFT JOIN f_equipment_fire_equipment fe ON fe.fire_equipment_id = e.id LEFT JOIN f_equipment_fire_equipment fe ON fe.fire_equipment_id = e.id
LEFT JOIN f_equipment f ON f.id = fe.equipment_id LEFT JOIN f_equipment f ON f.id = fe.equipment_id
LEFT JOIN f_dict d on d.id = p.alarm_type LEFT JOIN f_dict d on d.id = p.alarm_type -->
</select> </select>
<select id="findOneByPointCode" resultType="com.yeejoin.amos.fas.business.vo.EquipCommunicationData"> <select id="findOneByPointCode" resultType="com.yeejoin.amos.fas.business.vo.EquipCommunicationData">
SELECT <!-- SELECT
p.`code` pointCode, p.`code` pointCode,
p.`name` pointName, p.`name` pointName,
e.id fireEquipmentId, e.id fireEquipmentId,
...@@ -359,7 +359,7 @@ ...@@ -359,7 +359,7 @@
f_fire_equipment_point p f_fire_equipment_point p
LEFT JOIN f_fire_equipment e ON e.id = p.fire_equipment_id LEFT JOIN f_fire_equipment e ON e.id = p.fire_equipment_id
LEFT JOIN f_dict d on d.id = p.alarm_type LEFT JOIN f_dict d on d.id = p.alarm_type
where p.`code` = #{code} where p.`code` = #{code} -->
</select> </select>
<select id="listByCodes" resultType="com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentEntity"> <select id="listByCodes" resultType="com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentEntity">
...@@ -393,7 +393,7 @@ ...@@ -393,7 +393,7 @@
<insert id="saveBatch" keyColumn="id" keyProperty="id" <insert id="saveBatch" keyColumn="id" keyProperty="id"
parameterType="com.yeejoin.amos.fas.business.param.FireEquipmentParam" parameterType="com.yeejoin.amos.fas.business.param.FireEquipmentParam"
useGeneratedKeys="true"> useGeneratedKeys="true">
insert into f_fire_equipment <!-- insert into f_fire_equipment
( (
org_code, org_code,
code, code,
...@@ -432,7 +432,7 @@ ...@@ -432,7 +432,7 @@
#{item.weight}, #{item.weight},
#{item.riskSourceId} #{item.riskSourceId}
) )
</foreach> </foreach> -->
</insert> </insert>
<update id="updateBatch"> <update id="updateBatch">
...@@ -517,7 +517,7 @@ ...@@ -517,7 +517,7 @@
count(1) count(1)
FROM FROM
f_equipment_fire_equipment efe f_equipment_fire_equipment efe
JOIN f_fire_equipment fe ON efe.fire_equipment_id = fe.id JOIN wl_equipment_specific fe ON efe.fire_equipment_id = fe.id
WHERE WHERE
efe.equipment_id = ${equipmentId} efe.equipment_id = ${equipmentId}
<if test="fname != null"> <if test="fname != null">
...@@ -531,7 +531,7 @@ ...@@ -531,7 +531,7 @@
<select id="removeIfmeaPointByFireEquipIdAndEquipId" resultType="long"> <select id="removeIfmeaPointByFireEquipIdAndEquipId" resultType="long">
DELETE fmep FROM `f_fmea_equipment_point` fmep DELETE fmep FROM `f_fmea_equipment_point` fmep
LEFT JOIN f_fire_equipment_point fep ON fep.id = fmep.equipment_point_id LEFT JOIN wl_equipment_specific_index esi ON esi.id = fmep.equipment_point_id
WHERE fep.fire_equipment_id = #{fireEquipmentId} AND fmep.important_equipment_id = #{importantEquipmentId} WHERE esi.equipment_specific_id = #{fireEquipmentId} AND fmep.important_equipment_id = #{importantEquipmentId}
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -6,30 +6,30 @@ ...@@ -6,30 +6,30 @@
<select id="queryOne" resultType="java.util.Map"> <select id="queryOne" resultType="java.util.Map">
select * from f_fire_equipment_point where id = ${id} <!-- select * from f_fire_equipment_point where id = ${id} -->
</select> </select>
<select id="queryCountForPage" resultType="long"> <select id="queryCountForPage" resultType="long">
select count(1) from f_fire_equipment_point <!-- select count(1) from f_fire_equipment_point
where fire_equipment_id = ${fireEqumntId} where fire_equipment_id = ${fireEqumntId}
<if test="name!=null"> <if test="name!=null">
and fp.name like '%${name}%' and fp.name like '%${name}%'
</if> </if> -->
</select> </select>
<select id="queryForPage" resultType="java.util.Map"> <select id="queryForPage" resultType="java.util.Map">
select * from f_fire_equipment_point fp <!-- select * from f_fire_equipment_point fp
where fp.fire_equipment_id = ${fireEqumntId} where fp.fire_equipment_id = ${fireEqumntId}
<if test="name!=null"> <if test="name!=null">
and fp.name like '%${name}%' and fp.name like '%${name}%'
</if> </if>
LIMIT ${start},${length} ; LIMIT ${start},${length} ; -->
</select> </select>
<select id="queryForEqueAndPointName" resultType="map"> <select id="queryForEqueAndPointName" resultType="map">
SELECT <!-- SELECT
ep.`name`, ep.`name`,
( (
SELECT SELECT
...@@ -52,12 +52,12 @@ ...@@ -52,12 +52,12 @@
AND se.risk_source_id = ${riskSourceId} AND se.risk_source_id = ${riskSourceId}
) )
AND ep.type = 'SWITCH' AND ep.type = 'SWITCH'
AND ep.`value` = 1 AND ep.`value` = 1 -->
</select> </select>
<select id="queryStopCountByEuipmentIdAndAlarmType" resultType="int"> <select id="queryStopCountByEuipmentIdAndAlarmType" resultType="int">
SELECT <!-- SELECT
count(1) count(1)
FROM FROM
f_equipment e, f_equipment e,
...@@ -70,11 +70,11 @@ ...@@ -70,11 +70,11 @@
and d.id = ep.alarm_type and d.id = ep.alarm_type
AND d.dict_value = #{alarmType} AND d.dict_value = #{alarmType}
AND e.id = #{equimentId} AND e.id = #{equimentId}
AND ep.`value` = #{value} AND ep.`value` = #{value} -->
</select> </select>
<select id="queryCountByEuipmentIdAndAlarmType" resultType="int"> <select id="queryCountByEuipmentIdAndAlarmType" resultType="int">
SELECT <!-- SELECT
count(1) count(1)
FROM FROM
f_equipment e, f_equipment e,
...@@ -86,17 +86,17 @@ ...@@ -86,17 +86,17 @@
AND fe.fire_equipment_id = ep.fire_equipment_id AND fe.fire_equipment_id = ep.fire_equipment_id
and d.id = ep.alarm_type and d.id = ep.alarm_type
AND d.dict_value = #{alarmType} AND d.dict_value = #{alarmType}
AND e.id = #{equimentId} AND e.id = #{equimentId}-->
</select> </select>
<update id="updateValue"> <update id="updateValue">
update f_fire_equipment_point set value = #{state},create_date = NOW() where id = #{id} <!-- update f_fire_equipment_point set value = #{state},create_date = NOW() where id = #{id} -->
</update> </update>
<insert id="saveBatch" keyColumn="id" keyProperty="id" <insert id="saveBatch" keyColumn="id" keyProperty="id"
parameterType="com.yeejoin.amos.fas.business.param.FireEquipmentPointParam" parameterType="com.yeejoin.amos.fas.business.param.FireEquipmentPointParam"
useGeneratedKeys="true"> useGeneratedKeys="true">
insert into f_fire_equipment_point <!-- insert into f_fire_equipment_point
( (
name, name,
code, code,
...@@ -119,11 +119,11 @@ ...@@ -119,11 +119,11 @@
#{item.orgCode}, #{item.orgCode},
#{item.createBy} #{item.createBy}
) )
</foreach> </foreach>-->
</insert> </insert>
<select id="listByMap" resultType="com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentPointEntity"> <select id="listByMap" resultType="com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentPointEntity">
select <!-- select
a.id, a.id,
a.name, a.name,
a.code, a.code,
...@@ -159,11 +159,11 @@ ...@@ -159,11 +159,11 @@
order by a.create_date desc order by a.create_date desc
<if test="pageSize!=null and pageSize!=-1 and offset!=null"> <if test="pageSize!=null and pageSize!=-1 and offset!=null">
limit #{offset},#{pageSize} limit #{offset},#{pageSize}
</if> </if> -->
</select> </select>
<select id="countByMap" resultType="long"> <select id="countByMap" resultType="long">
select <!-- select
count(1) count(1)
from from
f_fire_equipment_point as a f_fire_equipment_point as a
...@@ -178,11 +178,11 @@ ...@@ -178,11 +178,11 @@
<if test="type!=null and type.trim() != ''"> <if test="type!=null and type.trim() != ''">
and a.type = #{type} and a.type = #{type}
</if> </if>
</where> </where> -->
</select> </select>
<select id="getByCode" resultType="com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentPointEntity"> <select id="getByCode" resultType="com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentPointEntity">
select <!-- select
id, id,
name, name,
code, code,
...@@ -199,11 +199,11 @@ ...@@ -199,11 +199,11 @@
f_fire_equipment_point f_fire_equipment_point
where where
code = #{code} code = #{code}
limit 1 limit 1 -->
</select> </select>
<update id="updateBatch"> <update id="updateBatch">
<foreach collection="list" item="item" index="index" separator=";"> <!-- <foreach collection="list" item="item" index="index" separator=";">
update f_fire_equipment_point update f_fire_equipment_point
<set> <set>
<if test="item.name != null"> <if test="item.name != null">
...@@ -241,11 +241,11 @@ ...@@ -241,11 +241,11 @@
</if> </if>
</set> </set>
where id = #{item.id} where id = #{item.id}
</foreach> </foreach> -->
</update> </update>
<select id="listByCodes" resultType="com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentPointEntity"> <select id="listByCodes" resultType="com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentPointEntity">
select <!-- select
id, id,
name, name,
code, code,
...@@ -264,11 +264,11 @@ ...@@ -264,11 +264,11 @@
code in code in
<foreach collection="codes" item="item" index="index" open="(" separator="," close=")"> <foreach collection="codes" item="item" index="index" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach> -->
</select> </select>
<select id="getById" resultType="com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentPointEntity"> <select id="getById" resultType="com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentPointEntity">
select <!-- select
id, id,
name, name,
code, code,
...@@ -285,11 +285,11 @@ ...@@ -285,11 +285,11 @@
f_fire_equipment_point f_fire_equipment_point
where where
id = #{id} id = #{id}
limit 1 limit 1 -->
</select> </select>
<select id="countBindByIds" resultType="java.lang.Long"> <select id="countBindByIds" resultType="java.lang.Long">
select <!-- select
count(1) count(1)
from from
f_fire_equipment_point f_fire_equipment_point
...@@ -299,23 +299,23 @@ ...@@ -299,23 +299,23 @@
#{item} #{item}
</foreach> </foreach>
and and
fire_equipment_id > 0 fire_equipment_id > 0 -->
</select> </select>
<update id="updatefireEquipmentIdByIds"> <update id="updatefireEquipmentIdByIds">
update <!-- update
f_fire_equipment_point f_fire_equipment_point
set set
fire_equipment_id = #{fireEquipmentId} fire_equipment_id = #{fireEquipmentId}
where id in where id in
<foreach collection="ids" item="item" index="index" open="(" separator="," close=")"> <foreach collection="ids" item="item" index="index" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach> -->
</update> </update>
<insert id="save" keyColumn="id" keyProperty="id" parameterType="com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentPointEntity" <insert id="save" keyColumn="id" keyProperty="id" parameterType="com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentPointEntity"
useGeneratedKeys="true"> useGeneratedKeys="true">
insert into f_fire_equipment_point <!-- insert into f_fire_equipment_point
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null"> <if test="name != null">
name, name,
...@@ -385,11 +385,11 @@ ...@@ -385,11 +385,11 @@
<if test="alarmType != null"> <if test="alarmType != null">
#{alarmType}, #{alarmType},
</if> </if>
</trim> </trim> -->
</insert> </insert>
<update id="update" parameterType="com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentPointEntity"> <update id="update" parameterType="com.yeejoin.amos.fas.business.entity.mybatis.FireEquipmentPointEntity">
update f_fire_equipment_point <!-- update f_fire_equipment_point
<set> <set>
<if test="name != null"> <if test="name != null">
name = #{name}, name = #{name},
...@@ -425,25 +425,25 @@ ...@@ -425,25 +425,25 @@
alarm_type = #{alarmType}, alarm_type = #{alarmType},
</if> </if>
</set> </set>
where id = #{id} where id = #{id} -->
</update> </update>
<delete id="deleteBatchByIds"> <delete id="deleteBatchByIds">
delete from f_fire_equipment_point <!-- delete from f_fire_equipment_point
where where
id in id in
<foreach collection="list" item="item" index="index" open="(" separator="," close=")"> <foreach collection="list" item="item" index="index" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach> -->
</delete> </delete>
<select id="getPointsByEquipmentIdAndType" resultType="Map"> <select id="getPointsByEquipmentIdAndType" resultType="Map">
SELECT p.* from <!-- SELECT p.* from
f_fire_equipment_point p f_fire_equipment_point p
LEFT JOIN f_fire_equipment fe on p.fire_equipment_id = fe.id LEFT JOIN f_fire_equipment fe on p.fire_equipment_id = fe.id
LEFT JOIN f_equipment_fire_equipment e on fe.id = e.fire_equipment_id LEFT JOIN f_equipment_fire_equipment e on fe.id = e.fire_equipment_id
where e.equipment_id = #{id} where e.equipment_id = #{id}
and p.type = #{type} and p.type = #{type} -->
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -50,14 +50,14 @@ ...@@ -50,14 +50,14 @@
select select
c.fmea_id as fmeaId c.fmea_id as fmeaId
from from
f_fire_equipment as a wl_equipment_specific as a
left join left join
f_fire_equipment_point as b on b.fire_equipment_id = a.id wl_equipment_specific_index as b on b.equipment_specific_id = a.id
left join left join
f_fmea_equipment_point as c on c.equipment_point_id = b.id f_fmea_equipment_point as c on c.equipment_point_id = b.id
where where
c.fmea_id = #{fmeaId} c.fmea_id = #{fmeaId}
group by b.fire_equipment_id group by b.equipment_specific_id
) as d ) as d
</select> </select>
...@@ -65,21 +65,25 @@ ...@@ -65,21 +65,25 @@
select select
c.fmea_id as fmeaId, c.fmea_id as fmeaId,
a.id as equipmentId, a.id as equipmentId,
group_concat(concat( b.NAME, '##', c.state ) SEPARATOR <![CDATA[ '\n' ]]> ) as equipmentPointNames, group_concat(concat( ei.name, '##', c.state ) SEPARATOR <![CDATA[ '\n' ]]> ) as equipmentPointNames,
a.name as equipmentName, ed.name as equipmentName,
a.code as equipmentCode, a.code as equipmentCode,
d.name AS importantEquipName, d.name AS importantEquipName,
d.id AS importantEquipId d.id AS importantEquipId
from from
f_fire_equipment as a wl_equipment_specific as a
left join left join
f_fire_equipment_point as b on b.fire_equipment_id = a.id wl_equipment_detail as ed on ed.id = a.equipment_detail_id
left join
wl_equipment_specific_index as b on b.equipment_specific_id = a.id
left join
wl_equipment_index as ei on b.equipment_index_id = ei.id
left join left join
f_fmea_equipment_point as c on c.equipment_point_id = b.id f_fmea_equipment_point as c on c.equipment_point_id = b.id
LEFT JOIN f_equipment AS d ON d.id = c.important_equipment_id LEFT JOIN f_equipment AS d ON d.id = c.important_equipment_id
where where
c.fmea_id = #{fmeaId} c.fmea_id = #{fmeaId}
group by b.fire_equipment_id,c.important_equipment_id group by b.equipment_specific_id,c.important_equipment_id
limit #{offset},#{limit} limit #{offset},#{limit}
</select> </select>
...@@ -87,13 +91,13 @@ ...@@ -87,13 +91,13 @@
select select
count(1) count(1)
from from
f_fire_equipment_point as a wl_equipment_specific_index as a
where where
a.fire_equipment_id = #{equipmentId} a.equipment_specific_id = #{equipmentId}
</select> </select>
<select id="listEquipmentPointIdsByEquipmentId" resultType="java.lang.Long"> <select id="listEquipmentPointIdsByEquipmentId" resultType="java.lang.Long">
select id from f_fire_equipment_point where fire_equipment_id = #{equipmentId} select id from wl_equipment_specific_index where equipment_specific_id = #{equipmentId}
</select> </select>
<select id="listByEquipmentPointId" resultType="com.yeejoin.amos.fas.dao.entity.FmeaEquipmentPoint"> <select id="listByEquipmentPointId" resultType="com.yeejoin.amos.fas.dao.entity.FmeaEquipmentPoint">
...@@ -108,8 +112,8 @@ ...@@ -108,8 +112,8 @@
<select id="listEquipmentPoint" resultType="java.util.Map"> <select id="listEquipmentPoint" resultType="java.util.Map">
select select
a.id, a.id,
a.name, ei.name,
a.code, ei.name_key as code,
( (
select select
case when count(1) > 0 then 'bound' else 'noBound' end case when count(1) > 0 then 'bound' else 'noBound' end
...@@ -123,15 +127,15 @@ ...@@ -123,15 +127,15 @@
d.important_equipment_id = #{importantEquipId} d.important_equipment_id = #{importantEquipId}
) isBound ) isBound
from from
f_fire_equipment_point as a wl_equipment_specific_index as a
left join f_dict fd on fd.id = a.alarm_type left join wl_equipment_index ei on ei.id = a.equipment_index_id
<where> <where>
fd.dict_value = 'alarm_type_trouble' ei.type_code = 'BREAKDOWN'
<if test="equipmentId!=null"> <if test="equipmentId!=null">
and a.fire_equipment_id = #{equipmentId} and a.equipment_specific_id = #{equipmentId}
</if> </if>
<if test="equipmentPointName!=null and equipmentPointName!=''"> <if test="equipmentPointName!=null and equipmentPointName!=''">
and a.name like concat("%",#{equipmentPointName},"%") and ei.name like concat("%",#{equipmentPointName},"%")
</if> </if>
</where> </where>
</select> </select>
......
...@@ -149,12 +149,11 @@ ...@@ -149,12 +149,11 @@
SELECT SELECT
1 1
FROM FROM
f_fire_equipment_point ep wl_equipment_specific_index ep
LEFT JOIN f_fire_equipment e ON e.id = ep.fire_equipment_id LEFT JOIN wl_equipment_specific e ON e.id = ep.equipment_specific_id
LEFT JOIN f_equipment_fire_equipment fe ON fe.fire_equipment_id = e.id LEFT JOIN f_equipment_fire_equipment fe ON fe.fire_equipment_id = e.id
LEFT JOIN f_dict d on ep.alarm_type = d.id LEFT JOIN wl_equipment_index ei on ei.id = ep.equipment_index_id
where d.dict_code = 'fire_equipment_switch' where ei.type_code = 'FIREALARM'
and d.dict_value = 'alarm_type_fire'
and fe.equipment_id = #{equipmentId} and fe.equipment_id = #{equipmentId}
and ep.id = #{pointId} and ep.id = #{pointId}
</select> </select>
......
...@@ -570,12 +570,14 @@ ...@@ -570,12 +570,14 @@
<select id="queryForFmeaEquipAlarm" resultType="map"> <select id="queryForFmeaEquipAlarm" resultType="map">
SELECT SELECT
fe.`name` as 'fireEquipmentName', ed.`name` as 'fireEquipmentName',
fep.`name` as 'name' ei.`name` as 'name'
FROM FROM
`f_fmea_equipment_point` AS fmep `f_fmea_equipment_point` AS fmep
LEFT JOIN f_fire_equipment_point fep ON fep.id = fmep.equipment_point_id LEFT JOIN wl_equipment_specific_index fep ON fep.id = fmep.equipment_point_id
LEFT JOIN f_fire_equipment fe ON fe.id = fep.fire_equipment_id LEFT JOIN wl_equipment_index ei ON ei.id = fep.equipment_index_id
LEFT JOIN wl_equipment_specific fe ON fe.id = fep.equipment_specific_id
LEFT JOIN wl_equipment_detail ed ON ed.id = fe.equipment_detail_id
LEFT JOIN f_fmea fm ON fm.id = fmep.fmea_id LEFT JOIN f_fmea fm ON fm.id = fmep.fmea_id
WHERE WHERE
fmep.state = 1 fmep.state = 1
...@@ -637,7 +639,7 @@ ...@@ -637,7 +639,7 @@
<select id="queryContingencyWater" resultType="java.util.HashMap"> <select id="queryContingencyWater" resultType="java.util.HashMap">
SELECT <!-- SELECT
wr.alarm_level, wr.alarm_level,
wr.max_level, wr.max_level,
wr.area, wr.area,
...@@ -654,7 +656,7 @@ ...@@ -654,7 +656,7 @@
wr.alarm_level, wr.alarm_level,
wr.max_level, wr.max_level,
wr.area, wr.area,
wr.`name` wr.`name` -->
</select> </select>
......
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