<?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.ruoyi.system.mapper.NotifyChannelConfigMapper">
|
|
<resultMap type="NotifyChannelConfig" id="NotifyChannelConfigResult">
|
<id property="id" column="id"/>
|
<result property="notifyType" column="notify_type"/>
|
<result property="channel" column="channel"/>
|
<result property="enabled" column="enabled"/>
|
<result property="priority" column="priority"/>
|
<result property="configJson" column="config_json"/>
|
<result property="createBy" column="create_by"/>
|
<result property="createTime" column="create_time"/>
|
<result property="updateBy" column="update_by"/>
|
<result property="updateTime" column="update_time"/>
|
<result property="remark" column="remark"/>
|
</resultMap>
|
|
<sql id="selectNotifyChannelConfigVo">
|
select id, notify_type, channel, enabled, priority, config_json,
|
create_by, create_time, update_by, update_time, remark
|
from sys_notify_channel_config
|
</sql>
|
|
<select id="selectNotifyChannelConfigById" parameterType="Long" resultMap="NotifyChannelConfigResult">
|
<include refid="selectNotifyChannelConfigVo"/>
|
where id = #{id}
|
</select>
|
|
<select id="selectNotifyChannelConfigList" parameterType="NotifyChannelConfig" resultMap="NotifyChannelConfigResult">
|
<include refid="selectNotifyChannelConfigVo"/>
|
<where>
|
<if test="notifyType != null and notifyType != ''">
|
AND notify_type = #{notifyType}
|
</if>
|
<if test="channel != null and channel != ''">
|
AND channel = #{channel}
|
</if>
|
<if test="enabled != null and enabled != ''">
|
AND enabled = #{enabled}
|
</if>
|
</where>
|
order by priority desc
|
</select>
|
|
<select id="selectEnabledChannelsByType" parameterType="String" resultMap="NotifyChannelConfigResult">
|
<include refid="selectNotifyChannelConfigVo"/>
|
where notify_type = #{notifyType} and enabled = '1'
|
order by priority desc
|
</select>
|
|
<select id="selectByTypeAndChannel" resultMap="NotifyChannelConfigResult">
|
<include refid="selectNotifyChannelConfigVo"/>
|
where notify_type = #{notifyType} and channel = #{channel}
|
</select>
|
|
<insert id="insertNotifyChannelConfig" parameterType="NotifyChannelConfig" useGeneratedKeys="true" keyProperty="id">
|
insert into sys_notify_channel_config (
|
notify_type, channel, enabled, priority, config_json,
|
create_by, create_time, update_by, update_time, remark
|
) values (
|
#{notifyType}, #{channel}, #{enabled}, #{priority}, #{configJson},
|
#{createBy}, sysdate(), #{updateBy}, sysdate(), #{remark}
|
)
|
</insert>
|
|
<update id="updateNotifyChannelConfig" parameterType="NotifyChannelConfig">
|
update sys_notify_channel_config
|
<set>
|
<if test="notifyType != null">notify_type = #{notifyType},</if>
|
<if test="channel != null">channel = #{channel},</if>
|
<if test="enabled != null">enabled = #{enabled},</if>
|
<if test="priority != null">priority = #{priority},</if>
|
<if test="configJson != null">config_json = #{configJson},</if>
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
update_time = sysdate()
|
</set>
|
where id = #{id}
|
</update>
|
|
<delete id="deleteNotifyChannelConfigById" parameterType="Long">
|
delete from sys_notify_channel_config where id = #{id}
|
</delete>
|
|
<delete id="deleteNotifyChannelConfigByIds" parameterType="Long">
|
delete from sys_notify_channel_config where id in
|
<foreach collection="array" item="id" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
</mapper>
|