shiyunteng
2025-03-28 fc0db201e10ed1cc6d68aaf0a37d65933398c2f6
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
<?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.InventoryFlowWaterMapper">
 
  <resultMap id="inventoryFlowWaterMap" type="com.by4cloud.platformx.device.entity.InventoryFlowWater">
        <id property="id" column="id"/>
        <result property="inventoryId" column="inventory_id"/>
        <result property="classId" column="class_id"/>
        <result property="deviceId" column="device_id"/>
        <result property="num" column="num"/>
        <result property="planId" column="plan_id"/>
        <result property="remark" column="remark"/>
        <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="pageNew" resultType="com.by4cloud.platformx.device.entity.vo.InventoryFlowWaterPageVo">
        select
            ifw.id,
            d.name devicName,
            dc.name className,
            d.create_time ,
            ifw.operate_type,
            di.serial_no
        from
            inventory_flow_water ifw
        join device d on d.id = ifw.device_id
        join device_class dc on dc.id = ifw.class_id
        join device_inventory di on di.id = ifw.inventory_id
        where
              ifw.del_flag = '0'
        <if test="queryDTO.deviceName != null and queryDTO.deviceName !=''">
            and d.name like CONCAT('%', #{queryDTO.deviceName}, '%')
        </if>
            order by ifw.create_time desc
    </select>
</mapper>