<?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.liquidnet.service.account.wallet.mapper.FinChannelMapper" >
  <resultMap id="BaseResultMap" type="com.liquidnet.service.account.wallet.entity.FinChannel" >
    <id column="FC0" property="channelId" jdbcType="VARCHAR" />
    <result column="FC1" property="channelCode" jdbcType="VARCHAR" />
    <result column="FC2" property="channelName" jdbcType="VARCHAR" />
    <result column="FC3" property="channelStatus" jdbcType="VARCHAR" />
    <result column="FC4" property="channelKey" jdbcType="VARCHAR" />
    <result column="FC5" property="createTime" jdbcType="TIMESTAMP" />
    <result column="FC6" property="updateTime" jdbcType="TIMESTAMP" />
    <result column="FC7" property="operator" jdbcType="VARCHAR" />
  </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" >
    FC0, FC1, FC2, FC3, FC4, FC5, 
    FC6, FC7
  </sql>
  <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.liquidnet.service.account.wallet.entity.FinChannelExample" >
    select
    <if test="distinct" >
      distinct
    </if>
    <include refid="Base_Column_List" />
    from FIN_WL_N01
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null" >
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
    select 
    <include refid="Base_Column_List" />
    from FIN_WL_N01
    where FC0 = #{channelId,jdbcType=VARCHAR}
  </select>
  <insert id="insert" parameterType="com.liquidnet.service.account.wallet.entity.FinChannel" >
    insert into FIN_WL_N01 (FC0, FC1, FC2,
      FC3, FC4, FC5, 
      FC6, FC7)
    values (#{channelId,jdbcType=VARCHAR}, #{channelCode,jdbcType=VARCHAR}, #{channelName,jdbcType=VARCHAR}, 
      #{channelStatus,jdbcType=VARCHAR}, #{channelKey,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, 
      #{updateTime,jdbcType=TIMESTAMP}, #{operator,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.liquidnet.service.account.wallet.entity.FinChannel" >
    insert into FIN_WL_N01
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="channelId != null" >
        FC0,
      </if>
      <if test="channelCode != null" >
        FC1,
      </if>
      <if test="channelName != null" >
        FC2,
      </if>
      <if test="channelStatus != null" >
        FC3,
      </if>
      <if test="channelKey != null" >
        FC4,
      </if>
      <if test="createTime != null" >
        FC5,
      </if>
      <if test="updateTime != null" >
        FC6,
      </if>
      <if test="operator != null" >
        FC7,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="channelId != null" >
        #{channelId,jdbcType=VARCHAR},
      </if>
      <if test="channelCode != null" >
        #{channelCode,jdbcType=VARCHAR},
      </if>
      <if test="channelName != null" >
        #{channelName,jdbcType=VARCHAR},
      </if>
      <if test="channelStatus != null" >
        #{channelStatus,jdbcType=VARCHAR},
      </if>
      <if test="channelKey != null" >
        #{channelKey,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null" >
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null" >
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="operator != null" >
        #{operator,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.liquidnet.service.account.wallet.entity.FinChannelExample" resultType="java.lang.Integer" >
    select count(*) from FIN_WL_N01
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map" >
    update FIN_WL_N01
    <set >
      <if test="record.channelId != null" >
        FC0 = #{record.channelId,jdbcType=VARCHAR},
      </if>
      <if test="record.channelCode != null" >
        FC1 = #{record.channelCode,jdbcType=VARCHAR},
      </if>
      <if test="record.channelName != null" >
        FC2 = #{record.channelName,jdbcType=VARCHAR},
      </if>
      <if test="record.channelStatus != null" >
        FC3 = #{record.channelStatus,jdbcType=VARCHAR},
      </if>
      <if test="record.channelKey != null" >
        FC4 = #{record.channelKey,jdbcType=VARCHAR},
      </if>
      <if test="record.createTime != null" >
        FC5 = #{record.createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.updateTime != null" >
        FC6 = #{record.updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.operator != null" >
        FC7 = #{record.operator,jdbcType=VARCHAR},
      </if>
    </set>
    <if test="_parameter != null" >
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map" >
    update FIN_WL_N01
    set FC0 = #{record.channelId,jdbcType=VARCHAR},
      FC1 = #{record.channelCode,jdbcType=VARCHAR},
      FC2 = #{record.channelName,jdbcType=VARCHAR},
      FC3 = #{record.channelStatus,jdbcType=VARCHAR},
      FC4 = #{record.channelKey,jdbcType=VARCHAR},
      FC5 = #{record.createTime,jdbcType=TIMESTAMP},
      FC6 = #{record.updateTime,jdbcType=TIMESTAMP},
      FC7 = #{record.operator,jdbcType=VARCHAR}
    <if test="_parameter != null" >
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.liquidnet.service.account.wallet.entity.FinChannel" >
    update FIN_WL_N01
    <set >
      <if test="channelCode != null" >
        FC1 = #{channelCode,jdbcType=VARCHAR},
      </if>
      <if test="channelName != null" >
        FC2 = #{channelName,jdbcType=VARCHAR},
      </if>
      <if test="channelStatus != null" >
        FC3 = #{channelStatus,jdbcType=VARCHAR},
      </if>
      <if test="channelKey != null" >
        FC4 = #{channelKey,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null" >
        FC5 = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null" >
        FC6 = #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="operator != null" >
        FC7 = #{operator,jdbcType=VARCHAR},
      </if>
    </set>
    where FC0 = #{channelId,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.liquidnet.service.account.wallet.entity.FinChannel" >
    update FIN_WL_N01
    set FC1 = #{channelCode,jdbcType=VARCHAR},
      FC2 = #{channelName,jdbcType=VARCHAR},
      FC3 = #{channelStatus,jdbcType=VARCHAR},
      FC4 = #{channelKey,jdbcType=VARCHAR},
      FC5 = #{createTime,jdbcType=TIMESTAMP},
      FC6 = #{updateTime,jdbcType=TIMESTAMP},
      FC7 = #{operator,jdbcType=VARCHAR}
    where FC0 = #{channelId,jdbcType=VARCHAR}
  </update>

  <select id="selectForClickList" resultMap="BaseResultMap">
    SELECT FC0, FC2 FROM FIN_WL_N01
  </select>
</mapper>