package com.hfkj.dao;

import com.hfkj.entity.BsOrderAfterSalesApply;
import com.hfkj.entity.BsOrderAfterSalesApplyExample;
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 BsOrderAfterSalesApplyMapper extends BsOrderAfterSalesApplyMapperExt {
    @SelectProvider(type=BsOrderAfterSalesApplySqlProvider.class, method="countByExample")
    long countByExample(BsOrderAfterSalesApplyExample example);

    @DeleteProvider(type=BsOrderAfterSalesApplySqlProvider.class, method="deleteByExample")
    int deleteByExample(BsOrderAfterSalesApplyExample example);

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

    @Insert({
        "insert into bs_order_after_sales_apply (user_id, user_phone, ",
        "mer_id, apply_no, `type`, ",
        "order_no, child_order_no, ",
        "product_type, product_id, ",
        "product_name, product_img, ",
        "product_spec_id, product_spec_name, ",
        "product_count, photo, ",
        "remarks, send_express_no, ",
        "refund_order_no, refund_price, ",
        "refund_integral, `status`, ",
        "audit_remarks, create_time, ",
        "audit_time, send_express_time, ",
        "finish_time, update_time, ",
        "ext_1, ext_2, ext_3)",
        "values (#{userId,jdbcType=BIGINT}, #{userPhone,jdbcType=VARCHAR}, ",
        "#{merId,jdbcType=BIGINT}, #{applyNo,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, ",
        "#{orderNo,jdbcType=VARCHAR}, #{childOrderNo,jdbcType=VARCHAR}, ",
        "#{productType,jdbcType=INTEGER}, #{productId,jdbcType=BIGINT}, ",
        "#{productName,jdbcType=VARCHAR}, #{productImg,jdbcType=VARCHAR}, ",
        "#{productSpecId,jdbcType=BIGINT}, #{productSpecName,jdbcType=VARCHAR}, ",
        "#{productCount,jdbcType=INTEGER}, #{photo,jdbcType=VARCHAR}, ",
        "#{remarks,jdbcType=VARCHAR}, #{sendExpressNo,jdbcType=VARCHAR}, ",
        "#{refundOrderNo,jdbcType=VARCHAR}, #{refundPrice,jdbcType=DECIMAL}, ",
        "#{refundIntegral,jdbcType=BIGINT}, #{status,jdbcType=INTEGER}, ",
        "#{auditRemarks,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ",
        "#{auditTime,jdbcType=TIMESTAMP}, #{sendExpressTime,jdbcType=TIMESTAMP}, ",
        "#{finishTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ",
        "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
    })
    @Options(useGeneratedKeys=true,keyProperty="id")
    int insert(BsOrderAfterSalesApply record);

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

    @SelectProvider(type=BsOrderAfterSalesApplySqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT),
        @Result(column="user_phone", property="userPhone", jdbcType=JdbcType.VARCHAR),
        @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT),
        @Result(column="apply_no", property="applyNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="type", property="type", jdbcType=JdbcType.INTEGER),
        @Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="child_order_no", property="childOrderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="product_type", property="productType", jdbcType=JdbcType.INTEGER),
        @Result(column="product_id", property="productId", jdbcType=JdbcType.BIGINT),
        @Result(column="product_name", property="productName", jdbcType=JdbcType.VARCHAR),
        @Result(column="product_img", property="productImg", jdbcType=JdbcType.VARCHAR),
        @Result(column="product_spec_id", property="productSpecId", jdbcType=JdbcType.BIGINT),
        @Result(column="product_spec_name", property="productSpecName", jdbcType=JdbcType.VARCHAR),
        @Result(column="product_count", property="productCount", jdbcType=JdbcType.INTEGER),
        @Result(column="photo", property="photo", jdbcType=JdbcType.VARCHAR),
        @Result(column="remarks", property="remarks", jdbcType=JdbcType.VARCHAR),
        @Result(column="send_express_no", property="sendExpressNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="refund_order_no", property="refundOrderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="refund_price", property="refundPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="refund_integral", property="refundIntegral", jdbcType=JdbcType.BIGINT),
        @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
        @Result(column="audit_remarks", property="auditRemarks", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="audit_time", property="auditTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="send_express_time", property="sendExpressTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="finish_time", property="finishTime", 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<BsOrderAfterSalesApply> selectByExample(BsOrderAfterSalesApplyExample example);

    @Select({
        "select",
        "id, user_id, user_phone, mer_id, apply_no, `type`, order_no, child_order_no, ",
        "product_type, product_id, product_name, product_img, product_spec_id, product_spec_name, ",
        "product_count, photo, remarks, send_express_no, refund_order_no, refund_price, ",
        "refund_integral, `status`, audit_remarks, create_time, audit_time, send_express_time, ",
        "finish_time, update_time, ext_1, ext_2, ext_3",
        "from bs_order_after_sales_apply",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT),
        @Result(column="user_phone", property="userPhone", jdbcType=JdbcType.VARCHAR),
        @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT),
        @Result(column="apply_no", property="applyNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="type", property="type", jdbcType=JdbcType.INTEGER),
        @Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="child_order_no", property="childOrderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="product_type", property="productType", jdbcType=JdbcType.INTEGER),
        @Result(column="product_id", property="productId", jdbcType=JdbcType.BIGINT),
        @Result(column="product_name", property="productName", jdbcType=JdbcType.VARCHAR),
        @Result(column="product_img", property="productImg", jdbcType=JdbcType.VARCHAR),
        @Result(column="product_spec_id", property="productSpecId", jdbcType=JdbcType.BIGINT),
        @Result(column="product_spec_name", property="productSpecName", jdbcType=JdbcType.VARCHAR),
        @Result(column="product_count", property="productCount", jdbcType=JdbcType.INTEGER),
        @Result(column="photo", property="photo", jdbcType=JdbcType.VARCHAR),
        @Result(column="remarks", property="remarks", jdbcType=JdbcType.VARCHAR),
        @Result(column="send_express_no", property="sendExpressNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="refund_order_no", property="refundOrderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="refund_price", property="refundPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="refund_integral", property="refundIntegral", jdbcType=JdbcType.BIGINT),
        @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
        @Result(column="audit_remarks", property="auditRemarks", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="audit_time", property="auditTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="send_express_time", property="sendExpressTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="finish_time", property="finishTime", 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)
    })
    BsOrderAfterSalesApply selectByPrimaryKey(Long id);

    @UpdateProvider(type=BsOrderAfterSalesApplySqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") BsOrderAfterSalesApply record, @Param("example") BsOrderAfterSalesApplyExample example);

    @UpdateProvider(type=BsOrderAfterSalesApplySqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") BsOrderAfterSalesApply record, @Param("example") BsOrderAfterSalesApplyExample example);

    @UpdateProvider(type=BsOrderAfterSalesApplySqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(BsOrderAfterSalesApply record);

    @Update({
        "update bs_order_after_sales_apply",
        "set user_id = #{userId,jdbcType=BIGINT},",
          "user_phone = #{userPhone,jdbcType=VARCHAR},",
          "mer_id = #{merId,jdbcType=BIGINT},",
          "apply_no = #{applyNo,jdbcType=VARCHAR},",
          "`type` = #{type,jdbcType=INTEGER},",
          "order_no = #{orderNo,jdbcType=VARCHAR},",
          "child_order_no = #{childOrderNo,jdbcType=VARCHAR},",
          "product_type = #{productType,jdbcType=INTEGER},",
          "product_id = #{productId,jdbcType=BIGINT},",
          "product_name = #{productName,jdbcType=VARCHAR},",
          "product_img = #{productImg,jdbcType=VARCHAR},",
          "product_spec_id = #{productSpecId,jdbcType=BIGINT},",
          "product_spec_name = #{productSpecName,jdbcType=VARCHAR},",
          "product_count = #{productCount,jdbcType=INTEGER},",
          "photo = #{photo,jdbcType=VARCHAR},",
          "remarks = #{remarks,jdbcType=VARCHAR},",
          "send_express_no = #{sendExpressNo,jdbcType=VARCHAR},",
          "refund_order_no = #{refundOrderNo,jdbcType=VARCHAR},",
          "refund_price = #{refundPrice,jdbcType=DECIMAL},",
          "refund_integral = #{refundIntegral,jdbcType=BIGINT},",
          "`status` = #{status,jdbcType=INTEGER},",
          "audit_remarks = #{auditRemarks,jdbcType=VARCHAR},",
          "create_time = #{createTime,jdbcType=TIMESTAMP},",
          "audit_time = #{auditTime,jdbcType=TIMESTAMP},",
          "send_express_time = #{sendExpressTime,jdbcType=TIMESTAMP},",
          "finish_time = #{finishTime,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(BsOrderAfterSalesApply record);
}