MessageRouterMapper.xml 8.0 KB
<?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.sunyo.wlpt.message.bus.service.mapper.MessageRouterMapper" >
  <resultMap id="BaseResultMap" type="com.sunyo.wlpt.message.bus.service.model.MessageRouter" >
    <id column="id" property="id" jdbcType="VARCHAR" />
    <result column="sndr" property="sndr" jdbcType="VARCHAR" />
    <result column="btype" property="btype" jdbcType="VARCHAR" />
    <result column="stype" property="stype" jdbcType="VARCHAR" />
    <result column="optype" property="optype" jdbcType="VARCHAR" />
    <result column="msg_limit" property="msgLimit" jdbcType="TINYINT" />
    <result column="character" property="character" jdbcType="VARCHAR" />
    <result column="status" property="status" jdbcType="BIT" />
    <result column="usage" property="usage" jdbcType="TINYINT" />
    <result column="des" property="des" jdbcType="VARCHAR" />
    <result column="ver" property="ver" jdbcType="VARCHAR" />
    <result column="creat_time" property="creatTime" jdbcType="TIMESTAMP" />
    <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
  </resultMap>
  <resultMap id="TreeMap" type="com.sunyo.wlpt.message.bus.service.model.MessageRouter" extends="BaseResultMap">
    <collection column="id" javaType="java.util.ArrayList" ofType="com.sunyo.wlpt.message.bus.service.model.MessageRouterReciver" property="rcvrList" select="com.sunyo.wlpt.message.bus.service.mapper.MessageRouterReciverMapper.selectByRouterKey" />
  </resultMap>

  <sql id="Base_Column_List" >
    id, sndr, btype, stype, optype, msg_limit, `character`, status, `usage`, des, ver, creat_time,
    update_time
  </sql>
  <select id="selectCountRouter" resultType="java.lang.Integer">
    select count(*) from message_router
    where 1=1
    <if test="sndr != null and sndr!=''" >
      and  sndr = #{sndr,jdbcType=VARCHAR}
    </if>
    <if test="btype != null and btype!=''" >
      and  btype = #{btype,jdbcType=VARCHAR}
    </if>
    <if test="stype != null and stype!=''" >
      and  stype = #{stype,jdbcType=VARCHAR}
    </if>
  </select>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
    select
    <include refid="Base_Column_List" />
    from message_router
    where id = #{id,jdbcType=VARCHAR}
  </select>
  <select id="queRouterList" parameterType="com.sunyo.wlpt.message.bus.service.model.MessageRouter" resultMap="TreeMap">
    select
    <include refid="Base_Column_List" />
    from message_router where 1=1
    <if test="sndr != null and sndr!=''" >
    and  sndr = #{sndr,jdbcType=VARCHAR}
    </if>
    <if test="btype != null and btype!=''" >
    and  btype = #{btype,jdbcType=VARCHAR}
    </if>
    <if test="stype != null and stype!=''" >
    and  stype = #{stype,jdbcType=VARCHAR}
    </if>
  </select>

  <select id="selectBySndr" resultMap="BaseResultMap" parameterType="java.lang.String" >
    select
    <include refid="Base_Column_List" />
    from message_router
    where sndr = #{id,jdbcType=VARCHAR}
  </select>

  <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
    delete from message_router
    where id = #{id,jdbcType=VARCHAR}
  </delete>
  <insert id="insert" parameterType="com.sunyo.wlpt.message.bus.service.model.MessageRouter" >
    insert into message_router (id, sndr, btype,
      stype, optype, msg_limit,
      `character`, `status`, `usage`, des,
      ver, creat_time, update_time
      )
    values (#{id,jdbcType=VARCHAR}, #{sndr,jdbcType=VARCHAR}, #{btype,jdbcType=VARCHAR},
      #{stype,jdbcType=VARCHAR}, #{optype,jdbcType=VARCHAR}, #{msgLimit,jdbcType=TINYINT},
      #{character,jdbcType=VARCHAR}, #{status,jdbcType=BIT}, #{usage,jdbcType=TINYINT}, #{des,jdbcType=VARCHAR},
      #{ver,jdbcType=VARCHAR}, #{creatTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.sunyo.wlpt.message.bus.service.model.MessageRouter" >
    insert into message_router
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        id,
      </if>
      <if test="sndr != null" >
        sndr,
      </if>
      <if test="btype != null" >
        btype,
      </if>
      <if test="stype != null" >
        stype,
      </if>
      <if test="optype != null" >
        optype,
      </if>
      <if test="msgLimit != null" >
        msg_limit,
      </if>
      <if test="character != null" >
        `character`,
      </if>
      <if test="status != null" >
        `status`,
      </if>
      <if test="usage != null" >
        `usage`,
      </if>
      <if test="des != null" >
        des,
      </if>
      <if test="ver != null" >
        ver,
      </if>
      <if test="creatTime != null" >
        creat_time,
      </if>
      <if test="updateTime != null" >
        update_time,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        #{id,jdbcType=VARCHAR},
      </if>
      <if test="sndr != null" >
        #{sndr,jdbcType=VARCHAR},
      </if>
      <if test="btype != null" >
        #{btype,jdbcType=VARCHAR},
      </if>
      <if test="stype != null" >
        #{stype,jdbcType=VARCHAR},
      </if>
      <if test="optype != null" >
        #{optype,jdbcType=VARCHAR},
      </if>
      <if test="msgLimit != null" >
        #{msgLimit,jdbcType=TINYINT},
      </if>
      <if test="character != null" >
        #{character,jdbcType=VARCHAR},
      </if>
      <if test="status != null" >
        #{status,jdbcType=BIT},
      </if>
      <if test="usage != null" >
        #{usage,jdbcType=TINYINT},
      </if>
      <if test="des != null" >
        #{des,jdbcType=VARCHAR},
      </if>
      <if test="ver != null" >
        #{ver,jdbcType=VARCHAR},
      </if>
      <if test="creatTime != null" >
        #{creatTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null" >
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.sunyo.wlpt.message.bus.service.model.MessageRouter" >
    update message_router
    <set >
      <if test="sndr != null" >
        sndr = #{sndr,jdbcType=VARCHAR},
      </if>
      <if test="btype != null" >
        btype = #{btype,jdbcType=VARCHAR},
      </if>
      <if test="stype != null" >
        stype = #{stype,jdbcType=VARCHAR},
      </if>
      <if test="optype != null" >
        optype = #{optype,jdbcType=VARCHAR},
      </if>
      <if test="msgLimit != null" >
        msg_limit = #{msgLimit,jdbcType=TINYINT},
      </if>
      <if test="character != null" >
        `character` = #{character,jdbcType=VARCHAR},
      </if>
      <if test="status != null" >
        status = #{status,jdbcType=BIT},
      </if>
      <if test="usage != null" >
        `usage` = #{usage,jdbcType=TINYINT},
      </if>
      <if test="des != null" >
        des = #{des,jdbcType=VARCHAR},
      </if>
      <if test="ver != null" >
        ver = #{ver,jdbcType=VARCHAR},
      </if>
      <if test="creatTime != null" >
        creat_time = #{creatTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null" >
        update_time = #{updateTime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.sunyo.wlpt.message.bus.service.model.MessageRouter" >
    update message_router
    set sndr = #{sndr,jdbcType=VARCHAR},
      btype = #{btype,jdbcType=VARCHAR},
      stype = #{stype,jdbcType=VARCHAR},
      optype = #{optype,jdbcType=VARCHAR},
      msg_limit = #{msgLimit,jdbcType=TINYINT},
      `character` = #{character,jdbcType=VARCHAR},
      status = #{status,jdbcType=BIT},
      `usage` = #{usage,jdbcType=TINYINT},
      des = #{des,jdbcType=VARCHAR},
      ver = #{ver,jdbcType=VARCHAR},
      creat_time = #{creatTime,jdbcType=TIMESTAMP},
      update_time = #{updateTime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=VARCHAR}
  </update>
</mapper>