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

import com.jpsoft.shinestar.modules.base.dto.PersonHealthLedgerDTO;
import com.jpsoft.shinestar.modules.base.entity.PersonHealthLedger;
import com.jpsoft.shinestar.modules.base.entity.PersonInfo;
import com.jpsoft.shinestar.modules.common.dto.Sort;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

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

@Repository
public interface PersonHealthLedgerDAO {
	int insert(PersonHealthLedger entity);
	int update(PersonHealthLedger entity);
	int exist(String id);
	PersonHealthLedger get(String id);
	int delete(String id);
	List<PersonHealthLedger> findByTimeAndPersonId(String queryTime,Long personId,String addressOut,String addressIn,String temperature);
	List<PersonHealthLedger> list();
	List<PersonHealthLedger> search(Map<String, Object> searchParams, List<Sort> sortList);
	List<PersonHealthLedger> findByCreateTime(@Param("startTime") Date startTime, @Param("endTime") Date endTime);
	PersonHealthLedger existByCreateTimeAndPersonId(@Param("personId") long personId, @Param("startTime") Date startTime, @Param("endTime") Date endTime);

	PersonHealthLedger lastByPersonId(Long personId);

	List<PersonHealthLedgerDTO> workerSearch(Map<String, Object> searchParams, List<Sort> sortList);

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

    int replace(Long srcPersonId, Long destPersonId);

	List<Map> query(@Param("searchParams")Map<String, Object> searchParams);

	List<PersonHealthLedger> findByCreateTimeAndPersonId(@Param("personId")long personId,@Param("startTime")Date startTime, @Param("endTime")Date endTime);

}