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;

namespace ASHermed.SinoInterface.Api.IRepository
{

    public interface IPubMapUserPatRepository : IBaseRepositoryToASHermed_SinoInterface<Pub_Map_User_Pat>
    {
        int InsertPubMapUserPat(Pub_Map_User_Pat pubMapUserPat);
        int UpdatePubMapUserPat(Pub_Map_User_Pat pubMapUserPat);
        /// <summary>
        /// 用于区分用户所属关系
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="patId"></param>
        /// <param name="type"></param>
        /// <returns></returns>
        Pub_Map_User_Pat GetPubUserPat(int userId, int patId, string type = "sino");
        /// <summary>
        /// 不区分用户所属关系
        /// </summary>
        /// <param name="patId"></param>
        /// <returns></returns>
        Pub_Map_User_Pat GetUserPat(int userId, int patId);
        List<Pub_Map_User_Pat> GetUserPats(int userId);
        List<Pub_Map_User_Pat> SelectByPatId(int id, string type = "sino");

        /// <summary>
        /// 根据患者Id查询
        /// </summary>
        /// <param name="patId"></param>
        /// <returns></returns>
        Pub_Map_User_Pat GetByPatId(int patId);

        /// <summary>
        /// 查询患者的所有绑定关系
        /// </summary>
        /// <param name="patId"></param>
        /// <returns></returns>
        List<Pub_Map_User_Pat> GetBind(int patId);

        Task<Pub_Map_User_Pat> GetByUserIdAndPatIdAsync(int userId, int patId);
        Pub_Map_User_Pat GetByUserIdOneself(int userId);
    }
}
