package com.hfkj.dao;

import com.hfkj.entity.BsMerWithdrawal;
import com.hfkj.entity.BsMerWithdrawalExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;
import org.springframework.stereotype.Repository;

/**
 * 
 * 代码由工具生成,请勿修改!!!
 * 如果需要扩展请在其父类进行扩展
 * 
 **/
@Repository
public interface BsMerWithdrawalMapper extends BsMerWithdrawalMapperExt {
    @SelectProvider(type=BsMerWithdrawalSqlProvider.class, method="countByExample")
    long countByExample(BsMerWithdrawalExample example);

    @DeleteProvider(type=BsMerWithdrawalSqlProvider.class, method="deleteByExample")
    int deleteByExample(BsMerWithdrawalExample example);

    @Delete({
        "delete from bs_mer_withdrawal",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long id);

    @Insert({
        "insert into bs_mer_withdrawal (mer_id, mer_no, ",
        "mer_name, platform_type, ",
        "platform_no, cup_no, ",
        "mer_order_no, draw_jnl, ",
        "draw_amt, draw_fee, ",
        "draw_mode, batch_auto_settle, ",
        "batch_no, acct_no, ",
        "acct_name, bank_no, ",
        "settle_no, bank_name, ",
        "draw_status, create_time, ",
        "update_time, complete_time, ",
        "ext_1, ext_2, ext_3)",
        "values (#{merId,jdbcType=BIGINT}, #{merNo,jdbcType=VARCHAR}, ",
        "#{merName,jdbcType=VARCHAR}, #{platformType,jdbcType=INTEGER}, ",
        "#{platformNo,jdbcType=VARCHAR}, #{cupNo,jdbcType=VARCHAR}, ",
        "#{merOrderNo,jdbcType=INTEGER}, #{drawJnl,jdbcType=VARCHAR}, ",
        "#{drawAmt,jdbcType=DECIMAL}, #{drawFee,jdbcType=DECIMAL}, ",
        "#{drawMode,jdbcType=INTEGER}, #{batchAutoSettle,jdbcType=INTEGER}, ",
        "#{batchNo,jdbcType=VARCHAR}, #{acctNo,jdbcType=VARCHAR}, ",
        "#{acctName,jdbcType=VARCHAR}, #{bankNo,jdbcType=VARCHAR}, ",
        "#{settleNo,jdbcType=VARCHAR}, #{bankName,jdbcType=VARCHAR}, ",
        "#{drawStatus,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ",
        "#{updateTime,jdbcType=TIMESTAMP}, #{completeTime,jdbcType=TIMESTAMP}, ",
        "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
    })
    @Options(useGeneratedKeys=true,keyProperty="id")
    int insert(BsMerWithdrawal record);

    @InsertProvider(type=BsMerWithdrawalSqlProvider.class, method="insertSelective")
    @Options(useGeneratedKeys=true,keyProperty="id")
    int insertSelective(BsMerWithdrawal record);

    @SelectProvider(type=BsMerWithdrawalSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT),
        @Result(column="mer_no", property="merNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR),
        @Result(column="platform_type", property="platformType", jdbcType=JdbcType.INTEGER),
        @Result(column="platform_no", property="platformNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="cup_no", property="cupNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="mer_order_no", property="merOrderNo", jdbcType=JdbcType.INTEGER),
        @Result(column="draw_jnl", property="drawJnl", jdbcType=JdbcType.VARCHAR),
        @Result(column="draw_amt", property="drawAmt", jdbcType=JdbcType.DECIMAL),
        @Result(column="draw_fee", property="drawFee", jdbcType=JdbcType.DECIMAL),
        @Result(column="draw_mode", property="drawMode", jdbcType=JdbcType.INTEGER),
        @Result(column="batch_auto_settle", property="batchAutoSettle", jdbcType=JdbcType.INTEGER),
        @Result(column="batch_no", property="batchNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="acct_no", property="acctNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="acct_name", property="acctName", jdbcType=JdbcType.VARCHAR),
        @Result(column="bank_no", property="bankNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="settle_no", property="settleNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="bank_name", property="bankName", jdbcType=JdbcType.VARCHAR),
        @Result(column="draw_status", property="drawStatus", jdbcType=JdbcType.INTEGER),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="complete_time", property="completeTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
        @Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
        @Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
    })
    List<BsMerWithdrawal> selectByExample(BsMerWithdrawalExample example);

