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

import java.util.List;

import com.jpsoft.shinestar.modules.base.entity.CompanyInfo;
import com.jpsoft.shinestar.modules.base.entity.PersonInfo;
import com.jpsoft.shinestar.modules.base.entity.PersonRoleIcon;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import com.jpsoft.shinestar.modules.base.entity.PersonPopedom;
import java.util.Map;
import com.jpsoft.shinestar.modules.common.dto.Sort;

@Repository
public interface PersonPopedomDAO {
	int insert(PersonPopedom entity);
	int update(PersonPopedom entity);
	int exist(String id);
	PersonPopedom get(String id);
	int delete(String id);
	List<PersonPopedom> list();
	List<PersonPopedom> search(Map<String, Object> searchParams, List<Sort> sortList);
	int countByPerson(Long personId);
	PersonPopedom findOneByPersonId(Long personId);
    List<PersonPopedom> findByPersonId(Long id);
	List<PersonPopedom> findByCompanyIdAndRoleIds(@Param("companyId") String companyId, @Param("personRoleId")String personRoleId);
	PersonPopedom findByVerify(PersonPopedom personPopedom);

	List<PersonPopedom> findByCompanyIdAndRoleIdList(@Param("serviceCompanyId")String serviceCompanyId, @Param("personRoloIds")List<String> personRoloIds);
	List<PersonPopedom> findByRelationPopedomId(String relationPopedomId);

	List<PersonPopedom> findByCompanyId(String companyId);

	Integer findNumByCompanyId(String companyId);

    Integer findNumByCompanyList(List<CompanyInfo> companyInfoList);

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

    List<PersonPopedom> findByCompanyListAndName(@Param("companyInfoList")List<CompanyInfo> companyInfoList, @Param("personName")String personName);

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

	PersonPopedom hasEnableAttendance(Long personId,String companyCode);

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

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

    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);


	List<PersonPopedom> search2(Map<String, Object> searchParams, List<Sort> sortList);

	PersonPopedom findByIdIgnoreDel(String personPopedomId);
}