/// <summary>
        /// 环境检测列表
        /// </summary>
        /// <param name="iFilter"></param>
        /// <returns></returns>
        public List <BUS_ENVIRONMENTTEST> GetAllEnvironmentTestService(CommonFilter iFilter)
        {
            string filter = "1=1";

            filter += iFilter.GetQueryString();
            List <BUS_ENVIRONMENTTEST> list = EntityOperate <BUS_ENVIRONMENTTEST> .GetEntityList(filter, "ENVID desc");

            if (list == null || list.Count <= 0)
            {
                return(new List <BUS_ENVIRONMENTTEST>());
            }
            return(list);
        }
示例#2
0
        /// <summary>
        /// 根据筛选条件查询住院病人授权数据列表
        /// </summary>
        /// <param name="iFilter"></param>
        /// <returns></returns>
        public List <CD_InpatientAuthorized> GetAll(CommonFilter iFilter)
        {
            string filter = "1=1";

            filter += iFilter.GetQueryString();
            List <CD_InpatientAuthorized> list = EntityOperate <CD_InpatientAuthorized> .GetEntityList(filter, "InpatientId");

            if (list == null || list.Count <= 0)
            {
                return(new List <CD_InpatientAuthorized>());
            }
            return(list);
        }
示例#3
0
        /// <summary>
        /// 获取所有反馈单
        /// </summary>
        /// <param name="iFilter"></param>
        /// <returns></returns>
        public List <BUS_YGDCFKD> GetAllFkd(CommonFilter iFilter)
        {
            string filter = "1=1";

            filter += iFilter.GetQueryString();
            List <BUS_YGDCFKD> list = EntityOperate <BUS_YGDCFKD> .GetEntityList(filter, "FKDID desc");

            if (list == null || list.Count <= 0)
            {
                return(new List <BUS_YGDCFKD>());
            }
            return(list);
        }
示例#4
0
        /// <summary>
        /// 根据筛选条件查询模板数据列表
        /// </summary>
        /// <param name="iFilter"></param>
        /// <returns></returns>
        public List <AI_StructuredTemplate> GetAll(CommonFilter iFilter)
        {
            string filter = "1=1";

            filter += iFilter.GetQueryString();
            List <AI_StructuredTemplate> list = EntityOperate <AI_StructuredTemplate> .GetEntityList(filter, "CreateTime");

            if (list == null || list.Count <= 0)
            {
                return(new List <AI_StructuredTemplate>());
            }
            return(list);
        }
示例#5
0
        /// <summary>
        /// 获取手卫生依从性及正确性现场调查列表
        /// </summary>
        /// <param name="iFilter"></param>
        /// <returns></returns>
        public List <BUS_HANDHYGIENE> GetAllHandHygieneService(CommonFilter iFilter)
        {
            string filter = "1=1";

            filter += iFilter.GetQueryString();
            List <BUS_HANDHYGIENE> list = EntityOperate <BUS_HANDHYGIENE> .GetEntityList(filter, "HANDID desc");

            if (list == null || list.Count <= 0)
            {
                return(new List <BUS_HANDHYGIENE>());
            }
            return(list);
        }
示例#6
0
        /// <summary>
        /// 根据筛选条件查询死亡记录数据列表
        /// </summary>
        /// <param name="iFilter"></param>
        /// <returns></returns>
        public List <CD_DeathRecord> GetAll(CommonFilter iFilter)
        {
            string filter = "1=1";

            filter += iFilter.GetQueryString();
            List <CD_DeathRecord> list = EntityOperate <CD_DeathRecord> .GetEntityList(filter, "DeathId");

            if (list == null || list.Count <= 0)
            {
                return(new List <CD_DeathRecord>());
            }
            return(list);
        }
        /// <summary>
        /// 多重耐药菌隔离措施列表
        /// </summary>
        /// <param name="iFilter"></param>
        /// <returns></returns>
        public List <BUS_DRUGRESISTQUAR> GetAllDrugResistQuarService(CommonFilter iFilter)
        {
            string filter = "1=1";

            filter += iFilter.GetQueryString();
            List <BUS_DRUGRESISTQUAR> list = EntityOperate <BUS_DRUGRESISTQUAR> .GetEntityList(filter, "DCID desc");

            if (list == null || list.Count <= 0)
            {
                return(new List <BUS_DRUGRESISTQUAR>());
            }
            return(list);
        }
