预警分析

This commit is contained in:
hongchao 2026-01-16 14:58:43 +08:00
parent 9042c13c4c
commit 13df76c18c
2 changed files with 21 additions and 7 deletions

View File

@ -235,9 +235,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN ma_type mt ON sai.type_id = mt.type_id
LEFT JOIN ma_type mt2 ON mt.parent_id = mt2.type_id
left join sys_dept sd ON sd.dept_id = bp.imp_unit
where mm.next_check_time is not null and mt.`level` = '4'
and sai.`status`='0' and sai.end_time is null
where mm.next_check_time is not null
AND mm.this_check_time is not null
AND bp.pro_name is not null
and sai.`status`='0'
and sai.is_slt = 0
and mm.ma_status = 2
and mt2.type_id not in (6032,6008,6270)
and mt.jiju_type =2
@ -275,9 +277,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN sys_dept sd on bp.imp_unit = sd.dept_id
LEFT JOIN ma_type mt ON sai.type_id = mt.type_id
LEFT JOIN ma_type mt2 ON mt.parent_id = mt2.type_id
WHERE mm.next_check_time is not null AND mt.`level`=4
and sai.`status`='0' and sai.end_time is null
WHERE mm.next_check_time is not null
AND mm.this_check_time is not null
AND bp.pro_name is not null
and sai.`status`='0'
and sai.is_slt = 0
and mm.ma_status = 2
and mt2.type_id not in (6032,6008,6270)
and mt.jiju_type =2

View File

@ -248,17 +248,27 @@
AND mm.this_check_time is not null
AND mm.next_check_time is not null
AND mt.jiju_type = 2
and sai.`status`='0'
AND mt2.type_id not in (6032,6008,6270)
<if test="companyId != null">
AND sd.dept_id=#{companyId}
</if>
/*AND DATEDIFF(mm.next_check_time, CURDATE()) &lt;= 30*/
<if test="status != null and status == 0">
AND mm.next_check_time &gt;= NOW()
AND mm.next_check_time >= NOW()
</if>
<if test="status != null and status == 1">
AND mm.next_check_time &lt; NOW()
</if>
<if test="status != null and status == 2">
AND mm.next_check_time &lt; NOW() AND DATEDIFF(NOW(), mm.next_check_time) &lt;= 7
</if>
<if test="status != null and status == 3">
AND mm.next_check_time &lt; NOW() AND DATEDIFF(NOW(), mm.next_check_time) &lt;=15
</if>
<if test="status != null and status == 4">
AND mm.next_check_time &lt; NOW() AND DATEDIFF(NOW(), mm.next_check_time) &lt;= 30
</if>
<if test="keyWord != null and keyWord != ''">
and (
mt4.type_name like concat('%', #{keyWord}, '%') or