package com.hfkj.dao;

import com.hfkj.entity.BsTradeTakeConfig;
import com.hfkj.entity.BsTradeTakeConfigExample;
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 BsTradeTakeConfigMapper extends BsTradeTakeConfigMapperExt {
    @SelectProvider(type=BsTradeTakeConfigSqlProvider.class, method="countByExample")
    long countByExample(BsTradeTakeConfigExample example);

    @DeleteProvider(type=BsTradeTakeConfigSqlProvider.class, method="deleteByExample")
    int deleteByExample(BsTradeTakeConfigExample example);

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

    @Insert({
        "insert into bs_trade_take_config (company_id, company_name, ",
        "platform_type, platform_type_name, ",
        "receiver_role, receiver_role_name, ",
        "receiver_account, receiver_name, ",
        "receiver_ratio, receiver_object_id, ",
        "receiver_object_name, sub_receiver_role, ",
        "sub_receiver_role_name, sub_receiver_account, ",
        "sub_receiver_name, sub_receiver_ratio, ",
        "sub_receiver_object_id, sub_receiver_object_name, ",
        "`status`, op_user_id, ",
        "op_user_name, create_time, ",
        "update_time, ext_1, ",
        "ext_2, ext_3)",
        "values (#{companyId,jdbcType=BIGINT}, #{companyName,jdbcType=VARCHAR}, ",
        "#{platformType,jdbcType=INTEGER}, #{platformTypeName,jdbcType=VARCHAR}, ",
        "#{receiverRole,jdbcType=INTEGER}, #{receiverRoleName,jdbcType=VARCHAR}, ",
        "#{receiverAccount,jdbcType=VARCHAR}, #{receiverName,jdbcType=VARCHAR}, ",
        "#{receiverRatio,jdbcType=DECIMAL}, #{receiverObjectId,jdbcType=BIGINT}, ",
        "#{receiverObjectName,jdbcType=VARCHAR}, #{subReceiverRole,jdbcType=INTEGER}, ",
        "#{subReceiverRoleName,jdbcType=VARCHAR}, #{subReceiverAccount,jdbcType=VARCHAR}, ",
        "#{subReceiverName,jdbcType=VARCHAR}, #{subReceiverRatio,jdbcType=DECIMAL}, ",
        "#{subReceiverObjectId,jdbcType=BIGINT}, #{subReceiverObjectName,jdbcType=VARCHAR}, ",
        "#{status,jdbcType=INTEGER}, #{opUserId,jdbcType=BIGINT}, ",
        "#{opUserName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ",
        "#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ",
        "#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
    })
    @Options(useGeneratedKeys=true,keyProperty="id")
    int insert(BsTradeTakeConfig record);

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

    @SelectProvider(type=BsTradeTakeConfigSqlProvider.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="company_name", property="companyName", jdbcType=JdbcType.VARCHAR),
        @Result(column="platform_type", property="platformType", jdbcType=JdbcType.INTEGER),
        @Result(column="platform_type_name", property="platformTypeName", jdbcType=JdbcType.VARCHAR),
        @Result(column="receiver_role", property="receiverRole", jdbcType=JdbcType.INTEGER),
        @Result(column="receiver_role_name", property="receiverRoleName", jdbcType=JdbcType.VARCHAR),
        @Result(column="receiver_account", property="receiverAccount", jdbcType=JdbcType.VARCHAR),
        @Result(column="receiver_name", property="receiverName", jdbcType=JdbcType.VARCHAR),
        @Result(column="receiver_ratio", property="receiverRatio", jdbcType=JdbcType.DECIMAL),
        @Result(column="receiver_object_id", property="receiverObjectId", jdbcType=JdbcType.BIGINT),
        @Result(column="receiver_object_name", property="receiverObjectName", jdbcType=JdbcType.VARCHAR),
        @Result(column="sub_receiver_role", property="subReceiverRole", jdbcType=JdbcType.INTEGER),
        @Result(column="sub_receiver_role_name", property="subReceiverRoleName", jdbcType=JdbcType.VARCHAR),
        @Result(column="sub_receiver_account", property="subReceiverAccount", jdbcType=JdbcType.VARCHAR),
        @Result(column="sub_receiver_name", property="subReceiverName", jdbcType=JdbcType.VARCHAR),
        @Result(column="sub_receiver_ratio", property="subReceiverRatio", jdbcType=JdbcType.DECIMAL),
        @Result(column="sub_receiver_object_id", property="subReceiverObjectId", jdbcType=JdbcType.BIGINT),
        @Result(column="sub_receiver_object_name", property="subReceiverObjectName", jdbcType=JdbcType.VARCHAR),
        @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
        @Result(column="op_user_id", property="opUserId", jdbcType=JdbcType.BIGINT),
        @Result(column="op_user_name", property="opUserName", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_time", property="updateTime", 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<BsTradeTakeConfig> selectByExample(BsTradeTakeConfigExample example);

    @Select({
        "select",
        "id, company_id, company_name, platform_type, platform_type_name, receiver_role, ",
        "receiver_role_name, receiver_account, receiver_name, receiver_ratio, receiver_object_id, ",
        "receiver_object_name, sub_receiver_role, sub_receiver_role_name, sub_receiver_account, ",
        "sub_receiver_name, sub_receiver_ratio, sub_receiver_object_id, sub_receiver_object_name, ",
        "`status`, op_user_id, op_user_name, create_time, update_time, ext_1, ext_2, ",
        "ext_3",
        "from bs_trade_take_config",
        "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="company_name", property="companyName", jdbcType=JdbcType.VARCHAR),
        @Result(column="platform_type", property="platformType", jdbcType=JdbcType.INTEGER),
        @Result(column="platform_type_name", property="platformTypeName", jdbcType=JdbcType.VARCHAR),
        @Result(column="receiver_role", property="receiverRole", jdbcType=JdbcType.INTEGER),
        @Result(column="receiver_role_name", property="receiverRoleName", jdbcType=JdbcType.VARCHAR),
        @Result(column="receiver_account", property="receiverAccount", jdbcType=JdbcType.VARCHAR),
        @Result(column="receiver_name", property="receiverName", jdbcType=JdbcType.VARCHAR),
        @Result(column="receiver_ratio", property="receiverRatio", jdbcType=JdbcType.DECIMAL),
        @Result(column="receiver_object_id", property="receiverObjectId", jdbcType=JdbcType.BIGINT),
        @Result(column="receiver_object_name", property="receiverObjectName", jdbcType=JdbcType.VARCHAR),
        @Result(column="sub_receiver_role", property="subReceiverRole", jdbcType=JdbcType.INTEGER),
        @Result(column="sub_receiver_role_name", property="subReceiverRoleName", jdbcType=JdbcType.VARCHAR),
        @Result(column="sub_receiver_account", property="subReceiverAccount", jdbcType=JdbcType.VARCHAR),
        @Result(column="sub_receiver_name", property="subReceiverName", jdbcType=JdbcType.VARCHAR),
        @Result(column="sub_receiver_ratio", property="subReceiverRatio", jdbcType=JdbcType.DECIMAL),
        @Result(column="sub_receiver_object_id", property="subReceiverObjectId", jdbcType=JdbcType.BIGINT),
        @Result(column="sub_receiver_object_name", property="subReceiverObjectName", jdbcType=JdbcType.VARCHAR),
        @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
        @Result(column="op_user_id", property="opUserId", jdbcType=JdbcType.BIGINT),
        @Result(column="op_user_name", property="opUserName", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_time", property="updateTime", 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)
    })
    BsTradeTakeConfig selectByPrimaryKey(Long id);

    @UpdateProvider(type=BsTradeTakeConfigSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") BsTradeTakeConfig record, @Param("example") BsTradeTakeConfigExample example);

    @UpdateProvider(type=BsTradeTakeConfigSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") BsTradeTakeConfig record, @Param("example") BsTradeTakeConfigExample example);

    @UpdateProvider(type=BsTradeTakeConfigSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(BsTradeTakeConfig record);

    @Update({
        "update bs_trade_take_config",
        "set company_id = #{companyId,jdbcType=BIGINT},",
          "company_name = #{companyName,jdbcType=VARCHAR},",
          "platform_type = #{platformType,jdbcType=INTEGER},",
          "platform_type_name = #{platformTypeName,jdbcType=VARCHAR},",
          "receiver_role = #{receiverRole,jdbcType=INTEGER},",
          "receiver_role_name = #{receiverRoleName,jdbcType=VARCHAR},",
          "receiver_account = #{receiverAccount,jdbcType=VARCHAR},",
          "receiver_name = #{receiverName,jdbcType=VARCHAR},",
          "receiver_ratio = #{receiverRatio,jdbcType=DECIMAL},",
          "receiver_object_id = #{receiverObjectId,jdbcType=BIGINT},",
          "receiver_object_name = #{receiverObjectName,jdbcType=VARCHAR},",
          "sub_receiver_role = #{subReceiverRole,jdbcType=INTEGER},",
          "sub_receiver_role_name = #{subReceiverRoleName,jdbcType=VARCHAR},",
          "sub_receiver_account = #{subReceiverAccount,jdbcType=VARCHAR},",
          "sub_receiver_name = #{subReceiverName,jdbcType=VARCHAR},",
          "sub_receiver_ratio = #{subReceiverRatio,jdbcType=DECIMAL},",
          "sub_receiver_object_id = #{subReceiverObjectId,jdbcType=BIGINT},",
          "sub_receiver_object_name = #{subReceiverObjectName,jdbcType=VARCHAR},",
          "`status` = #{status,jdbcType=INTEGER},",
          "op_user_id = #{opUserId,jdbcType=BIGINT},",
          "op_user_name = #{opUserName,jdbcType=VARCHAR},",
          "create_time = #{createTime,jdbcType=TIMESTAMP},",
          "update_time = #{updateTime,jdbcType=TIMESTAMP},",
          "ext_1 = #{ext1,jdbcType=VARCHAR},",
          "ext_2 = #{ext2,jdbcType=VARCHAR},",
          "ext_3 = #{ext3,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(BsTradeTakeConfig record);
}