|
@@ -118,4 +118,36 @@
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
+ <select id="getDevStatusMap" parameterType="hashMap" resultType="java.util.Map">
|
|
|
+ select sum(num1) as barrelLackNum,
|
|
|
+ sum(num2) as barrelExprNum,
|
|
|
+ sum(num3) as cupLackNum,
|
|
|
+ sum(num4) as cupExprNum
|
|
|
+ from (
|
|
|
+ select count(distinct p.id) as num1 ,0 as num2,0 as num3,0 as num4 from imcs_tenant_productionresource p left join bt_equ_barrel b on b.equ_id = p.id
|
|
|
+ where p.status = '1' and b.residue_warn>=b.mtr_residue and b.barrel_type <![CDATA[ <= ]]> '3'
|
|
|
+ <if test="id != null">
|
|
|
+ and p.id = #{id}
|
|
|
+ </if>
|
|
|
+ union
|
|
|
+ select 0 as num1 , count(distinct p.id) as num2,0 as num3,0 as num4 from imcs_tenant_productionresource p left join bt_equ_barrel b on b.equ_id = p.id
|
|
|
+ where p.status = '1' and b.barrel_type <![CDATA[ <= ]]> '3' and TIMESTAMPDIFF(DAY, now(), b.expr_time) <![CDATA[ < ]]> 0
|
|
|
+ <if test="id != null">
|
|
|
+ and p.id = #{id}
|
|
|
+ </if>
|
|
|
+ union
|
|
|
+ select 0 as num1 ,0 as num2, count(distinct p.id) as num3,0 as num4 from imcs_tenant_productionresource p left join bt_equ_barrel b on b.equ_id = p.id
|
|
|
+ where p.status = '1' and b.residue_warn>=b.mtr_residue and b.barrel_type>'3'
|
|
|
+ <if test="id != null">
|
|
|
+ and p.id = #{id}
|
|
|
+ </if>
|
|
|
+ union
|
|
|
+ select 0 as num1 ,0 as num2, 0 as num3, count(distinct p.id) as num4 from imcs_tenant_productionresource p left join bt_equ_barrel b on b.equ_id = p.id
|
|
|
+ where p.status = '1' and TIMESTAMPDIFF(DAY, now(), b.expr_time) <![CDATA[ < ]]> 0 and b.barrel_type>'3'
|
|
|
+ <if test="id != null">
|
|
|
+ and p.id = #{id}
|
|
|
+ </if>
|
|
|
+ )s
|
|
|
+ </select>
|
|
|
+
|
|
|
</mapper>
|