package com.xinelu.manage.mapper.patientprehospitalization;

import com.xinelu.manage.domain.patientprehospitalization.PatientPreHospitalization;
import com.xinelu.manage.dto.patientinfo.PatientInfoDto;

import java.time.LocalDate;
import java.util.List;
import org.apache.ibatis.annotations.Param;

/**
* @author Administrator
* @description 针对表【patient_pre_hospitalization(预住院患者表)】的数据库操作Mapper
* @createDate 2024-03-08 10:26:02
* @Entity com.xinelu.manage.domain.patientprehospitalization.PatientPreHospitalization
*/
public interface PatientPreHospitalizationMapper {

    int deleteByPrimaryKey(Long id);

    int insert(PatientPreHospitalization record);

	int insertBatch(@Param("recordList") List<PatientPreHospitalization> recordList);

    int insertSelective(PatientPreHospitalization record);

    PatientPreHospitalization selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(PatientPreHospitalization record);

    int updateByPrimaryKey(PatientPreHospitalization record);

	List<PatientPreHospitalization> selectList(PatientInfoDto patientInfo);

	List<PatientPreHospitalization> selectApplyList(PatientPreHospitalization preHospitalizationQuery);

	/**
	 * 批量删除患者信息
	 *
	 * @param ids 需要删除的数据主键集合
	 * @return 结果
	 */
	public int deleteByIds(Long[] ids);

	/**
	 * 根据创建时间查询预住院患者数量
	 *
	 * @param firstDay 本月第一天
	 * @param now      当前时间
	 * @return int
	 */
	int getPatientPreHospitalizationCountByCreateTime(@Param("firstDay") LocalDate firstDay, @Param("now") LocalDate now, @Param("hospitalAgencyId")Long hospitalAgencyId);
}
