<?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.SysMsgTypeMapper">
  <resultMap id="BaseResultMap" type="io.dataease.base.domain.SysMsgType">
    <id column="msg_type_id" jdbcType="BIGINT" property="msgTypeId" />
    <result column="pid" jdbcType="BIGINT" property="pid" />
    <result column="type_name" jdbcType="VARCHAR" property="typeName" />
    <result column="router" jdbcType="VARCHAR" property="router" />
    <result column="callback" jdbcType="VARCHAR" property="callback" />
  </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_type_id, pid, type_name, router, callback
  </sql>
  <select id="selectByExample" parameterType="io.dataease.base.domain.SysMsgTypeExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from sys_msg_type
    <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_type
    where msg_type_id = #{msgTypeId,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from sys_msg_type
    where msg_type_id = #{msgTypeId,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="io.dataease.base.domain.SysMsgTypeExample">
    delete from sys_msg_type
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="io.dataease.base.domain.SysMsgType">
    insert into sys_msg_type (msg_type_id, pid, type_name, 
      router, callback)
    values (#{msgTypeId,jdbcType=BIGINT}, #{pid,jdbcType=BIGINT}, #{typeName,jdbcType=VARCHAR}, 
      #{router,jdbcType=VARCHAR}, #{callback,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="io.dataease.base.domain.SysMsgType">
    insert into sys_msg_type
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="msgTypeId != null">
        msg_type_id,
      </if>
      <if test="pid != null">
        pid,
      </if>
      <if test="typeName != null">
        type_name,
      </if>
      <if test="router != null">
        router,
      </if>
      <if test="callback != null">
        callback,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="msgTypeId != null">
        #{msgTypeId,jdbcType=BIGINT},
      </if>
      <if test="pid != null">
        #{pid,jdbcType=BIGINT},
      </if>
      <if test="typeName != null">
        #{typeName,jdbcType=VARCHAR},
      </if>
      <if test="router != null">
        #{router,jdbcType=VARCHAR},
      </if>
      <if test="callback != null">
        #{callback,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="io.dataease.base.domain.SysMsgTypeExample" resultType="java.lang.Long">
    select count(*) from sys_msg_type
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update sys_msg_type
    <set>
      <if test="record.msgTypeId != null">
        msg_type_id = #{record.msgTypeId,jdbcType=BIGINT},
      </if>
      <if test="record.pid != null">
        pid = #{record.pid,jdbcType=BIGINT},
      </if>
      <if test="record.typeName != null">
        type_name = #{record.typeName,jdbcType=VARCHAR},
      </if>
      <if test="record.router != null">
        router = #{record.router,jdbcType=VARCHAR},
      </if>
      <if test="record.callback != null">
        callback = #{record.callback,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_type
    set msg_type_id = #{record.msgTypeId,jdbcType=BIGINT},
      pid = #{record.pid,jdbcType=BIGINT},
      type_name = #{record.typeName,jdbcType=VARCHAR},
      router = #{record.router,jdbcType=VARCHAR},
      callback = #{record.callback,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="io.dataease.base.domain.SysMsgType">
    update sys_msg_type
    <set>
      <if test="pid != null">
        pid = #{pid,jdbcType=BIGINT},
      </if>
      <if test="typeName != null">
        type_name = #{typeName,jdbcType=VARCHAR},
      </if>
      <if test="router != null">
        router = #{router,jdbcType=VARCHAR},
      </if>
      <if test="callback != null">
        callback = #{callback,jdbcType=VARCHAR},
      </if>
    </set>
    where msg_type_id = #{msgTypeId,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="io.dataease.base.domain.SysMsgType">
    update sys_msg_type
    set pid = #{pid,jdbcType=BIGINT},
      type_name = #{typeName,jdbcType=VARCHAR},
      router = #{router,jdbcType=VARCHAR},
      callback = #{callback,jdbcType=VARCHAR}
    where msg_type_id = #{msgTypeId,jdbcType=BIGINT}
  </update>
</mapper>