src/main/resources/mapper/device/DeviceMaintenanceMapper.xml
@@ -18,6 +18,9 @@
        dm.update_user,
        dm.tenant_id,
        dm.maintenance_actually_name,
        dm.maintenance_person,
        dm.maintenance_location,
        dm.maintenance_items,
        dl.device_name,
        dl.device_model,
        su.nick_name as create_user_name
@@ -38,13 +41,24 @@
            <if test="deviceMaintenanceDto.maintenanceActuallyName != null">
                and dm.maintenance_actually_name like concat('%',#{deviceMaintenanceDto.maintenanceActuallyName},'%')
            </if>
            <if test="deviceMaintenanceDto.maintenancePlanTimeReq != null">
                and dm.maintenance_plan_time like concat('%',#{deviceMaintenanceDto.maintenancePlanTimeReq},'%')
            <if test="deviceMaintenanceDto.maintenanceLocation != null and deviceMaintenanceDto.maintenanceLocation != ''">
                and dm.maintenance_location like concat('%',#{deviceMaintenanceDto.maintenanceLocation},'%')
            </if>
            <if test="deviceMaintenanceDto.maintenanceActuallyTimeReq != null">
                and dm.maintenance_actually_time like concat('%',#{deviceMaintenanceDto.maintenanceActuallyTimeReq},'%')
            <if test="deviceMaintenanceDto.maintenanceItems != null and deviceMaintenanceDto.maintenanceItems != ''">
                and dm.maintenance_items like concat('%',#{deviceMaintenanceDto.maintenanceItems},'%')
            </if>
            <if test="deviceMaintenanceDto.maintenancePlanTime != null">
                and dm.maintenance_plan_time like concat('%',#{deviceMaintenanceDto.maintenancePlanTime},'%')
            </if>
            <if test="deviceMaintenanceDto.maintenanceActuallyTime != null">
                and dm.maintenance_actually_time like concat('%',#{deviceMaintenanceDto.maintenanceActuallyTime},'%')
            </if>
            <if test="deviceMaintenanceDto.maintenanceActuallyTime != null">
                and dm.maintenance_actually_time >= str_to_date(#{deviceMaintenanceDto.maintenanceActuallyTime}, '%Y-%m-%d')
                and dm.maintenance_actually_time &lt; date_add(str_to_date(#{deviceMaintenanceDto.maintenanceActuallyTime}, '%Y-%m-%d'), interval 1 day)
            </if>
        </where>
        order by dm.create_time desc
    </select>
    <select id="detailById" resultType="com.ruoyi.device.dto.DeviceMaintenanceDto">
        select dm.id,
@@ -59,6 +73,9 @@
               dm.update_user,
               dm.tenant_id,
               dm.maintenance_actually_name,
               dm.maintenance_person,
               dm.maintenance_location,
               dm.maintenance_items,
               dl.device_name,
               dl.device_model,
               su.user_name as create_user_name