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

namespace ASHermed.SinoInterface.Api.MySqlRepository
{
   
	public class DicMapHosDeptRepository : BaseRepositoryToASHermed_SinoInterface<Dic_Map_Hos_Dept>, IDicMapHosDeptRepository
    {
        public Dic_Map_Hos_Dept SelectByHosIdDeptID(int hosId, int deptID, int useoss)
        {
            var parms = new Dictionary<string, object>();
            parms.Add("@hosId", hosId);
            parms.Add("@deptId", deptID);
            parms.Add("@useOccasion", useoss);
            var selectSql = @"select ID, APT_HOS_ID, APT_DEPT_ID, IS_DELETED,CREATE_USER, CREATE_TIME, UPDATE_USER, UPDATE_TIME, `STATUS`,DEPT_PARENT_ID,
                CN_SMS_ADDR,EN_SMS_ADDR
        from dic_map_hos_dept
        where IS_DELETED = false
        and APT_HOS_ID = @hosId
        and APT_DEPT_ID = @deptId
        and USE_OCCASION=@useOccasion";
            var result = Query<Dic_Map_Hos_Dept>(selectSql, parms);
            return result.FirstOrDefault();
        }


    }


}
