<?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.FinBizTransExtraMapper" >
  <resultMap id="BaseResultMap" type="com.liquidnet.service.account.wallet.entity.FinBizTransExtra" >
    <id column="FBTE0" property="transNo" jdbcType="VARCHAR" />
    <result column="FBTE1" property="walletNo" jdbcType="VARCHAR" />
    <result column="FBTE2" property="balanceAvailable" jdbcType="DECIMAL" />
    <result column="FBTE3" property="balancePending" jdbcType="DECIMAL" />
    <result column="FBTE4" property="balanceFrozen" jdbcType="DECIMAL" />
    <result column="FBTE5" property="received" jdbcType="INTEGER" />
    <result column="FBTE6" property="calTime" jdbcType="TIMESTAMP" />
    <result column="FBTE7" property="receivedTime" 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" >
    FBTE0, FBTE1, FBTE2, FBTE3, FBTE4, FBTE5, FBTE6,
    FBTE7
  </sql>
  <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.liquidnet.service.account.wallet.entity.FinBizTransExtraExample" >
    select
    <if test="distinct" >
      distinct
    </if>
    <include refid="Base_Column_List" />
    from FIN_WL_N08
    <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_N08
    where FBTE0 = #{transNo,jdbcType=VARCHAR}
  </select>
  <insert id="insert" parameterType="com.liquidnet.service.account.wallet.entity.FinBizTransExtra" >
    insert into FIN_WL_N08 (FBTE0, FBTE1, FBTE2, FBTE3,
      FBTE4, FBTE5, FBTE6,
      FBTE7)
    values (#{transNo,jdbcType=VARCHAR}, #{walletNo,jdbcType=VARCHAR}, #{balanceAvailable,jdbcType=DECIMAL},
      #{balancePending,jdbcType=DECIMAL}, #{balanceFrozen,jdbcType=DECIMAL}, #{received,jdbcType=INTEGER},
      #{calTime,jdbcType=TIMESTAMP}, #{receivedTime,jdbcType=TIMESTAMP})
  </insert>
  <insert id="insertSelective" parameterType="com.liquidnet.service.account.wallet.entity.FinBizTransExtra" >
    insert into FIN_WL_N08
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="transNo != null" >
        FBTE0,
      </if>
      <if test="walletNo != null" >
        FBTE1,
      </if>
      <if test="balanceAvailable != null" >
        FBTE2,
      </if>
      <if test="balancePending != null" >
        FBTE3,
      </if>
      <if test="balanceFrozen != null" >
        FBTE4,
      </if>
      <if test="received != null" >
        FBTE5,
      </if>
      <if test="calTime != null" >
        FBTE6,
      </if>
      <if test="receivedTime != null" >
        FBTE7,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="transNo != null" >
        #{transNo,jdbcType=VARCHAR},
      </if>
      <if test="walletNo != null" >
        #{walletNo,jdbcType=VARCHAR},
      </if>
      <if test="balanceAvailable != null" >
        #{balanceAvailable,jdbcType=DECIMAL},
      </if>
      <if test="balancePending != null" >
        #{balancePending,jdbcType=DECIMAL},
      </if>
      <if test="balanceFrozen != null" >
        #{balanceFrozen,jdbcType=DECIMAL},
      </if>
      <if test="received != null" >
        #{received,jdbcType=INTEGER},
      </if>
      <if test="calTime != null" >
        #{calTime,jdbcType=TIMESTAMP},
      </if>
      <if test="receivedTime != null" >
        #{receivedTime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.liquidnet.service.account.wallet.entity.FinBizTransExtraExample" resultType="java.lang.Integer" >
    select count(*) from FIN_WL_N08
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map" >
    update FIN_WL_N08
    <set >
      <if test="record.transNo != null" >
        FBTE0 = #{record.transNo,jdbcType=VARCHAR},
      </if>
      <if test="record.walletNo != null" >
        FBTE1 = #{record.walletNo,jdbcType=VARCHAR},
      </if>
      <if test="record.balanceAvailable != null" >
        FBTE2 = #{record.balanceAvailable,jdbcType=DECIMAL},
      </if>
      <if test="record.balancePending != null" >
        FBTE3 = #{record.balancePending,jdbcType=DECIMAL},
      </if>
      <if test="record.balanceFrozen != null" >
        FBTE4 = #{record.balanceFrozen,jdbcType=DECIMAL},
      </if>
      <if test="record.received != null" >
        FBTE5 = #{record.received,jdbcType=INTEGER},
      </if>
      <if test="record.calTime != null" >
        FBTE6 = #{record.calTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.receivedTime != null" >
        FBTE7 = #{record.receivedTime,jdbcType=TIMESTAMP},
      </if>
    </set>
    <if test="_parameter != null" >
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map" >
    update FIN_WL_N08
    set FBTE0 = #{record.transNo,jdbcType=VARCHAR},
      FBTE1 = #{record.walletNo,jdbcType=VARCHAR},
      FBTE2 = #{record.balanceAvailable,jdbcType=DECIMAL},
      FBTE3 = #{record.balancePending,jdbcType=DECIMAL},
      FBTE4 = #{record.balanceFrozen,jdbcType=DECIMAL},
      FBTE5 = #{record.received,jdbcType=INTEGER},
      FBTE6 = #{record.calTime,jdbcType=TIMESTAMP},
      FBTE7 = #{record.receivedTime,jdbcType=TIMESTAMP}
    <if test="_parameter != null" >
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.liquidnet.service.account.wallet.entity.FinBizTransExtra" >
    update FIN_WL_N08
    <set >
      <if test="walletNo != null" >
        FBTE1 = #{walletNo,jdbcType=VARCHAR},
      </if>
      <if test="balanceAvailable != null" >
        FBTE2 = #{balanceAvailable,jdbcType=DECIMAL},
      </if>
      <if test="balancePending != null" >
        FBTE3 = #{balancePending,jdbcType=DECIMAL},
      </if>
      <if test="balanceFrozen != null" >
        FBTE4 = #{balanceFrozen,jdbcType=DECIMAL},
      </if>
      <if test="received != null" >
        FBTE5 = #{received,jdbcType=INTEGER},
      </if>
      <if test="calTime != null" >
        FBTE6 = #{calTime,jdbcType=TIMESTAMP},
      </if>
      <if test="receivedTime != null" >
        FBTE7 = #{receivedTime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where FBTE0 = #{transNo,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.liquidnet.service.account.wallet.entity.FinBizTransExtra" >
    update FIN_WL_N08
    set FBTE1 = #{walletNo,jdbcType=VARCHAR},
      FBTE2 = #{balanceAvailable,jdbcType=DECIMAL},
      FBTE3 = #{balancePending,jdbcType=DECIMAL},
      FBTE4 = #{balanceFrozen,jdbcType=DECIMAL},
      FBTE5 = #{received,jdbcType=INTEGER},
      FBTE6 = #{calTime,jdbcType=TIMESTAMP},
      FBTE7 = #{receivedTime,jdbcType=TIMESTAMP}
    where FBTE0 = #{transNo,jdbcType=VARCHAR}
  </update>


    <insert id="insertByBatch" parameterType="java.util.List">
        insert into FIN_WL_N08 (FBTE0, FBTE1, FBTE2, FBTE3,
                                FBTE4, FBTE5, FBTE6, FBTE7)
                values
        <foreach collection="list" item="obj" index="idx" separator=",">
            (#{obj.transNo,jdbcType=VARCHAR}, #{obj.walletNo,jdbcType=VARCHAR},
             #{obj.balanceAvailable,jdbcType=DECIMAL},
             #{obj.balancePending,jdbcType=DECIMAL}, #{obj.balanceFrozen,jdbcType=DECIMAL},
             #{obj.received,jdbcType=INTEGER},
             #{obj.calTime,jdbcType=TIMESTAMP}, #{obj.receivedTime,jdbcType=TIMESTAMP})
        </foreach>
    </insert>
</mapper>
