package com.hfkj.dao;

import com.hfkj.entity.BsHltCardRecord;
import com.hfkj.entity.BsHltCardRecordExample;
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 BsHltCardRecordMapper extends BsHltCardRecordMapperExt {
    @SelectProvider(type=BsHltCardRecordSqlProvider.class, method="countByExample")
    long countByExample(BsHltCardRecordExample example);

    @DeleteProvider(type=BsHltCardRecordSqlProvider.class, method="deleteByExample")
    int deleteByExample(BsHltCardRecordExample example);

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

    @Insert({
        "insert into bs_hlt_card_record (order_no, card_no, ",
        "user_phone, pay_order_no, ",
        "pay_serial_no, pay_price, ",
        "pay_status, create_time, ",
        "update_time, pay_time, ",
        "refund_time, exception_status, ",
        "exception_content, ext_1, ",
        "ext_2, ext_3)",
        "values (#{orderNo,jdbcType=VARCHAR}, #{cardNo,jdbcType=VARCHAR}, ",
        "#{userPhone,jdbcType=VARCHAR}, #{payOrderNo,jdbcType=VARCHAR}, ",
        "#{paySerialNo,jdbcType=VARCHAR}, #{payPrice,jdbcType=DECIMAL}, ",
        "#{payStatus,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ",
        "#{updateTime,jdbcType=TIMESTAMP}, #{payTime,jdbcType=TIMESTAMP}, ",
        "#{refundTime,jdbcType=TIMESTAMP}, #{exceptionStatus,jdbcType=BIT}, ",
        "#{exceptionContent,jdbcType=VARCHAR}, #{ext1,jdbcType=VARCHAR}, ",
        "#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
    })
    @Options(useGeneratedKeys=true,keyProperty="id")
    int insert(BsHltCardRecord record);

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

    @SelectProvider(type=BsHltCardRecordSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="card_no", property="cardNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_phone", property="userPhone", jdbcType=JdbcType.VARCHAR),
        @Result(column="pay_order_no", property="payOrderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="pay_serial_no", property="paySerialNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="pay_price", property="payPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="pay_status", property="payStatus", jdbcType=JdbcType.INTEGER),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="pay_time", property="payTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="refund_time", property="refundTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="exception_status", property="exceptionStatus", jdbcType=JdbcType.BIT),
        @Result(column="exception_content", property="exceptionContent", jdbcType=JdbcType.VARCHAR),
        @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<BsHltCardRecord> selectByExample(BsHltCardRecordExample example);

    @Select({
        "select",
        "id, order_no, card_no, user_phone, pay_order_no, pay_serial_no, pay_price, pay_status, ",
        "create_time, update_time, pay_time, refund_time, exception_status, exception_content, ",
        "ext_1, ext_2, ext_3",
        "from bs_hlt_card_record",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="card_no", property="cardNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_phone", property="userPhone", jdbcType=JdbcType.VARCHAR),
        @Result(column="pay_order_no", property="payOrderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="pay_serial_no", property="paySerialNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="pay_price", property="payPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="pay_status", property="payStatus", jdbcType=JdbcType.INTEGER),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="pay_time", property="payTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="refund_time", property="refundTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="exception_status", property="exceptionStatus", jdbcType=JdbcType.BIT),
        @Result(column="exception_content", property="exceptionContent", jdbcType=JdbcType.VARCHAR),
        @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)
    })
    BsHltCardRecord selectByPrimaryKey(Long id);

    @UpdateProvider(type=BsHltCardRecordSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") BsHltCardRecord record, @Param("example") BsHltCardRecordExample example);

    @UpdateProvider(type=BsHltCardRecordSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") BsHltCardRecord record, @Param("example") BsHltCardRecordExample example);

    @UpdateProvider(type=BsHltCardRecordSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(BsHltCardRecord record);

    @Update({
        "update bs_hlt_card_record",
        "set order_no = #{orderNo,jdbcType=VARCHAR},",
          "card_no = #{cardNo,jdbcType=VARCHAR},",
          "user_phone = #{userPhone,jdbcType=VARCHAR},",
          "pay_order_no = #{payOrderNo,jdbcType=VARCHAR},",
          "pay_serial_no = #{paySerialNo,jdbcType=VARCHAR},",
          "pay_price = #{payPrice,jdbcType=DECIMAL},",
          "pay_status = #{payStatus,jdbcType=INTEGER},",
          "create_time = #{createTime,jdbcType=TIMESTAMP},",
          "update_time = #{updateTime,jdbcType=TIMESTAMP},",
          "pay_time = #{payTime,jdbcType=TIMESTAMP},",
          "refund_time = #{refundTime,jdbcType=TIMESTAMP},",
          "exception_status = #{exceptionStatus,jdbcType=BIT},",
          "exception_content = #{exceptionContent,jdbcType=VARCHAR},",
          "ext_1 = #{ext1,jdbcType=VARCHAR},",
          "ext_2 = #{ext2,jdbcType=VARCHAR},",
          "ext_3 = #{ext3,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(BsHltCardRecord record);
}