package com.hfkj.dao;

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

import java.util.List;

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


    @Insert({
            "<script>",
            "insert into goods_user_address (user_id, consignee, ",
            "phone, address, ",
            "region_id, region_name, ",
            "whether_default, create_time, ",
            "update_time, op_id, ",
            "op_name, ext_1, ext_2, ",
            "ext_3)",
            "values ",
            "<foreach collection='list' item='item' index='index' separator=','>",
            "(#{item.userId,jdbcType=BIGINT}, " +
            "#{item.consignee,jdbcType=VARCHAR}, ",
            "#{item.phone,jdbcType=VARCHAR}, " +
            "#{item.address,jdbcType=VARCHAR}, ",
            "#{item.regionId,jdbcType=VARCHAR}, " +
            "#{item.regionName,jdbcType=VARCHAR}, ",
            "#{item.whetherDefault,jdbcType=BIT}, " +
            "#{item.createTime,jdbcType=TIMESTAMP}, ",
            "#{item.updateTime,jdbcType=TIMESTAMP}, " +
            "#{item.opId,jdbcType=BIGINT}, ",
            "#{item.opName,jdbcType=VARCHAR}, " +
            "#{item.ext1,jdbcType=VARCHAR}, " +
            "#{item.ext2,jdbcType=VARCHAR}, ",
            "#{item.ext3,jdbcType=VARCHAR})",
            "</foreach>",
            "</script>"
    })
    void insertAddressList(@Param(value = "list") List<GoodsUserAddress> list);
}