package com.hfkj.dao;

import com.hfkj.entity.BsTradeOrderProfitSharing;
import com.hfkj.entity.BsTradeOrderProfitSharingExample;
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 BsTradeOrderProfitSharingMapper extends BsTradeOrderProfitSharingMapperExt {
    @SelectProvider(type=BsTradeOrderProfitSharingSqlProvider.class, method="countByExample")
    long countByExample(BsTradeOrderProfitSharingExample example);

    @DeleteProvider(type=BsTradeOrderProfitSharingSqlProvider.class, method="deleteByExample")
    int deleteByExample(BsTradeOrderProfitSharingExample example);

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

    @Insert({
        "insert into bs_trade_order_profit_sharing (cmd_type, trade_order_id, ",
        "trade_order_no, origin_profit_sharing_order_no, ",
        "profit_sharing_order_no, platform_type, ",
        "platform_profit_sharing_order_no, platform_mer_no, ",
        "platform_trade_no, platform_appid, ",
        "ratio, profit_sharing_amoun, ",
        "`status`, create_type, ",
        "create_time, profit_sharing_time, ",
        "finish_time, ext_1, ",
        "ext_2, ext_3)",
        "values (#{cmdType,jdbcType=INTEGER}, #{tradeOrderId,jdbcType=BIGINT}, ",
        "#{tradeOrderNo,jdbcType=VARCHAR}, #{originProfitSharingOrderNo,jdbcType=VARCHAR}, ",
        "#{profitSharingOrderNo,jdbcType=VARCHAR}, #{platformType,jdbcType=INTEGER}, ",
        "#{platformProfitSharingOrderNo,jdbcType=VARCHAR}, #{platformMerNo,jdbcType=VARCHAR}, ",
        "#{platformTradeNo,jdbcType=VARCHAR}, #{platformAppid,jdbcType=VARCHAR}, ",
        "#{ratio,jdbcType=DECIMAL}, #{profitSharingAmoun,jdbcType=DECIMAL}, ",
        "#{status,jdbcType=INTEGER}, #{createType,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(BsTradeOrderProfitSharing record);

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

    @SelectProvider(type=BsTradeOrderProfitSharingSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="cmd_type", property="cmdType", jdbcType=JdbcType.INTEGER),
        @Result(column="trade_order_id", property="tradeOrderId", jdbcType=JdbcType.BIGINT),
        @Result(column="trade_order_no", property="tradeOrderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="origin_profit_sharing_order_no", property="originProfitSharingOrderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="profit_sharing_order_no", property="profitSharingOrderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="platform_type", property="platformType", jdbcType=JdbcType.INTEGER),
        @Result(column="platform_profit_sharing_order_no", property="platformProfitSharingOrderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="platform_mer_no", property="platformMerNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="platform_trade_no", property="platformTradeNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="platform_appid", property="platformAppid", jdbcType=JdbcType.VARCHAR),
        @Result(column="ratio", property="ratio", jdbcType=JdbcType.DECIMAL),
        @Result(column="profit_sharing_amoun", property="profitSharingAmoun", jdbcType=JdbcType.DECIMAL),
        @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
        @Result(column="create_type", property="createType", 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<BsTradeOrderProfitSharing> selectByExample(BsTradeOrderProfitSharingExample example);

    @Select({
        "select",
        "id, cmd_type, trade_order_id, trade_order_no, origin_profit_sharing_order_no, ",
        "profit_sharing_order_no, platform_type, platform_profit_sharing_order_no, platform_mer_no, ",
        "platform_trade_no, platform_appid, ratio, profit_sharing_amoun, `status`, create_type, ",
        "create_time, profit_sharing_time, finish_time, ext_1, ext_2, ext_3",
        "from bs_trade_order_profit_sharing",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="cmd_type", property="cmdType", jdbcType=JdbcType.INTEGER),
        @Result(column="trade_order_id", property="tradeOrderId", jdbcType=JdbcType.BIGINT),
        @Result(column="trade_order_no", property="tradeOrderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="origin_profit_sharing_order_no", property="originProfitSharingOrderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="profit_sharing_order_no", property="profitSharingOrderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="platform_type", property="platformType", jdbcType=JdbcType.INTEGER),
        @Result(column="platform_profit_sharing_order_no", property="platformProfitSharingOrderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="platform_mer_no", property="platformMerNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="platform_trade_no", property="platformTradeNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="platform_appid", property="platformAppid", jdbcType=JdbcType.VARCHAR),
        @Result(column="ratio", property="ratio", jdbcType=JdbcType.DECIMAL),
        @Result(column="profit_sharing_amoun", property="profitSharingAmoun", jdbcType=JdbcType.DECIMAL),
        @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
        @Result(column="create_type", property="createType", 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)
    })
    BsTradeOrderProfitSharing selectByPrimaryKey(Long id);

    @UpdateProvider(type=BsTradeOrderProfitSharingSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") BsTradeOrderProfitSharing record, @Param("example") BsTradeOrderProfitSharingExample example);

    @UpdateProvider(type=BsTradeOrderProfitSharingSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") BsTradeOrderProfitSharing record, @Param("example") BsTradeOrderProfitSharingExample example);

    @UpdateProvider(type=BsTradeOrderProfitSharingSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(BsTradeOrderProfitSharing record);

    @Update({
        "update bs_trade_order_profit_sharing",
        "set cmd_type = #{cmdType,jdbcType=INTEGER},",
          "trade_order_id = #{tradeOrderId,jdbcType=BIGINT},",
          "trade_order_no = #{tradeOrderNo,jdbcType=VARCHAR},",
          "origin_profit_sharing_order_no = #{originProfitSharingOrderNo,jdbcType=VARCHAR},",
          "profit_sharing_order_no = #{profitSharingOrderNo,jdbcType=VARCHAR},",
          "platform_type = #{platformType,jdbcType=INTEGER},",
          "platform_profit_sharing_order_no = #{platformProfitSharingOrderNo,jdbcType=VARCHAR},",
          "platform_mer_no = #{platformMerNo,jdbcType=VARCHAR},",
          "platform_trade_no = #{platformTradeNo,jdbcType=VARCHAR},",
          "platform_appid = #{platformAppid,jdbcType=VARCHAR},",
          "ratio = #{ratio,jdbcType=DECIMAL},",
          "profit_sharing_amoun = #{profitSharingAmoun,jdbcType=DECIMAL},",
          "`status` = #{status,jdbcType=INTEGER},",
          "create_type = #{createType,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(BsTradeOrderProfitSharing record);
}