using PoJun.Dapper.IRepository;
using ASHermed.SinoInterface.Entity.Test;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using ASHermed.SinoInterface.Repository.MySql;
using ASHermed.SinoInterface.Api.ContractModel.App;
using ASHermed.SinoInterface.Api.ContractModel;
using ASHermed.SinoInterface.Api.ContractModel.App.Model;

namespace ASHermed.SinoInterface.Api.IRepository
{

    public interface IPubUserInfoRepository : IBaseRepositoryToASHermed_SinoInterface<Pub_User_Info>
    {
        int InsertPubUserInfo(Pub_User_Info userInfo);
        int UpdatePubUserInfo(Pub_User_Info userInfo);
        Pub_User_Info SelectByIdentifier(string identifier);
        Pub_User_Info SelectByPhone(string acc);
        Pub_User_Info SelectByLinKinOpenId(string linKingOpenId);

        Pub_User_Info SelectByEmail(string acc);
        Pub_Map_User_Type SelectUserTypeByPhone(string phone);

        Pub_User_Info SelectByAppOpenId(string openId);

        Pub_User_Info SelectByAppOpenIdWithPhone(string openId, string account);
        Pub_User_Info GetUserByPhone(string phone);

        int UserComformInformed(int userId);

        Pub_User_Info SelectByPrimaryKey(int userId);

        int UpdateTreatment(int userId, string md5PassWord);
        Pub_User_Info SelectByTreatment(int userId, string md5PassWord);
        Pub_User_Info SelectById(int userId);
        List<Pub_User_Info> SelectByIds(List<int> userIds);
        string GetMHelper(string role);
        List<PubUserModel> SelectUserWithDocByImid(string aiteId);

        Pub_User_Info GetUserByUid(string uid);
        List<Pub_User_Info> GetAllUser();
        int CignaPerfectUserInfo(CignaUserInfo model);
        Pub_User_Info SelectByPatId(int pid);
        PatUserInfoResp SelectByImId(int userId, string imId);
        Task<List<Pub_Relationship>> GetRelationship();
        Task<List<Pub_Contactway>> GetContactway();
        Task<List<Pub_Howknow>> GetHowknow();
        int UserSignOff(int patId);
        List<Pub_User_Info> GetAllUserInfo();
        Sys_User GetReceptionInfoByAcc(string account, string password);
        Sys_User GetReceptionInfoByPhone(string phone);
        int UpdateUserVersion(int id, string vers);
        int InsertReceptionCode(string code);
        Pub_ReceptionCode GetPubReceptionCode(string code);
        int InvalidReceptionCode(string code);
        int InsertPubComplaint(Pub_Complaint userComplaintInfo);
        Pub_Sms_Survey GetSmsSurvey(string pid);
        int UpdateSmsSurvey(Pub_Sms_Survey ent);

        Task<int> YouZanMatchUserOpenId(int userID, string openId);

        /// <summary>
        /// 标记有赞付费用户
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="watchMode"></param> 
        /// <returns></returns> 
        int YouZanRecordWatchMode(int userId, int watchMode);

        Pub_User_Info GetUserByYZOpenId(string openId);
        UserDetail SelectDetailByPhone(string sharingPhone);

        /// <summary>
        /// 查询家庭成员列表
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        Task<List<PatientModel>> GetFamilyListByUserIdAsync(int userId);

        /// <summary>
        /// 获取详细信息
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="patientId"></param>
        /// <returns></returns>
        Task<PatientModel> GetPatientInfoByIdAsync(int userId, int patientId);

        /// <summary>
        /// 获取已绑定的家庭成员数量
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        Task<int> GetFamilyCountAsync(int userId);

        /// <summary>
        /// 家庭成员是否绑定了本人
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        Task<bool> IsBandMyselfAsync(int userId);

        /// <summary>
        /// 删除家庭成员
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="patientId"></param>
        /// <returns></returns>
        Task DeletePatientAsync(int userId, int patientId);
        List<Pub_User_Info> GetIsRegNotHasImIdUser();
    }
}
