ConsumerGroupMapper.xml 3.6 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.ConsumerGroupMapper" >
  <resultMap id="BaseResultMap" type="com.sunyo.wlpt.message.bus.service.model.ConsumerGroup" >
    <id column="id" property="id" jdbcType="VARCHAR" />
    <result column="name" property="name" jdbcType="VARCHAR" />
    <result column="des" property="des" jdbcType="VARCHAR" />
    <result column="user_id" property="userId" jdbcType="VARCHAR" />
    <result column="username" property="username" jdbcType="VARCHAR" />
  </resultMap>
  <sql id="Base_Column_List" >
    id, name, des, user_id, username
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
    select
    <include refid="Base_Column_List" />
    from consumer_group
    where id = #{id,jdbcType=VARCHAR}
  </select>
  <select id="selectByusername" resultMap="BaseResultMap" parameterType="java.lang.String">
    select
    <include refid="Base_Column_List" />
 from consumer_group
    where username = #{username,jdbcType=VARCHAR}
  </select>
  <select id="groups" resultType="java.lang.String" parameterType="java.lang.String" >
   select
    name
  from consumer_group
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
    delete from consumer_group
    where id = #{id,jdbcType=VARCHAR}
  </delete>
  <insert id="insert" parameterType="com.sunyo.wlpt.message.bus.service.model.ConsumerGroup" >
    insert into consumer_group (id, name, des,
      user_id, username)
    values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{des,jdbcType=VARCHAR},
      #{userId,jdbcType=VARCHAR}, #{username,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.sunyo.wlpt.message.bus.service.model.ConsumerGroup" >
    insert into consumer_group
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        id,
      </if>
      <if test="name != null" >
        name,
      </if>
      <if test="des != null" >
        des,
      </if>
      <if test="userId != null" >
        user_id,
      </if>
      <if test="username != null" >
        username,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        #{id,jdbcType=VARCHAR},
      </if>
      <if test="name != null" >
        #{name,jdbcType=VARCHAR},
      </if>
      <if test="des != null" >
        #{des,jdbcType=VARCHAR},
      </if>
      <if test="userId != null" >
        #{userId,jdbcType=VARCHAR},
      </if>
      <if test="username != null" >
        #{username,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.sunyo.wlpt.message.bus.service.model.ConsumerGroup" >
    update consumer_group
    <set >
      <if test="name != null" >
        name = #{name,jdbcType=VARCHAR},
      </if>
      <if test="des != null" >
        des = #{des,jdbcType=VARCHAR},
      </if>
      <if test="userId != null" >
        user_id = #{userId,jdbcType=VARCHAR},
      </if>
      <if test="username != null" >
        username = #{username,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.sunyo.wlpt.message.bus.service.model.ConsumerGroup" >
    update consumer_group
    set name = #{name,jdbcType=VARCHAR},
      des = #{des,jdbcType=VARCHAR},
      user_id = #{userId,jdbcType=VARCHAR},
      username = #{username,jdbcType=VARCHAR}
    where id = #{id,jdbcType=VARCHAR}
  </update>
</mapper>