| | |
| | | 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 != ''"> |
| | |
| | | <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> |