package com.hfkj.dao;

import com.hfkj.entity.BsMealTableOrderChildProduct;
import com.hfkj.entity.BsMealTableOrderProduct;
import com.hfkj.entity.CmsPatch;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * mapper扩展类
 */
public interface BsMealTableOrderProductMapperExt {

    @Insert(value = {
            "<script>",
            "insert into bs_meal_table_order_product (order_id, order_no, ",
            "product_category_id, product_category_name, ",
            "product_id, product_img, ",
            "product_name, product_spec, ",
            "product_price, product_num, ",
            "product_total_price, `status`, ",
            "create_time, update_time, ",
            "ext_1, ext_2, ext_3)",
            "values " +
            "<foreach collection=\"dataList\" item=\"item\" index=\"idx\" open=\"(\" separator=\"),(\" close=\")\">",
            "#{orderId,jdbcType=BIGINT}, #{orderNo,jdbcType=VARCHAR}, ",
            "#{productCategoryId,jdbcType=BIGINT}, #{productCategoryName,jdbcType=VARCHAR}, ",
            "#{productId,jdbcType=BIGINT}, #{productImg,jdbcType=VARCHAR}, ",
            "#{productName,jdbcType=VARCHAR}, #{productSpec,jdbcType=VARCHAR}, ",
            "#{productPrice,jdbcType=DECIMAL}, #{productNum,jdbcType=INTEGER}, ",
            "#{productTotalPrice,jdbcType=DECIMAL}, #{status,jdbcType=INTEGER}, ",
            "#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ",
            "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR}",
            "</foreach>" +
            "</script>"
    })
    void addPatch(@Param(value = "dataList") List<BsMealTableOrderChildProduct> dataList);

}
