package com.hai.dao;

import com.hai.entity.OutRechargeOrder;
import com.hai.entity.OutRechargeOrderExample;
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 OutRechargeOrderMapper extends OutRechargeOrderMapperExt {
    @SelectProvider(type=OutRechargeOrderSqlProvider.class, method="countByExample")
    long countByExample(OutRechargeOrderExample example);

    @DeleteProvider(type=OutRechargeOrderSqlProvider.class, method="deleteByExample")
    int deleteByExample(OutRechargeOrderExample example);

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

    @Insert({
        "insert into out_recharge_order (order_no, mem_discount_id, ",
        "mem_discount_name, user_id, ",
        "user_name, user_phone, ",
        "recharge_model, pay_type, ",
        "pay_price, order_price, ",
        "recharge_type, pay_real_price, ",
        "pay_serial_no, deduction_price, ",
        "`status`, recharge_content, ",
        "recharge_name, recharge_status, ",
        "id_card, create_timed, ",
        "pay_time, cancel_time, ",
        "finish_time, remarks, ",
        "out_refund_no, refund_time, ",
        "refund_id, refund_fee, ",
        "agent_key, object_id, ",
        "Identification_code, abnormal_msg)",
        "values (#{orderNo,jdbcType=VARCHAR}, #{memDiscountId,jdbcType=BIGINT}, ",
        "#{memDiscountName,jdbcType=VARCHAR}, #{userId,jdbcType=BIGINT}, ",
        "#{userName,jdbcType=VARCHAR}, #{userPhone,jdbcType=VARCHAR}, ",
        "#{rechargeModel,jdbcType=INTEGER}, #{payType,jdbcType=INTEGER}, ",
        "#{payPrice,jdbcType=DECIMAL}, #{orderPrice,jdbcType=DECIMAL}, ",
        "#{rechargeType,jdbcType=INTEGER}, #{payRealPrice,jdbcType=DECIMAL}, ",
        "#{paySerialNo,jdbcType=VARCHAR}, #{deductionPrice,jdbcType=DECIMAL}, ",
        "#{status,jdbcType=INTEGER}, #{rechargeContent,jdbcType=VARCHAR}, ",
        "#{rechargeName,jdbcType=VARCHAR}, #{rechargeStatus,jdbcType=INTEGER}, ",
        "#{idCard,jdbcType=VARCHAR}, #{createTimed,jdbcType=TIMESTAMP}, ",
        "#{payTime,jdbcType=TIMESTAMP}, #{cancelTime,jdbcType=TIMESTAMP}, ",
        "#{finishTime,jdbcType=TIMESTAMP}, #{remarks,jdbcType=VARCHAR}, ",
        "#{outRefundNo,jdbcType=VARCHAR}, #{refundTime,jdbcType=TIMESTAMP}, ",
        "#{refundId,jdbcType=VARCHAR}, #{refundFee,jdbcType=DECIMAL}, ",
        "#{agentKey,jdbcType=VARCHAR}, #{objectId,jdbcType=INTEGER}, ",
        "#{identificationCode,jdbcType=BIGINT}, #{abnormalMsg,jdbcType=VARCHAR})"
    })
    @Options(useGeneratedKeys=true,keyProperty="id")
    int insert(OutRechargeOrder record);

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

    @SelectProvider(type=OutRechargeOrderSqlProvider.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="mem_discount_id", property="memDiscountId", jdbcType=JdbcType.BIGINT),
        @Result(column="mem_discount_name", property="memDiscountName", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT),
        @Result(column="user_name", property="userName", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_phone", property="userPhone", jdbcType=JdbcType.VARCHAR),
        @Result(column="recharge_model", property="rechargeModel", jdbcType=JdbcType.INTEGER),
        @Result(column="pay_type", property="payType", jdbcType=JdbcType.INTEGER),
        @Result(column="pay_price", property="payPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="order_price", property="orderPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="recharge_type", property="rechargeType", jdbcType=JdbcType.INTEGER),
        @Result(column="pay_real_price", property="payRealPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="pay_serial_no", property="paySerialNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="deduction_price", property="deductionPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
        @Result(column="recharge_content", property="rechargeContent", jdbcType=JdbcType.VARCHAR),
        @Result(column="recharge_name", property="rechargeName", jdbcType=JdbcType.VARCHAR),
        @Result(column="recharge_status", property="rechargeStatus", jdbcType=JdbcType.INTEGER),
        @Result(column="id_card", property="idCard", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_timed", property="createTimed", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="pay_time", property="payTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="cancel_time", property="cancelTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="finish_time", property="finishTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="remarks", property="remarks", jdbcType=JdbcType.VARCHAR),
        @Result(column="out_refund_no", property="outRefundNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="refund_time", property="refundTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="refund_id", property="refundId", jdbcType=JdbcType.VARCHAR),
        @Result(column="refund_fee", property="refundFee", jdbcType=JdbcType.DECIMAL),
        @Result(column="agent_key", property="agentKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="object_id", property="objectId", jdbcType=JdbcType.INTEGER),
        @Result(column="Identification_code", property="identificationCode", jdbcType=JdbcType.BIGINT),
        @Result(column="abnormal_msg", property="abnormalMsg", jdbcType=JdbcType.VARCHAR)
    })
    List<OutRechargeOrder> selectByExample(OutRechargeOrderExample example);

    @Select({
        "select",
        "id, order_no, mem_discount_id, mem_discount_name, user_id, user_name, user_phone, ",
        "recharge_model, pay_type, pay_price, order_price, recharge_type, pay_real_price, ",
        "pay_serial_no, deduction_price, `status`, recharge_content, recharge_name, recharge_status, ",
        "id_card, create_timed, pay_time, cancel_time, finish_time, remarks, out_refund_no, ",
        "refund_time, refund_id, refund_fee, agent_key, object_id, Identification_code, ",
        "abnormal_msg",
        "from out_recharge_order",
        "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="mem_discount_id", property="memDiscountId", jdbcType=JdbcType.BIGINT),
        @Result(column="mem_discount_name", property="memDiscountName", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT),
        @Result(column="user_name", property="userName", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_phone", property="userPhone", jdbcType=JdbcType.VARCHAR),
        @Result(column="recharge_model", property="rechargeModel", jdbcType=JdbcType.INTEGER),
        @Result(column="pay_type", property="payType", jdbcType=JdbcType.INTEGER),
        @Result(column="pay_price", property="payPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="order_price", property="orderPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="recharge_type", property="rechargeType", jdbcType=JdbcType.INTEGER),
        @Result(column="pay_real_price", property="payRealPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="pay_serial_no", property="paySerialNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="deduction_price", property="deductionPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
        @Result(column="recharge_content", property="rechargeContent", jdbcType=JdbcType.VARCHAR),
        @Result(column="recharge_name", property="rechargeName", jdbcType=JdbcType.VARCHAR),
        @Result(column="recharge_status", property="rechargeStatus", jdbcType=JdbcType.INTEGER),
        @Result(column="id_card", property="idCard", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_timed", property="createTimed", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="pay_time", property="payTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="cancel_time", property="cancelTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="finish_time", property="finishTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="remarks", property="remarks", jdbcType=JdbcType.VARCHAR),
        @Result(column="out_refund_no", property="outRefundNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="refund_time", property="refundTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="refund_id", property="refundId", jdbcType=JdbcType.VARCHAR),
        @Result(column="refund_fee", property="refundFee", jdbcType=JdbcType.DECIMAL),
        @Result(column="agent_key", property="agentKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="object_id", property="objectId", jdbcType=JdbcType.INTEGER),
        @Result(column="Identification_code", property="identificationCode", jdbcType=JdbcType.BIGINT),
        @Result(column="abnormal_msg", property="abnormalMsg", jdbcType=JdbcType.VARCHAR)
    })
    OutRechargeOrder selectByPrimaryKey(Long id);

    @UpdateProvider(type=OutRechargeOrderSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") OutRechargeOrder record, @Param("example") OutRechargeOrderExample example);

    @UpdateProvider(type=OutRechargeOrderSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") OutRechargeOrder record, @Param("example") OutRechargeOrderExample example);

    @UpdateProvider(type=OutRechargeOrderSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(OutRechargeOrder record);

    @Update({
        "update out_recharge_order",
        "set order_no = #{orderNo,jdbcType=VARCHAR},",
          "mem_discount_id = #{memDiscountId,jdbcType=BIGINT},",
          "mem_discount_name = #{memDiscountName,jdbcType=VARCHAR},",
          "user_id = #{userId,jdbcType=BIGINT},",
          "user_name = #{userName,jdbcType=VARCHAR},",
          "user_phone = #{userPhone,jdbcType=VARCHAR},",
          "recharge_model = #{rechargeModel,jdbcType=INTEGER},",
          "pay_type = #{payType,jdbcType=INTEGER},",
          "pay_price = #{payPrice,jdbcType=DECIMAL},",
          "order_price = #{orderPrice,jdbcType=DECIMAL},",
          "recharge_type = #{rechargeType,jdbcType=INTEGER},",
          "pay_real_price = #{payRealPrice,jdbcType=DECIMAL},",
          "pay_serial_no = #{paySerialNo,jdbcType=VARCHAR},",
          "deduction_price = #{deductionPrice,jdbcType=DECIMAL},",
          "`status` = #{status,jdbcType=INTEGER},",
          "recharge_content = #{rechargeContent,jdbcType=VARCHAR},",
          "recharge_name = #{rechargeName,jdbcType=VARCHAR},",
          "recharge_status = #{rechargeStatus,jdbcType=INTEGER},",
          "id_card = #{idCard,jdbcType=VARCHAR},",
          "create_timed = #{createTimed,jdbcType=TIMESTAMP},",
          "pay_time = #{payTime,jdbcType=TIMESTAMP},",
          "cancel_time = #{cancelTime,jdbcType=TIMESTAMP},",
          "finish_time = #{finishTime,jdbcType=TIMESTAMP},",
          "remarks = #{remarks,jdbcType=VARCHAR},",
          "out_refund_no = #{outRefundNo,jdbcType=VARCHAR},",
          "refund_time = #{refundTime,jdbcType=TIMESTAMP},",
          "refund_id = #{refundId,jdbcType=VARCHAR},",
          "refund_fee = #{refundFee,jdbcType=DECIMAL},",
          "agent_key = #{agentKey,jdbcType=VARCHAR},",
          "object_id = #{objectId,jdbcType=INTEGER},",
          "Identification_code = #{identificationCode,jdbcType=BIGINT},",
          "abnormal_msg = #{abnormalMsg,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(OutRechargeOrder record);
}