liyong
2 天以前 af107f8697ed128acfe7fca372ca365ac597d6cf
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="com.ruoyi.device.mapper.DeviceLedgerMapper">
 
    <select id="queryPage" resultType="com.ruoyi.device.pojo.DeviceLedger">
        SELECT
        id,
        device_name AS deviceName,
        device_model AS deviceModel,
        supplier_name AS supplierName,
        unit,
        number,
        tax_including_price_unit AS taxIncludingPriceUnit,
        tax_including_price_total AS taxIncludingPriceTotal,
        tax_rate AS taxRate,
        un_tax_including_price_total AS unTaxIncludingPriceTotal,
        create_time AS createTime,
        update_time AS updateTime,
        create_user AS createUser,
        update_user AS updateUser,
        tenant_id AS tenantId
        FROM device_ledger
        <where>
            <!-- 设备名称 -->
            <if test="deviceLedger.deviceName != null and deviceLedger.deviceName != ''">
                AND device_name LIKE CONCAT('%', #{deviceLedger.deviceName}, '%')
            </if>
 
            <!-- 规格型号 -->
            <if test="deviceLedger.deviceModel != null and deviceLedger.deviceModel != ''">
                AND device_model LIKE CONCAT('%', #{deviceLedger.deviceModel}, '%')
            </if>
 
            <!-- 供应商名称 -->
            <if test="deviceLedger.supplierName != null and deviceLedger.supplierName != ''">
                AND supplier_name LIKE CONCAT('%', #{deviceLedger.supplierName}, '%')
            </if>
 
            <!-- 单位 -->
            <if test="deviceLedger.unit != null and deviceLedger.unit != ''">
                AND unit = #{deviceLedger.unit}
            </if>
 
            <!-- 录入人 -->
            <if test="deviceLedger.createUser != null and deviceLedger.createUser != ''">
                AND create_user LIKE CONCAT('%', #{deviceLedger.createUser}, '%')
            </if>
 
            <!-- 更新人 -->
            <if test="deviceLedger.updateUser != null and deviceLedger.updateUser != ''">
                AND update_user LIKE CONCAT('%', #{deviceLedger.updateUser}, '%')
            </if>
 
            <!-- 租户ID -->
            <if test="deviceLedger.tenantId != null">
                AND tenant_id = #{deviceLedger.tenantId}
            </if>
        </where>
        ORDER BY create_time DESC
    </select>
    <select id="deviceLedgerExportList" resultType="com.ruoyi.device.dto.DeviceLedgerExeclDto">
 
    </select>
 
</mapper>