package com.hfkj.dao;

import com.hfkj.entity.BsTradeOrderProfitSharingReceiver;
import com.hfkj.entity.BsTradeOrderProfitSharingReceiverExample;
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 BsTradeOrderProfitSharingReceiverMapper extends BsTradeOrderProfitSharingReceiverMapperExt {
    @SelectProvider(type=BsTradeOrderProfitSharingReceiverSqlProvider.class, method="countByExample")
    long countByExample(BsTradeOrderProfitSharingReceiverExample example);

    @DeleteProvider(type=BsTradeOrderProfitSharingReceiverSqlProvider.class, method="deleteByExample")
    int deleteByExample(BsTradeOrderProfitSharingReceiverExample example);

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

    @Insert({
        "insert into bs_trade_order_profit_sharing_receiver (trade_order_profit_sharing_id, trade_order_id, ",
        "trade_order_no, profit_sharing_amount, ",
        "ratio, receiver_object_type, ",
        "receiver_object_id, receiver_no, ",
        "receiver_account, receiver_name, ",
        "receiver_amount, `status`, ",
        "create_time, profit_sharing_time, ",
        "finish_time, ext_1, ",
        "ext_2, ext_3)",
        "values (#{tradeOrderProfitSharingId,jdbcType=BIGINT}, #{tradeOrderId,jdbcType=BIGINT}, ",
        "#{tradeOrderNo,jdbcType=VARCHAR}, #{profitSharingAmount,jdbcType=DECIMAL}, ",
        "#{ratio,jdbcType=DECIMAL}, #{receiverObjectType,jdbcType=INTEGER}, ",
        "#{receiverObjectId,jdbcType=VARCHAR}, #{receiverNo,jdbcType=VARCHAR}, ",
        "#{receiverAccount,jdbcType=VARCHAR}, #{receiverName,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(BsTradeOrderProfitSharingReceiver record);

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

    @SelectProvider(type=BsTradeOrderProfitSharingReceiverSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="trade_order_profit_sharing_id", property="tradeOrderProfitSharingId", jdbcType=JdbcType.BIGINT),
        @Result(column="trade_order_id", property="tradeOrderId", jdbcType=JdbcType.BIGINT),
        @Result(column="trade_order_no", property="tradeOrderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="profit_sharing_amount", property="profitSharingAmount", jdbcType=JdbcType.DECIMAL),
        @Result(column="ratio", property="ratio", jdbcType=JdbcType.DECIMAL),
        @Result(column="receiver_object_type", property="receiverObjectType", jdbcType=JdbcType.INTEGER),
        @Result(column="receiver_object_id", property="receiverObjectId", jdbcType=JdbcType.VARCHAR),
        @Result(column="receiver_no", property="receiverNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="receiver_account", property="receiverAccount", jdbcType=JdbcType.VARCHAR),
        @Result(column="receiver_name", property="receiverName", 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<BsTradeOrderProfitSharingReceiver> selectByExample(BsTradeOrderProfitSharingReceiverExample example);

    @Select({
        "select",
        "id, trade_order_profit_sharing_id, trade_order_id, trade_order_no, profit_sharing_amount, ",
        "ratio, receiver_object_type, receiver_object_id, receiver_no, receiver_account, ",
        "receiver_name, receiver_amount, `status`, create_time, profit_sharing_time, ",
        "finish_time, ext_1, ext_2, ext_3",
        "from bs_trade_order_profit_sharing_receiver",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="trade_order_profit_sharing_id", property="tradeOrderProfitSharingId", jdbcType=JdbcType.BIGINT),
        @Result(column="trade_order_id", property="tradeOrderId", jdbcType=JdbcType.BIGINT),
        @Result(column="trade_order_no", property="tradeOrderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="profit_sharing_amount", property="profitSharingAmount", jdbcType=JdbcType.DECIMAL),
        @Result(column="ratio", property="ratio", jdbcType=JdbcType.DECIMAL),
        @Result(column="receiver_object_type", property="receiverObjectType", jdbcType=JdbcType.INTEGER),
        @Result(column="receiver_object_id", property="receiverObjectId", jdbcType=JdbcType.VARCHAR),
        @Result(column="receiver_no", property="receiverNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="receiver_account", property="receiverAccount", jdbcType=JdbcType.VARCHAR),
        @Result(column="receiver_name", property="receiverName", 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)
    })
    BsTradeOrderProfitSharingReceiver selectByPrimaryKey(Long id);

    @UpdateProvider(type=BsTradeOrderProfitSharingReceiverSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") BsTradeOrderProfitSharingReceiver record, @Param("example") BsTradeOrderProfitSharingReceiverExample example);

    @UpdateProvider(type=BsTradeOrderProfitSharingReceiverSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") BsTradeOrderProfitSharingReceiver record, @Param("example") BsTradeOrderProfitSharingReceiverExample example);

    @UpdateProvider(type=BsTradeOrderProfitSharingReceiverSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(BsTradeOrderProfitSharingReceiver record);

    @Update({
        "update bs_trade_order_profit_sharing_receiver",
        "set trade_order_profit_sharing_id = #{tradeOrderProfitSharingId,jdbcType=BIGINT},",
          "trade_order_id = #{tradeOrderId,jdbcType=BIGINT},",
          "trade_order_no = #{tradeOrderNo,jdbcType=VARCHAR},",
          "profit_sharing_amount = #{profitSharingAmount,jdbcType=DECIMAL},",
          "ratio = #{ratio,jdbcType=DECIMAL},",
          "receiver_object_type = #{receiverObjectType,jdbcType=INTEGER},",
          "receiver_object_id = #{receiverObjectId,jdbcType=VARCHAR},",
          "receiver_no = #{receiverNo,jdbcType=VARCHAR},",
          "receiver_account = #{receiverAccount,jdbcType=VARCHAR},",
          "receiver_name = #{receiverName,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(BsTradeOrderProfitSharingReceiver record);
}