package com.ruoyi.device.mapper;
|
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.ruoyi.device.dto.SafetyFacilityDto;
|
import com.ruoyi.device.pojo.SafetyFacility;
|
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 SafetyFacilityMapper extends BaseMapper<SafetyFacility> {
|
|
/**
|
* 查询安全设施列表(关联设备信息)
|
*/
|
@Select("<script>" +
|
"SELECT sf.*, dl.device_name, dl.device_model " +
|
"FROM safety_facility sf " +
|
"LEFT JOIN device_ledger dl ON sf.device_id = dl.id " +
|
"WHERE sf.deleted = 0 " +
|
"<if test='dto.facilityName != null and dto.facilityName != \"\"'> " +
|
"AND sf.facility_name LIKE CONCAT('%', #{dto.facilityName}, '%') " +
|
"</if>" +
|
"<if test='dto.facilityType != null and dto.facilityType != \"\"'> " +
|
"AND sf.facility_type = #{dto.facilityType} " +
|
"</if>" +
|
"<if test='dto.status != null and dto.status != \"\"'> " +
|
"AND sf.status = #{dto.status} " +
|
"</if>" +
|
"<if test='dto.location != null and dto.location != \"\"'> " +
|
"AND sf.location LIKE CONCAT('%', #{dto.location}, '%') " +
|
"</if>" +
|
"ORDER BY sf.create_time DESC" +
|
"</script>")
|
List<SafetyFacilityDto> selectSafetyFacilityList(@Param("dto") SafetyFacilityDto dto);
|
}
|