package com.jzdsh.auto.biz;

import com.jfinal.plugin.activerecord.Db;
import com.jzdsh.auto.model.SearchProvider;
import lombok.extern.log4j.Log4j2;

import java.util.List;
import java.util.stream.Collectors;

/**
 * @ProjectName: auto
 * @Package: com.jzdsh.auto.biz
 * @ClassName: SearchProviderService
 * @Author: Jzdsh
 * @Description: 服务商信息查查询条件
 * @Date: 2020/3/23 18:58
 * @Version: 1.0
 */
@Log4j2
public class SearchProviderService {


    /**
     * 服务商搜索条件批量保存
     * @param modelList
     */
    public void saveList(List<SearchProvider> modelList){
        try {
            if(modelList != null && modelList.size() > 0){
                Db.batchSave(modelList,modelList.size());
            }
        } catch (Exception e) {
            log.info("",e);
        }
    }


    /**
     * 根据 店铺id删除信息
     * @param shopId
     */
    public void deleteByShopId(int shopId){
        try {
            Db.delete("delete from search_provider where shopId = ?",shopId );
        } catch (Exception e) {
           log.info("",e);
        }
    }

}
