예제 #1
0
        public IList <TB_CHILDBASE> GetListByCheckHs(string checkday, string isjiuzhen, string hospital, int cd_id)
        {
            string sqls = "select distinct b.* from tb_childcheck a left join TB_CHILDBASE b on a.childid=b.id where ((a.checkday='" + checkday + "'" + " and  a.hospital='" + hospital + "'";

            if (isjiuzhen == "未就诊")
            {
                sqls += " and (a.zhenduan is null or a.zhenduan ='')";
            }
            else
            {
                sqls += " and a.zhenduan is not null and a.zhenduan !=''";
            }
            sqls += " ) or b.id=" + cd_id + ")  order by b.childname";
            return(DALStatic.GetListBySql <TB_CHILDBASE>(sqls, ""));
        }
예제 #2
0
        public IList <TB_CHILDBASE> GetListByCheckDoc(string checkday, string isjiuzhen, int cd_id)
        {
            string sqls = "select distinct b.* from tb_childcheck a left join TB_CHILDBASE b on a.childid=b.id where ((a.checkday='" + checkday + "'";

            if (isjiuzhen == "未就诊")
            {
                sqls += " and (a.zhenduan is null or a.zhenduan ='')";
            }
            else
            {
                sqls += " and a.zhenduan is not null and a.zhenduan !=''";
            }
            sqls += " ) or b.id=" + cd_id + ") and (a.ck_fz='" + globalInfoClass.UserName + "' or a.ck_fz='" + globalInfoClass.Zhicheng + "' or a.doctorname='" + globalInfoClass.UserName + "') order by b.childname";
            return(DALStatic.GetListBySql <TB_CHILDBASE>(sqls, ""));
        }
예제 #3
0
 public IList <SYS_MENUS> GetListBySql(string menu_type, string role_code)
 {
     if (role_code == "-1")
     {
         return(GetList(menu_type));
     }
     else
     {
         string sqls = " select b.* from sys_role_menu a "
                       + " left join SYS_MENUS b on a.menu_code=b.menu_code "
                       + " where a.role_code='" + role_code + "' and b.menu_type='" + menu_type + "' and is_enable='1' "
                       + " order by b.menu_code ";
         var list = DALStatic.GetListBySql <SYS_MENUS>(sqls);
         return(list);
     }
 }
예제 #4
0
        public IList <yy_asd_tabCount> GetList(DateTime startTime, DateTime endTime, string pz_lx)
        {
            var list = new List <yy_asd_tabCount>();

            while (startTime.Date <= endTime.Date)
            {
                var sql = @"SELECT   @yy_rq yy_rq ,
         pz_xm ,
         pzDetails.time time ,
         (   SELECT COUNT(1)
             FROM   dbo.YY_ASD_TAB
             WHERE  yy_xm = pz.pz_xm
                    AND yy_sjd = pzDetails.time
                    AND yy_rq = @yy_rq ) count ,
         pzDetails.countPerTime totalCount
FROM     [dbo].[yy_pz_tab] pz
         LEFT JOIN dbo.YY_PZ_DETAILS_TAB pzDetails ON pzDetails.pzid = pz.id
WHERE    pz.pz_lx = @pz_lx
         AND pz.pz_xq LIKE ( '%'
                             + CAST(( DATEPART(dw, @yy_rq) - 1 ) AS VARCHAR(1))
                             + '%' )
ORDER BY pz.id;";

                var prms = new SqlParameter[]
                {
                    new SqlParameter("@pz_lx", pz_lx),
                    new SqlParameter("@yy_rq", startTime.ToString("yyyy-MM-dd")),
                };

                list.AddRange(DALStatic.GetListBySql <yy_asd_tabCount>(sql, prms));

                startTime = startTime.AddDays(1);
            }

            return(list);
        }
예제 #5
0
        public IList <TB_CHILDBASE> GetListBySqlCheckTime(string checkTime)
        {
            string sqls = "select distinct a.* from TB_CHILDBASE a where EXISTS (select 1 from tb_childcheck where a.id = childid AND checkday='" + checkTime + "')";

            return(DALStatic.GetListBySql <TB_CHILDBASE>(sqls, ""));
        }
