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.base.entity.ParkingApply;
import com.jpsoft.shinestar.modules.base.entity.PersonApplicationInfo;
import com.jpsoft.shinestar.modules.base.entity.PersonInfo;
import com.jpsoft.shinestar.modules.common.dto.Sort;
import org.apache.ibatis.annotations.Param;

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

public interface PersonInfoService {
	PersonInfo get(Long id);
	boolean exist(Long id);
	int insert(PersonInfo model);
	int update(PersonInfo model);
	int delete(Long id);
	List<PersonInfo> list();
	Page<PersonInfo> pageSearch(Map<String, Object> searchParams, int pageNum, int pageSize, boolean count, List<Sort> sortList);
	Page<PersonInfo> pageSearchNew(Map<String, Object> searchParams, int pageNum, int pageSize, boolean count, List<Sort> sortList);
    PersonInfo findByNameAndPhone(String name, String phone);
	PersonInfo findByOpenId(String openId);

    List<PersonInfo> findByCompanyId(String companyId);
	List<PersonInfo> findListByCompanyCode(String companyCode);
	List<PersonInfo> findByCompanyIdAndPopedom(String type, String companyId);

	PersonInfo getIgnoreDelFlag(Long id);
    long countByCompanyCode(String code, Long relatePersonId);

	List<PersonInfo> findByCompanyCode(Map<String, Object> searchParams, List<Sort> sortList);

	List<PersonInfo> findByUpdateHealthyTime(Date startDate, int limit);

	long countByCompanyList(List<CompanyInfo> list);

	long countByCompanyListAndPopedom(String type, List<CompanyInfo> list);

	PersonInfo findById(long longValue);

    long countByCompanyId(String companyId);

    long countByCompanyIds(List<String> companyIds);

    PersonInfo addPersonForCompany(PersonInfo personInfo, String deviceNo);

	long notGuestList();

	int resetOpenId(Long personId);

	int updateHealthyCode(PersonInfo personInfo);

	List<Map> groupByHealthyCode(Map<String, Object> searchParams);

	List<Map> groupHealthyById(@Param("idList") List<Long> idList);

    PersonInfo findByPhone(String phone);

	List<Long> findByOrderProperty(Map<String, Object> searchParams);

    Long insertPersonAndPopedom(PersonApplicationInfo personApplicationInfo, String deviceIds, String companyId) throws Exception;

    void sendRegisterMessage(PersonApplicationInfo personApplicationInfo);

    void sendParkingMessage(ParkingApply parkingApply);

    PersonInfo findByNameAndIdCard(String name, String idCard);

	Page<PersonInfo> searchCanteenOutsourcerBalance(Map<String, Object> searchParams, int pageNum, int pageSize,boolean count, List<Sort> sortList);

    PersonInfo findByIdIgnoreDel(Long personId);

    PersonInfo findByCarNum(String carNum);

	PersonInfo findJobNumber(String jobNumber);

	List<PersonInfo> findByHq();

	int updateNullForHqSortNo(Long personId);
}