bug修复

This commit is contained in:
guoshengxiong 2024-04-29 23:17:59 +08:00
parent b525b1eda5
commit 9c00f94cd1
4 changed files with 10 additions and 30 deletions

View File

@ -5,7 +5,8 @@
resultType="com.zhgd.xmgl.modules.xz.security.entity.XzSecurityDangerItemRecord">
SELECT IFNULL(b.record_status,0) record_status,a.*
from xz_security_danger_item_record a LEFT JOIN
(SELECT * FROM project_danger_type_disable WHERE project_sn=#{projectSn} and type=2) b ON b.danger_type_id=a.id
(SELECT * FROM xz_security_project_danger_type_disable WHERE project_sn=#{projectSn} and type=2) b ON
b.danger_type_id=a.id
WHERE a.danger_type_id=#{dangerTypeId}
<if test="content != null and content != ''">
and a.content like CONCAT(CONCAT('%',#{content}),'%')
@ -32,7 +33,7 @@
from xz_security_danger_item_record a
INNER JOIN xz_security_danger_type_record t ON a.danger_type_id = t.id
LEFT JOIN
(SELECT * FROM project_danger_type_disable WHERE project_sn = #{projectSn} and type = 2) b
(SELECT * FROM xz_security_project_danger_type_disable WHERE project_sn = #{projectSn} and type = 2) b
ON b.danger_type_id = a.id
WHERE t.sn = #{headquartersSn}
and IFNULL(b.record_status, 0) = 0

View File

@ -8,27 +8,6 @@
left join xz_security_danger_item_record as dir on dtr.id = dir.danger_type_id or dir.danger_type_id = dtr2.id
where dtr.id = #{id}
</delete>
<!-- <select id="selectDangerTypeList" resultType="com.zhgd.jeecg.common.mybatis.EntityMap">-->
<!-- SELECT a.id,-->
<!-- a.`code`,-->
<!-- a.create_time,-->
<!-- a.danger_name,-->
<!-- a.`level`,-->
<!-- a.order_sort,-->
<!-- a.parent_id,-->
<!-- a.remark,-->
<!-- IFNULL(b.record_status, 0) record_status-->
<!-- from xz_security_danger_type_record a-->
<!-- INNER JOIN company p1 ON a.sn = p1.headquarters_sn-->
<!-- INNER JOIN project p2 ON p2.company_sn = p1.company_sn-->
<!-- LEFT JOIN (SELECT *-->
<!-- FROM project_danger_type_disable-->
<!-- WHERE project_sn = #{projectSn}-->
<!-- and type = 1) b ON b.danger_type_id = a.id-->
<!-- WHERE a.parent_id = 0-->
<!-- and p2.project_sn = #{projectSn}-->
<!-- ORDER BY a.parent_id, a.order_sort-->
<!-- </select>-->
<select id="selectChildDangerTypeList" resultType="com.zhgd.jeecg.common.mybatis.EntityMap">
SELECT a.id,
a.`code`,
@ -43,7 +22,7 @@
INNER JOIN company p1 ON a.sn = p1.headquarters_sn
INNER JOIN project p2 ON p2.company_sn = p1.company_sn
LEFT JOIN (SELECT *
FROM project_danger_type_disable
FROM xz_security_project_danger_type_disable
WHERE project_sn = #{projectSn}
and type = 1) b ON b.danger_type_id = a.id
WHERE a.parent_id != 0
@ -97,7 +76,7 @@
INNER JOIN company p1 ON a.sn = p1.headquarters_sn
INNER JOIN project p2 ON p2.company_sn = p1.company_sn
LEFT JOIN (SELECT *
FROM project_danger_type_disable
FROM xz_security_project_danger_type_disable
WHERE project_sn = #{projectSn}
and type = 1) b ON b.danger_type_id = a.id
WHERE a.parent_id = 0

View File

@ -4,7 +4,7 @@
<select id="selectInspectTaskItemRecordPage" resultType="com.zhgd.jeecg.common.mybatis.EntityMap">
SELECT a.*,b.task_name,b.sn,b.start_time,b.end_time,b.frequency_num,b.frequency_type,b.report_type,
b.inspect_remark,b.inspect_user,b.id as record_id
from inspect_task_item_record a INNER JOIN inspect_task_record b ON a.task_id=b.id
from xz_security_inspect_task_item_record a INNER JOIN xz_security_inspect_task_record b ON a.task_id=b.id
<where>
<if test="param.taskId != null and param.taskId != ''">
and a.task_id=#{param.taskId}

View File

@ -3,7 +3,7 @@
<mapper namespace="com.zhgd.xmgl.modules.xz.security.mapper.XzSecurityInspectTaskRecordMapper">
<select id="selectInspectTaskRecordPage" resultType="com.zhgd.jeecg.common.mybatis.EntityMap">
SELECT a.*,b.inspect_type_name,d.real_name create_user_name
from inspect_task_record a
from xz_security_inspect_task_record a
LEFT JOIN inspect_type b ON a.inspect_type_id=b.id
LEFT JOIN system_user d ON a.create_user=d.user_id
WHERE a.sn=#{param.sn}
@ -30,13 +30,13 @@
WHEN to_days(itir.add_time) <![CDATA[ <>]]> TO_DAYS(NOW()) THEN 1
ELSE 0 END)), 0) no_rectification_num
from (select *
from inspect_task_record
from xz_security_inspect_task_record
where start_time <![CDATA[<=]]> CURDATE()
and end_time >= CURDATE()) itr
left join
(select m1.id, m1.task_id, m1.item_name, m1.frequency_type, m1.add_time, m1.inspect_order
from inspect_task_item_record m1
left join inspect_task_item_record m2
from xz_security_inspect_task_item_record m1
left join xz_security_inspect_task_item_record m2
on m1.task_id = m2.task_id and m1.id <![CDATA[<]]> m2.id
where m2.id is null) itir on itr.id = itir.task_id
where itr.sn = #{projectSn}