<?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> 
 |