package com.hxzk.gps.mapper.Warning;
|
|
import com.hxzk.gps.entity.Warning.TbWarning;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Select;
|
|
import java.util.List;
|
|
/**
|
* <p>
|
* Mapper 接口
|
* </p>
|
*
|
* @author YuZhiTong
|
* @since 2025-05-23
|
*/
|
public interface TbWarningMapper extends BaseMapper<TbWarning> {
|
//查询当前登录用户公司下的告警列表信息
|
|
List<TbWarning> FindWarningInfo(@Param("CompanyName") String CompanyName, @Param("objectid")String objectid, @Param("baoliu10")String baoliu10,@Param("type")String type);
|
|
List<TbWarning> FindWarningUntreated(@Param("companyIds") List companyIds,@Param("status")String status);
|
|
|
/*
|
* 获取统计页面告警数据
|
* */
|
@Select("<script>"
|
+ "select count(*) from tb_warning w "
|
+ "inner join tb_person p on p.p_tagid = w.`objectid` "
|
+ "where w.type = #{type} "
|
+ "and p.companyid in "
|
+ "<foreach item='item' collection='companyids' open='(' separator=',' close=')'>"
|
+ "#{item}"
|
+ "</foreach>"
|
+ "</script>")
|
Integer FindDayCountInfo(@Param("type")String type,@Param("companyids")List companyids);
|
|
/*
|
* 获取统计页面告警数据(日期筛选)
|
* */
|
@Select({
|
"<script>",
|
"SELECT count(*) FROM tb_warning w ",
|
"INNER JOIN tb_person p ON p.p_tagid = w.objectid ",
|
"WHERE w.type = #{type} AND p.company = #{company} ",
|
"<if test='timeRange != null'>",
|
" AND w.time >= ",
|
" <choose>",
|
" <when test='timeRange == 1'>DATE_SUB(NOW(), INTERVAL 1 DAY)</when>",
|
" <when test='timeRange == 2'>DATE_SUB(NOW(), INTERVAL 30 DAY)</when>",
|
" <when test='timeRange == 3'>DATE_SUB(NOW(), INTERVAL 3 MONTH)</when>",
|
" <when test='timeRange == 4'>DATE_SUB(NOW(), INTERVAL 6 MONTH)</when>",
|
" <when test='timeRange == 5'>DATE_SUB(NOW(), INTERVAL 1 YEAR)</when>",
|
" </choose>",
|
"</if>",
|
"</script>"
|
})
|
Integer FindDayDateCountInfo(
|
@Param("type") String type,
|
@Param("company") String company,
|
@Param("timeRange") Integer timeRange
|
);
|
|
|
|
/*
|
* 统计分析所有告警功能
|
* */
|
@Select(" SELECT w.id, w.type, w.objectid, w.status, w.time, w.baoliu1, w.baoliu2, w.baoliu3, w.baoliu4, w.baoliu5, w.baoliu6,w.baoliu7, p.p_name as baoliu10\n" +
|
" FROM tb_warning w" +
|
" INNER JOIN tb_person p on p.p_tagid = w.objectid" +
|
" WHERE p.company = #{CompanyName}")
|
public List<TbWarning> FindWarningAll(@Param("CompanyName") String CompanyName);
|
|
@Select("<script>" +
|
"SELECT w.id, w.type, w.objectid, w.status, w.time, w.baoliu1, w.baoliu2, w.baoliu3, w.baoliu4, w.baoliu5, w.baoliu6, w.baoliu7, p.p_name as baoliu10 " +
|
"FROM tb_warning w " +
|
"INNER JOIN tb_person p ON p.p_tagid = w.objectid " +
|
"WHERE w.status = '未处理' and p.companyid IN " +
|
"<foreach item='company' collection='Companyids' open='(' separator=',' close=')'>" +
|
" #{company}" +
|
"</foreach>" +
|
" AND w.type = #{type}" +
|
"</script>")
|
public List<TbWarning> FindWarningInfoType(@Param("Companyids") List Companyids,@Param("type") String type);
|
|
/*
|
* 获取引擎更新时间
|
* */
|
@Select("select addtime from warn_tongji limit 0,1")
|
String FindCSDATE();
|
}
|