package com.hfkj.dao;

import com.hfkj.entity.BsGasOrderAudit;
import com.hfkj.entity.BsGasOrderAuditExample;
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 BsGasOrderAuditMapper extends BsGasOrderAuditMapperExt {
    @SelectProvider(type=BsGasOrderAuditSqlProvider.class, method="countByExample")
    long countByExample(BsGasOrderAuditExample example);

    @DeleteProvider(type=BsGasOrderAuditSqlProvider.class, method="deleteByExample")
    int deleteByExample(BsGasOrderAuditExample example);

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

    @Insert({
        "insert into bs_gas_order_audit (audit_type, audit_no, ",
        "order_no, channel_type, ",
        "channel_order_no, agent_id, ",
        "agent_name, user_phone, ",
        "mer_id, mer_no, mer_name, ",
        "gas_refuel_price, gas_oil_no, ",
        "gas_gun_no, gas_pay_time, ",
        "remark, `status`, ",
        "reject_remark, create_time, ",
        "update_time, ext_1, ",
        "ext_2, ext_3)",
        "values (#{auditType,jdbcType=INTEGER}, #{auditNo,jdbcType=VARCHAR}, ",
        "#{orderNo,jdbcType=VARCHAR}, #{channelType,jdbcType=INTEGER}, ",
        "#{channelOrderNo,jdbcType=VARCHAR}, #{agentId,jdbcType=BIGINT}, ",
        "#{agentName,jdbcType=VARCHAR}, #{userPhone,jdbcType=VARCHAR}, ",
        "#{merId,jdbcType=BIGINT}, #{merNo,jdbcType=VARCHAR}, #{merName,jdbcType=VARCHAR}, ",
        "#{gasRefuelPrice,jdbcType=DECIMAL}, #{gasOilNo,jdbcType=VARCHAR}, ",
        "#{gasGunNo,jdbcType=VARCHAR}, #{gasPayTime,jdbcType=TIMESTAMP}, ",
        "#{remark,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ",
        "#{rejectRemark,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ",
        "#{updateTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ",
        "#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
    })
    @Options(useGeneratedKeys=true,keyProperty="id")
    int insert(BsGasOrderAudit record);

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

    @SelectProvider(type=BsGasOrderAuditSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="audit_type", property="auditType", jdbcType=JdbcType.INTEGER),
        @Result(column="audit_no", property="auditNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="channel_type", property="channelType", jdbcType=JdbcType.INTEGER),
        @Result(column="channel_order_no", property="channelOrderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="agent_id", property="agentId", jdbcType=JdbcType.BIGINT),
        @Result(column="agent_name", property="agentName", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_phone", property="userPhone", jdbcType=JdbcType.VARCHAR),
        @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT),
        @Result(column="mer_no", property="merNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR),
        @Result(column="gas_refuel_price", property="gasRefuelPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="gas_oil_no", property="gasOilNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="gas_gun_no", property="gasGunNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="gas_pay_time", property="gasPayTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="remark", property="remark", jdbcType=JdbcType.VARCHAR),
        @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
        @Result(column="reject_remark", property="rejectRemark", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_time", property="updateTime", 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<BsGasOrderAudit> selectByExample(BsGasOrderAuditExample example);

    @Select({
        "select",
        "id, audit_type, audit_no, order_no, channel_type, channel_order_no, agent_id, ",
        "agent_name, user_phone, mer_id, mer_no, mer_name, gas_refuel_price, gas_oil_no, ",
        "gas_gun_no, gas_pay_time, remark, `status`, reject_remark, create_time, update_time, ",
        "ext_1, ext_2, ext_3",
        "from bs_gas_order_audit",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="audit_type", property="auditType", jdbcType=JdbcType.INTEGER),
        @Result(column="audit_no", property="auditNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="channel_type", property="channelType", jdbcType=JdbcType.INTEGER),
        @Result(column="channel_order_no", property="channelOrderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="agent_id", property="agentId", jdbcType=JdbcType.BIGINT),
        @Result(column="agent_name", property="agentName", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_phone", property="userPhone", jdbcType=JdbcType.VARCHAR),
        @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT),
        @Result(column="mer_no", property="merNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR),
        @Result(column="gas_refuel_price", property="gasRefuelPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="gas_oil_no", property="gasOilNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="gas_gun_no", property="gasGunNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="gas_pay_time", property="gasPayTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="remark", property="remark", jdbcType=JdbcType.VARCHAR),
        @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
        @Result(column="reject_remark", property="rejectRemark", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_time", property="updateTime", 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)
    })
    BsGasOrderAudit selectByPrimaryKey(Long id);

    @UpdateProvider(type=BsGasOrderAuditSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") BsGasOrderAudit record, @Param("example") BsGasOrderAuditExample example);

    @UpdateProvider(type=BsGasOrderAuditSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") BsGasOrderAudit record, @Param("example") BsGasOrderAuditExample example);

    @UpdateProvider(type=BsGasOrderAuditSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(BsGasOrderAudit record);

    @Update({
        "update bs_gas_order_audit",
        "set audit_type = #{auditType,jdbcType=INTEGER},",
          "audit_no = #{auditNo,jdbcType=VARCHAR},",
          "order_no = #{orderNo,jdbcType=VARCHAR},",
          "channel_type = #{channelType,jdbcType=INTEGER},",
          "channel_order_no = #{channelOrderNo,jdbcType=VARCHAR},",
          "agent_id = #{agentId,jdbcType=BIGINT},",
          "agent_name = #{agentName,jdbcType=VARCHAR},",
          "user_phone = #{userPhone,jdbcType=VARCHAR},",
          "mer_id = #{merId,jdbcType=BIGINT},",
          "mer_no = #{merNo,jdbcType=VARCHAR},",
          "mer_name = #{merName,jdbcType=VARCHAR},",
          "gas_refuel_price = #{gasRefuelPrice,jdbcType=DECIMAL},",
          "gas_oil_no = #{gasOilNo,jdbcType=VARCHAR},",
          "gas_gun_no = #{gasGunNo,jdbcType=VARCHAR},",
          "gas_pay_time = #{gasPayTime,jdbcType=TIMESTAMP},",
          "remark = #{remark,jdbcType=VARCHAR},",
          "`status` = #{status,jdbcType=INTEGER},",
          "reject_remark = #{rejectRemark,jdbcType=VARCHAR},",
          "create_time = #{createTime,jdbcType=TIMESTAMP},",
          "update_time = #{updateTime,jdbcType=TIMESTAMP},",
          "ext_1 = #{ext1,jdbcType=VARCHAR},",
          "ext_2 = #{ext2,jdbcType=VARCHAR},",
          "ext_3 = #{ext3,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(BsGasOrderAudit record);
}