Houjie
2025-06-10 be8a6f171bd41aa50fb7310b2ccbe753dac20b89
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?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.eam.mapper.ReportAfterRepairMapper">
 
    <select id="getReportAfterRepairList"  parameterType="Map" resultType="Map">
        SELECT
        t1.id,
        t1.num num,
        t1.equipment_id equipmentId,
        t1.fault_description faultDescription,
        t1.photo photo,
        t1.approval approval,
        t1.fault_time faultTime,
        t1.depart_id departId,
        t1.report_user_id reportUserId,
        t1.report_repair_id reportRepairId,
        t1.team_id teamId,
        t1.maintenance_method maintenanceMethod,
        t1.responsibility_id responsibilityId,
        t1.outsourcing_unit outsourcingUnit,
        t1.actual_hour actualHour,
        t1.working_hour_quota workingHourQuota,
        t1.actual_start_time actualStartTime,
        t1.actual_end_time actualEndTime,
        t1.remark remark,
        t1.status status,
        t1.audit_status auditStatus,
        t1.create_by createBy,
        t1.create_time createTime,
        t1.update_by updateBy,
        t1.update_time updateTime,
        t2.num equipmentNum,
        t2.name equipmentName,
        t2.model equipmentModel,
        t2.specification equipmentSpecification,
        t3.depart_name departName,
        t4.item_text maintenanceMethodName,
        t5.item_text auditStatusName,
        t6.name teamName,
        t7.realname responsibilityName,
        t8.name outsourcingUnitName,
        t9.realname reportUserName
        FROM
        mom_eam_report_after_repair t1
        left join mom_eam_equipment t2 on t1.equipment_id = t2.id
        left join sys_depart t3 on t2.use_id = t3.id
        left join (select * from v_sys_dict where dict_code='maintenance_method') t4 on t1.maintenance_method = t4.item_value
        left join (select * from v_sys_dict where dict_code='audit_status') t5 on t1.audit_status = t5.item_value
        left join mom_base_team t6 on t1.team_id = t6.id
        left join sys_user t7 on t7.id = t1.responsibility_id
        left join mom_base_supplier t8 on t8.id = t1.outsourcing_unit
        left join sys_user t9 on t9.id = t1.report_user_id
        WHERE t1.del_flag = 0
        <if test="params.num != null and params.num != ''">
            and t1.num like concat('%',#{params.num},'%')
        </if>
        <if test="params.equipmentId != null and params.equipmentId != ''">
            and t1.equipment_id = #{params.equipmentId}
        </if>
        <if test="params.equipmentNum != null and params.equipmentNum != ''">
            and t2.num like concat('%',#{params.equipmentNum},'%')
        </if>
        <if test="params.auditStatus != null and params.auditStatus != ''">
            and t1.audit_status  =#{params.auditStatus}
        </if>
        ORDER BY t1.create_time desc
    </select>
</mapper>