    @Select({
        "select",
        "id, mer_id, mer_no, mer_name, platform_type, platform_no, cup_no, mer_order_no, ",
        "draw_jnl, draw_amt, draw_fee, draw_mode, batch_auto_settle, batch_no, acct_no, ",
        "acct_name, bank_no, settle_no, bank_name, draw_status, create_time, update_time, ",
        "complete_time, ext_1, ext_2, ext_3",
        "from bs_mer_withdrawal",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT),
        @Result(column="mer_no", property="merNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR),
        @Result(column="platform_type", property="platformType", jdbcType=JdbcType.INTEGER),
        @Result(column="platform_no", property="platformNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="cup_no", property="cupNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="mer_order_no", property="merOrderNo", jdbcType=JdbcType.INTEGER),
        @Result(column="draw_jnl", property="drawJnl", jdbcType=JdbcType.VARCHAR),
        @Result(column="draw_amt", property="drawAmt", jdbcType=JdbcType.DECIMAL),
        @Result(column="draw_fee", property="drawFee", jdbcType=JdbcType.DECIMAL),
        @Result(column="draw_mode", property="drawMode", jdbcType=JdbcType.INTEGER),
        @Result(column="batch_auto_settle", property="batchAutoSettle", jdbcType=JdbcType.INTEGER),
        @Result(column="batch_no", property="batchNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="acct_no", property="acctNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="acct_name", property="acctName", jdbcType=JdbcType.VARCHAR),
        @Result(column="bank_no", property="bankNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="settle_no", property="settleNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="bank_name", property="bankName", jdbcType=JdbcType.VARCHAR),
        @Result(column="draw_status", property="drawStatus", jdbcType=JdbcType.INTEGER),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="complete_time", property="completeTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR),
        @Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR),
        @Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR)
    })
    BsMerWithdrawal selectByPrimaryKey(Long id);

    @UpdateProvider(type=BsMerWithdrawalSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") BsMerWithdrawal record, @Param("example") BsMerWithdrawalExample example);

    @UpdateProvider(type=BsMerWithdrawalSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") BsMerWithdrawal record, @Param("example") BsMerWithdrawalExample example);

    @UpdateProvider(type=BsMerWithdrawalSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(BsMerWithdrawal record);

    @Update({
        "update bs_mer_withdrawal",
        "set mer_id = #{merId,jdbcType=BIGINT},",
          "mer_no = #{merNo,jdbcType=VARCHAR},",
          "mer_name = #{merName,jdbcType=VARCHAR},",
          "platform_type = #{platformType,jdbcType=INTEGER},",
          "platform_no = #{platformNo,jdbcType=VARCHAR},",
          "cup_no = #{cupNo,jdbcType=VARCHAR},",
          "mer_order_no = #{merOrderNo,jdbcType=INTEGER},",
          "draw_jnl = #{drawJnl,jdbcType=VARCHAR},",
          "draw_amt = #{drawAmt,jdbcType=DECIMAL},",
          "draw_fee = #{drawFee,jdbcType=DECIMAL},",
          "draw_mode = #{drawMode,jdbcType=INTEGER},",
          "batch_auto_settle = #{batchAutoSettle,jdbcType=INTEGER},",
          "batch_no = #{batchNo,jdbcType=VARCHAR},",
          "acct_no = #{acctNo,jdbcType=VARCHAR},",
          "acct_name = #{acctName,jdbcType=VARCHAR},",
          "bank_no = #{bankNo,jdbcType=VARCHAR},",
          "settle_no = #{settleNo,jdbcType=VARCHAR},",
          "bank_name = #{bankName,jdbcType=VARCHAR},",
          "draw_status = #{drawStatus,jdbcType=INTEGER},",
          "create_time = #{createTime,jdbcType=TIMESTAMP},",
          "update_time = #{updateTime,jdbcType=TIMESTAMP},",
          "complete_time = #{completeTime,jdbcType=TIMESTAMP},",
          "ext_1 = #{ext1,jdbcType=VARCHAR},",
          "ext_2 = #{ext2,jdbcType=VARCHAR},",
          "ext_3 = #{ext3,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(BsMerWithdrawal record);
}