예제 #6
0
        public IList <TB_CHILDBASE> GetListByCheckDoc(string checkday, string isjiuzhen, int cd_id, IList <SYS_MENUS> list)
        {
            string sqls = "";

            if (globalInfoClass.Ward_name.Trim().Equals("儿保室"))
            {
                sqls = "select distinct b.* from tb_childcheck a left join TB_CHILDBASE b on a.childid=b.id where ((a.checkday='" + checkday + "'";
                if (isjiuzhen == "未就诊")
                {
                    sqls += " and (a.zhenduan is null or a.zhenduan ='')";
                }
                else
                {
                    sqls += " and a.zhenduan is not null and a.zhenduan !=''";
                }
                sqls += " ) or b.id=" + cd_id + ") and (a.ck_fz='" + globalInfoClass.UserName + "' or a.ck_fz='" + globalInfoClass.Zhicheng + "' or a.ck_fz='' or a.doctorname='" + globalInfoClass.UserName + "') order by b.childname";
            }
            else if (globalInfoClass.Ward_name.Trim().Equals("测评室") || globalInfoClass.Ward_name.Trim().Equals("护士站"))
            {
                sqls = "";
                if (isjiuzhen == "未就诊")
                {
                }
                else
                {
                    sqls = "select distinct c.* from ( select a.* from dbo.TB_CHILDBASE a where 1 = 2 ";
                    foreach (SYS_MENUS obj in list)
                    {
                        /*
                         * ADHD报告
                         * ADOS1报告
                         * ADOS2报告
                         * ADOS3报告
                         * ADOS4报告
                         * ASD报告(4岁以下)
                         * ASD报告(4岁及以上)
                         * Gesell评价表
                         * SM评价表
                         * 大韦氏评价表
                         * 小韦氏评价表
                         * 语言筛查<3岁3月
                         * 语言筛查>3岁3月
                         * 能力测试<6岁
                         * 注意力测验
                         * DDST
                         * 图片词汇测试
                         * DST测试
                         */
                        if (obj.MENU_URL == null || obj.MENU_NAME.Trim().Equals("基本信息") || obj.MENU_URL.Trim().Equals(""))
                        {
                            continue;
                        }
                        if (obj.MENU_NAME.Trim().Equals("ADHD报告"))
                        {
                            sqls += "union all select a.* from dbo.TB_CHILDBASE a inner join dbo.cp_adhd_tab b on a.id = b.child_id where b.csrq = " + "'" + checkday + "' ";
                        }
                        else if (obj.MENU_NAME.Trim().Equals("ADOS1报告"))
                        {
                            sqls += "union all select a.* from dbo.TB_CHILDBASE a inner join dbo.cp_ados1_tab b on a.id = b.child_id where b.pgrq = " + "'" + checkday + "' ";
                        }
                        else if (obj.MENU_NAME.Trim().Equals("ADOS2报告"))
                        {
                            sqls += "union all select a.* from dbo.TB_CHILDBASE a inner join dbo.cp_ados2_tab b on a.id = b.child_id where b.pgrq = " + "'" + checkday + "' ";
                        }
                        else if (obj.MENU_NAME.Trim().Equals("ADOS3报告"))
                        {
                            sqls += "union all select a.* from dbo.TB_CHILDBASE a inner join dbo.cp_ados3_tab b on a.id = b.child_id where b.pgrq = " + "'" + checkday + "' ";
                        }
                        else if (obj.MENU_NAME.Trim().Equals("ADOS4报告"))
                        {
                            sqls += "union all select a.* from dbo.TB_CHILDBASE a inner join dbo.cp_ados4_tab b on a.id = b.child_id where b.pgrq = " + "'" + checkday + "' ";
                        }
                        else if (obj.MENU_NAME.Trim().Equals("ASD报告(4岁以下)"))
                        {
                            sqls += "union all select a.* from dbo.TB_CHILDBASE a inner join dbo.cp_asd1_tab b on a.id = b.child_id where b.csrq = " + "'" + checkday + "' ";
                        }
                        else if (obj.MENU_NAME.Trim().Equals("ASD报告(4岁及以上)"))
                        {
                            sqls += "union all select a.* from dbo.TB_CHILDBASE a inner join dbo.cp_asd2_tab b on a.id = b.child_id where b.csrq = " + "'" + checkday + "' ";
                        }
                        else if (obj.MENU_NAME.Trim().Equals("Gesell评价表"))
                        {
                            sqls += "union all select a.* from dbo.TB_CHILDBASE a inner join dbo.cp_gesell_tab b on a.id = b.child_id where b.csrq = " + "'" + checkday + "' ";
                        }
                        else if (obj.MENU_NAME.Trim().Equals("SM评价表"))
                        {
                            sqls += "union all select a.* from dbo.TB_CHILDBASE a inner join dbo.cp_sm_tab b on a.id = b.child_id where b.csrq = " + "'" + checkday + "' ";
                        }
                        else if (obj.MENU_NAME.Trim().Equals("大韦氏评价表"))
                        {
                            sqls += "union all select a.* from dbo.TB_CHILDBASE a inner join dbo.cp_wisc_tab b on a.id = b.child_id where b.csrq = " + "'" + checkday + "' ";
                        }
                        else if (obj.MENU_NAME.Trim().Equals("小韦氏评价表"))
                        {
                            sqls += "union all select a.* from dbo.TB_CHILDBASE a inner join dbo.cp_wycsi_tab b on a.id = b.child_id where b.csrq = " + "'" + checkday + "' ";
                        }
                        else if (obj.MENU_NAME.Trim().Equals("语言筛查<3岁3月"))
                        {
                            sqls += "union all select a.* from dbo.TB_CHILDBASE a inner join dbo.cp_zqyyfyjc_tab b on a.id = b.child_id where b.csrq = " + "'" + checkday + "' ";
                            sqls += "union all select a.* from dbo.TB_CHILDBASE a inner join dbo.cp_cdi_tab b on a.id = b.child_id where b.csrq = " + "'" + checkday + "' ";
                        }
                        else if (obj.MENU_NAME.Trim().Equals("语言筛查>3岁3月"))
                        {
                            sqls += "union all select a.* from dbo.TB_CHILDBASE a inner join dbo.cp_cdi1_tab b on a.id = b.child_id where b.csrq = " + "'" + checkday + "' ";
                        }
                        else if (obj.MENU_NAME.Trim().Equals("能力测试<6岁"))
                        {
                            sqls += "union all select a.* from dbo.TB_CHILDBASE a inner join dbo.cp_ppvt_tab b on a.id = b.child_id where b.cyrq = " + "'" + checkday + "' ";
                        }
                        else if (obj.MENU_NAME.Trim().Equals("注意力测验"))
                        {
                            sqls += "union all select a.* from dbo.TB_CHILDBASE a inner join dbo.cp_zylcy_tab b on a.id = b.child_id where b.cyrq = " + "'" + checkday + "' ";
                        }
                        else if (obj.MENU_NAME.Trim().Equals("DDST"))
                        {
                            sqls += "union all select a.* from dbo.TB_CHILDBASE a inner join dbo.cp_ddst_tab b on a.id = b.child_id where b.csrq = " + "'" + checkday + "' ";
                        }
                        else if (obj.MENU_NAME.Trim().Equals("图片词汇测试"))
                        {
                            sqls += "union all select a.* from dbo.TB_CHILDBASE a inner join dbo.cp_tpch_tab b on a.id = b.child_id where b.csrq = " + "'" + checkday + "' ";
                        }
                        else if (obj.MENU_NAME.Trim().Equals("DST测试"))
                        {
                            sqls += "union all select a.* from dbo.TB_CHILDBASE a inner join dbo.cp_dst_tab b on a.id = b.child_id where b.csrq = " + "'" + checkday + "' ";
                        }
                    }

                    sqls += ") as c";
                }
            }
            else if (globalInfoClass.Ward_name.Trim().Equals("训练室"))
            {
                sqls = "";
                if (isjiuzhen == "未就诊")
                {
                }
                else
                {
                }
            }
            if (sqls.Trim().Equals(""))
            {
                return(null);
            }
            return(DALStatic.GetListBySql <TB_CHILDBASE>(sqls, ""));
        }
예제 #7
0
 /// <summary>
 /// 执行sql语句查询数据
 /// 实体类属性名与数据表字段名匹配
 /// </summary>
 /// <param name="sql">sql</param>
 /// <param name="parameters">参数</param>
 /// <returns></returns>
 public static IList <T2> GetListBySql <T2>(string sql, params object[] parameters)
 {
     return(DALStatic.GetListBySql <T2>(sql, parameters));
 }