package com.rf.psychological.institution.service;

import com.rf.psychological.dao.vo.SaveInstitutionVO;
import com.rf.psychological.institution.model.InstitutionEntity;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.domain.Page;

import java.util.List;
import java.util.Optional;

public interface InstitutionService {

    /**
     * @param institutionEntity
     */
    void save(InstitutionEntity institutionEntity);

    InstitutionEntity findByInstitutionId(String institutionId);

    /**
     * 查询所有机构名称
     *
     * @param pageNum
     * @param pageSize
     * @param searchKey
     * @return
     */
    List<InstitutionEntity> findAllInstitutionByName(int pageNum, int pageSize, String searchKey);

    int allInstitutionNum(String searchKey);


    void delInstitution(String institutionId);

    /**
     * 根据机构编号查询机构信息
     * @param institutionNo
     * @return
     */
    InstitutionEntity findByInstitutionNo(String institutionNo);

    /**
     * 添加机构和人员
     * @param saveInstitutionVO 机构人员
     */
    void saveInstitutionAndUser(SaveInstitutionVO saveInstitutionVO);

    /**
     * 获取到机构信息
     * @param pageNum 页码
     * @param pageSize 数量
     * @param searchKey 查询值
     * @return
     */
    Page<InstitutionEntity> findAllInstitution(int pageNum, int pageSize, String searchKey);

    Optional<InstitutionEntity> findById(String institutionId);

    List<InstitutionEntity> findByInstitutionName(String institutionName);

    String newNumber();

    InstitutionEntity update(InstitutionEntity entity);

    boolean checkTestNum(String institutionNo);
}
