AlarmCustomRuleConfigMapper.java 1.3 KB
package com.skua.modules.alarmtmp.mapper;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.skua.modules.alarmtmp.entity.AlarmCustomRuleConfig;
import com.skua.modules.alarmtmp.vo.AlarmCustomRuleConfigVO;

/**
 * 报警方案库
 */
public interface AlarmCustomRuleConfigMapper extends BaseMapper<AlarmCustomRuleConfig> {

	@Select("SELECT\r\n" + 
			"	a.*, b.alarm_rule_level_name,c.alarm_template_name,d.alarm_index_show_tag \r\n" + 
			"FROM\r\n" + 
			"	alarm_custom_rule_config a\r\n" + 
			"LEFT JOIN alarm_rule_level_config b ON a.id = b.alarm_rule_id " +
			"LEFT JOIN alarm_rule_level_config_template c ON (b.alarm_rule_level_name = c.alarm_template_level_name and b.sort=c.sort and b.template_type = c.alarm_template_type) " +
			"LEFT JOIN alarm_custom_rule_repository d ON a.alarm_rule_repository_id = d.id " +
			"${ew.customSqlSegment}")
	IPage<AlarmCustomRuleConfigVO> getPage(Page<AlarmCustomRuleConfigVO> page,@Param(Constants.WRAPPER)QueryWrapper<AlarmCustomRuleConfigVO> queryWrapper);

}