| | |
| | | |
| | | <select id="getEquipmentTechnologyStatusList" parameterType="String" resultType="Map"> |
| | | SELECT |
| | | ( SELECT COUNT ( 0 ) FROM mom_eam_equipment WHERE del_flag = '0' and technology_status = 'qualified' and factory_model_id = #{factoryModelId}) as qualifiedCount, |
| | | ( SELECT COUNT ( 0 ) FROM mom_eam_equipment WHERE del_flag = '0' and technology_status = 'limitedUse' and factory_model_id = #{factoryModelId}) as limitedUseCount, |
| | | ( SELECT COUNT ( 0 ) FROM mom_eam_equipment WHERE del_flag = '0' and technology_status = 'disabled' and factory_model_id = #{factoryModelId}) as disabledCount |
| | | ( SELECT COUNT ( 0 ) FROM mom_eam_equipment WHERE del_flag = '0' and technology_status = 'qualified' and work_center_id = #{factoryModelId}) as qualifiedCount, |
| | | ( SELECT COUNT ( 0 ) FROM mom_eam_equipment WHERE del_flag = '0' and technology_status = 'limitedUse' and work_center_id = #{factoryModelId}) as limitedUseCount, |
| | | ( SELECT COUNT ( 0 ) FROM mom_eam_equipment WHERE del_flag = '0' and technology_status = 'disabled' and work_center_id = #{factoryModelId}) as disabledCount |
| | | </select> |
| | | |
| | | <select id="getReportRepairEquipmentList" parameterType="String" resultType="Map"> |
| | | SELECT |
| | | ( select COUNT(0) from mom_eam_equipment_report_repair t1 left join mom_eam_equipment t2 on t1.equipment_id = t2.id WHERE del_flag = '0' and SUBSTRING(CONVERT(VARCHAR(10), t1.fault_time, 120), 1, 10) = SUBSTRING(CONVERT(VARCHAR(10), GETDATE(), 120), 1, 10) and t2.factory_model_id = #{factoryModelId}) as failurTotalCount, |
| | | ( select COUNT(0) from mom_eam_equipment_report_repair t1 left join mom_eam_equipment t2 on t1.equipment_id = t2.id where del_flag = '0' and t1.is_stop = '1' and SUBSTRING(CONVERT(VARCHAR(10), t1.fault_time, 120), 1, 10) = SUBSTRING(CONVERT(VARCHAR(10), GETDATE(), 120), 1, 10) and t2.factory_model_id = #{factoryModelId}) as noStopCount, |
| | | ( select COUNT(0) from mom_eam_equipment_report_repair t1 left join mom_eam_equipment t2 on t1.equipment_id = t2.id where del_flag = '0' and t1.is_stop = '2' and SUBSTRING(CONVERT(VARCHAR(10), t1.fault_time, 120), 1, 10) = SUBSTRING(CONVERT(VARCHAR(10), GETDATE(), 120), 1, 10) and t2.factory_model_id = #{factoryModelId}) as stopCount |
| | | ( select COUNT(0) from mom_eam_equipment_report_repair t1 left join mom_eam_equipment t2 on t1.equipment_id = t2.id WHERE del_flag = '0' and SUBSTRING(CONVERT(VARCHAR(10), t1.fault_time, 120), 1, 10) = SUBSTRING(CONVERT(VARCHAR(10), GETDATE(), 120), 1, 10) and t2.work_center_id = #{factoryModelId}) as failurTotalCount, |
| | | ( select COUNT(0) from mom_eam_equipment_report_repair t1 left join mom_eam_equipment t2 on t1.equipment_id = t2.id where del_flag = '0' and t1.is_stop = '1' and SUBSTRING(CONVERT(VARCHAR(10), t1.fault_time, 120), 1, 10) = SUBSTRING(CONVERT(VARCHAR(10), GETDATE(), 120), 1, 10) and t2.work_center_id = #{factoryModelId}) as noStopCount, |
| | | ( select COUNT(0) from mom_eam_equipment_report_repair t1 left join mom_eam_equipment t2 on t1.equipment_id = t2.id where del_flag = '0' and t1.is_stop = '2' and SUBSTRING(CONVERT(VARCHAR(10), t1.fault_time, 120), 1, 10) = SUBSTRING(CONVERT(VARCHAR(10), GETDATE(), 120), 1, 10) and t2.work_center_id = #{factoryModelId}) as stopCount |
| | | </select> |
| | | |
| | | <select id="getThisMonthMaintenanceList" parameterType="String" resultType="Map"> |
| | | select count(0) as totalCount from mom_eam_equipment t1 where t1.del_flag = '0' and SUBSTRING(CONVERT(VARCHAR(10), t1.next_third_maintenance_time, 120), 1, 7) = SUBSTRING(CONVERT(VARCHAR(10), GETDATE(), 120), 1, 7) and t2.factory_model_id = #{factoryModelId} |
| | | select count(0) as totalCount from mom_eam_equipment t1 where t1.del_flag = '0' and SUBSTRING(CONVERT(VARCHAR(10), t1.next_third_maintenance_time, 120), 1, 7) = SUBSTRING(CONVERT(VARCHAR(10), GETDATE(), 120), 1, 7) and t2.work_center_id = #{factoryModelId} |
| | | </select> |
| | | |
| | | <select id="getNextMonthMaintenanceList" parameterType="String" resultType="Map"> |
| | | select count(0) as totalCount from mom_eam_equipment t1 where t1.del_flag = '0' and SUBSTRING(CONVERT(VARCHAR(10), t1.next_third_maintenance_time, 120), 1, 7) = SUBSTRING(CONVERT(VARCHAR(10), DATEADD(MONTH, 1, GETDATE()), 120), 1, 7) and t2.factory_model_id = #{factoryModelId} |
| | | select count(0) as totalCount from mom_eam_equipment t1 where t1.del_flag = '0' and SUBSTRING(CONVERT(VARCHAR(10), t1.next_third_maintenance_time, 120), 1, 7) = SUBSTRING(CONVERT(VARCHAR(10), DATEADD(MONTH, 1, GETDATE()), 120), 1, 7) and t2.work_center_id = #{factoryModelId} |
| | | </select> |
| | | |
| | | <select id="getNextNextMonthMaintenanceList" parameterType="String" resultType="Map"> |
| | | select count(0) as totalCount from mom_eam_equipment t1 where t1.del_flag = '0' and SUBSTRING(CONVERT(VARCHAR(10), t1.next_third_maintenance_time, 120), 1, 7) = SUBSTRING(CONVERT(VARCHAR(10), DATEADD(MONTH,2 , GETDATE()), 120), 1, 7) and t2.factory_model_id = #{factoryModelId} |
| | | select count(0) as totalCount from mom_eam_equipment t1 where t1.del_flag = '0' and SUBSTRING(CONVERT(VARCHAR(10), t1.next_third_maintenance_time, 120), 1, 7) = SUBSTRING(CONVERT(VARCHAR(10), DATEADD(MONTH,2 , GETDATE()), 120), 1, 7) and t2.work_center_id = #{factoryModelId} |
| | | </select> |
| | | |
| | | |