示例#8
0
        /// <summary>
        /// 医院感染病例个案调查列表
        /// </summary>
        /// <param name="iFilter"></param>
        /// <returns></returns>
        public List <BUS_INFECTIONEXAMINE> GetAllInfectionExamineService(CommonFilter iFilter)
        {
            string filter = "1=1";

            filter += iFilter.GetQueryString();
            List <BUS_INFECTIONEXAMINE> list = EntityOperate <BUS_INFECTIONEXAMINE> .GetEntityList(filter, "EXID desc");

            if (list == null || list.Count <= 0)
            {
                return(new List <BUS_INFECTIONEXAMINE>());
            }
            return(list);
        }
示例#9
0
        /// <summary>
        /// 根据筛选条件查询病程记录数据列表
        /// </summary>
        /// <param name="iFilter"></param>
        /// <returns></returns>
        public List <CD_FormEmr> GetAll(CommonFilter iFilter)
        {
            string filter = "1=1";

            filter += iFilter.GetQueryString();
            List <CD_FormEmr> list = EntityOperate <CD_FormEmr> .GetEntityList(filter, "CreateTime");

            if (list == null || list.Count <= 0)
            {
                return(new List <CD_FormEmr>());
            }
            return(list);
        }
示例#10
0
        /// <summary>
        /// 获取所有洗手考核标准
        /// </summary>
        /// <param name="iFilter"></param>
        /// <returns></returns>
        public List <BUS_DISINFECTION> GetAllDisInfection(CommonFilter iFilter)
        {
            string filter = "1=1";

            filter += iFilter.GetQueryString();
            List <BUS_DISINFECTION> list = EntityOperate <BUS_DISINFECTION> .GetEntityList(filter, "DISID desc");

            if (list == null || list.Count <= 0)
            {
                return(new List <BUS_DISINFECTION>());
            }
            return(list);
        }
示例#11
0
        /// <summary>
        /// 获取所有洗手考核标准
        /// </summary>
        /// <param name="iFilter"></param>
        /// <returns></returns>
        public List <BUS_WASHHANDOPERATION> GetAllWashHand(CommonFilter iFilter)
        {
            string filter = "1=1";

            filter += iFilter.GetQueryString();
            List <BUS_WASHHANDOPERATION> list = EntityOperate <BUS_WASHHANDOPERATION> .GetEntityList(filter, "WHOID desc");

            if (list == null || list.Count <= 0)
            {
                return(new List <BUS_WASHHANDOPERATION>());
            }
            return(list);
        }
示例#12
0
        /// <summary>
        /// 获取系统用户分组数据列表
        /// </summary>
        /// <param name="commonFilter">通用的数据检索器</param>
        /// <returns>系统用户分组数据列表</returns>
        public List <GI_Role> GetAll(CommonFilter commonFilter)
        {
            string Filter = "1=1";

            if (!string.IsNullOrWhiteSpace(commonFilter.keyword))
            {
                Filter += string.Format(" and ROLENAME like '%{0}%'", commonFilter.keyword);
            }
            Filter += commonFilter.GetQueryString();
            List <GI_Role> list = EntityOperate <GI_Role> .GetEntityList(Filter);

            if (list == null || list.Count <= 0)
            {
                return(new List <GI_Role>());
            }
            list.ForEach((f) =>
            {
                if (!string.IsNullOrWhiteSpace(f.RolePower))
                {
                    f.PowerName = "";
                    foreach (string each in f.RolePower.Split(','))
                    {
                        switch (each)
                        {
                        case "1":
                            f.PowerName += "查看,";
                            break;

                        case "2":
                            f.PowerName += "编辑,";
                            break;

                        case "3":
                            f.PowerName += "删除,";
                            break;

                        case "4":
                            f.PowerName += "打印,";
                            break;

                        case "5":
                            f.PowerName += "授权,";
                            break;
                        }
                    }
                    f.PowerName = f.PowerName.Trim(',');
                }
            });
            return(list);
        }
