package com.hfkj.dao;

import com.hfkj.entity.BsOrderGoods;
import com.hfkj.entity.BsOrderGoodsExample;
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 BsOrderGoodsMapper extends BsOrderGoodsMapperExt {
    @SelectProvider(type=BsOrderGoodsSqlProvider.class, method="countByExample")
    long countByExample(BsOrderGoodsExample example);

    @DeleteProvider(type=BsOrderGoodsSqlProvider.class, method="deleteByExample")
    int deleteByExample(BsOrderGoodsExample example);

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

    @Insert({
        "insert into bs_order_goods (logistics_no, freight_price, ",
        "delivery_address_id, delivery_address, ",
        "order_no, child_order_no, ",
        "mer_id, mer_name, user_id, ",
        "user_phone, goods_id, ",
        "img, goods_name, ",
        "goods_type_id, goods_type_name, ",
        "goods_brand_id, goods_brand_name, ",
        "goods_specs_id, goods_specs_name, ",
        "goods_specs_original_price, goods_count, ",
        "total_price, total_deduction_price, ",
        "coupon_discount_price, integral_discount_price, ",
        "platform_code, pay_real_price, ",
        "pay_channel, pay_serial_no, ",
        "pay_type, `status`, ",
        "logistics_status_desc, logistics_status, ",
        "create_time, pay_time, ",
        "cancel_time, refund_time, ",
        "finish_time, update_time, ",
        "exception_status, exception_msg, ",
        "ext_1, ext_2, ext_3)",
        "values (#{logisticsNo,jdbcType=VARCHAR}, #{freightPrice,jdbcType=DECIMAL}, ",
        "#{deliveryAddressId,jdbcType=BIGINT}, #{deliveryAddress,jdbcType=VARCHAR}, ",
        "#{orderNo,jdbcType=VARCHAR}, #{childOrderNo,jdbcType=VARCHAR}, ",
        "#{merId,jdbcType=BIGINT}, #{merName,jdbcType=VARCHAR}, #{userId,jdbcType=BIGINT}, ",
        "#{userPhone,jdbcType=VARCHAR}, #{goodsId,jdbcType=BIGINT}, ",
        "#{img,jdbcType=VARCHAR}, #{goodsName,jdbcType=VARCHAR}, ",
        "#{goodsTypeId,jdbcType=BIGINT}, #{goodsTypeName,jdbcType=VARCHAR}, ",
        "#{goodsBrandId,jdbcType=BIGINT}, #{goodsBrandName,jdbcType=VARCHAR}, ",
        "#{goodsSpecsId,jdbcType=BIGINT}, #{goodsSpecsName,jdbcType=VARCHAR}, ",
        "#{goodsSpecsOriginalPrice,jdbcType=DECIMAL}, #{goodsCount,jdbcType=INTEGER}, ",
        "#{totalPrice,jdbcType=DECIMAL}, #{totalDeductionPrice,jdbcType=DECIMAL}, ",
        "#{couponDiscountPrice,jdbcType=DECIMAL}, #{integralDiscountPrice,jdbcType=DECIMAL}, ",
        "#{platformCode,jdbcType=VARCHAR}, #{payRealPrice,jdbcType=DECIMAL}, ",
        "#{payChannel,jdbcType=INTEGER}, #{paySerialNo,jdbcType=VARCHAR}, ",
        "#{payType,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, ",
        "#{logisticsStatusDesc,jdbcType=VARCHAR}, #{logisticsStatus,jdbcType=VARCHAR}, ",
        "#{createTime,jdbcType=TIMESTAMP}, #{payTime,jdbcType=TIMESTAMP}, ",
        "#{cancelTime,jdbcType=TIMESTAMP}, #{refundTime,jdbcType=TIMESTAMP}, ",
        "#{finishTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ",
        "#{exceptionStatus,jdbcType=BIT}, #{exceptionMsg,jdbcType=VARCHAR}, ",
        "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
    })
    @Options(useGeneratedKeys=true,keyProperty="id")
    int insert(BsOrderGoods record);

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

    @SelectProvider(type=BsOrderGoodsSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="logistics_no", property="logisticsNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="freight_price", property="freightPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="delivery_address_id", property="deliveryAddressId", jdbcType=JdbcType.BIGINT),
        @Result(column="delivery_address", property="deliveryAddress", jdbcType=JdbcType.VARCHAR),
        @Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="child_order_no", property="childOrderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT),
        @Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT),
        @Result(column="user_phone", property="userPhone", jdbcType=JdbcType.VARCHAR),
        @Result(column="goods_id", property="goodsId", jdbcType=JdbcType.BIGINT),
        @Result(column="img", property="img", jdbcType=JdbcType.VARCHAR),
        @Result(column="goods_name", property="goodsName", jdbcType=JdbcType.VARCHAR),
        @Result(column="goods_type_id", property="goodsTypeId", jdbcType=JdbcType.BIGINT),
        @Result(column="goods_type_name", property="goodsTypeName", jdbcType=JdbcType.VARCHAR),
        @Result(column="goods_brand_id", property="goodsBrandId", jdbcType=JdbcType.BIGINT),
        @Result(column="goods_brand_name", property="goodsBrandName", jdbcType=JdbcType.VARCHAR),
        @Result(column="goods_specs_id", property="goodsSpecsId", jdbcType=JdbcType.BIGINT),
        @Result(column="goods_specs_name", property="goodsSpecsName", jdbcType=JdbcType.VARCHAR),
        @Result(column="goods_specs_original_price", property="goodsSpecsOriginalPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="goods_count", property="goodsCount", jdbcType=JdbcType.INTEGER),
        @Result(column="total_price", property="totalPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="total_deduction_price", property="totalDeductionPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="coupon_discount_price", property="couponDiscountPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="integral_discount_price", property="integralDiscountPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="platform_code", property="platformCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="pay_real_price", property="payRealPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="pay_channel", property="payChannel", jdbcType=JdbcType.INTEGER),
        @Result(column="pay_serial_no", property="paySerialNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="pay_type", property="payType", jdbcType=JdbcType.INTEGER),
        @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
        @Result(column="logistics_status_desc", property="logisticsStatusDesc", jdbcType=JdbcType.VARCHAR),
        @Result(column="logistics_status", property="logisticsStatus", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="pay_time", property="payTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="cancel_time", property="cancelTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="refund_time", property="refundTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="finish_time", property="finishTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="exception_status", property="exceptionStatus", jdbcType=JdbcType.BIT),
        @Result(column="exception_msg", property="exceptionMsg", 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<BsOrderGoods> selectByExample(BsOrderGoodsExample example);

    @Select({
        "select",
        "id, logistics_no, freight_price, delivery_address_id, delivery_address, order_no, ",
        "child_order_no, mer_id, mer_name, user_id, user_phone, goods_id, img, goods_name, ",
        "goods_type_id, goods_type_name, goods_brand_id, goods_brand_name, goods_specs_id, ",
        "goods_specs_name, goods_specs_original_price, goods_count, total_price, total_deduction_price, ",
        "coupon_discount_price, integral_discount_price, platform_code, pay_real_price, ",
        "pay_channel, pay_serial_no, pay_type, `status`, logistics_status_desc, logistics_status, ",
        "create_time, pay_time, cancel_time, refund_time, finish_time, update_time, exception_status, ",
        "exception_msg, ext_1, ext_2, ext_3",
        "from bs_order_goods",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="logistics_no", property="logisticsNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="freight_price", property="freightPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="delivery_address_id", property="deliveryAddressId", jdbcType=JdbcType.BIGINT),
        @Result(column="delivery_address", property="deliveryAddress", jdbcType=JdbcType.VARCHAR),
        @Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="child_order_no", property="childOrderNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT),
        @Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT),
        @Result(column="user_phone", property="userPhone", jdbcType=JdbcType.VARCHAR),
        @Result(column="goods_id", property="goodsId", jdbcType=JdbcType.BIGINT),
        @Result(column="img", property="img", jdbcType=JdbcType.VARCHAR),
        @Result(column="goods_name", property="goodsName", jdbcType=JdbcType.VARCHAR),
        @Result(column="goods_type_id", property="goodsTypeId", jdbcType=JdbcType.BIGINT),
        @Result(column="goods_type_name", property="goodsTypeName", jdbcType=JdbcType.VARCHAR),
        @Result(column="goods_brand_id", property="goodsBrandId", jdbcType=JdbcType.BIGINT),
        @Result(column="goods_brand_name", property="goodsBrandName", jdbcType=JdbcType.VARCHAR),
        @Result(column="goods_specs_id", property="goodsSpecsId", jdbcType=JdbcType.BIGINT),
        @Result(column="goods_specs_name", property="goodsSpecsName", jdbcType=JdbcType.VARCHAR),
        @Result(column="goods_specs_original_price", property="goodsSpecsOriginalPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="goods_count", property="goodsCount", jdbcType=JdbcType.INTEGER),
        @Result(column="total_price", property="totalPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="total_deduction_price", property="totalDeductionPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="coupon_discount_price", property="couponDiscountPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="integral_discount_price", property="integralDiscountPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="platform_code", property="platformCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="pay_real_price", property="payRealPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="pay_channel", property="payChannel", jdbcType=JdbcType.INTEGER),
        @Result(column="pay_serial_no", property="paySerialNo", jdbcType=JdbcType.VARCHAR),
        @Result(column="pay_type", property="payType", jdbcType=JdbcType.INTEGER),
        @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
        @Result(column="logistics_status_desc", property="logisticsStatusDesc", jdbcType=JdbcType.VARCHAR),
        @Result(column="logistics_status", property="logisticsStatus", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="pay_time", property="payTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="cancel_time", property="cancelTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="refund_time", property="refundTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="finish_time", property="finishTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="exception_status", property="exceptionStatus", jdbcType=JdbcType.BIT),
        @Result(column="exception_msg", property="exceptionMsg", 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)
    })
    BsOrderGoods selectByPrimaryKey(Long id);

    @UpdateProvider(type=BsOrderGoodsSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") BsOrderGoods record, @Param("example") BsOrderGoodsExample example);

    @UpdateProvider(type=BsOrderGoodsSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") BsOrderGoods record, @Param("example") BsOrderGoodsExample example);

    @UpdateProvider(type=BsOrderGoodsSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(BsOrderGoods record);

    @Update({
        "update bs_order_goods",
        "set logistics_no = #{logisticsNo,jdbcType=VARCHAR},",
          "freight_price = #{freightPrice,jdbcType=DECIMAL},",
          "delivery_address_id = #{deliveryAddressId,jdbcType=BIGINT},",
          "delivery_address = #{deliveryAddress,jdbcType=VARCHAR},",
          "order_no = #{orderNo,jdbcType=VARCHAR},",
          "child_order_no = #{childOrderNo,jdbcType=VARCHAR},",
          "mer_id = #{merId,jdbcType=BIGINT},",
          "mer_name = #{merName,jdbcType=VARCHAR},",
          "user_id = #{userId,jdbcType=BIGINT},",
          "user_phone = #{userPhone,jdbcType=VARCHAR},",
          "goods_id = #{goodsId,jdbcType=BIGINT},",
          "img = #{img,jdbcType=VARCHAR},",
          "goods_name = #{goodsName,jdbcType=VARCHAR},",
          "goods_type_id = #{goodsTypeId,jdbcType=BIGINT},",
          "goods_type_name = #{goodsTypeName,jdbcType=VARCHAR},",
          "goods_brand_id = #{goodsBrandId,jdbcType=BIGINT},",
          "goods_brand_name = #{goodsBrandName,jdbcType=VARCHAR},",
          "goods_specs_id = #{goodsSpecsId,jdbcType=BIGINT},",
          "goods_specs_name = #{goodsSpecsName,jdbcType=VARCHAR},",
          "goods_specs_original_price = #{goodsSpecsOriginalPrice,jdbcType=DECIMAL},",
          "goods_count = #{goodsCount,jdbcType=INTEGER},",
          "total_price = #{totalPrice,jdbcType=DECIMAL},",
          "total_deduction_price = #{totalDeductionPrice,jdbcType=DECIMAL},",
          "coupon_discount_price = #{couponDiscountPrice,jdbcType=DECIMAL},",
          "integral_discount_price = #{integralDiscountPrice,jdbcType=DECIMAL},",
          "platform_code = #{platformCode,jdbcType=VARCHAR},",
          "pay_real_price = #{payRealPrice,jdbcType=DECIMAL},",
          "pay_channel = #{payChannel,jdbcType=INTEGER},",
          "pay_serial_no = #{paySerialNo,jdbcType=VARCHAR},",
          "pay_type = #{payType,jdbcType=INTEGER},",
          "`status` = #{status,jdbcType=INTEGER},",
          "logistics_status_desc = #{logisticsStatusDesc,jdbcType=VARCHAR},",
          "logistics_status = #{logisticsStatus,jdbcType=VARCHAR},",
          "create_time = #{createTime,jdbcType=TIMESTAMP},",
          "pay_time = #{payTime,jdbcType=TIMESTAMP},",
          "cancel_time = #{cancelTime,jdbcType=TIMESTAMP},",
          "refund_time = #{refundTime,jdbcType=TIMESTAMP},",
          "finish_time = #{finishTime,jdbcType=TIMESTAMP},",
          "update_time = #{updateTime,jdbcType=TIMESTAMP},",
          "exception_status = #{exceptionStatus,jdbcType=BIT},",
          "exception_msg = #{exceptionMsg,jdbcType=VARCHAR},",
          "ext_1 = #{ext1,jdbcType=VARCHAR},",
          "ext_2 = #{ext2,jdbcType=VARCHAR},",
          "ext_3 = #{ext3,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(BsOrderGoods record);
}