package com.ningdatech.carapi.sys.service;

import java.util.Collection;
import java.util.List;
import java.util.Map;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ningdatech.carapi.car.datascreen.model.dto.DataScreenParam;
import com.ningdatech.carapi.car.rpt.model.dto.RptOtherParamDTO;
import com.ningdatech.carapi.car.rpt.model.po.RptOtherOnlineVehiclesPO;
import com.ningdatech.carapi.company.entity.po.ResCompanyTotalPO;
import com.ningdatech.carapi.safe.model.dto.SecurityHonestyPageQuery;
import com.ningdatech.carapi.sys.entity.Company;
import com.ningdatech.carapi.sys.entity.dto.CompanySaveDTO;
import com.ningdatech.carapi.sys.entity.dto.CompanyUpdateDTO;

/**
 * <p>
 * 企业
 * </p>
 *
 * @author PoffyZhang
 * @since 2022-09-30
 */
public interface CompanyService extends IService<Company> {


    /**
     * 根据ID删除
     *
     * @param ids id
     * @return 是否成功
     */
    boolean removeByIdWithCache(List<Long> ids);

    /**
     * 保存企业
     *
     * @param data   企业
     * @param userId 用户id
     */
    Company save(CompanySaveDTO data, Long userId);

    /**
     * 修改
     *
     * @param data   企业
     * @param userId 用户id
     */
    Company update(CompanyUpdateDTO data, Long userId);

    Boolean check(String name);

    Boolean check(String name, Long id);

    Map<Long, Company> listCompanyByIds(Collection<Long> ids);

    List<Company> listCompanyByCompanyNames(Collection<String> names);

    Company getCompanyByCompanyNames(String companyName);

    List<String> findCompanyIdsByRegionId(DataScreenParam param);

    Page<RptOtherOnlineVehiclesPO> pageVehicleNum(Page<RptOtherOnlineVehiclesPO> page, RptOtherParamDTO param);

    List<ResCompanyTotalPO> countByRegion(DataScreenParam param);

    List<ResCompanyTotalPO> countEnterpriseType(DataScreenParam param);

    Page<Company> pageDataScope(Page<Company> page, LambdaQueryWrapper<Company> wrapper, SecurityHonestyPageQuery param);
}