示例#13
0
        /// <summary>
        /// 根据洗手考核ID获取单个洗手考核数据
        /// </summary>
        /// <param name="iFilter"></param>
        /// <returns></returns>
        public Tuple <BUS_WASHHANDOPERATION, List <AI_DeptInfo> > GetWashHandModel(CommonFilter iFilter, string WHOID)
        {
            string filter = "1=1";

            filter += iFilter.GetQueryString();
            //  if (!string.IsNullOrWhiteSpace(WHOID)) { filter += " and WHOID=" + WHOID + ""; }

            BUS_WASHHANDOPERATION model = EntityOperate <BUS_WASHHANDOPERATION> .GetEntityById(WHOID, "WHOID");

            var departList = EntityOperate <AI_DeptInfo> .GetEntityList(filter + (model == null ? "" : " and deptid='" + model.DEPTID + "'"), "ParentID,DeptID");

            var tupe = new Tuple <BUS_WASHHANDOPERATION, List <AI_DeptInfo> >(model, departList);

            return(tupe);
        }
示例#14
0
        /// <summary>
        /// 根据洗手考核ID获取单个洗手考核数据
        /// </summary>
        /// <param name="iFilter"></param>
        /// <returns></returns>
        public Tuple <BUS_DISINFECTION, List <AI_DeptInfo> > GetDisInfectionModel(CommonFilter iFilter, string DISID)
        {
            string filter = "1=1";

            filter += iFilter.GetQueryString();
            // if (!string.IsNullOrWhiteSpace(DISID)) { filter += " and DISID=" + DISID + ""; }

            BUS_DISINFECTION model = EntityOperate <BUS_DISINFECTION> .GetEntityById(DISID, "DISID");

            var departList = EntityOperate <AI_DeptInfo> .GetEntityList(filter + (model == null ? "" : " and deptid='" + model.DEPTID + "'"), "ParentID,DeptID");

            var tupe = new Tuple <BUS_DISINFECTION, List <AI_DeptInfo> >(model, departList);

            return(tupe);
        }
        /// <summary>
        /// 根据ID获取环境检测列表数据列表
        /// </summary>
        /// <param name="iFilter"></param>
        /// <returns></returns>
        public Tuple <List <BUS_ENVIRONMENTTEST_SOURCE>, List <AI_DeptInfo>, BUS_ENVIRONMENTTEST> GetEnvironmentTestSourceList(CommonFilter iFilter, string ENVID)
        {
            string filter = "1=1";

            filter += iFilter.GetQueryString();

            List <BUS_ENVIRONMENTTEST_SOURCE> list = EntityOperate <BUS_ENVIRONMENTTEST_SOURCE> .GetEntityList(filter + (string.IsNullOrWhiteSpace(ENVID) == true ? "" : " and ENVID='" + ENVID + "'"));

            var model = EntityOperate <BUS_ENVIRONMENTTEST> .GetEntityById(ENVID, "ENVID");

            var departList = EntityOperate <AI_DeptInfo> .GetEntityList(filter + (model == null ? "" : " and deptid='" + model.DEPTID + "'"), "ParentID,DeptID");

            var tupe = new Tuple <List <BUS_ENVIRONMENTTEST_SOURCE>, List <AI_DeptInfo>, BUS_ENVIRONMENTTEST>(list, departList, model);

            return(tupe);
        }
示例#16
0
        /// <summary>
        /// 根据ID获取多重耐药菌隔离措施数据列表
        /// </summary>
        /// <param name="iFilter"></param>
        /// <returns></returns>
        public Tuple <List <BUS_DRUGRESISTQUAR_SOURCE>, List <AI_DeptInfo>, BUS_DRUGRESISTQUAR> GetDrugResistQuarSourceList(CommonFilter iFilter, string DCID)
        {
            string filter = "1=1";

            filter += iFilter.GetQueryString();

            List <BUS_DRUGRESISTQUAR_SOURCE> list = EntityOperate <BUS_DRUGRESISTQUAR_SOURCE> .GetEntityList(filter + (string.IsNullOrWhiteSpace(DCID) == true ? "" : " and DCID='" + DCID + "'"));

            var model = EntityOperate <BUS_DRUGRESISTQUAR> .GetEntityById(DCID, "DCID");

            var departList = EntityOperate <AI_DeptInfo> .GetEntityList(filter + (model == null ? "" : " and deptid='" + model.DEPTID + "'"), "ParentID,DeptID");

            var tupe = new Tuple <List <BUS_DRUGRESISTQUAR_SOURCE>, List <AI_DeptInfo>, BUS_DRUGRESISTQUAR>(list, departList, model);

            return(tupe);
        }
