2 天以前 4f55d3cb4bc644e4534106336f2047af1a4db5df
src/main/resources/mapper/device/DeviceLedgerMapper.xml
@@ -31,9 +31,14 @@
        dl.tenant_id,
        dl.is_depr,
        dl.annual_depreciation_amount,
        dl.type
        dl.type,
        dl.area_id,
        dl.is_iot_device,
        dl.external_code,
        da.area_name AS areaName
        FROM device_ledger dl
        left join sys_user su on dl.create_user = su.user_id
        left join device_area da on dl.area_id = da.id
        <where>
            <!-- 设备名称 -->
            <if test="deviceLedger.deviceName != null and deviceLedger.deviceName != ''">
@@ -76,6 +81,21 @@
            <if test="deviceLedger.tenantId != null">
                AND tenant_id = #{deviceLedger.tenantId}
            </if>
            <!-- 设备区域 -->
            <if test="deviceLedger.areaId != null">
                AND dl.area_id = #{deviceLedger.areaId}
            </if>
            <!-- 是否物联设备 -->
            <if test="deviceLedger.isIotDevice != null">
                AND dl.is_iot_device = #{deviceLedger.isIotDevice}
            </if>
            <!-- 外部编码 -->
            <if test="deviceLedger.externalCode != null and deviceLedger.externalCode != ''">
                AND dl.external_code LIKE CONCAT('%', #{deviceLedger.externalCode}, '%')
            </if>
        </where>
        ORDER BY create_time DESC
    </select>