package com.jzdsh.auto.biz;

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

import java.util.List;

/**
 * @ProjectName: auto
 * @Package: com.jzdsh.auto.biz
 * @ClassName: SearchDealerService
 * @Author: Jzdsh
 * @Description: 经销商信息查询条件
 * @Date: 2020/3/24 14:57
 * @Version: 1.0
 */
@Log4j2
public class SearchDealerService {


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

    public void deleteByShopId(int shopId) {
        try {
            Db.delete("delete from search_provider where shopId = ?", shopId);
        } catch (Exception e) {
            log.info("", e);
        }
    }

}