示例#17
0
        /// <summary>
        /// 根据筛选条件查询手术记录数据列表
        /// </summary>
        /// <param name="iFilter"></param>
        /// <returns></returns>
        public List <CD_OperationRecord> GetAll(CommonFilter iFilter)
        {
            string filter = "1=1";

            if (!string.IsNullOrWhiteSpace(iFilter.keyword))
            {
                filter += string.Format(" and OperationName like '%{0}%'", iFilter.keyword);
            }
            filter += iFilter.GetQueryString();
            List <CD_OperationRecord> list = EntityOperate <CD_OperationRecord> .GetEntityList(filter, "OperationId");

            if (list == null || list.Count <= 0)
            {
                return(new List <CD_OperationRecord>());
            }
            return(list);
        }
示例#18
0
        /// <summary>
        /// 获取医生分组列表
        /// </summary>
        /// <param name="CommonFilter"></param>
        /// <returns></returns>
        public List <AI_DoctorGroup> GetAll(CommonFilter commonFilter)
        {
            string Filter = " 1= 1";

            if (!string.IsNullOrWhiteSpace(commonFilter.keyword))
            {
                Filter += string.Format(" and (GROUPNAME like '%{0}%' or GROUPNUM like '%{0}%')", commonFilter.keyword);
            }
            Filter += commonFilter.GetQueryString();
            List <AI_DoctorGroup> list = EntityOperate <AI_DoctorGroup> .GetEntityList(Filter).FindAll(f => f.Del != 1);

            if (list == null || list.Count <= 0)
            {
                return(new List <AI_DoctorGroup>());
            }
            return(list);
        }
示例#19
0
        /// <summary>
        /// 根据ID获取手卫生依从性及正确性现场调查评分数据表
        /// </summary>
        /// <param name="iFilter"></param>
        /// <returns></returns>
        public Tuple <List <BUS_HANDHYGIENE_SOURCE>, List <AI_DeptInfo>, BUS_HANDHYGIENE> GetHandHygieneSourceList(CommonFilter iFilter, string HANDID)
        {
            string filter = "1=1";

            filter += iFilter.GetQueryString();
            //if (!string.IsNullOrWhiteSpace(RISKID)) { filter += " and RISKID='" + RISKID + "'"; }

            List <BUS_HANDHYGIENE_SOURCE> list = EntityOperate <BUS_HANDHYGIENE_SOURCE> .GetEntityList(filter + (string.IsNullOrWhiteSpace(HANDID) == true ? "" : " and HANDID='" + HANDID + "'"));

            var model = EntityOperate <BUS_HANDHYGIENE> .GetEntityById(HANDID, "HANDID");

            var departList = EntityOperate <AI_DeptInfo> .GetEntityList(filter + (model == null ? "" : " and deptid='" + model.DEPTID + "'"), "ParentID,DeptID");

            var tupe = new Tuple <List <BUS_HANDHYGIENE_SOURCE>, List <AI_DeptInfo>, BUS_HANDHYGIENE>(list, departList, model);

            return(tupe);
        }
示例#20
0
        /// <summary>
        /// 根据筛选条件查询标准诊断数据列表
        /// </summary>
        /// <param name="iFilter"></param>
        /// <returns></returns>
        public List <AI_Diagnosis> GetDiagnosisList(CommonFilter iFilter)
        {
            string filter = "1=1";

            if (!string.IsNullOrWhiteSpace(iFilter.keyword))
            {
                filter += string.Format(" and (DiagnosisName like '%{0}%' or DiagnosisCode like '%{0}%' or SpellCode like '%{0}%')", iFilter.keyword.ToUpper());
            }
            filter += iFilter.GetQueryString();
            List <AI_Diagnosis> list = EntityOperate <AI_Diagnosis> .GetEntityList(filter, "DiagnosisId");

            if (list == null || list.Count <= 0)
            {
                return(new List <AI_Diagnosis>());
            }
            return(list);
        }
示例#21
0
        public List <CD_Consultation> GetAll(CommonFilter commonFilter)
        {
            string filter = "1=1";

            if (!string.IsNullOrWhiteSpace(commonFilter.keyword))
            {
                //  filter += string.Format(" and Name like '%{0}%'", commonFilter.keyword);
                filter += commonFilter.GetQueryString();
            }
            List <CD_Consultation> list = EntityOperate <CD_Consultation> .GetEntityList(filter, "OrganID");

            if (list == null || list.Count <= 0)
            {
                return(new List <CD_Consultation>());
            }
            return(list);
        }
