<?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.MchInfoMapper" >
  <resultMap id="BaseResultMap" type="org.xxpay.dal.dao.model.MchInfo" >
    <id column="MchId" property="mchId" jdbcType="VARCHAR" />
    <result column="Name" property="name" jdbcType="VARCHAR" />
    <result column="Type" property="type" jdbcType="VARCHAR" />
    <result column="ReqKey" property="reqKey" jdbcType="VARCHAR" />
    <result column="ResKey" property="resKey" jdbcType="VARCHAR" />
    <result column="State" property="state" jdbcType="TINYINT" />
    <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" >
    MchId, Name, Type, ReqKey, ResKey, State, CreateTime, UpdateTime
  </sql>
  <select id="selectByExample" resultMap="BaseResultMap" parameterType="org.xxpay.dal.dao.model.MchInfoExample" >
    select
    <if test="distinct" >
      distinct
    </if>
    <include refid="Base_Column_List" />
    from t_mch_info
    <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.String" >
    select 
    <include refid="Base_Column_List" />
    from t_mch_info
    where MchId = #{mchId,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
    delete from t_mch_info
    where MchId = #{mchId,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteByExample" parameterType="org.xxpay.dal.dao.model.MchInfoExample" >
    delete from t_mch_info
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="org.xxpay.dal.dao.model.MchInfo" >
    insert into t_mch_info (MchId, Name, Type, 
      ReqKey, ResKey, State, 
      CreateTime, UpdateTime)
    values (#{mchId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, 
      #{reqKey,jdbcType=VARCHAR}, #{resKey,jdbcType=VARCHAR}, #{state,jdbcType=TINYINT}, 
      #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
  </insert>
  <insert id="insertSelective" parameterType="org.xxpay.dal.dao.model.MchInfo" >
    insert into t_mch_info
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="mchId != null" >
        MchId,
      </if>
      <if test="name != null" >
        Name,
      </if>
      <if test="type != null" >
        Type,
      </if>
      <if test="reqKey != null" >
        ReqKey,
      </if>
      <if test="resKey != null" >
        ResKey,
      </if>
      <if test="state != null" >
        State,
      </if>
      <if test="createTime != null" >
        CreateTime,
      </if>
      <if test="updateTime != null" >
        UpdateTime,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="mchId != null" >
        #{mchId,jdbcType=VARCHAR},
      </if>
      <if test="name != null" >
        #{name,jdbcType=VARCHAR},
      </if>
      <if test="type != null" >
        #{type,jdbcType=VARCHAR},
      </if>
      <if test="reqKey != null" >
        #{reqKey,jdbcType=VARCHAR},
      </if>
      <if test="resKey != null" >
        #{resKey,jdbcType=VARCHAR},
      </if>
      <if test="state != null" >
        #{state,jdbcType=TINYINT},
      </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.MchInfoExample" resultType="java.lang.Integer" >
    select count(*) from t_mch_info
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map" >
    update t_mch_info
    <set >
      <if test="record.mchId != null" >
        MchId = #{record.mchId,jdbcType=VARCHAR},
      </if>
      <if test="record.name != null" >
        Name = #{record.name,jdbcType=VARCHAR},
      </if>
      <if test="record.type != null" >
        Type = #{record.type,jdbcType=VARCHAR},
      </if>
      <if test="record.reqKey != null" >
        ReqKey = #{record.reqKey,jdbcType=VARCHAR},
      </if>
      <if test="record.resKey != null" >
        ResKey = #{record.resKey,jdbcType=VARCHAR},
      </if>
      <if test="record.state != null" >
        State = #{record.state,jdbcType=TINYINT},
      </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_mch_info
    set MchId = #{record.mchId,jdbcType=VARCHAR},
      Name = #{record.name,jdbcType=VARCHAR},
      Type = #{record.type,jdbcType=VARCHAR},
      ReqKey = #{record.reqKey,jdbcType=VARCHAR},
      ResKey = #{record.resKey,jdbcType=VARCHAR},
      State = #{record.state,jdbcType=TINYINT},
      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.MchInfo" >
    update t_mch_info
    <set >
      <if test="name != null" >
        Name = #{name,jdbcType=VARCHAR},
      </if>
      <if test="type != null" >
        Type = #{type,jdbcType=VARCHAR},
      </if>
      <if test="reqKey != null" >
        ReqKey = #{reqKey,jdbcType=VARCHAR},
      </if>
      <if test="resKey != null" >
        ResKey = #{resKey,jdbcType=VARCHAR},
      </if>
      <if test="state != null" >
        State = #{state,jdbcType=TINYINT},
      </if>
      <if test="createTime != null" >
        CreateTime = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null" >
        UpdateTime = #{updateTime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where MchId = #{mchId,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="org.xxpay.dal.dao.model.MchInfo" >
    update t_mch_info
    set Name = #{name,jdbcType=VARCHAR},
      Type = #{type,jdbcType=VARCHAR},
      ReqKey = #{reqKey,jdbcType=VARCHAR},
      ResKey = #{resKey,jdbcType=VARCHAR},
      State = #{state,jdbcType=TINYINT},
      CreateTime = #{createTime,jdbcType=TIMESTAMP},
      UpdateTime = #{updateTime,jdbcType=TIMESTAMP}
    where MchId = #{mchId,jdbcType=VARCHAR}
  </update>
</mapper>