Commit f2ab9ba4 by liuyang

2024-05-24 1.设备点检预警预警逻辑调整

2.设备保养逻辑调整
parent bee2e13e
......@@ -171,7 +171,7 @@
join ${hggpSchema}.HGSB002 B on A.PARENT_ID = B.ID AND B.DELETE_FLAG = '0'
where 1 = 1
and PLAN_END_DATE < DATE_FORMAT(CURDATE(), '%Y%m%d')
AND TASK_STATUS = '0' AND B.PLAN_TYPE = '1'
AND B.PLAN_STATUS = '1' and B.TASK_STATUS = '0' AND B.PLAN_TYPE = '1'
<include refid="authCondition"/>
<isNotEmpty prepend=" AND " property="companyCode">
B.COMPANY_CODE = #companyCode#
......@@ -214,9 +214,8 @@
<include refid="column002"/>
from ${hggpSchema}.HGSB002A A
join ${hggpSchema}.HGSB002 B on A.PARENT_ID = B.ID AND B.DELETE_FLAG = '0'
where 1 = 1
and PLAN_END_DATE &lt; DATE_FORMAT(CURDATE(), '%Y%m%d')
AND TASK_STATUS = '0' AND B.PLAN_TYPE = '1'
where 1 = 1 and PLAN_END_DATE &lt; DATE_FORMAT(CURDATE(), '%Y%m%d')
AND B.PLAN_STATUS = '1' AND TASK_STATUS = '0' AND B.PLAN_TYPE = '1'
<include refid="authCondition"/>
<isNotEmpty prepend=" AND " property="companyCode">
B.COMPANY_CODE = #companyCode#
......
......@@ -177,8 +177,8 @@
from ${hggpSchema}.HGSB002A A
join ${hggpSchema}.HGSB002 B on A.PARENT_ID = B.ID AND B.DELETE_FLAG = '0'
where 1 = 1
and PLAN_END_DATE &lt; DATE_FORMAT(CURDATE(), '%Y%m%d')
AND TASK_STATUS = '0' AND B.PLAN_TYPE = '2'
AND PLAN_END_DATE &lt; DATE_FORMAT(CURDATE(), '%Y%m%d')
AND B.PLAN_STATUS = '1' AND TASK_STATUS = '0' AND B.PLAN_TYPE = '2'
<include refid="authCondition"/>
<isNotEmpty prepend=" AND " property="companyCode">
B.COMPANY_CODE = #companyCode#
......@@ -202,7 +202,7 @@
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
A.PLAN_START_DATE desc, A.PLAN_END_DATE desc
A.PLAN_END_DATE desc, A.PLAN_START_DATE desc, A.PLAN_CODE desc
</isEmpty>
</dynamic>
</select>
......@@ -211,30 +211,30 @@
SELECT
COUNT(*)
FROM (
SELECT
<include refid="column001"/>
FROM ${hggpSchema}.HGSB005A A
JOIN ${hggpSchema}.HGSB005 B ON A.PARENT_ID = B.ID AND B.DELETE_FLAG = '0' WHERE 1=1
<include refid="authCondition"/>
<include refid="condition" />
UNION ALL
SELECT
<include refid="column002"/>
from ${hggpSchema}.HGSB002A A
join ${hggpSchema}.HGSB002 B on A.PARENT_ID = B.ID AND B.DELETE_FLAG = '0'
where 1 = 1
and PLAN_END_DATE &lt; DATE_FORMAT(CURDATE(), '%Y%m%d')
AND TASK_STATUS = '0' AND B.PLAN_TYPE = '2'
<include refid="authCondition"/>
<isNotEmpty prepend=" AND " property="companyCode">
B.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
B.COMPANY_NAME LIKE CONCAT('%', #companyName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceName">
A.DEVICE_NAME LIKE CONCAT('%', #deviceName#, '%')
</isNotEmpty>
SELECT
<include refid="column001"/>
FROM ${hggpSchema}.HGSB005A A
JOIN ${hggpSchema}.HGSB005 B ON A.PARENT_ID = B.ID AND B.DELETE_FLAG = '0' WHERE 1=1
<include refid="authCondition"/>
<include refid="condition" />
UNION ALL
SELECT
<include refid="column002"/>
from ${hggpSchema}.HGSB002A A
join ${hggpSchema}.HGSB002 B on A.PARENT_ID = B.ID AND B.DELETE_FLAG = '0'
where 1 = 1
and PLAN_END_DATE &lt; DATE_FORMAT(CURDATE(), '%Y%m%d')
AND B.PLAN_STATUS = '1' AND TASK_STATUS = '0' AND B.PLAN_TYPE = '2'
<include refid="authCondition"/>
<isNotEmpty prepend=" AND " property="companyCode">
B.COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyName">
B.COMPANY_NAME LIKE CONCAT('%', #companyName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deviceName">
A.DEVICE_NAME LIKE CONCAT('%', #deviceName#, '%')
</isNotEmpty>
) A
WHERE 1=1
<isEqual prepend=" AND " property="upkeepStatus" compareValue="1">
......
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