qushaowei
2024-03-22 8b43a416a2bb5188a25bfe0765fa1f42afe8bd23
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/CalibrationOrderMapper.xml
@@ -70,8 +70,8 @@
    </select>
    <select id="getFactoryThisMonthMaintenanceFinishList"  parameterType="String" resultType="Map">
        select count(0) as totalCount from    mom_eam_daily_maintenance_order t1 left join mom_eam_equipment t2 on t1.equipment_id = t2.id
        where t1.del_flag = '0' and t1.status = '5' and  SUBSTRING(CONVERT(VARCHAR(10), t1.actual_end_time, 120), 1, 7) = SUBSTRING(CONVERT(VARCHAR(10), GETDATE(), 120), 1, 7)
        select count(0) as totalCount from    mom_eam_daily_maintenance_order t1 left join mom_eam_equipment t2 on t1.equipment_id = t2.id left join mom_eam_maintenance_cycle t4 on t1.maintenance_cycle_id = t4.id
        where t1.del_flag = '0' and t1.status = '5' and t4.maintenance_type = '3' and  SUBSTRING(CONVERT(VARCHAR(10), t1.actual_end_time, 120), 1, 7) = SUBSTRING(CONVERT(VARCHAR(10), GETDATE(), 120), 1, 7)
    </select>
    <select id="getEquipmentTechnologyStatusList"  parameterType="String" resultType="Map">
@@ -101,8 +101,29 @@
    </select>
    <select id="getThisMonthMaintenanceFinishList"  parameterType="String" resultType="Map">
        select count(0) as totalCount from    mom_eam_daily_maintenance_order t1 left join mom_eam_equipment t2 on t1.equipment_id = t2.id
        where t1.del_flag = '0' and t1.status = '5' and  SUBSTRING(CONVERT(VARCHAR(10), t1.actual_end_time, 120), 1, 7) = SUBSTRING(CONVERT(VARCHAR(10), GETDATE(), 120), 1, 7)   <if test="workCenterId != null and workCenterId != ''"> and t2.work_center_id = #{workCenterId} </if> <if test="areaId != null and areaId != ''"> and t2.area_id = #{areaId} </if>
        select count(0) as totalCount from    mom_eam_daily_maintenance_order t1 left join mom_eam_equipment t2 on t1.equipment_id = t2.id left join mom_eam_maintenance_cycle t4 on t1.maintenance_cycle_id = t4.id
        where t1.del_flag = '0' and t1.status = '5' and t4.maintenance_type = '3' and  SUBSTRING(CONVERT(VARCHAR(10), t1.actual_end_time, 120), 1, 7) = SUBSTRING(CONVERT(VARCHAR(10), GETDATE(), 120), 1, 7)   <if test="workCenterId != null and workCenterId != ''"> and t2.work_center_id = #{workCenterId} </if> <if test="areaId != null and areaId != ''"> and t2.area_id = #{areaId} </if>
    </select>
    <select id="get3MaintenancePostponeCount"  parameterType="String" resultType="Map">
        select count(0) as totalCount from (select DISTINCT  t2.id  from mom_eam_plan_change_apply t1 left join mom_eam_equipment t2 on t1.equipment_id = t2.id
        where  SUBSTRING(CONVERT(VARCHAR(10), t2.next_third_maintenance_time, 120), 1, 7) = SUBSTRING(CONVERT(VARCHAR(10), GETDATE(), 120), 1, 7)  and t2.area_id = #{areaId} ) t4
    </select>
    <select id="get3MaintenanceOverdueCount"  parameterType="String" resultType="Map">
        SELECT
            count(0) as totalCount
        FROM
            mom_eam_daily_maintenance_order t1
        LEFT JOIN mom_eam_equipment t2 ON t1.equipment_id = t2.id
        left join mom_eam_maintenance_cycle t4 on t1.maintenance_cycle_id = t4.id
        WHERE
            t1.del_flag = '0'
            and t1.status = '3'
            and t4.maintenance_type = '3'
            and SUBSTRING(CONVERT(VARCHAR(10), t1.plan_start_time, 120), 1, 10) &lt; SUBSTRING(CONVERT(VARCHAR(10), GETDATE(), 120), 1, 10)
            and SUBSTRING(CONVERT(VARCHAR(10), t2.next_third_maintenance_time, 120), 1, 10) = SUBSTRING(CONVERT(VARCHAR(10), GETDATE(), 120), 1, 10)
            <if test="areaId != null and areaId != ''"> and t2.area_id = #{areaId} </if>
    </select>
    <select id="getCenterTwoMaintenancePlanList"  parameterType="String" resultType="Map">