| | |
| | | <mapper namespace="org.jeecg.modules.eam.mapper.EamWeekMaintenanceOrderMapper"> |
| | | |
| | | <select id="queryPageList" resultType="org.jeecg.modules.eam.entity.EamWeekMaintenanceOrder"> |
| | | select wmo.*, e.equipment_code, e.equipment_name |
| | | select wmo.*, e.equipment_code, e.equipment_name, e.installation_position |
| | | from eam_week_maintenance_order wmo |
| | | inner join eam_equipment e |
| | | on wmo.equipment_id = e.id |
| | | ${ew.customSqlSegment} |
| | | </select> |
| | | |
| | | <select id="equipmentMaintenanceStatistics" |
| | | resultType="org.jeecg.modules.eam.vo.EquipmentMaintenanceStatistics"> |
| | | select FORMAT(err.maintenance_date, 'yyyy-MM') as monthStr, |
| | | COUNT(1) as planNumber, |
| | | SUM(CASE WHEN err.maintenance_status = 'COMPLETE' THEN 1 ELSE 0 END) as completeNumber |
| | | from eam_week_maintenance_order err |
| | | inner join eam_equipment e |
| | | on err.equipment_id = e.id |
| | | where err.maintenance_status != 'ABOLISH' and err.del_flag = 0 and e.del_flag = 0 |
| | | <if test="productionIds != null"> |
| | | AND e.org_id IN |
| | | <foreach collection="productionIds" item="productionId" index="index" open="(" close=")" separator=","> |
| | | #{productionId} |
| | | </foreach> |
| | | </if> |
| | | and err.maintenance_date >= #{start} |
| | | and err.maintenance_date < #{end} |
| | | group by FORMAT(err.maintenance_date, 'yyyy-MM') |
| | | </select> |
| | | <select id="selectUnReceivedMaintenanceOrder" |
| | | resultType="org.jeecg.modules.eam.entity.EamWeekMaintenanceOrder"> |
| | | select ewm.*,ee.org_id |
| | | from eam_week_maintenance_order ewm |
| | | left join eam_equipment ee on ewm.equipment_id = ee.id |
| | | where ewm.maintenance_status = 'WAIT_MAINTENANCE' and ewm.del_flag = 0 |
| | | </select> |
| | | </mapper> |