package com.hai.dao;

import com.hai.entity.HighPayRecord;
import com.hai.entity.HighPayRecordExample;
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 HighPayRecordMapper extends HighPayRecordMapperExt {
    @SelectProvider(type=HighPayRecordSqlProvider.class, method="countByExample")
    long countByExample(HighPayRecordExample example);

    @DeleteProvider(type=HighPayRecordSqlProvider.class, method="deleteByExample")
    int deleteByExample(HighPayRecordExample example);

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

    @Insert({
        "insert into high_pay_record (pay_serial_no, res_type, ",
        "pay_type, pay_money, ",
        "pay_time, body_info, ",
        "pay_result, fail_code, ",
        "fail_reason, create_time, ",
        "ext_1, ext_2, ext_3)",
        "values (#{paySerialNo,jdbcType=VARCHAR}, #{resType,jdbcType=INTEGER}, ",
        "#{payType,jdbcType=INTEGER}, #{payMoney,jdbcType=DECIMAL}, ",
        "#{payTime,jdbcType=TIMESTAMP}, #{bodyInfo,jdbcType=VARCHAR}, ",
        "#{payResult,jdbcType=VARCHAR}, #{failCode,jdbcType=VARCHAR}, ",
        "#{failReason,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}, ",
        "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
    })
    @Options(useGeneratedKeys=true,keyProperty="id")
    int insert(HighPayRecord record);

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

    @SelectProvider(type=HighPayRecordSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="pay_serial_no", property="paySerialNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="res_type", property="resType", jdbcType=JdbcType.INTEGER),
        @Result(column="pay_type", property="payType", jdbcType=JdbcType.INTEGER),
        @Result(column="pay_money", property="payMoney", jdbcType=JdbcType.DECIMAL),
        @Result(column="pay_time", property="payTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="body_info", property="bodyInfo", jdbcType=JdbcType.VARCHAR),
        @Result(column="pay_result", property="payResult", jdbcType=JdbcType.VARCHAR),
        @Result(column="fail_code", property="failCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="fail_reason", property="failReason", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="create_time", property="createTime", 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<HighPayRecord> selectByExample(HighPayRecordExample example);

    @Select({
        "select",
        "id, pay_serial_no, res_type, pay_type, pay_money, pay_time, body_info, pay_result, ",
        "fail_code, fail_reason, create_time, ext_1, ext_2, ext_3",
        "from high_pay_record",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="pay_serial_no", property="paySerialNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="res_type", property="resType", jdbcType=JdbcType.INTEGER),
        @Result(column="pay_type", property="payType", jdbcType=JdbcType.INTEGER),
        @Result(column="pay_money", property="payMoney", jdbcType=JdbcType.DECIMAL),
        @Result(column="pay_time", property="payTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="body_info", property="bodyInfo", jdbcType=JdbcType.VARCHAR),
        @Result(column="pay_result", property="payResult", jdbcType=JdbcType.VARCHAR),
        @Result(column="fail_code", property="failCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="fail_reason", property="failReason", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="create_time", property="createTime", 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)
    })
    HighPayRecord selectByPrimaryKey(Long id);

    @UpdateProvider(type=HighPayRecordSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") HighPayRecord record, @Param("example") HighPayRecordExample example);

    @UpdateProvider(type=HighPayRecordSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") HighPayRecord record, @Param("example") HighPayRecordExample example);

    @UpdateProvider(type=HighPayRecordSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(HighPayRecord record);

    @Update({
        "update high_pay_record",
        "set pay_serial_no = #{paySerialNo,jdbcType=VARCHAR},",
          "res_type = #{resType,jdbcType=INTEGER},",
          "pay_type = #{payType,jdbcType=INTEGER},",
          "pay_money = #{payMoney,jdbcType=DECIMAL},",
          "pay_time = #{payTime,jdbcType=TIMESTAMP},",
          "body_info = #{bodyInfo,jdbcType=VARCHAR},",
          "pay_result = #{payResult,jdbcType=VARCHAR},",
          "fail_code = #{failCode,jdbcType=VARCHAR},",
          "fail_reason = #{failReason,jdbcType=TIMESTAMP},",
          "create_time = #{createTime,jdbcType=TIMESTAMP},",
          "ext_1 = #{ext1,jdbcType=VARCHAR},",
          "ext_2 = #{ext2,jdbcType=VARCHAR},",
          "ext_3 = #{ext3,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(HighPayRecord record);
}