| | |
| | | <mapper namespace="com.ruoyi.device.mapper.DeviceCalibrationPlanDetailMapper"> |
| | | |
| | | <!-- 设备校准计划详情列表 --> |
| | | <select id="pageDeviceCalibrationPlanDetail" resultType="com.ruoyi.device.pojo.DeviceCalibrationPlanDetail"> |
| | | <select id="pageDeviceCalibrationPlanDetail" resultType="com.ruoyi.device.dto.DeviceCalibrationPlanDetailDto"> |
| | | select * from ( |
| | | select * |
| | | from device_calibration_plan_detail |
| | | order by plan_date asc |
| | | select t.*, |
| | | case when d.next_calibration_date is not null |
| | | and d.next_calibration_date <= date_add(curdate(), interval 1 month) |
| | | and (d.last_calibration_date is null or d.last_calibration_date < t.plan_date) |
| | | then 1 else 0 end as red_flag |
| | | from device_calibration_plan_detail t |
| | | left join device d on d.id = t.device_id |
| | | order by t.plan_date asc |
| | | ) a |
| | | <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> |
| | | ${ew.customSqlSegment} |