gunshi-project-ss/src/main/java/com/gunshi/project/ss/mapper/WarningRuleInfoMapper.java

89 lines
4.2 KiB
Java

package com.gunshi.project.ss.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gunshi.project.ss.entity.so.WarningRulePageSo;
import com.gunshi.project.ss.model.WarningRuleInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
@Mapper
public interface WarningRuleInfoMapper extends BaseMapper<WarningRuleInfo> {
@Select("""
<script>
select t1.*,t2.warning_type,t2.warning_obj,t2.warning_level,t2.rel_stcd from public.warning_rule_info t1
left join public.warning_rule t2 on t1.rule_id = t2.id
where 1=1
<if test="obj.warningType != null and obj.warningType != ''">
and t2.warning_type = #{obj.warningType}
</if>
<if test="obj.warningObj != null ">
and t2.warning_obj = #{obj.warningObj}
</if>
<if test="obj.warningLevel != null ">
and t2.warning_level = #{obj.warningLevel}
</if>
<if test="obj.dateTimeRangeSo != null and obj.dateTimeRangeSo.start != null">
and t1.create_time <![CDATA[>=]]> #{obj.dateTimeRangeSo.start}
</if>
<if test="obj.dateTimeRangeSo != null and obj.dateTimeRangeSo.end != null">
and t1.create_time <![CDATA[<=]]> #{obj.dateTimeRangeSo.end}
</if>
order by t1.create_time desc
</script>
""")
Page<WarningRuleInfo> page(Page<WarningRuleInfo> page,@Param("obj") WarningRulePageSo page1);
@Select("""
<script>
select t1.id,t2.warning_level from public.warning_rule_info t1
left join public.warning_rule t2 on t1.rule_id = t2.id
where 1=1
<if test="obj.warningType != null and obj.warningType != ''">
and t2.warning_type = #{obj.warningType}
</if>
<if test="obj.warningObj != null ">
and t2.warning_obj = #{obj.warningObj}
</if>
<if test="obj.warningLevel != null ">
and t2.warning_level = #{obj.warningLevel}
</if>
<if test="obj.dateTimeRangeSo != null and obj.dateTimeRangeSo.start != null">
and t1.create_time <![CDATA[>=]]> #{obj.dateTimeRangeSo.start}
</if>
<if test="obj.dateTimeRangeSo != null and obj.dateTimeRangeSo.end != null">
and t1.create_time <![CDATA[<=]]> #{obj.dateTimeRangeSo.end}
</if>
</script>
""")
List<WarningRuleInfo> infoStat(@Param("obj") WarningRulePageSo page);
@Select("""
<script>
select t1.*,t2.warning_type,t2.warning_obj,t2.warning_level,t2.rel_stcd from public.warning_rule_info t1
left join public.warning_rule t2 on t1.rule_id = t2.id
where t1.status != 0
<if test="obj.warningType != null and obj.warningType != ''">
and t2.warning_type = #{obj.warningType}
</if>
<if test="obj.warningLevel != null ">
and t2.warning_level = #{obj.warningLevel}
</if>
<if test="obj.auditStatus != null ">
and t1.status = #{obj.auditStatus}
</if>
<if test="obj.dateTimeRangeSo != null and obj.dateTimeRangeSo.start != null">
and t1.init_audit_time <![CDATA[>=]]> #{obj.dateTimeRangeSo.start}
</if>
<if test="obj.dateTimeRangeSo != null and obj.dateTimeRangeSo.end != null">
and t1.init_audit_time <![CDATA[<=]]> #{obj.dateTimeRangeSo.end}
</if>
order by t1.init_audit_time desc
</script>
""")
Page<WarningRuleInfo> auditPage(Page<WarningRuleInfo> page,@Param("obj") WarningRulePageSo page1);
}