package com.hai.dao;

import com.hai.entity.HighProfitSharingRecord;
import com.hai.entity.HighProfitSharingRecordExample;
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 HighProfitSharingRecordMapper extends HighProfitSharingRecordMapperExt {
    @SelectProvider(type=HighProfitSharingRecordSqlProvider.class, method="countByExample")
    long countByExample(HighProfitSharingRecordExample example);

    @DeleteProvider(type=HighProfitSharingRecordSqlProvider.class, method="deleteByExample")
    int deleteByExample(HighProfitSharingRecordExample example);

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

    @Insert({
        "insert into high_profit_sharing_record (transaction_id, out_order_no, ",
        "order_id, price, ",
        "content, create_time, ",
        "`status`)",
        "values (#{transactionId,jdbcType=VARCHAR}, #{outOrderNo,jdbcType=VARCHAR}, ",
        "#{orderId,jdbcType=VARCHAR}, #{price,jdbcType=DECIMAL}, ",
        "#{content,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ",
        "#{status,jdbcType=VARCHAR})"
    })
    @Options(useGeneratedKeys=true,keyProperty="id")
    int insert(HighProfitSharingRecord record);

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

    @SelectProvider(type=HighProfitSharingRecordSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="transaction_id", property="transactionId", jdbcType=JdbcType.VARCHAR),
        @Result(column="out_order_no", property="outOrderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="order_id", property="orderId", jdbcType=JdbcType.VARCHAR),
        @Result(column="price", property="price", jdbcType=JdbcType.DECIMAL),
        @Result(column="content", property="content", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="status", property="status", jdbcType=JdbcType.VARCHAR)
    })
    List<HighProfitSharingRecord> selectByExample(HighProfitSharingRecordExample example);

    @Select({
        "select",
        "id, transaction_id, out_order_no, order_id, price, content, create_time, `status`",
        "from high_profit_sharing_record",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="transaction_id", property="transactionId", jdbcType=JdbcType.VARCHAR),
        @Result(column="out_order_no", property="outOrderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="order_id", property="orderId", jdbcType=JdbcType.VARCHAR),
        @Result(column="price", property="price", jdbcType=JdbcType.DECIMAL),
        @Result(column="content", property="content", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="status", property="status", jdbcType=JdbcType.VARCHAR)
    })
    HighProfitSharingRecord selectByPrimaryKey(Long id);

    @UpdateProvider(type=HighProfitSharingRecordSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") HighProfitSharingRecord record, @Param("example") HighProfitSharingRecordExample example);

    @UpdateProvider(type=HighProfitSharingRecordSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") HighProfitSharingRecord record, @Param("example") HighProfitSharingRecordExample example);

    @UpdateProvider(type=HighProfitSharingRecordSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(HighProfitSharingRecord record);

    @Update({
        "update high_profit_sharing_record",
        "set transaction_id = #{transactionId,jdbcType=VARCHAR},",
          "out_order_no = #{outOrderNo,jdbcType=VARCHAR},",
          "order_id = #{orderId,jdbcType=VARCHAR},",
          "price = #{price,jdbcType=DECIMAL},",
          "content = #{content,jdbcType=VARCHAR},",
          "create_time = #{createTime,jdbcType=TIMESTAMP},",
          "`status` = #{status,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(HighProfitSharingRecord record);
}