You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
78 lines
3.1 KiB
78 lines
3.1 KiB
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
|
<mapper namespace="com.thing.alarm.alarm.mapper.AlarmRuleActionMapper">
|
|
|
|
<resultMap type="com.thing.alarm.alarm.entity.AlarmRuleActionEntity" id="alarmRuleActionMap">
|
|
<result property="id" column="id"/>
|
|
<result property="ruleId" column="rule_id"/>
|
|
<result property="actionType" column="action_type"/>
|
|
<result property="actionId" column="action_id"/>
|
|
<result property="actionConfigure" column="action_configure"/>
|
|
<result property="creator" column="creator"/>
|
|
<result property="createDate" column="create_date"/>
|
|
<result property="updater" column="updater"/>
|
|
<result property="updateDate" column="update_date"/>
|
|
</resultMap>
|
|
|
|
<select id="getAlarmRuleActionList" resultType="com.thing.alarm.alarm.dto.AlarmRuleActionPageDTO">
|
|
select
|
|
ara.id,
|
|
ar.name as ruleName,
|
|
ar.type as ruleType,
|
|
ar.level as ruleLevel,
|
|
mps.receivers as receivers,
|
|
mps.name as pushName,
|
|
ara.action_type,
|
|
ar.content as ruleContent,
|
|
su.real_name as creator,
|
|
ara.create_date
|
|
from alarm_rule_action ara
|
|
left join alarm_rule ar on ar.id = ara.rule_id
|
|
left join msg_push_setting mps on mps.id = ara.action_id
|
|
left join sys_user su on su.id = ara.creator
|
|
<where>
|
|
<if test="ruleName != null and ruleName.trim() != ''">
|
|
and ar.name like #{ruleName}
|
|
</if>
|
|
<if test="pushName != null and pushName.trim() != ''">
|
|
and mps.name like #{pushName}
|
|
</if>
|
|
<if test="ruleType != null and ruleType.trim() != ''">
|
|
and ar.type = #{ruleType}
|
|
</if>
|
|
<if test="ruleLevel != null and ruleLevel.trim() != ''">
|
|
and ar.level = #{ruleLevel}
|
|
</if>
|
|
</where>
|
|
</select>
|
|
<select id="getAlarmRuleActionDetailDTO" resultType="com.thing.alarm.alarm.dto.AlarmRuleActionDetailDTO">
|
|
select
|
|
ara.id,
|
|
ar.id as ruleId,
|
|
ar.name as ruleName,
|
|
ara.action_type as ruleType,
|
|
mps.id as actionId,
|
|
mps.name as pushName,
|
|
mps.push_ids as pushMethod,
|
|
mps.receivers as receivers,
|
|
mt.name as templateName,
|
|
ar.content as ruleContent
|
|
from alarm_rule_action ara
|
|
left join alarm_rule ar on ar.id = ara.rule_id
|
|
left join msg_push_setting mps on mps.id = ara.action_id
|
|
left join msg_template mt on mt.id = mps.template_id
|
|
where ara.id = #{id}
|
|
</select>
|
|
<select id="getConfigType" resultType="java.lang.String">
|
|
SELECT string_agg(mp.config_type, ',') FROM msg_push mp
|
|
<where>
|
|
<if test="pushIdList != null">
|
|
and mp.id in
|
|
<foreach item="pushId" collection="pushIdList" open="(" separator="," close=")">
|
|
#{pushId}
|
|
</foreach>
|
|
</if>
|
|
</where>
|
|
</select>
|
|
</mapper>
|