package com.hfkj.dao;

import com.hfkj.entity.BsOrderChild;
import com.hfkj.entity.BsOrderChildExample;
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 BsOrderChildMapper extends BsOrderChildMapperExt {
    @SelectProvider(type=BsOrderChildSqlProvider.class, method="countByExample")
    long countByExample(BsOrderChildExample example);

    @DeleteProvider(type=BsOrderChildSqlProvider.class, method="deleteByExample")
    int deleteByExample(BsOrderChildExample example);

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

    @Insert({
        "insert into bs_order_child (mer_no, order_no, ",
        "child_order_no, product_type, ",
        "product_id, product_name, ",
        "product_img, product_spec_id, ",
        "product_spec_name, product_price, ",
        "product_actual_price, product_count, ",
        "product_total_price, total_deduction_price, ",
        "coupon_discount_price, integral_discount_price, ",
        "surplus_refund_count, surplus_refund_price, ",
        "surplus_refund_integral, `status`, ",
        "settle_account, settle_account_key, ",
        "create_time, update_time, ",
        "finish_time, ext_1, ",
        "ext_2, ext_3)",
        "values (#{merNo,jdbcType=VARCHAR}, #{orderNo,jdbcType=VARCHAR}, ",
        "#{childOrderNo,jdbcType=VARCHAR}, #{productType,jdbcType=INTEGER}, ",
        "#{productId,jdbcType=BIGINT}, #{productName,jdbcType=VARCHAR}, ",
        "#{productImg,jdbcType=VARCHAR}, #{productSpecId,jdbcType=BIGINT}, ",
        "#{productSpecName,jdbcType=VARCHAR}, #{productPrice,jdbcType=DECIMAL}, ",
        "#{productActualPrice,jdbcType=DECIMAL}, #{productCount,jdbcType=INTEGER}, ",
        "#{productTotalPrice,jdbcType=DECIMAL}, #{totalDeductionPrice,jdbcType=DECIMAL}, ",
        "#{couponDiscountPrice,jdbcType=DECIMAL}, #{integralDiscountPrice,jdbcType=DECIMAL}, ",
        "#{surplusRefundCount,jdbcType=INTEGER}, #{surplusRefundPrice,jdbcType=DECIMAL}, ",
        "#{surplusRefundIntegral,jdbcType=BIGINT}, #{status,jdbcType=INTEGER}, ",
        "#{settleAccount,jdbcType=VARCHAR}, #{settleAccountKey,jdbcType=VARCHAR}, ",
        "#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ",
        "#{finishTime,jdbcType=TIMESTAMP}, #{ext1,jdbcType=VARCHAR}, ",
        "#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})"
    })
    @Options(useGeneratedKeys=true,keyProperty="id")
    int insert(BsOrderChild record);

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

    @SelectProvider(type=BsOrderChildSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="mer_no", property="merNo", jdbcType=JdbcType.VARCHAR),
        @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_price", property="productPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="product_actual_price", property="productActualPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="product_count", property="productCount", jdbcType=JdbcType.INTEGER),
        @Result(column="product_total_price", property="productTotalPrice", 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="surplus_refund_count", property="surplusRefundCount", jdbcType=JdbcType.INTEGER),
        @Result(column="surplus_refund_price", property="surplusRefundPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="surplus_refund_integral", property="surplusRefundIntegral", jdbcType=JdbcType.BIGINT),
        @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
        @Result(column="settle_account", property="settleAccount", jdbcType=JdbcType.VARCHAR),
        @Result(column="settle_account_key", property="settleAccountKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="finish_time", property="finishTime", 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<BsOrderChild> selectByExample(BsOrderChildExample example);

    @Select({
        "select",
        "id, mer_no, order_no, child_order_no, product_type, product_id, product_name, ",
        "product_img, product_spec_id, product_spec_name, product_price, product_actual_price, ",
        "product_count, product_total_price, total_deduction_price, coupon_discount_price, ",
        "integral_discount_price, surplus_refund_count, surplus_refund_price, surplus_refund_integral, ",
        "`status`, settle_account, settle_account_key, create_time, update_time, finish_time, ",
        "ext_1, ext_2, ext_3",
        "from bs_order_child",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="mer_no", property="merNo", jdbcType=JdbcType.VARCHAR),
        @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_price", property="productPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="product_actual_price", property="productActualPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="product_count", property="productCount", jdbcType=JdbcType.INTEGER),
        @Result(column="product_total_price", property="productTotalPrice", 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="surplus_refund_count", property="surplusRefundCount", jdbcType=JdbcType.INTEGER),
        @Result(column="surplus_refund_price", property="surplusRefundPrice", jdbcType=JdbcType.DECIMAL),
        @Result(column="surplus_refund_integral", property="surplusRefundIntegral", jdbcType=JdbcType.BIGINT),
        @Result(column="status", property="status", jdbcType=JdbcType.INTEGER),
        @Result(column="settle_account", property="settleAccount", jdbcType=JdbcType.VARCHAR),
        @Result(column="settle_account_key", property="settleAccountKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="finish_time", property="finishTime", 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)
    })
    BsOrderChild selectByPrimaryKey(Long id);

    @UpdateProvider(type=BsOrderChildSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") BsOrderChild record, @Param("example") BsOrderChildExample example);

    @UpdateProvider(type=BsOrderChildSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") BsOrderChild record, @Param("example") BsOrderChildExample example);

    @UpdateProvider(type=BsOrderChildSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(BsOrderChild record);

    @Update({
        "update bs_order_child",
        "set mer_no = #{merNo,jdbcType=VARCHAR},",
          "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_price = #{productPrice,jdbcType=DECIMAL},",
          "product_actual_price = #{productActualPrice,jdbcType=DECIMAL},",
          "product_count = #{productCount,jdbcType=INTEGER},",
          "product_total_price = #{productTotalPrice,jdbcType=DECIMAL},",
          "total_deduction_price = #{totalDeductionPrice,jdbcType=DECIMAL},",
          "coupon_discount_price = #{couponDiscountPrice,jdbcType=DECIMAL},",
          "integral_discount_price = #{integralDiscountPrice,jdbcType=DECIMAL},",
          "surplus_refund_count = #{surplusRefundCount,jdbcType=INTEGER},",
          "surplus_refund_price = #{surplusRefundPrice,jdbcType=DECIMAL},",
          "surplus_refund_integral = #{surplusRefundIntegral,jdbcType=BIGINT},",
          "`status` = #{status,jdbcType=INTEGER},",
          "settle_account = #{settleAccount,jdbcType=VARCHAR},",
          "settle_account_key = #{settleAccountKey,jdbcType=VARCHAR},",
          "create_time = #{createTime,jdbcType=TIMESTAMP},",
          "update_time = #{updateTime,jdbcType=TIMESTAMP},",
          "finish_time = #{finishTime,jdbcType=TIMESTAMP},",
          "ext_1 = #{ext1,jdbcType=VARCHAR},",
          "ext_2 = #{ext2,jdbcType=VARCHAR},",
          "ext_3 = #{ext3,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(BsOrderChild record);
}