“linengliang”
2023-11-01 71957dc8efefed42e5fd6877f0f08b171feba4e1
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
<?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.EquipmentReportRepairMapper">
    <select id="getReportRepairList"  parameterType="Map" resultType="Map">
        SELECT
            t1.id,
            t1.num num,
            t1.equipment_id equipmentId,
            t1.fault_reason faultReason,
            t1.fault_description faultDescription,
            t1.photo photo,
            t1.is_stop isStop,
            t1.approval approval,
            t1.fault_time faultTime,
            t1.source source,
            t1.source_id sourceId,
            t1.urgency urgency,
            t1.is_create_order isCreateOrder,
            t1.use_depart_id useDepartId,
            t1.remark remark,
            t1.status status,
            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.team_id teamId,
            t2.specification equipmentSpecification,
            t3.depart_name departName,
            t4.item_text urgencyName,
            t5.item_text statusName,
            t6.item_text isStopName
        FROM
        mom_eam_equipment_report_repair t1
        left join mom_eam_equipment t2 on t1.equipment_id = t2.id
        left join sys_depart t3 on t1.use_depart_id = t3.id
        left join (select * from v_sys_dict where dict_code='urgency') t4 on t1.urgency = t4.item_value
        left join (select * from v_sys_dict where dict_code='equipment_report_repair_status') t5 on t1.status = t5.item_value
        left join (select * from v_sys_dict where dict_code='is_stop') t6 on t1.is_stop = t6.item_value
        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.equipmentName != null and params.equipmentName != ''">
            and t2.name like concat('%',#{params.equipmentName},'%')
        </if>
        <if test="params.status != null and params.status != ''">
            and t1.status = #{params.status}
        </if>
        <if test="params.teamId != null and params.teamId != ''">
            and t2.team_id = #{params.teamId}
        </if>
        ORDER BY t1.create_time desc
    </select>
</mapper>