| | |
| | | </where> |
| | | ORDER BY t1.create_time DESC |
| | | </select> |
| | | |
| | | <select id="equipmentRepairStatistics" resultType="org.jeecg.modules.eam.vo.EquipmentRepairStatistics"> |
| | | select FORMAT(err.create_time, 'yyyy-MM') as monthStr, |
| | | COUNT(1) as reportNumber, |
| | | SUM(CASE WHEN err.report_status = 'COMPLETE' THEN 1 ELSE 0 END) as repairedNumber |
| | | from eam_report_repair err |
| | | inner join eam_equipment e |
| | | on err.equipment_id = e.id |
| | | where err.report_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.create_time >= #{start} |
| | | and err.create_time < #{end} |
| | | group by FORMAT(err.create_time, 'yyyy-MM') |
| | | </select> |
| | | </mapper> |