cuijian
2023-08-19 bdd0875d4b13a3f1ef472f64d4b6a95e0ef64b22
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.EquipmentUnloadingMapper">
    <select id="getEquipmentUnloadingList" parameterType="String" resultType="Map">
        SELECT
        t1.id,
        t1.num,
        t1.unloading_type as unloadingType,
        t1.audit_status as auditStatus,
        t1.business_type as businessType,
        t1.remark,
        t1.create_by as createBy,
        t1.update_by as updateBy,
        t1.update_time as updateTime,
        t1.create_time as createTime,
        t2.item_text as audit_status,
        t3.id AS useDepartId,
        t3.depart_name as useDepartName,
        t4.item_text as business_type
 
 
        FROM
        mom_eam_equipment_unloading t1
        LEFT JOIN ( SELECT * FROM v_sys_dict WHERE dict_code = 'audit_status' ) t2 ON t2.item_value = t1.audit_status
        LEFT JOIN ( SELECT * FROM v_sys_dict WHERE dict_code = 'business_type' ) t4 ON t4.item_value = t1.business_type
        LEFT JOIN sys_depart t3 ON t1.use_depart_id = t3.id
        where t1.del_flag = 0  and t1.unloading_type ='borrow'
        <if test="num != 'null' and num != ''">
            and num like concat('%',#{num},'%')
        </if>
        <if test="auditStatus != 'null' and auditStatus != ''">
            and audit_status like concat('%',#{auditStatus},'%')
        </if>
        ORDER BY t1.create_time desc
    </select>
 
    <select id="getEquipmentUnloadingReturnList" parameterType="String" resultType="Map">
 
        SELECT
        t1.id,
        t1.num,
        t1.audit_status as auditStatus,
        t1.remark,
        t1.unloading_type as unloadingType,
        t1.business_type as businessType,
        t1.create_by as createBy,
        t1.update_by as updateBy,
        t1.update_time as updateTime,
        t1.create_time as createTime,
        t2.item_text as audit_status,
        t3.id AS useDepartId,
        t3.depart_name as useDepartName,
        t4.item_text as business_type
        FROM
        mom_eam_equipment_unloading t1
        LEFT JOIN ( SELECT * FROM v_sys_dict WHERE dict_code = 'audit_status' ) t2 ON t2.item_value = t1.audit_status
        LEFT JOIN ( SELECT * FROM v_sys_dict WHERE dict_code = 'business_type' ) t4 ON t4.item_value = t1.business_type
        LEFT JOIN sys_depart t3 ON t1.use_depart_id = t3.id
        where  t1.del_flag = 0  and t1.unloading_type ='return'
        <if test="num != 'null' and num != ''">
            and num like concat('%',#{num},'%')
        </if>
        <if test="auditStatus != 'null' and auditStatus != ''">
            and t1.audit_status like concat('%',#{auditStatus},'%')
        </if>
        ORDER BY t1.create_time desc
    </select>
</mapper>