shiyunteng
2 天以前 c6db287f6c987060d615fd7ef5126511e051d5c6
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
<?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="com.by4cloud.platformx.device.mapper.DeviceInventoryMapper">
 
  <resultMap id="deviceInventoryMap" type="com.by4cloud.platformx.device.entity.DeviceInventory">
        <id property="id" column="id"/>
        <result property="deviceNumber" column="device_number"/>
        <result property="serialNo" column="serial_no"/>
        <result property="deviceId" column="device_id"/>
        <result property="deviceId" column="device_id"/>
        <result property="name" column="name"/>
        <result property="source" column="source"/>
        <result property="compId" column="comp_id"/>
        <result property="createBy" column="create_by"/>
        <result property="createTime" column="create_time"/>
        <result property="updateBy" column="update_by"/>
        <result property="updateTime" column="update_time"/>
        <result property="delFlag" column="del_flag"/>
  </resultMap>
    <select id="getReleaseDetail" resultType="com.by4cloud.platformx.device.entity.vo.InventoryDetailVo">
        select
            c.name contractName,
            sd.name rentName,
            di.device_number,
            di.serial_no,
            dll.delivery_date,
            di.file_path
        from
            device_inventory di
                join device_leasing_ledger_item dlli on
                di.ledger_item_id = dlli.id
                join device_leasing_ledger dll on
                dll.id = dlli.ledger_id
                join contract c on
                c.`number`  = dll.contract_code
                join platformxx_boot.sys_dept sd on
                sd.dept_id = dll.lessee_contract_id
        where
            di.id =#{id}
    </select>
    <select id="selectListByClassId" resultType="com.by4cloud.platformx.device.entity.vo.DeviceClassVo">
        select
            di.device_id ,
            d.class_id ,
            d.number ,
            d.name,
            d.specification,
            di.serial_no
        from
            device_inventory di
                join device d on
                d.id = di.device_id
        where
            di.del_flag = '0'
          and d.class_id = #{classId}
    </select>
</mapper>