package com.hfkj.dao;

import com.hfkj.entity.BsMerSettleAcct;
import com.hfkj.entity.BsMerSettleAcctExample;
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 BsMerSettleAcctMapper extends BsMerSettleAcctMapperExt {
    @SelectProvider(type=BsMerSettleAcctSqlProvider.class, method="countByExample")
    long countByExample(BsMerSettleAcctExample example);

    @DeleteProvider(type=BsMerSettleAcctSqlProvider.class, method="deleteByExample")
    int deleteByExample(BsMerSettleAcctExample example);

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

    @Insert({
        "insert into bs_mer_settle_acct (mer_id, settle_type, ",
        "commission_img, bank_card_img, ",
        "bank_name, bank_card_no, ",
        "bank_card_holder, openning_bank_city_code, ",
        "openning_bank_city_name, openning_bank_area_code, ",
        "openning_bank_area_name, openning_bank_province_code, ",
        "openning_bank_province_name, openning_bank_code, ",
        "openning_bank_name, openning_bank_license_url, ",
        "clearing_bank_code, settle_id_card_name, ",
        "settle_id_card_no, settle_id_card_address, ",
        "settle_id_card_portrait_img, settle_id_card_national_emblem_img, ",
        "settle_id_period_type, settle_id_card_period_start, ",
        "settle_id_card_period_end, electronic_pact, ",
        "`status`, create_time, ",
        "update_time, ext_1, ",
        "ext_2, ext_3)",
        "values (#{merId,jdbcType=BIGINT}, #{settleType,jdbcType=INTEGER}, ",
        "#{commissionImg,jdbcType=VARCHAR}, #{bankCardImg,jdbcType=VARCHAR}, ",
        "#{bankName,jdbcType=VARCHAR}, #{bankCardNo,jdbcType=VARCHAR}, ",
        "#{bankCardHolder,jdbcType=VARCHAR}, #{openningBankCityCode,jdbcType=BIGINT}, ",
        "#{openningBankCityName,jdbcType=VARCHAR}, #{openningBankAreaCode,jdbcType=BIGINT}, ",
        "#{openningBankAreaName,jdbcType=VARCHAR}, #{openningBankProvinceCode,jdbcType=BIGINT}, ",
        "#{openningBankProvinceName,jdbcType=VARCHAR}, #{openningBankCode,jdbcType=VARCHAR}, ",
        "#{openningBankName,jdbcType=VARCHAR}, #{openningBankLicenseUrl,jdbcType=VARCHAR}, ",
        "#{clearingBankCode,jdbcType=VARCHAR}, #{settleIdCardName,jdbcType=VARCHAR}, ",
        "#{settleIdCardNo,jdbcType=VARCHAR}, #{settleIdCardAddress,jdbcType=VARCHAR}, ",
        "#{settleIdCardPortraitImg,jdbcType=VARCHAR}, #{settleIdCardNationalEmblemImg,jdbcType=VARCHAR}, ",
        "#{settleIdPeriodType,jdbcType=INTEGER}, #{settleIdCardPeriodStart,jdbcType=VARCHAR}, ",
        "#{settleIdCardPeriodEnd,jdbcType=VARCHAR}, #{electronicPact,jdbcType=VARCHAR}, ",
        "#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ",
        "#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ",
        "#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
    })
    @Options(useGeneratedKeys=true,keyProperty="id")
    int insert(BsMerSettleAcct record);

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

    @SelectProvider(type=BsMerSettleAcctSqlProvider.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="settle_type", property="settleType", jdbcType=JdbcType.INTEGER),
        @Result(column="commission_img", property="commissionImg", jdbcType=JdbcType.VARCHAR),
        @Result(column="bank_card_img", property="bankCardImg", jdbcType=JdbcType.VARCHAR),
        @Result(column="bank_name", property="bankName", jdbcType=JdbcType.VARCHAR),
        @Result(column="bank_card_no", property="bankCardNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="bank_card_holder", property="bankCardHolder", jdbcType=JdbcType.VARCHAR),
        @Result(column="openning_bank_city_code", property="openningBankCityCode", jdbcType=JdbcType.BIGINT),
        @Result(column="openning_bank_city_name", property="openningBankCityName", jdbcType=JdbcType.VARCHAR),
        @Result(column="openning_bank_area_code", property="openningBankAreaCode", jdbcType=JdbcType.BIGINT),
        @Result(column="openning_bank_area_name", property="openningBankAreaName", jdbcType=JdbcType.VARCHAR),
        @Result(column="openning_bank_province_code", property="openningBankProvinceCode", jdbcType=JdbcType.BIGINT),
        @Result(column="openning_bank_province_name", property="openningBankProvinceName", jdbcType=JdbcType.VARCHAR),
        @Result(column="openning_bank_code", property="openningBankCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="openning_bank_name", property="openningBankName", jdbcType=JdbcType.VARCHAR),
        @Result(column="openning_bank_license_url", property="openningBankLicenseUrl", jdbcType=JdbcType.VARCHAR),
        @Result(column="clearing_bank_code", property="clearingBankCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="settle_id_card_name", property="settleIdCardName", jdbcType=JdbcType.VARCHAR),
        @Result(column="settle_id_card_no", property="settleIdCardNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="settle_id_card_address", property="settleIdCardAddress", jdbcType=JdbcType.VARCHAR),
        @Result(column="settle_id_card_portrait_img", property="settleIdCardPortraitImg", jdbcType=JdbcType.VARCHAR),
        @Result(column="settle_id_card_national_emblem_img", property="settleIdCardNationalEmblemImg", jdbcType=JdbcType.VARCHAR),
        @Result(column="settle_id_period_type", property="settleIdPeriodType", jdbcType=JdbcType.INTEGER),
        @Result(column="settle_id_card_period_start", property="settleIdCardPeriodStart", jdbcType=JdbcType.VARCHAR),
        @Result(column="settle_id_card_period_end", property="settleIdCardPeriodEnd", jdbcType=JdbcType.VARCHAR),
        @Result(column="electronic_pact", property="electronicPact", jdbcType=JdbcType.VARCHAR),
        @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_time", property="updateTime", 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<BsMerSettleAcct> selectByExample(BsMerSettleAcctExample example);

    @Select({
        "select",
        "id, mer_id, settle_type, commission_img, bank_card_img, bank_name, bank_card_no, ",
        "bank_card_holder, openning_bank_city_code, openning_bank_city_name, openning_bank_area_code, ",
        "openning_bank_area_name, openning_bank_province_code, openning_bank_province_name, ",
        "openning_bank_code, openning_bank_name, openning_bank_license_url, clearing_bank_code, ",
        "settle_id_card_name, settle_id_card_no, settle_id_card_address, settle_id_card_portrait_img, ",
        "settle_id_card_national_emblem_img, settle_id_period_type, settle_id_card_period_start, ",
        "settle_id_card_period_end, electronic_pact, `status`, create_time, update_time, ",
        "ext_1, ext_2, ext_3",
        "from bs_mer_settle_acct",
        "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="settle_type", property="settleType", jdbcType=JdbcType.INTEGER),
        @Result(column="commission_img", property="commissionImg", jdbcType=JdbcType.VARCHAR),
        @Result(column="bank_card_img", property="bankCardImg", jdbcType=JdbcType.VARCHAR),
        @Result(column="bank_name", property="bankName", jdbcType=JdbcType.VARCHAR),
        @Result(column="bank_card_no", property="bankCardNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="bank_card_holder", property="bankCardHolder", jdbcType=JdbcType.VARCHAR),
        @Result(column="openning_bank_city_code", property="openningBankCityCode", jdbcType=JdbcType.BIGINT),
        @Result(column="openning_bank_city_name", property="openningBankCityName", jdbcType=JdbcType.VARCHAR),
        @Result(column="openning_bank_area_code", property="openningBankAreaCode", jdbcType=JdbcType.BIGINT),
        @Result(column="openning_bank_area_name", property="openningBankAreaName", jdbcType=JdbcType.VARCHAR),
        @Result(column="openning_bank_province_code", property="openningBankProvinceCode", jdbcType=JdbcType.BIGINT),
        @Result(column="openning_bank_province_name", property="openningBankProvinceName", jdbcType=JdbcType.VARCHAR),
        @Result(column="openning_bank_code", property="openningBankCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="openning_bank_name", property="openningBankName", jdbcType=JdbcType.VARCHAR),
        @Result(column="openning_bank_license_url", property="openningBankLicenseUrl", jdbcType=JdbcType.VARCHAR),
        @Result(column="clearing_bank_code", property="clearingBankCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="settle_id_card_name", property="settleIdCardName", jdbcType=JdbcType.VARCHAR),
        @Result(column="settle_id_card_no", property="settleIdCardNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="settle_id_card_address", property="settleIdCardAddress", jdbcType=JdbcType.VARCHAR),
        @Result(column="settle_id_card_portrait_img", property="settleIdCardPortraitImg", jdbcType=JdbcType.VARCHAR),
        @Result(column="settle_id_card_national_emblem_img", property="settleIdCardNationalEmblemImg", jdbcType=JdbcType.VARCHAR),
        @Result(column="settle_id_period_type", property="settleIdPeriodType", jdbcType=JdbcType.INTEGER),
        @Result(column="settle_id_card_period_start", property="settleIdCardPeriodStart", jdbcType=JdbcType.VARCHAR),
        @Result(column="settle_id_card_period_end", property="settleIdCardPeriodEnd", jdbcType=JdbcType.VARCHAR),
        @Result(column="electronic_pact", property="electronicPact", jdbcType=JdbcType.VARCHAR),
        @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_time", property="updateTime", 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)
    })
    BsMerSettleAcct selectByPrimaryKey(Long id);

    @UpdateProvider(type=BsMerSettleAcctSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") BsMerSettleAcct record, @Param("example") BsMerSettleAcctExample example);

    @UpdateProvider(type=BsMerSettleAcctSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") BsMerSettleAcct record, @Param("example") BsMerSettleAcctExample example);

    @UpdateProvider(type=BsMerSettleAcctSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(BsMerSettleAcct record);

    @Update({
        "update bs_mer_settle_acct",
        "set mer_id = #{merId,jdbcType=BIGINT},",
          "settle_type = #{settleType,jdbcType=INTEGER},",
          "commission_img = #{commissionImg,jdbcType=VARCHAR},",
          "bank_card_img = #{bankCardImg,jdbcType=VARCHAR},",
          "bank_name = #{bankName,jdbcType=VARCHAR},",
          "bank_card_no = #{bankCardNo,jdbcType=VARCHAR},",
          "bank_card_holder = #{bankCardHolder,jdbcType=VARCHAR},",
          "openning_bank_city_code = #{openningBankCityCode,jdbcType=BIGINT},",
          "openning_bank_city_name = #{openningBankCityName,jdbcType=VARCHAR},",
          "openning_bank_area_code = #{openningBankAreaCode,jdbcType=BIGINT},",
          "openning_bank_area_name = #{openningBankAreaName,jdbcType=VARCHAR},",
          "openning_bank_province_code = #{openningBankProvinceCode,jdbcType=BIGINT},",
          "openning_bank_province_name = #{openningBankProvinceName,jdbcType=VARCHAR},",
          "openning_bank_code = #{openningBankCode,jdbcType=VARCHAR},",
          "openning_bank_name = #{openningBankName,jdbcType=VARCHAR},",
          "openning_bank_license_url = #{openningBankLicenseUrl,jdbcType=VARCHAR},",
          "clearing_bank_code = #{clearingBankCode,jdbcType=VARCHAR},",
          "settle_id_card_name = #{settleIdCardName,jdbcType=VARCHAR},",
          "settle_id_card_no = #{settleIdCardNo,jdbcType=VARCHAR},",
          "settle_id_card_address = #{settleIdCardAddress,jdbcType=VARCHAR},",
          "settle_id_card_portrait_img = #{settleIdCardPortraitImg,jdbcType=VARCHAR},",
          "settle_id_card_national_emblem_img = #{settleIdCardNationalEmblemImg,jdbcType=VARCHAR},",
          "settle_id_period_type = #{settleIdPeriodType,jdbcType=INTEGER},",
          "settle_id_card_period_start = #{settleIdCardPeriodStart,jdbcType=VARCHAR},",
          "settle_id_card_period_end = #{settleIdCardPeriodEnd,jdbcType=VARCHAR},",
          "electronic_pact = #{electronicPact,jdbcType=VARCHAR},",
          "`status` = #{status,jdbcType=INTEGER},",
          "create_time = #{createTime,jdbcType=TIMESTAMP},",
          "update_time = #{updateTime,jdbcType=TIMESTAMP},",
          "ext_1 = #{ext1,jdbcType=VARCHAR},",
          "ext_2 = #{ext2,jdbcType=VARCHAR},",
          "ext_3 = #{ext3,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(BsMerSettleAcct record);
}