package com.hfkj.dao;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;

import java.util.List;

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

    @Insert("<script>" +
            " insert into bs_discount_use_mer(discount_id,discount_no,province_code,province_name,city_code,city_name,area_code,area_name,mer_id,mer_no,mer_name,mer_address,create_time)" +
            " select " +
            " #{discountId} discount_id," +
            " #{discountNo} discount_no," +
            " province_code, " +
            " province_name, " +
            " city_code, " +
            " city_name, " +
            " area_code, " +
            " area_name, " +
            " id, " +
            " mer_no, " +
            " mer_name, " +
            " address, " +
            " NOW() create_time" +
            " from bs_merchant " +
            " where mer_no in " +
            " <foreach collection='merList' item='item' index='index' open='(' separator=',' close=')'>#{item}</foreach>" +
            "</script>")
    void insertUseMer(@Param("discountId") Long discountId, @Param("discountNo") String discountNo, @Param("merList") List<String> merList);
}
