<?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.yd.dal.mapper.customer.AclCustomerFortunePayMapper">
  <resultMap id="BaseResultMap" type="com.yd.dal.entity.customer.AclCustomerFortunePay">
    <!--@mbg.generated-->
    <!--@Table ag_acl_customer_fortune_pay-->
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="withdraw_id" jdbcType="BIGINT" property="withdrawId" />
    <result column="withdraw_amount" jdbcType="DECIMAL" property="withdrawAmount" />
    <result column="customer_id" jdbcType="BIGINT" property="customerId" />
    <result column="customer_name" jdbcType="VARCHAR" property="customerName" />
    <result column="campaign_id" jdbcType="BIGINT" property="campaignId" />
    <result column="campaign_name" jdbcType="VARCHAR" property="campaignName" />
    <result column="campaing_reward" jdbcType="DECIMAL" property="campaingReward" />
    <result column="pay_to" jdbcType="VARCHAR" property="payTo" />
    <result column="pay_to_mobile" jdbcType="VARCHAR" property="payToMobile" typeHandler="com.yd.util.deshandler.DESTypeHandler"/>
    <result column="pay_to_wechat" jdbcType="VARCHAR" property="payToWechat" />
    <result column="pay_to_id_type_id" jdbcType="BIGINT" property="payToIdTypeId" />
    <result column="pay_to_id_no" jdbcType="VARCHAR" property="payToIdNo" typeHandler="com.yd.util.deshandler.DESTypeHandler"/>
    <result column="pay_to_birthday" jdbcType="DATE" property="payToBirthday" />
    <result column="pay_to_gender" jdbcType="INTEGER" property="payToGender" />
    <result column="pay_date" jdbcType="TIMESTAMP" property="payDate" />
    <result column="pay_amount" jdbcType="DECIMAL" property="payAmount" />
    <result column="tax_amount" jdbcType="DECIMAL" property="taxAmount" />
    <result column="paid_by" jdbcType="VARCHAR" property="paidBy" />
    <result column="paid_method" jdbcType="INTEGER" property="paidMethod" />
    <result column="pay_status" jdbcType="INTEGER" property="payStatus" />
    <result column="remark" jdbcType="LONGVARCHAR" property="remark" />
    <result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
    <result column="created_by" jdbcType="BIGINT" property="createdBy" />
    <result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
    <result column="updated_by" jdbcType="BIGINT" property="updatedBy" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--@mbg.generated-->
    id, withdraw_id, withdraw_amount, customer_id, customer_name, campaign_id, campaign_name, 
    campaing_reward, pay_to, pay_to_mobile, pay_to_wechat, pay_to_id_type_id, pay_to_id_no, 
    pay_to_birthday, pay_to_gender, pay_date, pay_amount, tax_amount, paid_by, paid_method, 
    pay_status, remark, created_at, created_by, updated_at, updated_by
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    <!--@mbg.generated-->
    select 
    <include refid="Base_Column_List" />
    from ag_acl_customer_fortune_pay
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    <!--@mbg.generated-->
    delete from ag_acl_customer_fortune_pay
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.customer.AclCustomerFortunePay" useGeneratedKeys="true">
    <!--@mbg.generated-->
    insert into ag_acl_customer_fortune_pay (withdraw_id, withdraw_amount, customer_id, 
      customer_name, campaign_id, campaign_name, 
      campaing_reward, pay_to, pay_to_mobile, 
      pay_to_wechat, pay_to_id_type_id, pay_to_id_no, 
      pay_to_birthday, pay_to_gender, pay_date, 
      pay_amount, tax_amount, paid_by, 
      paid_method, pay_status, remark, 
      created_at, created_by, updated_at, 
      updated_by)
    values (#{withdrawId,jdbcType=BIGINT}, #{withdrawAmount,jdbcType=DECIMAL}, #{customerId,jdbcType=BIGINT}, 
      #{customerName,jdbcType=VARCHAR}, #{campaignId,jdbcType=BIGINT}, #{campaignName,jdbcType=VARCHAR}, 
      #{campaingReward,jdbcType=DECIMAL}, #{payTo,jdbcType=VARCHAR}, #{payToMobile,jdbcType=VARCHAR,typeHandler=com.yd.util.deshandler.DESTypeHandler},
      #{payToWechat,jdbcType=VARCHAR}, #{payToIdTypeId,jdbcType=BIGINT}, #{payToIdNo,jdbcType=VARCHAR,typeHandler=com.yd.util.deshandler.DESTypeHandler},
      #{payToBirthday,jdbcType=DATE}, #{payToGender,jdbcType=INTEGER}, #{payDate,jdbcType=TIMESTAMP}, 
      #{payAmount,jdbcType=DECIMAL}, #{taxAmount,jdbcType=DECIMAL}, #{paidBy,jdbcType=VARCHAR}, 
      #{paidMethod,jdbcType=INTEGER}, #{payStatus,jdbcType=INTEGER}, #{remark,jdbcType=LONGVARCHAR}, 
      #{createdAt,jdbcType=TIMESTAMP}, #{createdBy,jdbcType=BIGINT}, #{updatedAt,jdbcType=TIMESTAMP}, 
      #{updatedBy,jdbcType=BIGINT})
  </insert>
  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yd.dal.entity.customer.AclCustomerFortunePay" useGeneratedKeys="true">
    <!--@mbg.generated-->
    insert into ag_acl_customer_fortune_pay
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="withdrawId != null">
        withdraw_id,
      </if>
      <if test="withdrawAmount != null">
        withdraw_amount,
      </if>
      <if test="customerId != null">
        customer_id,
      </if>
      <if test="customerName != null">
        customer_name,
      </if>
      <if test="campaignId != null">
        campaign_id,
      </if>
      <if test="campaignName != null">
        campaign_name,
      </if>
      <if test="campaingReward != null">
        campaing_reward,
      </if>
      <if test="payTo != null">
        pay_to,
      </if>
      <if test="payToMobile != null">
        pay_to_mobile,
      </if>
      <if test="payToWechat != null">
        pay_to_wechat,
      </if>
      <if test="payToIdTypeId != null">
        pay_to_id_type_id,
      </if>
      <if test="payToIdNo != null">
        pay_to_id_no,
      </if>
      <if test="payToBirthday != null">
        pay_to_birthday,
      </if>
      <if test="payToGender != null">
        pay_to_gender,
      </if>
      <if test="payDate != null">
        pay_date,
      </if>
      <if test="payAmount != null">
        pay_amount,
      </if>
      <if test="taxAmount != null">
        tax_amount,
      </if>
      <if test="paidBy != null">
        paid_by,
      </if>
      <if test="paidMethod != null">
        paid_method,
      </if>
      <if test="payStatus != null">
        pay_status,
      </if>
      <if test="remark != null">
        remark,
      </if>
      <if test="createdAt != null">
        created_at,
      </if>
      <if test="createdBy != null">
        created_by,
      </if>
      <if test="updatedAt != null">
        updated_at,
      </if>
      <if test="updatedBy != null">
        updated_by,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="withdrawId != null">
        #{withdrawId,jdbcType=BIGINT},
      </if>
      <if test="withdrawAmount != null">
        #{withdrawAmount,jdbcType=DECIMAL},
      </if>
      <if test="customerId != null">
        #{customerId,jdbcType=BIGINT},
      </if>
      <if test="customerName != null">
        #{customerName,jdbcType=VARCHAR},
      </if>
      <if test="campaignId != null">
        #{campaignId,jdbcType=BIGINT},
      </if>
      <if test="campaignName != null">
        #{campaignName,jdbcType=VARCHAR},
      </if>
      <if test="campaingReward != null">
        #{campaingReward,jdbcType=DECIMAL},
      </if>
      <if test="payTo != null">
        #{payTo,jdbcType=VARCHAR},
      </if>
      <if test="payToMobile != null">
        #{payToMobile,jdbcType=VARCHAR,typeHandler=com.yd.util.deshandler.DESTypeHandler},
      </if>
      <if test="payToWechat != null">
        #{payToWechat,jdbcType=VARCHAR},
      </if>
      <if test="payToIdTypeId != null">
        #{payToIdTypeId,jdbcType=BIGINT},
      </if>
      <if test="payToIdNo != null">
        #{payToIdNo,jdbcType=VARCHAR,typeHandler=com.yd.util.deshandler.DESTypeHandler},
      </if>
      <if test="payToBirthday != null">
        #{payToBirthday,jdbcType=DATE},
      </if>
      <if test="payToGender != null">
        #{payToGender,jdbcType=INTEGER},
      </if>
      <if test="payDate != null">
        #{payDate,jdbcType=TIMESTAMP},
      </if>
      <if test="payAmount != null">
        #{payAmount,jdbcType=DECIMAL},
      </if>
      <if test="taxAmount != null">
        #{taxAmount,jdbcType=DECIMAL},
      </if>
      <if test="paidBy != null">
        #{paidBy,jdbcType=VARCHAR},
      </if>
      <if test="paidMethod != null">
        #{paidMethod,jdbcType=INTEGER},
      </if>
      <if test="payStatus != null">
        #{payStatus,jdbcType=INTEGER},
      </if>
      <if test="remark != null">
        #{remark,jdbcType=LONGVARCHAR},
      </if>
      <if test="createdAt != null">
        #{createdAt,jdbcType=TIMESTAMP},
      </if>
      <if test="createdBy != null">
        #{createdBy,jdbcType=BIGINT},
      </if>
      <if test="updatedAt != null">
        #{updatedAt,jdbcType=TIMESTAMP},
      </if>
      <if test="updatedBy != null">
        #{updatedBy,jdbcType=BIGINT},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.yd.dal.entity.customer.AclCustomerFortunePay">
    <!--@mbg.generated-->
    update ag_acl_customer_fortune_pay
    <set>
      <if test="withdrawId != null">
        withdraw_id = #{withdrawId,jdbcType=BIGINT},
      </if>
      <if test="withdrawAmount != null">
        withdraw_amount = #{withdrawAmount,jdbcType=DECIMAL},
      </if>
      <if test="customerId != null">
        customer_id = #{customerId,jdbcType=BIGINT},
      </if>
      <if test="customerName != null">
        customer_name = #{customerName,jdbcType=VARCHAR},
      </if>
      <if test="campaignId != null">
        campaign_id = #{campaignId,jdbcType=BIGINT},
      </if>
      <if test="campaignName != null">
        campaign_name = #{campaignName,jdbcType=VARCHAR},
      </if>
      <if test="campaingReward != null">
        campaing_reward = #{campaingReward,jdbcType=DECIMAL},
      </if>
      <if test="payTo != null">
        pay_to = #{payTo,jdbcType=VARCHAR},
      </if>
      <if test="payToMobile != null">
        pay_to_mobile = #{payToMobile,jdbcType=VARCHAR,typeHandler=com.yd.util.deshandler.DESTypeHandler},
      </if>
      <if test="payToWechat != null">
        pay_to_wechat = #{payToWechat,jdbcType=VARCHAR},
      </if>
      <if test="payToIdTypeId != null">
        pay_to_id_type_id = #{payToIdTypeId,jdbcType=BIGINT},
      </if>
      <if test="payToIdNo != null">
        pay_to_id_no = #{payToIdNo,jdbcType=VARCHAR,typeHandler=com.yd.util.deshandler.DESTypeHandler},
      </if>
      <if test="payToBirthday != null">
        pay_to_birthday = #{payToBirthday,jdbcType=DATE},
      </if>
      <if test="payToGender != null">
        pay_to_gender = #{payToGender,jdbcType=INTEGER},
      </if>
      <if test="payDate != null">
        pay_date = #{payDate,jdbcType=TIMESTAMP},
      </if>
      <if test="payAmount != null">
        pay_amount = #{payAmount,jdbcType=DECIMAL},
      </if>
      <if test="taxAmount != null">
        tax_amount = #{taxAmount,jdbcType=DECIMAL},
      </if>
      <if test="paidBy != null">
        paid_by = #{paidBy,jdbcType=VARCHAR},
      </if>
      <if test="paidMethod != null">
        paid_method = #{paidMethod,jdbcType=INTEGER},
      </if>
      <if test="payStatus != null">
        pay_status = #{payStatus,jdbcType=INTEGER},
      </if>
      <if test="remark != null">
        remark = #{remark,jdbcType=LONGVARCHAR},
      </if>
      <if test="createdAt != null">
        created_at = #{createdAt,jdbcType=TIMESTAMP},
      </if>
      <if test="createdBy != null">
        created_by = #{createdBy,jdbcType=BIGINT},
      </if>
      <if test="updatedAt != null">
        updated_at = #{updatedAt,jdbcType=TIMESTAMP},
      </if>
      <if test="updatedBy != null">
        updated_by = #{updatedBy,jdbcType=BIGINT},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.yd.dal.entity.customer.AclCustomerFortunePay">
    <!--@mbg.generated-->
    update ag_acl_customer_fortune_pay
    set withdraw_id = #{withdrawId,jdbcType=BIGINT},
      withdraw_amount = #{withdrawAmount,jdbcType=DECIMAL},
      customer_id = #{customerId,jdbcType=BIGINT},
      customer_name = #{customerName,jdbcType=VARCHAR},
      campaign_id = #{campaignId,jdbcType=BIGINT},
      campaign_name = #{campaignName,jdbcType=VARCHAR},
      campaing_reward = #{campaingReward,jdbcType=DECIMAL},
      pay_to = #{payTo,jdbcType=VARCHAR},
      pay_to_mobile = #{payToMobile,jdbcType=VARCHAR},
      pay_to_wechat = #{payToWechat,jdbcType=VARCHAR},
      pay_to_id_type_id = #{payToIdTypeId,jdbcType=BIGINT},
      pay_to_id_no = #{payToIdNo,jdbcType=VARCHAR},
      pay_to_birthday = #{payToBirthday,jdbcType=DATE},
      pay_to_gender = #{payToGender,jdbcType=INTEGER},
      pay_date = #{payDate,jdbcType=TIMESTAMP},
      pay_amount = #{payAmount,jdbcType=DECIMAL},
      tax_amount = #{taxAmount,jdbcType=DECIMAL},
      paid_by = #{paidBy,jdbcType=VARCHAR},
      paid_method = #{paidMethod,jdbcType=INTEGER},
      pay_status = #{payStatus,jdbcType=INTEGER},
      remark = #{remark,jdbcType=LONGVARCHAR},
      created_at = #{createdAt,jdbcType=TIMESTAMP},
      created_by = #{createdBy,jdbcType=BIGINT},
      updated_at = #{updatedAt,jdbcType=TIMESTAMP},
      updated_by = #{updatedBy,jdbcType=BIGINT}
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateBatch" parameterType="java.util.List">
    <!--@mbg.generated-->
    update ag_acl_customer_fortune_pay
    <trim prefix="set" suffixOverrides=",">
      <trim prefix="withdraw_id = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.withdrawId,jdbcType=BIGINT}
        </foreach>
      </trim>
      <trim prefix="withdraw_amount = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.withdrawAmount,jdbcType=DECIMAL}
        </foreach>
      </trim>
      <trim prefix="customer_id = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.customerId,jdbcType=BIGINT}
        </foreach>
      </trim>
      <trim prefix="customer_name = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.customerName,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="campaign_id = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.campaignId,jdbcType=BIGINT}
        </foreach>
      </trim>
      <trim prefix="campaign_name = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.campaignName,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="campaing_reward = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.campaingReward,jdbcType=DECIMAL}
        </foreach>
      </trim>
      <trim prefix="pay_to = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.payTo,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="pay_to_mobile = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.payToMobile,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="pay_to_wechat = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.payToWechat,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="pay_to_id_type_id = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.payToIdTypeId,jdbcType=BIGINT}
        </foreach>
      </trim>
      <trim prefix="pay_to_id_no = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.payToIdNo,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="pay_to_birthday = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.payToBirthday,jdbcType=DATE}
        </foreach>
      </trim>
      <trim prefix="pay_to_gender = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.payToGender,jdbcType=INTEGER}
        </foreach>
      </trim>
      <trim prefix="pay_date = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.payDate,jdbcType=TIMESTAMP}
        </foreach>
      </trim>
      <trim prefix="pay_amount = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.payAmount,jdbcType=DECIMAL}
        </foreach>
      </trim>
      <trim prefix="tax_amount = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.taxAmount,jdbcType=DECIMAL}
        </foreach>
      </trim>
      <trim prefix="paid_by = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.paidBy,jdbcType=VARCHAR}
        </foreach>
      </trim>
      <trim prefix="paid_method = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.paidMethod,jdbcType=INTEGER}
        </foreach>
      </trim>
      <trim prefix="pay_status = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.payStatus,jdbcType=INTEGER}
        </foreach>
      </trim>
      <trim prefix="remark = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.remark,jdbcType=LONGVARCHAR}
        </foreach>
      </trim>
      <trim prefix="created_at = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.createdAt,jdbcType=TIMESTAMP}
        </foreach>
      </trim>
      <trim prefix="created_by = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.createdBy,jdbcType=BIGINT}
        </foreach>
      </trim>
      <trim prefix="updated_at = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.updatedAt,jdbcType=TIMESTAMP}
        </foreach>
      </trim>
      <trim prefix="updated_by = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          when id = #{item.id,jdbcType=BIGINT} then #{item.updatedBy,jdbcType=BIGINT}
        </foreach>
      </trim>
    </trim>
    where id in
    <foreach close=")" collection="list" item="item" open="(" separator=", ">
      #{item.id,jdbcType=BIGINT}
    </foreach>
  </update>
  <update id="updateBatchSelective" parameterType="java.util.List">
    <!--@mbg.generated-->
    update ag_acl_customer_fortune_pay
    <trim prefix="set" suffixOverrides=",">
      <trim prefix="withdraw_id = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.withdrawId != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.withdrawId,jdbcType=BIGINT}
          </if>
        </foreach>
      </trim>
      <trim prefix="withdraw_amount = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.withdrawAmount != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.withdrawAmount,jdbcType=DECIMAL}
          </if>
        </foreach>
      </trim>
      <trim prefix="customer_id = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.customerId != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.customerId,jdbcType=BIGINT}
          </if>
        </foreach>
      </trim>
      <trim prefix="customer_name = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.customerName != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.customerName,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="campaign_id = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.campaignId != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.campaignId,jdbcType=BIGINT}
          </if>
        </foreach>
      </trim>
      <trim prefix="campaign_name = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.campaignName != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.campaignName,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="campaing_reward = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.campaingReward != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.campaingReward,jdbcType=DECIMAL}
          </if>
        </foreach>
      </trim>
      <trim prefix="pay_to = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.payTo != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.payTo,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="pay_to_mobile = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.payToMobile != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.payToMobile,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="pay_to_wechat = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.payToWechat != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.payToWechat,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="pay_to_id_type_id = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.payToIdTypeId != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.payToIdTypeId,jdbcType=BIGINT}
          </if>
        </foreach>
      </trim>
      <trim prefix="pay_to_id_no = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.payToIdNo != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.payToIdNo,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="pay_to_birthday = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.payToBirthday != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.payToBirthday,jdbcType=DATE}
          </if>
        </foreach>
      </trim>
      <trim prefix="pay_to_gender = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.payToGender != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.payToGender,jdbcType=INTEGER}
          </if>
        </foreach>
      </trim>
      <trim prefix="pay_date = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.payDate != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.payDate,jdbcType=TIMESTAMP}
          </if>
        </foreach>
      </trim>
      <trim prefix="pay_amount = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.payAmount != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.payAmount,jdbcType=DECIMAL}
          </if>
        </foreach>
      </trim>
      <trim prefix="tax_amount = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.taxAmount != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.taxAmount,jdbcType=DECIMAL}
          </if>
        </foreach>
      </trim>
      <trim prefix="paid_by = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.paidBy != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.paidBy,jdbcType=VARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="paid_method = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.paidMethod != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.paidMethod,jdbcType=INTEGER}
          </if>
        </foreach>
      </trim>
      <trim prefix="pay_status = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.payStatus != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.payStatus,jdbcType=INTEGER}
          </if>
        </foreach>
      </trim>
      <trim prefix="remark = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.remark != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.remark,jdbcType=LONGVARCHAR}
          </if>
        </foreach>
      </trim>
      <trim prefix="created_at = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.createdAt != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.createdAt,jdbcType=TIMESTAMP}
          </if>
        </foreach>
      </trim>
      <trim prefix="created_by = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.createdBy != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.createdBy,jdbcType=BIGINT}
          </if>
        </foreach>
      </trim>
      <trim prefix="updated_at = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.updatedAt != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.updatedAt,jdbcType=TIMESTAMP}
          </if>
        </foreach>
      </trim>
      <trim prefix="updated_by = case" suffix="end,">
        <foreach collection="list" index="index" item="item">
          <if test="item.updatedBy != null">
            when id = #{item.id,jdbcType=BIGINT} then #{item.updatedBy,jdbcType=BIGINT}
          </if>
        </foreach>
      </trim>
    </trim>
    where id in
    <foreach close=")" collection="list" item="item" open="(" separator=", ">
      #{item.id,jdbcType=BIGINT}
    </foreach>
  </update>
  <insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
    <!--@mbg.generated-->
    insert into ag_acl_customer_fortune_pay
    (withdraw_id, withdraw_amount, customer_id, customer_name, campaign_id, campaign_name, 
      campaing_reward, pay_to, pay_to_mobile, pay_to_wechat, pay_to_id_type_id, pay_to_id_no, 
      pay_to_birthday, pay_to_gender, pay_date, pay_amount, tax_amount, paid_by, paid_method, 
      pay_status, remark, created_at, created_by, updated_at, updated_by)
    values
    <foreach collection="list" item="item" separator=",">
      (#{item.withdrawId,jdbcType=BIGINT}, #{item.withdrawAmount,jdbcType=DECIMAL}, #{item.customerId,jdbcType=BIGINT}, 
        #{item.customerName,jdbcType=VARCHAR}, #{item.campaignId,jdbcType=BIGINT}, #{item.campaignName,jdbcType=VARCHAR}, 
        #{item.campaingReward,jdbcType=DECIMAL}, #{item.payTo,jdbcType=VARCHAR}, #{item.payToMobile,jdbcType=VARCHAR}, 
        #{item.payToWechat,jdbcType=VARCHAR}, #{item.payToIdTypeId,jdbcType=BIGINT}, #{item.payToIdNo,jdbcType=VARCHAR}, 
        #{item.payToBirthday,jdbcType=DATE}, #{item.payToGender,jdbcType=INTEGER}, #{item.payDate,jdbcType=TIMESTAMP}, 
        #{item.payAmount,jdbcType=DECIMAL}, #{item.taxAmount,jdbcType=DECIMAL}, #{item.paidBy,jdbcType=VARCHAR}, 
        #{item.paidMethod,jdbcType=INTEGER}, #{item.payStatus,jdbcType=INTEGER}, #{item.remark,jdbcType=LONGVARCHAR}, 
        #{item.createdAt,jdbcType=TIMESTAMP}, #{item.createdBy,jdbcType=BIGINT}, #{item.updatedAt,jdbcType=TIMESTAMP}, 
        #{item.updatedBy,jdbcType=BIGINT})
    </foreach>
  </insert>

  <select id="findByWithdrawIds" resultMap="BaseResultMap">
    <!--@mbg.generated-->
    select
    <include refid="Base_Column_List" />
    from ag_acl_customer_fortune_pay
    where withdraw_id in
    <foreach collection="list" item="item" separator="," open="(" close=")">
      #{item}
    </foreach>
    </select>

  <select id="findByIds" resultMap="BaseResultMap">
    select
        <include refid="Base_Column_List" />
    from ag_acl_customer_fortune_pay
    where id in
      <foreach collection="array" item="item" separator="," open="(" close=")">
        #{item}
      </foreach>
    </select>
</mapper>