| | |
| | | left join mom_base_supplier t4 on t1.outsourcing_unit = t4.id |
| | | left join sys_user t5 on t5.id = t1.responsibility_id |
| | | left join mom_base_team t6 on t6.id=t1.team_id |
| | | left join mom_eam_repair_order_fault_analysis t7 on t7.repair_order_id=t1.id |
| | | where t1.del_flag = 0 |
| | | <if test="id != null and id != ''"> |
| | | and t1.id = #{id} |
| | |
| | | and t2.specific_equipment = #{specificEquipment} |
| | | </if> |
| | | <if test="equipmentImportanceId != null and equipmentImportanceId != ''"> |
| | | and t2. equipment_importance_id = #{equipmentImportanceId} |
| | | and t2.equipment_importance_id = #{equipmentImportanceId} |
| | | </if> |
| | | <if test="faultCause != null and faultCause != ''"> |
| | | and t7.repair_order_fault_analysis_uda2 = #{faultCause} |
| | | </if> |
| | | <if test="teamId != null and teamId != ''"> |
| | | and t1.team_id = #{teamId} |
| | |
| | | |
| | | |
| | | </select> |
| | | |
| | | <select id="getAllFaultCause" parameterType="Map" resultType="Map"> |
| | | SELECT |
| | | t1.repair_order_fault_analysis_uda2, |
| | | COUNT ( t1.repair_order_fault_analysis_uda2 ) AS total, |
| | | t2.item_text AS faultCause |
| | | FROM |
| | | ( SELECT * FROM v_sys_dict WHERE dict_code = 'repair_order_fault_cause' ) t2 |
| | | LEFT JOIN mom_eam_repair_order_fault_analysis t1 ON t1.repair_order_fault_analysis_uda2 = t2.item_value |
| | | WHERE |
| | | del_flag = '0' |
| | | GROUP BY |
| | | t1.repair_order_fault_analysis_uda2, |
| | | t2.item_text |
| | | |
| | | </select> |
| | | |
| | | <select id="getFaultCause" parameterType="Map" resultType="Map"> |
| | | SELECT |
| | | t3.item_text as faultCause, |
| | | count(t4.repair_order_fault_analysis_uda2) as total |
| | | FROM |
| | | ( SELECT * FROM v_sys_dict WHERE dict_code = 'repair_order_fault_cause' ) t3 |
| | | LEFT JOIN ( |
| | | SELECT |
| | | t1.repair_order_fault_analysis_uda2 |
| | | FROM |
| | | mom_eam_repair_order_fault_analysis t1 |
| | | LEFT JOIN mom_eam_repair_order t2 ON t1.repair_order_id = t2.id |
| | | WHERE |
| | | t1.del_flag = 0 |
| | | AND t2.del_flag = 0 |
| | | AND t2.equipment_id = #{equipmentId} |
| | | ) t4 ON t3.item_value = t4.repair_order_fault_analysis_uda2 |
| | | group by t3.item_text |
| | | </select> |
| | | |
| | | <select id="getFaultCausePie" parameterType="Map" resultType="Map"> |
| | | SELECT |
| | | t3.item_text as x, |
| | | count(t4.repair_order_fault_analysis_uda2) as y |
| | | FROM |
| | | ( SELECT * FROM v_sys_dict WHERE dict_code = 'repair_order_fault_cause' ) t3 |
| | | LEFT JOIN ( |
| | | SELECT |
| | | t1.repair_order_fault_analysis_uda2 |
| | | FROM |
| | | mom_eam_repair_order_fault_analysis t1 |
| | | LEFT JOIN mom_eam_repair_order t2 ON t1.repair_order_id = t2.id |
| | | left join mom_eam_equipment t11 on t2.equipment_id = t11.id |
| | | WHERE |
| | | t1.del_flag = 0 |
| | | AND t2.del_flag = 0 |
| | | <if test="params.equipmentNum != null and params.equipmentNum != ''"> |
| | | and t11.num = #{params.equipmentNum} |
| | | </if> |
| | | <if test="params.faultStartTime != null"> |
| | | and t2.create_time >= #{params.faultStartTime} |
| | | </if> |
| | | <if test="params.faultEndTime != null"> |
| | | and t2.create_time <= #{params.faultEndTime} |
| | | </if> |
| | | ) t4 ON t3.item_value = t4.repair_order_fault_analysis_uda2 |
| | | group by t3.item_text |
| | | </select> |
| | | |
| | | <select id="getFaultCauseBar" parameterType="Map" resultType="Map"> |
| | | SELECT |
| | | t3.item_text as item, |
| | | count(t4.repair_order_fault_analysis_uda2) as count |
| | | FROM |
| | | ( SELECT * FROM v_sys_dict WHERE dict_code = 'repair_order_fault_cause' ) t3 |
| | | LEFT JOIN ( |
| | | SELECT |
| | | t1.repair_order_fault_analysis_uda2 |
| | | FROM |
| | | mom_eam_repair_order_fault_analysis t1 |
| | | LEFT JOIN mom_eam_repair_order t2 ON t1.repair_order_id = t2.id |
| | | left join mom_eam_equipment t11 on t2.equipment_id = t11.id |
| | | WHERE |
| | | t1.del_flag = 0 |
| | | AND t2.del_flag = 0 |
| | | <if test="params.equipmentNum != null and params.equipmentNum != ''"> |
| | | and t11.num = #{params.equipmentNum} |
| | | </if> |
| | | <if test="params.faultStartTime != null"> |
| | | and t2.create_time >= #{params.faultStartTime} |
| | | </if> |
| | | <if test="params.faultEndTime != null"> |
| | | and t2.create_time <= #{params.faultEndTime} |
| | | </if> |
| | | ) t4 ON t3.item_value = t4.repair_order_fault_analysis_uda2 |
| | | group by t3.item_text |
| | | </select> |
| | | |
| | | <select id="getMTPF" parameterType="Map" resultType="Map"> |
| | | SELECT |
| | | t3.item_text as item, |
| | | count(t4.repair_order_fault_analysis_uda2) as count |
| | | FROM |
| | | ( SELECT * FROM v_sys_dict WHERE dict_code = 'repair_order_fault_cause' ) t3 |
| | | LEFT JOIN ( |
| | | SELECT |
| | | t1.repair_order_fault_analysis_uda2 |
| | | FROM |
| | | mom_eam_repair_order_fault_analysis t1 |
| | | LEFT JOIN mom_eam_repair_order t2 ON t1.repair_order_id = t2.id |
| | | left join mom_eam_equipment t11 on t2.equipment_id = t11.id |
| | | WHERE |
| | | t1.del_flag = 0 |
| | | AND t2.del_flag = 0 |
| | | <if test="params.equipmentNum != null and params.equipmentNum != ''"> |
| | | and t11.num = #{params.equipmentNum} |
| | | </if> |
| | | <if test="params.faultStartTime != null"> |
| | | and t2.create_time >= #{params.faultStartTime} |
| | | </if> |
| | | <if test="params.faultEndTime != null"> |
| | | and t2.create_time <= #{params.faultEndTime} |
| | | </if> |
| | | ) t4 ON t3.item_value = t4.repair_order_fault_analysis_uda2 |
| | | group by t3.item_text |
| | | </select> |
| | | </mapper> |