package com.rf.psychological.institution.service;

import com.rf.psychological.institution.model.InstitutionUserEntity;

import java.util.List;

public interface InstitutionUserService {

    /**
     * 根据手机号查询
     *
     * @return
     */
    InstitutionUserEntity findInstitutionByNo(String institutionNo);

    /**
     * 根据机构id
     *
     * @return
     */
    InstitutionUserEntity getOne(String institutionId);

    InstitutionUserEntity findByPhoneAndPassword(String phone, String password);

    InstitutionUserEntity findByPhone(String phone);

    InstitutionUserEntity findByInstitutionNoAndPhone(String institutionNo, String phone);

    /**
     * 保存机构用户
     *
     * @param institutionUserEntity
     */
    void save(InstitutionUserEntity institutionUserEntity);


    /**
     * 根据手机号修改密码
     *
     * @return
     */
    void updatePassword(String phone, String password, String institutionNo);

    /**
     * 可以模糊查询所有机构用户
     *
     * @return
     */
    List<InstitutionUserEntity> findAllByName(int pageNum, int pageSize, String searchKey);

    int allNum(String searchKey);

    List<InstitutionUserEntity> findAllInAdminByInNo(int pageNum, int pageSize, String institutionNo, String searchKey);

    int numAllInAdminByInNo(String institutionNo, String searchKey);

    /**
     * 根据手机号删除机构用户
     *
     * @param phone
     */
    void deleteByPhoneAndInstitutionNo(String phone, String institutionNo);


    /**
     * 审核机构用户
     *
     * @param phone
     * @param userStatus
     */
    void updateUserStatusByPhone(String phone, String userStatus, String institutionNo);

}
