package com.ruoyi.device.mapper;
|
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.ruoyi.device.dto.HazardReportDto;
|
import com.ruoyi.device.pojo.HazardReport;
|
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 HazardReportMapper extends BaseMapper<HazardReport> {
|
|
/**
|
* 查询隐患上报列表(关联设施信息)
|
*/
|
@Select("<script>" +
|
"SELECT hr.*, sf.facility_name, sf.facility_type " +
|
"FROM hazard_report hr " +
|
"LEFT JOIN safety_facility sf ON hr.facility_id = sf.id " +
|
"WHERE hr.deleted = 0 " +
|
"<if test='dto.reportType != null and dto.reportType != \"\"'> " +
|
"AND hr.report_type = #{dto.reportType} " +
|
"</if>" +
|
"<if test='dto.severity != null and dto.severity != \"\"'> " +
|
"AND hr.severity = #{dto.severity} " +
|
"</if>" +
|
"<if test='dto.rectificationStatus != null and dto.rectificationStatus != \"\"'> " +
|
"AND hr.rectification_status = #{dto.rectificationStatus} " +
|
"</if>" +
|
"<if test='dto.reporter != null and dto.reporter != \"\"'> " +
|
"AND hr.reporter LIKE CONCAT('%', #{dto.reporter}, '%') " +
|
"</if>" +
|
"ORDER BY hr.create_time DESC" +
|
"</script>")
|
List<HazardReportDto> selectHazardReportList(@Param("dto") HazardReportDto dto);
|
}
|