示例#22
0
        /// <summary>
        /// 获取用户数据列表
        /// </summary>
        /// <param name="commonFilter"></param>
        /// <returns></returns>
        public List <GI_UserInfo> GetAll(CommonFilter commonFilter)
        {
            string filter = "1=1";

            if (!string.IsNullOrWhiteSpace(commonFilter.keyword))
            {
                filter += string.Format(" and USERNAME like '%{0}%'", commonFilter.keyword);
            }
            filter += commonFilter.GetQueryString();
            List <GI_UserInfo> list = EntityOperate <GI_UserInfo> .GetEntityList(filter);

            if (list == null || list.Count <= 0)
            {
                return(new List <GI_UserInfo>());
            }

            return(list);
        }
示例#23
0
        /// <summary>
        /// 根据ID获取医院感染病例个案调查和血清学和病原学检测 数据列表
        /// </summary>
        /// <param name="iFilter"></param>
        /// <returns>依次返回:感染调查表数据,血清学病原学检测列表,发生感染时所在科室,曾住科室</returns>
        public Tuple <BUS_INFECTIONEXAMINE, List <BUS_INFECTIONEXAMINE_BLOOD>, List <AI_DeptInfo>, List <AI_DeptInfo> > GetInfectionExamineSource(CommonFilter iFilter, string EXID)
        {
            string filter = "1=1";

            filter += iFilter.GetQueryString();

            var model = EntityOperate <BUS_INFECTIONEXAMINE> .GetEntityById(EXID, "EXID");

            List <BUS_INFECTIONEXAMINE_BLOOD> bloodList = EntityOperate <BUS_INFECTIONEXAMINE_BLOOD> .GetEntityList(filter + (string.IsNullOrWhiteSpace(EXID) == true ? "" : " and EXID='" + EXID + "'"));

            var departList1 = EntityOperate <AI_DeptInfo> .GetEntityList(filter + (model == null ? "" : " and deptid='" + model.SZKSID + "'"), "ParentID,DeptID");  //所在科室

            var departList2 = EntityOperate <AI_DeptInfo> .GetEntityList(filter + (model == null ? "" : " and deptid='" + model.CZKSID + "'"), "ParentID,DeptID");  //曾住科室

            var tupe = new Tuple <BUS_INFECTIONEXAMINE, List <BUS_INFECTIONEXAMINE_BLOOD>, List <AI_DeptInfo>, List <AI_DeptInfo> >(model, bloodList, departList1, departList2);

            return(tupe);
        }
示例#24
0
        /// <summary>
        /// 根据反馈单数据ID 查询单条反馈单数据
        /// </summary>
        /// <param name="iFilter"></param>
        /// <returns></returns>
        public Tuple <BUS_YGDCFKD, BUS_YGDCFKD_SOURCE> GetFkdSourceModel(CommonFilter iFilter, string fkdSourceId)
        {
            string filter = "1=1";

            filter += iFilter.GetQueryString();
            // if (string.IsNullOrWhiteSpace(fkdSourceId)) { filter += " and FKDSOURCEID=" + fkdSourceId + ""; }

            BUS_YGDCFKD_SOURCE bus_ygdcfkd_source = EntityOperate <BUS_YGDCFKD_SOURCE> .GetEntityById(fkdSourceId, "FKDSOURCEID");

            BUS_YGDCFKD bus_ygdcfkd = EntityOperate <BUS_YGDCFKD> .GetEntityById((bus_ygdcfkd_source == null ? "" : bus_ygdcfkd_source.FKDID), "FKDID");

            var departList = EntityOperate <AI_DeptInfo> .GetEntityList(filter + (bus_ygdcfkd_source == null ? "" : " and deptid='" + bus_ygdcfkd.DEPTID + "'"), "ParentID,DeptID");

            bus_ygdcfkd_source.DpetList = departList;

            var tupe = new Tuple <BUS_YGDCFKD, BUS_YGDCFKD_SOURCE>(bus_ygdcfkd, bus_ygdcfkd_source);

            return(tupe);
        }
示例#25
0
        public List <GI_SYSAPPINFO> GetAll(CommonFilter commonFilter)
        {
            string Filter = "ISCANCE != 1";

            if (!string.IsNullOrWhiteSpace(commonFilter.keyword))
            {
                Filter += string.Format(" and (MODULENAME like '%{0}%' or MODULESHORTNAME like '%{0}%')", commonFilter.keyword);
            }
            Filter += commonFilter.GetQueryString();
            List <GI_SYSAPPINFO> list = EntityOperate <GI_SYSAPPINFO> .GetEntityList(Filter).FindAll(f => f.IsCance != 1);

            if (list == null || list.Count <= 0)
            {
                return(new List <GI_SYSAPPINFO>());
            }
            list.ForEach((f) =>
            {
                f.IsCanceName = f.IsCance != 1 ? "正常" : "作废";
            });
            return(list);
        }
