package com.hai.dao;

import com.hai.entity.HighRefundAudit;
import com.hai.entity.HighRefundAuditExample;
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 HighRefundAuditMapper extends HighRefundAuditMapperExt {
    @SelectProvider(type=HighRefundAuditSqlProvider.class, method="countByExample")
    long countByExample(HighRefundAuditExample example);

    @DeleteProvider(type=HighRefundAuditSqlProvider.class, method="deleteByExample")
    int deleteByExample(HighRefundAuditExample example);

    @Delete({
        "delete from high_refund_audit",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    @Insert({
        "insert into high_refund_audit (refund_source, refund_price, ",
        "pay_type, source_order_no, ",
        "pay_time, created_user_id, ",
        "created_time, created_user_name, ",
        "updated_user_id, updated_user_name, ",
        "updated_time, remark, ",
        "`status`, compan_id, ",
        "ext_1, ext_2, ext_3)",
        "values (#{refundSource,jdbcType=INTEGER}, #{refundPrice,jdbcType=DECIMAL}, ",
        "#{payType,jdbcType=INTEGER}, #{sourceOrderNo,jdbcType=VARCHAR}, ",
        "#{payTime,jdbcType=TIMESTAMP}, #{createdUserId,jdbcType=INTEGER}, ",
        "#{createdTime,jdbcType=TIMESTAMP}, #{createdUserName,jdbcType=VARCHAR}, ",
        "#{updatedUserId,jdbcType=INTEGER}, #{updatedUserName,jdbcType=VARCHAR}, ",
        "#{updatedTime,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR}, ",
        "#{status,jdbcType=INTEGER}, #{companId,jdbcType=INTEGER}, ",
        "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
    })
    @Options(useGeneratedKeys=true,keyProperty="id")
    int insert(HighRefundAudit record);

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

    @SelectProvider(type=HighRefundAuditSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="refund_source", property="refundSource", jdbcType=JdbcType.INTEGER),
        @Result(column="refund_price", property="refundPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="pay_type", property="payType", jdbcType=JdbcType.INTEGER),
        @Result(column="source_order_no", property="sourceOrderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="pay_time", property="payTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="created_user_id", property="createdUserId", jdbcType=JdbcType.INTEGER),
        @Result(column="created_time", property="createdTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="created_user_name", property="createdUserName", jdbcType=JdbcType.VARCHAR),
        @Result(column="updated_user_id", property="updatedUserId", jdbcType=JdbcType.INTEGER),
        @Result(column="updated_user_name", property="updatedUserName", jdbcType=JdbcType.VARCHAR),
        @Result(column="updated_time", property="updatedTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="remark", property="remark", jdbcType=JdbcType.VARCHAR),
        @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
        @Result(column="compan_id", property="companId", jdbcType=JdbcType.INTEGER),
        @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<HighRefundAudit> selectByExample(HighRefundAuditExample example);

    @Select({
        "select",
        "id, refund_source, refund_price, pay_type, source_order_no, pay_time, created_user_id, ",
        "created_time, created_user_name, updated_user_id, updated_user_name, updated_time, ",
        "remark, `status`, compan_id, ext_1, ext_2, ext_3",
        "from high_refund_audit",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="refund_source", property="refundSource", jdbcType=JdbcType.INTEGER),
        @Result(column="refund_price", property="refundPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="pay_type", property="payType", jdbcType=JdbcType.INTEGER),
        @Result(column="source_order_no", property="sourceOrderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="pay_time", property="payTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="created_user_id", property="createdUserId", jdbcType=JdbcType.INTEGER),
        @Result(column="created_time", property="createdTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="created_user_name", property="createdUserName", jdbcType=JdbcType.VARCHAR),
        @Result(column="updated_user_id", property="updatedUserId", jdbcType=JdbcType.INTEGER),
        @Result(column="updated_user_name", property="updatedUserName", jdbcType=JdbcType.VARCHAR),
        @Result(column="updated_time", property="updatedTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="remark", property="remark", jdbcType=JdbcType.VARCHAR),
        @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
        @Result(column="compan_id", property="companId", jdbcType=JdbcType.INTEGER),
        @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)
    })
    HighRefundAudit selectByPrimaryKey(Integer id);

    @UpdateProvider(type=HighRefundAuditSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") HighRefundAudit record, @Param("example") HighRefundAuditExample example);

    @UpdateProvider(type=HighRefundAuditSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") HighRefundAudit record, @Param("example") HighRefundAuditExample example);

    @UpdateProvider(type=HighRefundAuditSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(HighRefundAudit record);

    @Update({
        "update high_refund_audit",
        "set refund_source = #{refundSource,jdbcType=INTEGER},",
          "refund_price = #{refundPrice,jdbcType=DECIMAL},",
          "pay_type = #{payType,jdbcType=INTEGER},",
          "source_order_no = #{sourceOrderNo,jdbcType=VARCHAR},",
          "pay_time = #{payTime,jdbcType=TIMESTAMP},",
          "created_user_id = #{createdUserId,jdbcType=INTEGER},",
          "created_time = #{createdTime,jdbcType=TIMESTAMP},",
          "created_user_name = #{createdUserName,jdbcType=VARCHAR},",
          "updated_user_id = #{updatedUserId,jdbcType=INTEGER},",
          "updated_user_name = #{updatedUserName,jdbcType=VARCHAR},",
          "updated_time = #{updatedTime,jdbcType=TIMESTAMP},",
          "remark = #{remark,jdbcType=VARCHAR},",
          "`status` = #{status,jdbcType=INTEGER},",
          "compan_id = #{companId,jdbcType=INTEGER},",
          "ext_1 = #{ext1,jdbcType=VARCHAR},",
          "ext_2 = #{ext2,jdbcType=VARCHAR},",
          "ext_3 = #{ext3,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(HighRefundAudit record);
}