dataease-dm/backend/src/main/java/io/dataease/base/mapper/SysMsgChannelMapper.xml
2021-11-15 16:23:24 +08:00

181 lines
6.8 KiB
XML

<?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="io.dataease.base.mapper.SysMsgChannelMapper">
<resultMap id="BaseResultMap" type="io.dataease.base.domain.SysMsgChannel">
<id column="msg_channel_id" jdbcType="BIGINT" property="msgChannelId" />
<result column="channel_name" jdbcType="VARCHAR" property="channelName" />
<result column="service_name" jdbcType="VARCHAR" property="serviceName" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
msg_channel_id, channel_name, service_name
</sql>
<select id="selectByExample" parameterType="io.dataease.base.domain.SysMsgChannelExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from sys_msg_channel
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from sys_msg_channel
where msg_channel_id = #{msgChannelId,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from sys_msg_channel
where msg_channel_id = #{msgChannelId,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="io.dataease.base.domain.SysMsgChannelExample">
delete from sys_msg_channel
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="io.dataease.base.domain.SysMsgChannel">
insert into sys_msg_channel (msg_channel_id, channel_name, service_name
)
values (#{msgChannelId,jdbcType=BIGINT}, #{channelName,jdbcType=VARCHAR}, #{serviceName,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="io.dataease.base.domain.SysMsgChannel">
insert into sys_msg_channel
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="msgChannelId != null">
msg_channel_id,
</if>
<if test="channelName != null">
channel_name,
</if>
<if test="serviceName != null">
service_name,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="msgChannelId != null">
#{msgChannelId,jdbcType=BIGINT},
</if>
<if test="channelName != null">
#{channelName,jdbcType=VARCHAR},
</if>
<if test="serviceName != null">
#{serviceName,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="io.dataease.base.domain.SysMsgChannelExample" resultType="java.lang.Long">
select count(*) from sys_msg_channel
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update sys_msg_channel
<set>
<if test="record.msgChannelId != null">
msg_channel_id = #{record.msgChannelId,jdbcType=BIGINT},
</if>
<if test="record.channelName != null">
channel_name = #{record.channelName,jdbcType=VARCHAR},
</if>
<if test="record.serviceName != null">
service_name = #{record.serviceName,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update sys_msg_channel
set msg_channel_id = #{record.msgChannelId,jdbcType=BIGINT},
channel_name = #{record.channelName,jdbcType=VARCHAR},
service_name = #{record.serviceName,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="io.dataease.base.domain.SysMsgChannel">
update sys_msg_channel
<set>
<if test="channelName != null">
channel_name = #{channelName,jdbcType=VARCHAR},
</if>
<if test="serviceName != null">
service_name = #{serviceName,jdbcType=VARCHAR},
</if>
</set>
where msg_channel_id = #{msgChannelId,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="io.dataease.base.domain.SysMsgChannel">
update sys_msg_channel
set channel_name = #{channelName,jdbcType=VARCHAR},
service_name = #{serviceName,jdbcType=VARCHAR}
where msg_channel_id = #{msgChannelId,jdbcType=BIGINT}
</update>
</mapper>