zhangherong
2025-05-06 915a2e40175c6390802af1257e57effea5fd02ef
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/EamReportRepairMapper.xml
@@ -14,7 +14,7 @@
                <when test="equipmentIds != null and equipmentIds.size() > 0 ">
                    AND t2.equipment_code IN
                    <foreach collection="equipmentIds" item="equipmentId" index="index" open="(" close=")" separator=",">
                        {equipmentId}
                        #{equipmentId}
                    </foreach>
                </when>
                <otherwise>
@@ -46,6 +46,25 @@
                AND t1.fault_start_time BETWEEN #{ eamReportRepair.startTime } AND #{ eamReportRepair.endTime }
            </if>
        </where>
        ORDER BY t1.fault_start_time DESC
        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 &gt;= #{start}
        and err.create_time &lt; #{end}
        group by FORMAT(err.create_time, 'yyyy-MM')
    </select>
</mapper>