package com.jpsoft.shinestar.modules.base.service;

import com.github.pagehelper.Page;
import com.jpsoft.shinestar.modules.base.entity.CompanyInfo;
import com.jpsoft.shinestar.modules.common.dto.Sort;

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

public interface CompanyInfoService {
	CompanyInfo get(String id);
	boolean exist(String id);
	int insert(CompanyInfo model);
	int update(CompanyInfo model);
	int delete(String id);
	List<CompanyInfo> list();
	Page<CompanyInfo> pageSearch(Map<String, Object> searchParams, int pageNum, int pageSize, List<Sort> sortList);
    List<CompanyInfo> findByCompanyCode(String code, Long personId);
	//List<CompanyInfo> findByCompanyCode(String code);
    long countByParentId(String parentId);
    long countByCompanyCode(String code, Long personId);
    int updateCode(String oldCode, String newCode);
    Boolean hasChildren(String parentId);
	List<CompanyInfo> findByParentId(String parentId);
	CompanyInfo findByName(String name);
	List<CompanyInfo> findByCompanyCodeAndType(String code, String type);
    List<CompanyInfo> findByRegionIdAndSceneId(String regionId, String sceneId);

	List<CompanyInfo> findAllCompanyByCode(String code);

    List<CompanyInfo> findBySceneIdAndType(String sceneId, String type);

	List<CompanyInfo> findByRelationCompanyId(String relationCompanyId);

	List<CompanyInfo> findByRegionIdAndSceneIdAndEnableRegister(String regionId, String sceneId, boolean enableRegister);

    List<CompanyInfo> findByType(String type);

    List<CompanyInfo> findByUnitType(String unitType);

    List<CompanyInfo> findByHealthyReportTime(String healthyReportTime);

    CompanyInfo findByIdIgnoreDel(String companyId);

	List<CompanyInfo> findByOutscourcer(Boolean isOutsourcer);

	List<CompanyInfo> findByCompanyCodeAndOutscourcer(String code, Long personId,Boolean isOutsourcer);

	List<CompanyInfo> findByClassify(String classify);
}