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

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

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

public interface PersonPopedomService {
	PersonPopedom get(String id);
	boolean exist(String id);
	int insert(PersonPopedom model);
	int update(PersonPopedom model);
	int delete(String id);
	List<PersonPopedom> list();
	Page<PersonPopedom> pageSearch(Map<String, Object> searchParams,int pageNum,int pageSize,boolean count,List<Sort> sortList);
	Page<PersonPopedom> pageSearch2(Map<String, Object> searchParams,int pageNum,int pageSize,boolean count,List<Sort> sortList);
    List<PersonPopedom> findByPersonId(Long id);
	List<PersonPopedom> findByCompanyIdAndRoleIds(String companyId,String personRoleId);
	int countByPerson(Long personId);
	PersonPopedom findOneByPersonId(Long personId);
	PersonPopedom findByVerify(PersonPopedom personPopedom);
	PersonPopedom autoInsert(PersonInfo personInfo) throws Exception;

	List<PersonPopedom> findByCompanyIdAndRoleIdList(String serviceCompanyId, List<String> personRoloIds);

	List<PersonPopedom> findByRelationPopedomId(String relationPopedomId);

	List<PersonPopedom> findByCompanyId(String companyId);

	List<PersonPopedom> findByCompanyList(List<CompanyInfo> companyInfoList);

	Integer findNumByCompanyId(String companyId);

	Integer findNumByCompanyList(List<CompanyInfo> companyInfoList);

    List<PersonPopedom> findByCompanyListAndName(List<CompanyInfo> companyInfoList, String name);

    List<PersonPopedom> findByPersonIdAndCompanyCode(Long personId, String companyCode);

	PersonPopedom hasEnableAttendance(Long personId, String companyCode);

    List<PersonPopedom> findByCompanyIdAndEnableAttendance(List<CompanyInfo> companyInfoList, boolean b);

    List<PersonPopedom> findByPersonIdAndRoleIdList(Long personId, List<PersonRoleIcon> personRoleIconList);

    List<PersonPopedom> findApprovalList(PersonInfo personInfo, String type, Integer level, BigDecimal days) throws Exception;

    PersonPopedom hasEnableAttendanceByCompanyId(Long personId, String companyId);

    List<PersonPopedom> findByPersonIdCompanyId(Long personId, String companyId);

	List<PersonPopedom> findByPersonIdAndRoleId(Long personId, String personRoleId);

    List<PersonPopedom> findByCompanyIdAndEnableRegisterExamine(String companyId, boolean enableRegisterExamine);

	PersonPopedom findByIdIgnoreDel(String personPopedomId);
}