Lius
2025-06-12 a1bdd2887fec278235ec447c521918c021081d40
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.board.mapper.DtBoardMapper">
 
    <select id="equRepairList" resultType="org.jeecg.modules.board.vo.EquRepair">
        SELECT
            t3.equipment_code equipmentId,
            COUNT(*) faultNum,
            ROUND(
                    SUM(DATEDIFF(MINUTE, t2.fault_start_time, t1.actual_end_time)) / 60.0,
                    2
            ) faultTime
        FROM
            eam_repair_order t1
                LEFT JOIN eam_report_repair t2 ON t1.report_id = t2.id
                LEFT JOIN eam_equipment t3 ON t1.equipment_id = t3.id
        WHERE
            t1.repair_status = 'COMPLETE'
            AND t2.fault_start_time > #{date}
            AND t3.equipment_code IN
            <foreach collection="equipmentIdList" item="id" index="index" open="(" close=")" separator=",">
                #{ id }
            </foreach>
        GROUP BY
            t3.equipment_code
    </select>
</mapper>