<?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="org.xxpay.dal.dao.mapper.PayChannelMapper" >
  <resultMap id="BaseResultMap" type="org.xxpay.dal.dao.model.PayChannel" >
    <id column="id" property="id" jdbcType="INTEGER" />
    <result column="ChannelId" property="channelId" jdbcType="VARCHAR" />
    <result column="ChannelName" property="channelName" jdbcType="VARCHAR" />
    <result column="ChannelMchId" property="channelMchId" jdbcType="VARCHAR" />
    <result column="MchId" property="mchId" jdbcType="VARCHAR" />
    <result column="State" property="state" jdbcType="TINYINT" />
    <result column="Param" property="param" jdbcType="VARCHAR" />
    <result column="Remark" property="remark" jdbcType="VARCHAR" />
    <result column="CreateTime" property="createTime" jdbcType="TIMESTAMP" />
    <result column="UpdateTime" property="updateTime" jdbcType="TIMESTAMP" />
  </resultMap>
  <sql id="Example_Where_Clause" >
    <where >
      <foreach collection="oredCriteria" item="criteria" separator="or" >
        <if test="criteria.valid" >
          <trim prefix="(" suffix=")" prefixOverrides="and" >
            <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 collection="criterion.value" item="listItem" open="(" close=")" 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="(" suffix=")" prefixOverrides="and" >
            <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 collection="criterion.value" item="listItem" open="(" close=")" separator="," >
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Base_Column_List" >
    id, ChannelId, ChannelName, ChannelMchId, MchId, State, Param, Remark, CreateTime, 
    UpdateTime
  </sql>
  <select id="selectByExample" resultMap="BaseResultMap" parameterType="org.xxpay.dal.dao.model.PayChannelExample" >
    select
    <if test="distinct" >
      distinct
    </if>
    <include refid="Base_Column_List" />
    from t_pay_channel
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null" >
      order by ${orderByClause}
    </if>
    <if test="limit != null" >
      <if test="offset != null" >
        limit ${offset}, ${limit}
      </if>
      <if test="offset == null" >
        limit ${limit}
      </if>
    </if>
  </select>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
    select 
    <include refid="Base_Column_List" />
    from t_pay_channel
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
    delete from t_pay_channel
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <delete id="deleteByExample" parameterType="org.xxpay.dal.dao.model.PayChannelExample" >
    delete from t_pay_channel
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="org.xxpay.dal.dao.model.PayChannel" >
    insert into t_pay_channel (id, ChannelId, ChannelName, 
      ChannelMchId, MchId, State, 
      Param, Remark, CreateTime, 
      UpdateTime)
    values (#{id,jdbcType=INTEGER}, #{channelId,jdbcType=VARCHAR}, #{channelName,jdbcType=VARCHAR}, 
      #{channelMchId,jdbcType=VARCHAR}, #{mchId,jdbcType=VARCHAR}, #{state,jdbcType=TINYINT}, 
      #{param,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, 
      #{updateTime,jdbcType=TIMESTAMP})
  </insert>
  <insert id="insertSelective" parameterType="org.xxpay.dal.dao.model.PayChannel" >
    insert into t_pay_channel
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        id,
      </if>
      <if test="channelId != null" >
        ChannelId,
      </if>
      <if test="channelName != null" >
        ChannelName,
      </if>
      <if test="channelMchId != null" >
        ChannelMchId,
      </if>
      <if test="mchId != null" >
        MchId,
      </if>
      <if test="state != null" >
        State,
      </if>
      <if test="param != null" >
        Param,
      </if>
      <if test="remark != null" >
        Remark,
      </if>
      <if test="createTime != null" >
        CreateTime,
      </if>
      <if test="updateTime != null" >
        UpdateTime,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        #{id,jdbcType=INTEGER},
      </if>
      <if test="channelId != null" >
        #{channelId,jdbcType=VARCHAR},
      </if>
      <if test="channelName != null" >
        #{channelName,jdbcType=VARCHAR},
      </if>
      <if test="channelMchId != null" >
        #{channelMchId,jdbcType=VARCHAR},
      </if>
      <if test="mchId != null" >
        #{mchId,jdbcType=VARCHAR},
      </if>
      <if test="state != null" >
        #{state,jdbcType=TINYINT},
      </if>
      <if test="param != null" >
        #{param,jdbcType=VARCHAR},
      </if>
      <if test="remark != null" >
        #{remark,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null" >
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null" >
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="org.xxpay.dal.dao.model.PayChannelExample" resultType="java.lang.Integer" >
    select count(*) from t_pay_channel
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map" >
    update t_pay_channel
    <set >
      <if test="record.id != null" >
        id = #{record.id,jdbcType=INTEGER},
      </if>
      <if test="record.channelId != null" >
        ChannelId = #{record.channelId,jdbcType=VARCHAR},
      </if>
      <if test="record.channelName != null" >
        ChannelName = #{record.channelName,jdbcType=VARCHAR},
      </if>
      <if test="record.channelMchId != null" >
        ChannelMchId = #{record.channelMchId,jdbcType=VARCHAR},
      </if>
      <if test="record.mchId != null" >
        MchId = #{record.mchId,jdbcType=VARCHAR},
      </if>
      <if test="record.state != null" >
        State = #{record.state,jdbcType=TINYINT},
      </if>
      <if test="record.param != null" >
        Param = #{record.param,jdbcType=VARCHAR},
      </if>
      <if test="record.remark != null" >
        Remark = #{record.remark,jdbcType=VARCHAR},
      </if>
      <if test="record.createTime != null" >
        CreateTime = #{record.createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.updateTime != null" >
        UpdateTime = #{record.updateTime,jdbcType=TIMESTAMP},
      </if>
    </set>
    <if test="_parameter != null" >
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map" >
    update t_pay_channel
    set id = #{record.id,jdbcType=INTEGER},
      ChannelId = #{record.channelId,jdbcType=VARCHAR},
      ChannelName = #{record.channelName,jdbcType=VARCHAR},
      ChannelMchId = #{record.channelMchId,jdbcType=VARCHAR},
      MchId = #{record.mchId,jdbcType=VARCHAR},
      State = #{record.state,jdbcType=TINYINT},
      Param = #{record.param,jdbcType=VARCHAR},
      Remark = #{record.remark,jdbcType=VARCHAR},
      CreateTime = #{record.createTime,jdbcType=TIMESTAMP},
      UpdateTime = #{record.updateTime,jdbcType=TIMESTAMP}
    <if test="_parameter != null" >
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="org.xxpay.dal.dao.model.PayChannel" >
    update t_pay_channel
    <set >
      <if test="channelId != null" >
        ChannelId = #{channelId,jdbcType=VARCHAR},
      </if>
      <if test="channelName != null" >
        ChannelName = #{channelName,jdbcType=VARCHAR},
      </if>
      <if test="channelMchId != null" >
        ChannelMchId = #{channelMchId,jdbcType=VARCHAR},
      </if>
      <if test="mchId != null" >
        MchId = #{mchId,jdbcType=VARCHAR},
      </if>
      <if test="state != null" >
        State = #{state,jdbcType=TINYINT},
      </if>
      <if test="param != null" >
        Param = #{param,jdbcType=VARCHAR},
      </if>
      <if test="remark != null" >
        Remark = #{remark,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null" >
        CreateTime = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null" >
        UpdateTime = #{updateTime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="org.xxpay.dal.dao.model.PayChannel" >
    update t_pay_channel
    set ChannelId = #{channelId,jdbcType=VARCHAR},
      ChannelName = #{channelName,jdbcType=VARCHAR},
      ChannelMchId = #{channelMchId,jdbcType=VARCHAR},
      MchId = #{mchId,jdbcType=VARCHAR},
      State = #{state,jdbcType=TINYINT},
      Param = #{param,jdbcType=VARCHAR},
      Remark = #{remark,jdbcType=VARCHAR},
      CreateTime = #{createTime,jdbcType=TIMESTAMP},
      UpdateTime = #{updateTime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>