示例#26
0
        /// <summary>
        /// 根据反馈单ID获取所有反馈单数据
        /// </summary>
        /// <param name="iFilter"></param>
        /// <returns></returns>
        public List <BUS_YGDCFKD_SOURCE> GetAllFkdSource(CommonFilter iFilter, string FKDID)
        {
            string filter = "1=1";

            filter += iFilter.GetQueryString();
            if (!string.IsNullOrWhiteSpace(FKDID))
            {
                filter += " and FKDID=" + FKDID + "";
            }
            else
            {
                filter += " and FKDID=-1";
            }

            List <BUS_YGDCFKD_SOURCE> list = EntityOperate <BUS_YGDCFKD_SOURCE> .GetEntityList(filter, "FKDSOURCEID desc");

            if (list == null || list.Count <= 0)
            {
                return(new List <BUS_YGDCFKD_SOURCE>());
            }
            return(list);
        }
示例#27
0
        /// <summary>
        /// 根据ID获取手卫生依从性调查评分 数据分析表
        /// </summary>
        /// <param name="iFilter"></param>
        /// <param name="HANDID"></param>
        public Tuple <List <HandHygieneGroupAnalysis>, List <HandHygieneDczs>, List <HandHygieneOpModel> > GetHandHygiAnalysisSourceList(CommonFilter iFilter, string HANDID)
        {
            string filter = "1=1";

            filter += iFilter.GetQueryString();


            Func <string, int> funcSort = v =>
            {
                var sort = 0;
                switch (v)
                {
                case "护士":
                    sort = 1;
                    break;

                case "医技":
                    sort = 2;
                    break;

                case "医生":
                    sort = 3;
                    break;

                case "工人":
                    sort = 4;
                    break;
                }
                return(sort);
            };

            List <BUS_HANDHYGIENE_SOURCE> handHygiSource = EntityOperate <BUS_HANDHYGIENE_SOURCE> .GetEntityList(filter + (string.IsNullOrWhiteSpace(HANDID) == true ? "" : " and HANDID='" + HANDID + "'"));

            var handHygieneGroupList = handHygiSource.GroupBy(p => p.ZY).Select(g => new HandHygieneGroupAnalysis
            {
                handhygiene_source = g,
                zy         = g.Key,
                sort       = funcSort(g.Key),
                currentSum = g.Count()
            }).OrderBy(g => g.sort).ToList();

            //调查总数
            #region
            var dczsSql = string.Format(@" select * from 
                            (select count(jcbrq) jcbrq ,zy  from bus_handhygiene_source  where jcbrq != '正确'  and handid ={0}  group by zy ) 
                            pivot 
                            (
                               sum(jcbrq) for
                               zy in ('医生' ys,'护士' hs,'医技' yj,'工人' gr)
                            )
                            union all 
                            select * from 
                            (select count(JCBRH) JCBRH ,zy  from bus_handhygiene_source  where  JCBRH != '正确' and handid ={0} group by zy ) 
                            pivot 
                            (
                               sum(JCBRH) for
                               zy in ('医生' ys,'护士' hs,'医技' yj,'工人' gr)
                            ) 
                            union all 
                            select * from 
                            (select count(JCWJWPQ) JCWJWPQ ,zy  from bus_handhygiene_source  where  JCWJWPQ != '正确' and handid ={0} group by zy ) 
                            pivot 
                            (
                               sum(JCWJWPQ) for
                               zy in ('医生' ys,'护士' hs,'医技' yj,'工人' gr)
                            ) 
                            union all 
                            select * from 
                            (select count(JCBRHJH) JCBRHJH ,zy  from bus_handhygiene_source  where  JCBRHJH != '正确' and handid = {0} group by zy ) 
                            pivot 
                            (
                               sum(JCBRHJH) for
                               zy in ('医生' ys,'护士' hs,'医技' yj,'工人' gr)
                            )
                            union all 
                            select * from 
                            (select count(JCWWH) JCWWH ,zy  from bus_handhygiene_source  where  JCWWH != '正确' and handid = {0} group by zy ) 
                            pivot 
                            (
                               sum(JCWWH) for
                               zy in ('医生' ys,'护士' hs,'医技' yj,'工人' gr)
                            )
                            union all 
                            select * from 
                            (select count(PCQ) PCQ ,zy  from bus_handhygiene_source  where  PCQ != '正确' and handid = {0} group by zy ) 
                            pivot 
                            (
                               sum(PCQ) for
                               zy in ('医生' ys,'护士' hs,'医技' yj,'工人' gr)
                            )", HANDID);

            #endregion
            var dczsListSource = EntityOperate <HandHygieneDczs> .GetEntityListBySQL(dczsSql);

            var ysOpCount = dczsListSource.Sum(p => p.ys); //医生操作总数
            var hsOpCount = dczsListSource.Sum(p => p.hs); //护士操作总数
            var yjOpCount = dczsListSource.Sum(p => p.yj); //医技操作总数
            var grOpCount = dczsListSource.Sum(p => p.gr); //工人操作总数
            dczsListSource.Add(new HandHygieneDczs {
                ys = ysOpCount, hs = hsOpCount, yj = yjOpCount, gr = grOpCount
            });

            // List<HandHygieneDczs> dczsList = new List<HandHygieneDczs>();
            // string[] itemArr = { "接触病人前", "接触病人后", "无菌操作前", "接触病人周围环境后", "接触污物(摘手套)后", "配餐前", "总数" };



            var      opModelList = new List <HandHygieneOpModel>();
            string[] zyArr       = { "医生", "护士", "医技", "工人" };
            foreach (var zyItem in zyArr)
            {
                //获取操作列表sql
                var getOpList = string.Format(@"select sum(case jcbrq when '消' then 1 else 0  end) x,sum(case jcbrq when '洗' then 1 else 0  end) xx, sum(case jcbrq when '未' then 1 else 0  end) w 
                                              from bus_handhygiene_source  where zy = '{0}' and handid = {1} union all  --医生接触病人前
  
                                            select sum(case JCBRH when '消' then 1 else 0  end) x,sum(case JCBRH when '洗' then 1 else 0  end) xx, sum(case JCBRH when '未' then 1 else 0  end) w 
                                              from bus_handhygiene_source  where zy = '{0}' and handid = {1} union all  --接触病人后
  
                                            select sum(case JCWJWPQ when '消' then 1 else 0  end) x,sum(case JCWJWPQ when '洗' then 1 else 0  end) xx, sum(case JCWJWPQ when '未' then 1 else 0  end) w 
                                              from bus_handhygiene_source  where zy = '{0}' and handid = {1} union all   --接触无菌物品前
  
                                            select sum(case JCBRHJH when '消' then 1 else 0  end) x,sum(case JCBRHJH when '洗' then 1 else 0  end) xx, sum(case JCBRHJH when '未' then 1 else 0  end) w  
                                              from bus_handhygiene_source  where zy = '{0}' and handid = {1} union all --接触病人周围环境后
  
                                            select sum(case JCWWH when '消' then 1 else 0  end) x,sum(case JCWWH when '洗' then 1 else 0  end) xx, sum(case JCWWH when '未' then 1 else 0  end) w  
                                              from bus_handhygiene_source  where zy = '{0}' and handid = {1} union all  --接触污物(摘手套)后
  
                                            select sum(case PCQ when '消' then 1 else 0  end) x,sum(case PCQ when '洗' then 1 else 0  end) xx, sum(case PCQ when '未' then 1 else 0  end) w 
                                              from bus_handhygiene_source  where zy = '{0}'and handid = {1}   --配餐前", zyItem, HANDID);
                HandHygieneOpModel opModel = new HandHygieneOpModel();
                var opList = EntityOperate <OpCategory> .GetEntityListBySQL(getOpList);

                opModel.zyName = zyItem;
                opModel.opList = opList;
                var opCategoryModel = new OpCategory {
                    x = opList.Select(p => p.x).Sum(), xx = opList.Select(p => p.xx).Sum(), w = opList.Select(p => p.w).Sum()
                };
                opModel.opList.Add(opCategoryModel);
                opModelList.Add(opModel);
            }

            return(new Tuple <List <HandHygieneGroupAnalysis>, List <HandHygieneDczs>, List <HandHygieneOpModel> >(handHygieneGroupList, dczsListSource, opModelList));
        }