app检查表记录清单排查列表显示空的消防点位

0927cmt
songwenxuan 2024-05-10 17:01:15 +08:00
parent 3dc5aac3ac
commit fb2c461dd2
2 changed files with 149 additions and 117 deletions

View File

@ -28,6 +28,12 @@
FIRE_CHECK_TYPE = #{FIRE_CHECK_TYPE}, FIRE_CHECK_TYPE = #{FIRE_CHECK_TYPE},
OPERATOR = #{OPERATOR}, OPERATOR = #{OPERATOR},
OPERATTIME = #{OPERATTIME} OPERATTIME = #{OPERATTIME}
<if test="DEPARTMENT_ID != null and DEPARTMENT_ID != ''">
,DEPARTMENT_ID = #{DEPARTMENT_ID}
</if>
<if test="USER_ID != null and USER_ID != ''">
,USER_ID = #{USER_ID}
</if>
WHERE FIRE_CHECK_ID = #{FIRE_CHECK_ID} WHERE FIRE_CHECK_ID = #{FIRE_CHECK_ID}
</update> </update>
<update id="delByIds" parameterType="pd"> <update id="delByIds" parameterType="pd">
@ -64,14 +70,15 @@
cl.FIRE_CHECK_STANDARD_NAME, cl.FIRE_CHECK_STANDARD_NAME,
cl.FIRE_CHECK_TYPE AS FIRE_CHECK_TYPE_ID, cl.FIRE_CHECK_TYPE AS FIRE_CHECK_TYPE_ID,
IFNULL( FINISHED, 0 ) FINISHED, IFNULL( FINISHED, 0 ) FINISHED,
od.`NAME` AS DEPARTMENTNAME, d.`NAME` AS DEPARTMENTNAME,
su.`NAME` AS USERNAME, su.`NAME` AS USERNAME,
cl.STATE, cl.STATE,
sys_dictionaries.`NAME` AS FIRE_CHECK_TYPE, sys_dictionaries.`NAME` AS FIRE_CHECK_TYPE,
cl.FIRE_CHECK_ID, cl.FIRE_CHECK_ID,
ifnull(tt.CHECK_NUM,0) CHECK_NUM ifnull(tt.CHECK_NUM,0) CHECK_NUM
FROM FROM
bus_fire_checklist as cl bus_fire_checklist AS cl
left JOIN oa_department AS d ON cl.DEPARTMENT_ID = d.DEPARTMENT_ID
LEFT JOIN ( LEFT JOIN (
SELECT SELECT
FIRE_CHECK_ID, FIRE_CHECK_ID,
@ -85,8 +92,6 @@
AND CORPINFO_ID = #{pd.CORPINFO_ID} AND CORPINFO_ID = #{pd.CORPINFO_ID}
GROUP BY FIRE_CHECK_ID,PERIODSTART,PERIODEND ) AS t ON cl.FIRE_CHECK_ID = t.FIRE_CHECK_ID GROUP BY FIRE_CHECK_ID,PERIODSTART,PERIODEND ) AS t ON cl.FIRE_CHECK_ID = t.FIRE_CHECK_ID
LEFT JOIN sys_user AS su ON cl.USER_ID = su.USER_ID LEFT JOIN sys_user AS su ON cl.USER_ID = su.USER_ID
left join oa_department od
on od.DEPARTMENT_ID = su.DEPARTMENT_ID
LEFT JOIN sys_dictionaries ON cl.FIRE_CHECK_TYPE = sys_dictionaries.BIANMA LEFT JOIN sys_dictionaries ON cl.FIRE_CHECK_TYPE = sys_dictionaries.BIANMA
LEFT JOIN (SELECT FIRE_CHECK_ID, count(1) CHECK_NUM from bus_fire_record GROUP BY FIRE_CHECK_ID ) tt on cl.FIRE_CHECK_ID = tt.FIRE_CHECK_ID LEFT JOIN (SELECT FIRE_CHECK_ID, count(1) CHECK_NUM from bus_fire_record GROUP BY FIRE_CHECK_ID ) tt on cl.FIRE_CHECK_ID = tt.FIRE_CHECK_ID
where cl.ISDELETE = 0 and cl.STATE != 2 where cl.ISDELETE = 0 and cl.STATE != 2
@ -167,7 +172,7 @@
oa_department AS oa oa_department AS oa
ON ON
su.DEPARTMENT_ID = oa.DEPARTMENT_ID su.DEPARTMENT_ID = oa.DEPARTMENT_ID
INNER JOIN LEFT JOIN
sys_post AS sp sys_post AS sp
ON ON
su.POST_ID = sp.POST_ID su.POST_ID = sp.POST_ID
@ -223,13 +228,19 @@
fd.FIRE_DEVICE_TYPE_ID = sys_dictionaries.BIANMA fd.FIRE_DEVICE_TYPE_ID = sys_dictionaries.BIANMA
WHERE WHERE
fp.ISDELETE = 0 AND fp.ISDELETE = 0 AND
fd.ISDELETE = 0 fd.ISDELETE = 0 AND fr.ISDELETE = 0
<if test="USER_ID != null and USER_ID != ''"> <if test="USER_ID != null and USER_ID != ''">
and fp.USER_ID = #{USER_ID} and fp.USER_ID = #{USER_ID}
</if> </if>
<if test="USERNAME != null and USERNAME != ''"> <if test="USERNAME != null and USERNAME != ''">
and su.NAME like concat(#{USERNAME},'%') and su.NAME like concat(#{USERNAME},'%')
</if> </if>
<if test="departmentIds != null and departmentIds != ''">
and fp.DEPARTMENT_ID in
<foreach item="item" index="index" collection="departmentIds" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="DEPARTMENT_ID != null and DEPARTMENT_ID != ''"> <if test="DEPARTMENT_ID != null and DEPARTMENT_ID != ''">
and fp.DEPARTMENT_ID = #{DEPARTMENT_ID} and fp.DEPARTMENT_ID = #{DEPARTMENT_ID}
</if> </if>
@ -335,12 +346,17 @@
FROM bus_fire_checklist AS cl FROM bus_fire_checklist AS cl
LEFT JOIN bus_fire_device_prepared AS fpc ON cl.FIRE_CHECK_ID = fpc.FIRE_CHECK_ID LEFT JOIN bus_fire_device_prepared AS fpc ON cl.FIRE_CHECK_ID = fpc.FIRE_CHECK_ID
LEFT JOIN bus_fire_point_prepared fpp on cl.FIRE_CHECK_ID = fpp.FIRE_CHECK_ID LEFT JOIN bus_fire_point_prepared fpp on cl.FIRE_CHECK_ID = fpp.FIRE_CHECK_ID
LEFT JOIN bus_fire_point fp ON fp.FIRE_POINT_ID = fpp.FIRE_POINT_ID
LEFT JOIN sys_user AS su ON cl.USER_ID = su.USER_ID LEFT JOIN sys_user AS su ON cl.USER_ID = su.USER_ID
LEFT JOIN oa_department AS od ON cl.DEPARTMENT_ID = od.DEPARTMENT_ID LEFT JOIN oa_department AS od ON cl.DEPARTMENT_ID = od.DEPARTMENT_ID
LEFT JOIN sys_dictionaries ON cl.FIRE_CHECK_TYPE = sys_dictionaries.BIANMA LEFT JOIN sys_dictionaries ON cl.FIRE_CHECK_TYPE = sys_dictionaries.BIANMA
WHERE cl.ISDELETE = 0 WHERE cl.ISDELETE = 0
AND cl.STATE = 0 AND cl.STATE = 0
<if test="pd.pointId != null and pd.pointId != ''">
AND fpp.FIRE_POINT_ID = #{pd.pointId}
</if>
and fpp.ISDELETE = 0 and fpp.ISDELETE = 0
and fp.ISDELETE = 0
AND fpc.ISDELETE = 0 AND fpc.ISDELETE = 0
<if test="pd.roleLevel != null and pd.roleLevel != ''"><!-- 权限显示 --> <if test="pd.roleLevel != null and pd.roleLevel != ''"><!-- 权限显示 -->
<choose> <choose>

View File

@ -54,7 +54,7 @@
<insert id="additionRecord" parameterType="list"> <insert id="additionRecord" parameterType="list">
INSERT INTO `qa-cmt-prevention`.`bus_fire_record` INSERT INTO `qa-cmt-prevention`.`bus_fire_record`
(`FIRE_RECORD_ID`, `FIRE_CHECK_ID`, `CORPINFO_ID`, `CREATOR`, `CREATTIME`,REPEATCHECK, (`FIRE_RECORD_ID`, `FIRE_CHECK_ID`, `CORPINFO_ID`, `CREATOR`, `CREATTIME`,REPEATCHECK,
`OPERATOR`, `OPERATTIME`, `PERIODSTART`, `PERIODEND`) VALUES `OPERATOR`, `OPERATTIME`, `PERIODSTART`, `PERIODEND`, `PHONE_REPEAT`) VALUES
<foreach item="item" index="index" collection="list" separator=","> <foreach item="item" index="index" collection="list" separator=",">
( (
#{item.FIRE_RECORD_ID}, #{item.FIRE_RECORD_ID},
@ -66,7 +66,8 @@
#{item.OPERATOR}, #{item.OPERATOR},
#{item.OPERATTIME}, #{item.OPERATTIME},
#{item.PERIODSTART}, #{item.PERIODSTART},
#{item.PERIODEND} #{item.PERIODEND},
#{item.PHONE_REPEAT}
) )
</foreach> </foreach>
</insert> </insert>
@ -379,7 +380,7 @@
INNER JOIN bus_fire_point AS bfp ON bfd.FIRE_POINT_ID = bfp.FIRE_POINT_ID INNER JOIN bus_fire_point AS bfp ON bfd.FIRE_POINT_ID = bfp.FIRE_POINT_ID
INNER JOIN sys_user AS su ON cl.USER_ID = su.USER_ID INNER JOIN sys_user AS su ON cl.USER_ID = su.USER_ID
INNER JOIN oa_department AS oa ON su.DEPARTMENT_ID = oa.DEPARTMENT_ID INNER JOIN oa_department AS oa ON su.DEPARTMENT_ID = oa.DEPARTMENT_ID
INNER JOIN sys_post AS sp ON su.POST_ID = sp.POST_ID LEFT JOIN sys_post AS sp ON su.POST_ID = sp.POST_ID
INNER JOIN bus_fire_region AS bfr ON bfp.FIRE_REGION_ID = bfr.FIRE_REGION_ID INNER JOIN bus_fire_region AS bfr ON bfp.FIRE_REGION_ID = bfr.FIRE_REGION_ID
INNER JOIN bus_fire_record AS fr ON cl.FIRE_CHECK_ID = fr.FIRE_CHECK_ID INNER JOIN bus_fire_record AS fr ON cl.FIRE_CHECK_ID = fr.FIRE_CHECK_ID
WHERE cl.ISDELETE = 0 WHERE cl.ISDELETE = 0
@ -711,6 +712,7 @@
and frc.FIRE_RECORD_ID = #{FIRE_RECORD_ID} and frc.FIRE_RECORD_ID = #{FIRE_RECORD_ID}
AND frp.ISDELETE = 0 AND frp.ISDELETE = 0
AND fpp.ISDELETE = 0 AND fpp.ISDELETE = 0
AND t.FIRE_POINT_ID IS NOT NULL
order by t.FIRE_POINT_NAME order by t.FIRE_POINT_NAME
</select> </select>
<select id="getRecordDeviceByEid" resultType="com.zcloud.entity.PageData"> <select id="getRecordDeviceByEid" resultType="com.zcloud.entity.PageData">
@ -897,7 +899,7 @@
GROUP BY GROUP BY
FIRE_CHECK_ID FIRE_CHECK_ID
order by temp.FINISHED,fr. CREATTIME order by fr. CREATTIME
</select> </select>
<select id="getCheckingByCid" resultType="com.zcloud.entity.PageData"> <select id="getCheckingByCid" resultType="com.zcloud.entity.PageData">
select * from bus_fire_record where FIRE_CHECK_ID = #{FIRE_CHECK_ID} and ISDELETE = 0 and PHONE_REPEAT = 1 select * from bus_fire_record where FIRE_CHECK_ID = #{FIRE_CHECK_ID} and ISDELETE = 0 and PHONE_REPEAT = 1
@ -1016,4 +1018,18 @@
bus_fire_device_prepared where HIDDEN_ID = #{HIDDEN_ID} and ISDELETE = 0 order by OPERATTIME desc limit 1 bus_fire_device_prepared where HIDDEN_ID = #{HIDDEN_ID} and ISDELETE = 0 order by OPERATTIME desc limit 1
</select> </select>
<select id="getPhotoUploadMethod" resultType="com.zcloud.entity.PageData">
SELECT
fr.PHOTO_UPLOAD_METHOD
FROM
bus_fire_record_point frp
LEFT JOIN bus_fire_point fp ON frp.FIRE_POINT_ID = fp.FIRE_POINT_ID
AND fp.ISDELETE = '0'
LEFT JOIN bus_fire_region fr ON fr.FIRE_REGION_ID = fp.FIRE_REGION_ID
AND fr.ISDELETE = '0'
WHERE
frp.EQUIPMENT_POINT_ID = #{EQUIPMENT_POINT_ID}
AND frp.ISDELETE = '0'
</select>
</mapper> </mapper>