package com.hfkj.dao;

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

import java.util.List;

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


    @Insert(value = {
            "<script>",
            "insert into bs_meal_table_order_child_product (store_id, store_name, ",
            "child_order_id, child_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=\")\">",
            "#{item.storeId,jdbcType=BIGINT}, #{item.storeName,jdbcType=VARCHAR}, ",
            "#{item.childOrderId,jdbcType=BIGINT}, #{item.childOrderNo,jdbcType=VARCHAR}, ",
            "#{item.productCategoryId,jdbcType=BIGINT}, #{item.productCategoryName,jdbcType=VARCHAR}, ",
            "#{item.productId,jdbcType=BIGINT}, #{item.productImg,jdbcType=VARCHAR}, ",
            "#{item.productName,jdbcType=VARCHAR}, #{item.productSpec,jdbcType=VARCHAR}, ",
            "#{item.productPrice,jdbcType=DECIMAL}, #{item.productNum,jdbcType=INTEGER}, ",
            "#{item.productTotalPrice,jdbcType=DECIMAL}, #{item.status,jdbcType=INTEGER}, ",
            "#{item.createTime,jdbcType=TIMESTAMP}, #{item.updateTime,jdbcType=TIMESTAMP}, ",
            "#{item.ext1,jdbcType=VARCHAR}, #{item.ext2,jdbcType=VARCHAR}, #{item.ext3,jdbcType=VARCHAR}",
            "</foreach>",
            "</script>"
    })
    void addPatch(@Param(value = "dataList") List<BsMealTableOrderChildProduct> dataList);
}
