package com.hfkj.dao;

import com.hfkj.entity.BsDeviceOrderRefund;
import com.hfkj.entity.BsDeviceOrderRefundExample;
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 BsDeviceOrderRefundMapper extends BsDeviceOrderRefundMapperExt {
    @SelectProvider(type=BsDeviceOrderRefundSqlProvider.class, method="countByExample")
    long countByExample(BsDeviceOrderRefundExample example);

    @DeleteProvider(type=BsDeviceOrderRefundSqlProvider.class, method="deleteByExample")
    int deleteByExample(BsDeviceOrderRefundExample example);

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

    @Insert({
        "insert into bs_device_order_refund (refund_order_no, order_id, ",
        "order_no, order_type, ",
        "order_assign_id, device_id, ",
        "deivce_no, refund_price, ",
        "create_time, refund_time, ",
        "`status`, company_id, ",
        "company_name, agent_id, ",
        "agent_name, salesman_id, ",
        "salesman_name, mer_id, ",
        "mer_name, store_id, ",
        "store_name, ext_1, ",
        "ext_2, ext_3)",
        "values (#{refundOrderNo,jdbcType=VARCHAR}, #{orderId,jdbcType=BIGINT}, ",
        "#{orderNo,jdbcType=VARCHAR}, #{orderType,jdbcType=INTEGER}, ",
        "#{orderAssignId,jdbcType=BIGINT}, #{deviceId,jdbcType=BIGINT}, ",
        "#{deivceNo,jdbcType=VARCHAR}, #{refundPrice,jdbcType=DECIMAL}, ",
        "#{createTime,jdbcType=TIMESTAMP}, #{refundTime,jdbcType=TIMESTAMP}, ",
        "#{status,jdbcType=INTEGER}, #{companyId,jdbcType=BIGINT}, ",
        "#{companyName,jdbcType=VARCHAR}, #{agentId,jdbcType=BIGINT}, ",
        "#{agentName,jdbcType=VARCHAR}, #{salesmanId,jdbcType=BIGINT}, ",
        "#{salesmanName,jdbcType=VARCHAR}, #{merId,jdbcType=BIGINT}, ",
        "#{merName,jdbcType=VARCHAR}, #{storeId,jdbcType=BIGINT}, ",
        "#{storeName,jdbcType=VARCHAR}, #{ext1,jdbcType=VARCHAR}, ",
        "#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
    })
    @Options(useGeneratedKeys=true,keyProperty="id")
    int insert(BsDeviceOrderRefund record);

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

    @SelectProvider(type=BsDeviceOrderRefundSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="refund_order_no", property="refundOrderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="order_id", property="orderId", jdbcType=JdbcType.BIGINT),
        @Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="order_type", property="orderType", jdbcType=JdbcType.INTEGER),
        @Result(column="order_assign_id", property="orderAssignId", jdbcType=JdbcType.BIGINT),
        @Result(column="device_id", property="deviceId", jdbcType=JdbcType.BIGINT),
        @Result(column="deivce_no", property="deivceNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="refund_price", property="refundPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="refund_time", property="refundTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
        @Result(column="company_id", property="companyId", jdbcType=JdbcType.BIGINT),
        @Result(column="company_name", property="companyName", jdbcType=JdbcType.VARCHAR),
        @Result(column="agent_id", property="agentId", jdbcType=JdbcType.BIGINT),
        @Result(column="agent_name", property="agentName", jdbcType=JdbcType.VARCHAR),
        @Result(column="salesman_id", property="salesmanId", jdbcType=JdbcType.BIGINT),
        @Result(column="salesman_name", property="salesmanName", jdbcType=JdbcType.VARCHAR),
        @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT),
        @Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR),
        @Result(column="store_id", property="storeId", jdbcType=JdbcType.BIGINT),
        @Result(column="store_name", property="storeName", 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<BsDeviceOrderRefund> selectByExample(BsDeviceOrderRefundExample example);

    @Select({
        "select",
        "id, refund_order_no, order_id, order_no, order_type, order_assign_id, device_id, ",
        "deivce_no, refund_price, create_time, refund_time, `status`, company_id, company_name, ",
        "agent_id, agent_name, salesman_id, salesman_name, mer_id, mer_name, store_id, ",
        "store_name, ext_1, ext_2, ext_3",
        "from bs_device_order_refund",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="refund_order_no", property="refundOrderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="order_id", property="orderId", jdbcType=JdbcType.BIGINT),
        @Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="order_type", property="orderType", jdbcType=JdbcType.INTEGER),
        @Result(column="order_assign_id", property="orderAssignId", jdbcType=JdbcType.BIGINT),
        @Result(column="device_id", property="deviceId", jdbcType=JdbcType.BIGINT),
        @Result(column="deivce_no", property="deivceNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="refund_price", property="refundPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="refund_time", property="refundTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
        @Result(column="company_id", property="companyId", jdbcType=JdbcType.BIGINT),
        @Result(column="company_name", property="companyName", jdbcType=JdbcType.VARCHAR),
        @Result(column="agent_id", property="agentId", jdbcType=JdbcType.BIGINT),
        @Result(column="agent_name", property="agentName", jdbcType=JdbcType.VARCHAR),
        @Result(column="salesman_id", property="salesmanId", jdbcType=JdbcType.BIGINT),
        @Result(column="salesman_name", property="salesmanName", jdbcType=JdbcType.VARCHAR),
        @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT),
        @Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR),
        @Result(column="store_id", property="storeId", jdbcType=JdbcType.BIGINT),
        @Result(column="store_name", property="storeName", 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)
    })
    BsDeviceOrderRefund selectByPrimaryKey(Long id);

    @UpdateProvider(type=BsDeviceOrderRefundSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") BsDeviceOrderRefund record, @Param("example") BsDeviceOrderRefundExample example);

    @UpdateProvider(type=BsDeviceOrderRefundSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") BsDeviceOrderRefund record, @Param("example") BsDeviceOrderRefundExample example);

    @UpdateProvider(type=BsDeviceOrderRefundSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(BsDeviceOrderRefund record);

    @Update({
        "update bs_device_order_refund",
        "set refund_order_no = #{refundOrderNo,jdbcType=VARCHAR},",
          "order_id = #{orderId,jdbcType=BIGINT},",
          "order_no = #{orderNo,jdbcType=VARCHAR},",
          "order_type = #{orderType,jdbcType=INTEGER},",
          "order_assign_id = #{orderAssignId,jdbcType=BIGINT},",
          "device_id = #{deviceId,jdbcType=BIGINT},",
          "deivce_no = #{deivceNo,jdbcType=VARCHAR},",
          "refund_price = #{refundPrice,jdbcType=DECIMAL},",
          "create_time = #{createTime,jdbcType=TIMESTAMP},",
          "refund_time = #{refundTime,jdbcType=TIMESTAMP},",
          "`status` = #{status,jdbcType=INTEGER},",
          "company_id = #{companyId,jdbcType=BIGINT},",
          "company_name = #{companyName,jdbcType=VARCHAR},",
          "agent_id = #{agentId,jdbcType=BIGINT},",
          "agent_name = #{agentName,jdbcType=VARCHAR},",
          "salesman_id = #{salesmanId,jdbcType=BIGINT},",
          "salesman_name = #{salesmanName,jdbcType=VARCHAR},",
          "mer_id = #{merId,jdbcType=BIGINT},",
          "mer_name = #{merName,jdbcType=VARCHAR},",
          "store_id = #{storeId,jdbcType=BIGINT},",
          "store_name = #{storeName,jdbcType=VARCHAR},",
          "ext_1 = #{ext1,jdbcType=VARCHAR},",
          "ext_2 = #{ext2,jdbcType=VARCHAR},",
          "ext_3 = #{ext3,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(BsDeviceOrderRefund record);
}