yaowanxin
2025-09-22 37ffff3101151099120c385fc82c8ba4ba685f9a
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
<?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.DeviceDefectRecordMapper">
 
    <select id="listPage" resultType="com.ruoyi.device.dto.DeviceDefectRecordDto">
        select ddr.*,dl.device_name,dl.device_model
        from device_defect_record ddr
        left join device_ledger dl on ddr.device_ledger_id = dl.id
        <where>
            1=1
            <if test="deviceDefectRecordDto.deviceLedgerId != null">
                and ddr.device_ledger_id = #{deviceDefectRecordDto.deviceLedgerId}
            </if>
            <if test="deviceDefectRecordDto.deviceName != null and deviceDefectRecordDto.deviceName != ''">
                and dl.device_name like concat('%',#{deviceDefectRecordDto.deviceName},'%')
            </if>
            <if test="deviceDefectRecordDto.status != null">
                and ddr.status = #{deviceDefectRecordDto.status}
            </if>
        </where>
 
    </select>
</mapper>