package com.hfkj.dao;

import com.hfkj.entity.BsRebateMerAccountRecord;
import com.hfkj.entity.BsRebateMerAccountRecordExample;
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 BsRebateMerAccountRecordMapper extends BsRebateMerAccountRecordMapperExt {
    @SelectProvider(type=BsRebateMerAccountRecordSqlProvider.class, method="countByExample")
    long countByExample(BsRebateMerAccountRecordExample example);

    @DeleteProvider(type=BsRebateMerAccountRecordSqlProvider.class, method="deleteByExample")
    int deleteByExample(BsRebateMerAccountRecordExample example);

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

    @Insert({
        "insert into bs_rebate_mer_account_record (account_id, account_number, ",
        "trade_type, trade_number, ",
        "trade_amount, amount_before_change, ",
        "amount_after_change, object_type, ",
        "object_id, object_content, ",
        "`status`, create_time, ",
        "ext_1, ext_2, ext_3)",
        "values (#{accountId,jdbcType=BIGINT}, #{accountNumber,jdbcType=BIGINT}, ",
        "#{tradeType,jdbcType=INTEGER}, #{tradeNumber,jdbcType=VARCHAR}, ",
        "#{tradeAmount,jdbcType=DECIMAL}, #{amountBeforeChange,jdbcType=DECIMAL}, ",
        "#{amountAfterChange,jdbcType=DECIMAL}, #{objectType,jdbcType=INTEGER}, ",
        "#{objectId,jdbcType=BIGINT}, #{objectContent,jdbcType=VARCHAR}, ",
        "#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ",
        "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
    })
    @Options(useGeneratedKeys=true,keyProperty="id")
    int insert(BsRebateMerAccountRecord record);

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

    @SelectProvider(type=BsRebateMerAccountRecordSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="account_id", property="accountId", jdbcType=JdbcType.BIGINT),
        @Result(column="account_number", property="accountNumber", jdbcType=JdbcType.BIGINT),
        @Result(column="trade_type", property="tradeType", jdbcType=JdbcType.INTEGER),
        @Result(column="trade_number", property="tradeNumber", jdbcType=JdbcType.VARCHAR),
        @Result(column="trade_amount", property="tradeAmount", jdbcType=JdbcType.DECIMAL),
        @Result(column="amount_before_change", property="amountBeforeChange", jdbcType=JdbcType.DECIMAL),
        @Result(column="amount_after_change", property="amountAfterChange", jdbcType=JdbcType.DECIMAL),
        @Result(column="object_type", property="objectType", jdbcType=JdbcType.INTEGER),
        @Result(column="object_id", property="objectId", jdbcType=JdbcType.BIGINT),
        @Result(column="object_content", property="objectContent", 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<BsRebateMerAccountRecord> selectByExample(BsRebateMerAccountRecordExample example);

    @Select({
        "select",
        "id, account_id, account_number, trade_type, trade_number, trade_amount, amount_before_change, ",
        "amount_after_change, object_type, object_id, object_content, `status`, create_time, ",
        "ext_1, ext_2, ext_3",
        "from bs_rebate_mer_account_record",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="account_id", property="accountId", jdbcType=JdbcType.BIGINT),
        @Result(column="account_number", property="accountNumber", jdbcType=JdbcType.BIGINT),
        @Result(column="trade_type", property="tradeType", jdbcType=JdbcType.INTEGER),
        @Result(column="trade_number", property="tradeNumber", jdbcType=JdbcType.VARCHAR),
        @Result(column="trade_amount", property="tradeAmount", jdbcType=JdbcType.DECIMAL),
        @Result(column="amount_before_change", property="amountBeforeChange", jdbcType=JdbcType.DECIMAL),
        @Result(column="amount_after_change", property="amountAfterChange", jdbcType=JdbcType.DECIMAL),
        @Result(column="object_type", property="objectType", jdbcType=JdbcType.INTEGER),
        @Result(column="object_id", property="objectId", jdbcType=JdbcType.BIGINT),
        @Result(column="object_content", property="objectContent", 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)
    })
    BsRebateMerAccountRecord selectByPrimaryKey(Long id);

    @UpdateProvider(type=BsRebateMerAccountRecordSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") BsRebateMerAccountRecord record, @Param("example") BsRebateMerAccountRecordExample example);

    @UpdateProvider(type=BsRebateMerAccountRecordSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") BsRebateMerAccountRecord record, @Param("example") BsRebateMerAccountRecordExample example);

    @UpdateProvider(type=BsRebateMerAccountRecordSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(BsRebateMerAccountRecord record);

    @Update({
        "update bs_rebate_mer_account_record",
        "set account_id = #{accountId,jdbcType=BIGINT},",
          "account_number = #{accountNumber,jdbcType=BIGINT},",
          "trade_type = #{tradeType,jdbcType=INTEGER},",
          "trade_number = #{tradeNumber,jdbcType=VARCHAR},",
          "trade_amount = #{tradeAmount,jdbcType=DECIMAL},",
          "amount_before_change = #{amountBeforeChange,jdbcType=DECIMAL},",
          "amount_after_change = #{amountAfterChange,jdbcType=DECIMAL},",
          "object_type = #{objectType,jdbcType=INTEGER},",
          "object_id = #{objectId,jdbcType=BIGINT},",
          "object_content = #{objectContent,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(BsRebateMerAccountRecord record);
}