liding
2026-06-29 e492288919d92b8667c5781675c7581b37208405
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package com.ruoyi.device.mapper;
 
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.device.dto.LineInspectionDto;
import com.ruoyi.device.pojo.LineInspection;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
 
import java.util.List;
 
/**
 * 线路巡检Mapper接口
 */
@Mapper
public interface LineInspectionMapper extends BaseMapper<LineInspection> {
 
    /**
     * 查询线路巡检列表(关联设备信息)
     */
    @Select("<script>" +
            "SELECT li.*, dl.device_name, dl.device_model " +
            "FROM line_inspection li " +
            "LEFT JOIN device_ledger dl ON li.device_id = dl.id " +
            "WHERE li.deleted = 0 " +
            "<if test='dto.taskName != null and dto.taskName != \"\"'> " +
            "AND li.task_name LIKE CONCAT('%', #{dto.taskName}, '%') " +
            "</if>" +
            "<if test='dto.routeName != null and dto.routeName != \"\"'> " +
            "AND li.route_name LIKE CONCAT('%', #{dto.routeName}, '%') " +
            "</if>" +
            "<if test='dto.inspector != null and dto.inspector != \"\"'> " +
            "AND li.inspector LIKE CONCAT('%', #{dto.inspector}, '%') " +
            "</if>" +
            "<if test='dto.status != null and dto.status != \"\"'> " +
            "AND li.status = #{dto.status} " +
            "</if>" +
            "ORDER BY li.create_time DESC" +
            "</script>")
    List<LineInspectionDto> selectLineInspectionList(@Param("dto") LineInspectionDto dto);
}