吴羡
2026-10-24 3d397976d08f0359b8cfeb4e4f22403ae5d0c04f
cnas-device/src/main/resources/mapper/InsOrderDeviceRecordMapper.xml
@@ -5,9 +5,12 @@
    <select id="deviceRecordPage" resultType="com.ruoyi.device.dto.DeviceRecordDto">
        select dr.*,
               d.device_name,
               d.management_number
               d.specification_model,
               d.management_number,
               o.entrust_code as order_code
        from device_record dr
                 left join device d on d.id = dr.device_id
                 left join ins_order o on o.id = dr.ins_order_id
        where 1=1
        <if test="deviceId != null">
            and dr.device_id = #{deviceId}
@@ -37,12 +40,22 @@
    <!-- 查询导出设备使用记录 -->
    <select id="selectExportList" resultType="com.ruoyi.device.dto.DeviceRecordDto">
        select dr.*
        select dr.*,
               d.device_name,
               d.specification_model,
               d.management_number
        from device_record dr
                 left join device d on d.id = dr.device_id
        where dr.use_start_date is not null
        <if test="deviceId != null">
            and dr.device_id = #{deviceId}
        </if>
        <if test="sampleCode != '' and sampleCode != null">
            and dr.sample_code like concat('%', #{sampleCode}, '%')
        </if>
        <if test="managementNumber != '' and managementNumber != null">
            and d.management_number like concat('%', #{managementNumber}, '%')
        </if>
        <if test="exportDate != '' and exportDate != null">
            and DATE_FORMAT(dr.use_start_date, '%Y-%m') = #{exportDate}
        </if>