package com.hfkj.dao;

import com.hfkj.entity.BsTradeSettle;
import com.hfkj.entity.BsTradeSettleExample;
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 BsTradeSettleMapper extends BsTradeSettleMapperExt {
    @SelectProvider(type=BsTradeSettleSqlProvider.class, method="countByExample")
    long countByExample(BsTradeSettleExample example);

    @DeleteProvider(type=BsTradeSettleSqlProvider.class, method="deleteByExample")
    int deleteByExample(BsTradeSettleExample example);

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

    @Insert({
        "insert into bs_trade_settle (company_id, agent_id, ",
        "salesman_id, salesman_name, ",
        "mer_id, mer_name, mer_abbreviate, ",
        "mer_no, store_id, store_name, ",
        "platform_type, platform_mer_no, ",
        "platform_trade_no, platform_log_no, ",
        "pay_mode, out_trade_no, ",
        "acc_trade_no, trade_type, ",
        "trade_amount, trade_time, ",
        "shd_fee_amt, settle_amount, ",
        "settle_date, fee_rate, ",
        "org_out_trade_no, `status`, ",
        "create_time, ext_1, ",
        "ext_2, ext_3)",
        "values (#{companyId,jdbcType=BIGINT}, #{agentId,jdbcType=BIGINT}, ",
        "#{salesmanId,jdbcType=BIGINT}, #{salesmanName,jdbcType=VARCHAR}, ",
        "#{merId,jdbcType=BIGINT}, #{merName,jdbcType=VARCHAR}, #{merAbbreviate,jdbcType=VARCHAR}, ",
        "#{merNo,jdbcType=VARCHAR}, #{storeId,jdbcType=BIGINT}, #{storeName,jdbcType=VARCHAR}, ",
        "#{platformType,jdbcType=INTEGER}, #{platformMerNo,jdbcType=VARCHAR}, ",
        "#{platformTradeNo,jdbcType=VARCHAR}, #{platformLogNo,jdbcType=VARCHAR}, ",
        "#{payMode,jdbcType=VARCHAR}, #{outTradeNo,jdbcType=VARCHAR}, ",
        "#{accTradeNo,jdbcType=VARCHAR}, #{tradeType,jdbcType=INTEGER}, ",
        "#{tradeAmount,jdbcType=DECIMAL}, #{tradeTime,jdbcType=TIMESTAMP}, ",
        "#{shdFeeAmt,jdbcType=DECIMAL}, #{settleAmount,jdbcType=DECIMAL}, ",
        "#{settleDate,jdbcType=DATE}, #{feeRate,jdbcType=DECIMAL}, ",
        "#{orgOutTradeNo,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ",
        "#{createTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ",
        "#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
    })
    @Options(useGeneratedKeys=true,keyProperty="id")
    int insert(BsTradeSettle record);

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

    @SelectProvider(type=BsTradeSettleSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="company_id", property="companyId", jdbcType=JdbcType.BIGINT),
        @Result(column="agent_id", property="agentId", jdbcType=JdbcType.BIGINT),
        @Result(column="salesman_id", property="salesmanId", jdbcType=JdbcType.BIGINT),
        @Result(column="salesman_name", property="salesmanName", jdbcType=JdbcType.VARCHAR),
        @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT),
        @Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR),
        @Result(column="mer_abbreviate", property="merAbbreviate", jdbcType=JdbcType.VARCHAR),
        @Result(column="mer_no", property="merNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="store_id", property="storeId", jdbcType=JdbcType.BIGINT),
        @Result(column="store_name", property="storeName", jdbcType=JdbcType.VARCHAR),
        @Result(column="platform_type", property="platformType", jdbcType=JdbcType.INTEGER),
        @Result(column="platform_mer_no", property="platformMerNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="platform_trade_no", property="platformTradeNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="platform_log_no", property="platformLogNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="pay_mode", property="payMode", jdbcType=JdbcType.VARCHAR),
        @Result(column="out_trade_no", property="outTradeNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="acc_trade_no", property="accTradeNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="trade_type", property="tradeType", jdbcType=JdbcType.INTEGER),
        @Result(column="trade_amount", property="tradeAmount", jdbcType=JdbcType.DECIMAL),
        @Result(column="trade_time", property="tradeTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="shd_fee_amt", property="shdFeeAmt", jdbcType=JdbcType.DECIMAL),
        @Result(column="settle_amount", property="settleAmount", jdbcType=JdbcType.DECIMAL),
        @Result(column="settle_date", property="settleDate", jdbcType=JdbcType.DATE),
        @Result(column="fee_rate", property="feeRate", jdbcType=JdbcType.DECIMAL),
        @Result(column="org_out_trade_no", property="orgOutTradeNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
        @Result(column="create_time", property="createTime", 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<BsTradeSettle> selectByExample(BsTradeSettleExample example);

    @Select({
        "select",
        "id, company_id, agent_id, salesman_id, salesman_name, mer_id, mer_name, mer_abbreviate, ",
        "mer_no, store_id, store_name, platform_type, platform_mer_no, platform_trade_no, ",
        "platform_log_no, pay_mode, out_trade_no, acc_trade_no, trade_type, trade_amount, ",
        "trade_time, shd_fee_amt, settle_amount, settle_date, fee_rate, org_out_trade_no, ",
        "`status`, create_time, ext_1, ext_2, ext_3",
        "from bs_trade_settle",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="company_id", property="companyId", jdbcType=JdbcType.BIGINT),
        @Result(column="agent_id", property="agentId", jdbcType=JdbcType.BIGINT),
        @Result(column="salesman_id", property="salesmanId", jdbcType=JdbcType.BIGINT),
        @Result(column="salesman_name", property="salesmanName", jdbcType=JdbcType.VARCHAR),
        @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT),
        @Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR),
        @Result(column="mer_abbreviate", property="merAbbreviate", jdbcType=JdbcType.VARCHAR),
        @Result(column="mer_no", property="merNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="store_id", property="storeId", jdbcType=JdbcType.BIGINT),
        @Result(column="store_name", property="storeName", jdbcType=JdbcType.VARCHAR),
        @Result(column="platform_type", property="platformType", jdbcType=JdbcType.INTEGER),
        @Result(column="platform_mer_no", property="platformMerNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="platform_trade_no", property="platformTradeNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="platform_log_no", property="platformLogNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="pay_mode", property="payMode", jdbcType=JdbcType.VARCHAR),
        @Result(column="out_trade_no", property="outTradeNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="acc_trade_no", property="accTradeNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="trade_type", property="tradeType", jdbcType=JdbcType.INTEGER),
        @Result(column="trade_amount", property="tradeAmount", jdbcType=JdbcType.DECIMAL),
        @Result(column="trade_time", property="tradeTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="shd_fee_amt", property="shdFeeAmt", jdbcType=JdbcType.DECIMAL),
        @Result(column="settle_amount", property="settleAmount", jdbcType=JdbcType.DECIMAL),
        @Result(column="settle_date", property="settleDate", jdbcType=JdbcType.DATE),
        @Result(column="fee_rate", property="feeRate", jdbcType=JdbcType.DECIMAL),
        @Result(column="org_out_trade_no", property="orgOutTradeNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
        @Result(column="create_time", property="createTime", 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)
    })
    BsTradeSettle selectByPrimaryKey(Long id);

    @UpdateProvider(type=BsTradeSettleSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") BsTradeSettle record, @Param("example") BsTradeSettleExample example);

    @UpdateProvider(type=BsTradeSettleSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") BsTradeSettle record, @Param("example") BsTradeSettleExample example);

    @UpdateProvider(type=BsTradeSettleSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(BsTradeSettle record);

    @Update({
        "update bs_trade_settle",
        "set company_id = #{companyId,jdbcType=BIGINT},",
          "agent_id = #{agentId,jdbcType=BIGINT},",
          "salesman_id = #{salesmanId,jdbcType=BIGINT},",
          "salesman_name = #{salesmanName,jdbcType=VARCHAR},",
          "mer_id = #{merId,jdbcType=BIGINT},",
          "mer_name = #{merName,jdbcType=VARCHAR},",
          "mer_abbreviate = #{merAbbreviate,jdbcType=VARCHAR},",
          "mer_no = #{merNo,jdbcType=VARCHAR},",
          "store_id = #{storeId,jdbcType=BIGINT},",
          "store_name = #{storeName,jdbcType=VARCHAR},",
          "platform_type = #{platformType,jdbcType=INTEGER},",
          "platform_mer_no = #{platformMerNo,jdbcType=VARCHAR},",
          "platform_trade_no = #{platformTradeNo,jdbcType=VARCHAR},",
          "platform_log_no = #{platformLogNo,jdbcType=VARCHAR},",
          "pay_mode = #{payMode,jdbcType=VARCHAR},",
          "out_trade_no = #{outTradeNo,jdbcType=VARCHAR},",
          "acc_trade_no = #{accTradeNo,jdbcType=VARCHAR},",
          "trade_type = #{tradeType,jdbcType=INTEGER},",
          "trade_amount = #{tradeAmount,jdbcType=DECIMAL},",
          "trade_time = #{tradeTime,jdbcType=TIMESTAMP},",
          "shd_fee_amt = #{shdFeeAmt,jdbcType=DECIMAL},",
          "settle_amount = #{settleAmount,jdbcType=DECIMAL},",
          "settle_date = #{settleDate,jdbcType=DATE},",
          "fee_rate = #{feeRate,jdbcType=DECIMAL},",
          "org_out_trade_no = #{orgOutTradeNo,jdbcType=VARCHAR},",
          "`status` = #{status,jdbcType=INTEGER},",
          "create_time = #{createTime,jdbcType=TIMESTAMP},",
          "ext_1 = #{ext1,jdbcType=VARCHAR},",
          "ext_2 = #{ext2,jdbcType=VARCHAR},",
          "ext_3 = #{ext3,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(BsTradeSettle record);
}