package com.hfkj.dao;

import com.hfkj.entity.BsOrderSettleLedger;
import com.hfkj.entity.BsOrderSettleLedgerExample;
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 BsOrderSettleLedgerMapper extends BsOrderSettleLedgerMapperExt {
    @SelectProvider(type=BsOrderSettleLedgerSqlProvider.class, method="countByExample")
    long countByExample(BsOrderSettleLedgerExample example);

    @DeleteProvider(type=BsOrderSettleLedgerSqlProvider.class, method="deleteByExample")
    int deleteByExample(BsOrderSettleLedgerExample example);

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

    @Insert({
        "insert into bs_order_settle_ledger (order_settle_id, ratio, ",
        "sharing_amount, receiver_mer_no, ",
        "receiver_mer_name, receiver_amount, ",
        "`status`, create_time, ",
        "profit_sharing_time, finish_time, ",
        "ext_1, ext_2, ext_3)",
        "values (#{orderSettleId,jdbcType=BIGINT}, #{ratio,jdbcType=DECIMAL}, ",
        "#{sharingAmount,jdbcType=DECIMAL}, #{receiverMerNo,jdbcType=VARCHAR}, ",
        "#{receiverMerName,jdbcType=VARCHAR}, #{receiverAmount,jdbcType=DECIMAL}, ",
        "#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ",
        "#{profitSharingTime,jdbcType=TIMESTAMP}, #{finishTime,jdbcType=TIMESTAMP}, ",
        "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
    })
    @Options(useGeneratedKeys=true,keyProperty="id")
    int insert(BsOrderSettleLedger record);

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

    @SelectProvider(type=BsOrderSettleLedgerSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="order_settle_id", property="orderSettleId", jdbcType=JdbcType.BIGINT),
        @Result(column="ratio", property="ratio", jdbcType=JdbcType.DECIMAL),
        @Result(column="sharing_amount", property="sharingAmount", jdbcType=JdbcType.DECIMAL),
        @Result(column="receiver_mer_no", property="receiverMerNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="receiver_mer_name", property="receiverMerName", jdbcType=JdbcType.VARCHAR),
        @Result(column="receiver_amount", property="receiverAmount", jdbcType=JdbcType.DECIMAL),
        @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="profit_sharing_time", property="profitSharingTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="finish_time", property="finishTime", 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<BsOrderSettleLedger> selectByExample(BsOrderSettleLedgerExample example);

    @Select({
        "select",
        "id, order_settle_id, ratio, sharing_amount, receiver_mer_no, receiver_mer_name, ",
        "receiver_amount, `status`, create_time, profit_sharing_time, finish_time, ext_1, ",
        "ext_2, ext_3",
        "from bs_order_settle_ledger",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="order_settle_id", property="orderSettleId", jdbcType=JdbcType.BIGINT),
        @Result(column="ratio", property="ratio", jdbcType=JdbcType.DECIMAL),
        @Result(column="sharing_amount", property="sharingAmount", jdbcType=JdbcType.DECIMAL),
        @Result(column="receiver_mer_no", property="receiverMerNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="receiver_mer_name", property="receiverMerName", jdbcType=JdbcType.VARCHAR),
        @Result(column="receiver_amount", property="receiverAmount", jdbcType=JdbcType.DECIMAL),
        @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="profit_sharing_time", property="profitSharingTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="finish_time", property="finishTime", 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)
    })
    BsOrderSettleLedger selectByPrimaryKey(Long id);

    @UpdateProvider(type=BsOrderSettleLedgerSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") BsOrderSettleLedger record, @Param("example") BsOrderSettleLedgerExample example);

    @UpdateProvider(type=BsOrderSettleLedgerSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") BsOrderSettleLedger record, @Param("example") BsOrderSettleLedgerExample example);

    @UpdateProvider(type=BsOrderSettleLedgerSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(BsOrderSettleLedger record);

    @Update({
        "update bs_order_settle_ledger",
        "set order_settle_id = #{orderSettleId,jdbcType=BIGINT},",
          "ratio = #{ratio,jdbcType=DECIMAL},",
          "sharing_amount = #{sharingAmount,jdbcType=DECIMAL},",
          "receiver_mer_no = #{receiverMerNo,jdbcType=VARCHAR},",
          "receiver_mer_name = #{receiverMerName,jdbcType=VARCHAR},",
          "receiver_amount = #{receiverAmount,jdbcType=DECIMAL},",
          "`status` = #{status,jdbcType=INTEGER},",
          "create_time = #{createTime,jdbcType=TIMESTAMP},",
          "profit_sharing_time = #{profitSharingTime,jdbcType=TIMESTAMP},",
          "finish_time = #{finishTime,jdbcType=TIMESTAMP},",
          "ext_1 = #{ext1,jdbcType=VARCHAR},",
          "ext_2 = #{ext2,jdbcType=VARCHAR},",
          "ext_3 = #{ext3,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(BsOrderSettleLedger record);
}