protected void BindReportDataSource()
        {
            DateTime start           = Convert.ToDateTime(this.StartDate.Text);
            DateTime end             = Convert.ToDateTime(this.EndDate.Text);
            string   workCode        = Convert.ToString(this.WorkCode.Text);
            string   centerID        = Convert.ToString(this.Center.Text);
            string   stationID       = Convert.ToString(this.Station.Text);
            E_StatisticsPermisson em = UserOperateContext.Current.getMaxPerForStatistics();
            string selfWorkCode      = UserOperateContext.Current.Session_UsrInfo.WorkCode;
            string selfCenterID      = UserOperateContext.Current.Session_UsrInfo.P_Department.DispatchSubCenterID;
            string selfStationID     = UserOperateContext.Current.Session_UsrInfo.P_Department.DispatchSationID;
            string start1            = start.ToString();
            string end1 = end.ToString();

            this.ReportViewer1.LocalReport.DataSources.Clear();
            this.ReportViewer1.LocalReport.ReportPath = Server.MapPath(@"~/Reports/LS_BLTXSJ.rdlc");
            Microsoft.Reporting.WebForms.ReportParameter st = new Microsoft.Reporting.WebForms.ReportParameter("StartTime", start1);
            Microsoft.Reporting.WebForms.ReportParameter ed = new Microsoft.Reporting.WebForms.ReportParameter("EndTime", end1);
            this.ReportViewer1.LocalReport.SetParameters(new Microsoft.Reporting.WebForms.ReportParameter[] { st, ed });
            LSDAL     dal = new LSDAL();
            DataTable dt  = dal.Get_LS_BLTXSJ(start, end, workCode, centerID, stationID, em, selfWorkCode, selfCenterID, selfStationID);

            this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForLS_BLTXSJ", dt));

            this.ReportViewer1.LocalReport.Refresh();
        }
예제 #2
0
 //查询事件信息列表
 public object GetEventInfoList(int pageSize, int pageIndex, DateTime start, DateTime end, string mainSuit, string telephoneNumber, string localAddress, string patientName, string sendAddress,
     string dispatcher, string driver, string doctor, string nurse,string stretcher, string eventType, string illnessJudgment, string eventCode, string station, string ambulanceCode,
     string eventSource, E_StatisticsPermisson em, string selfWorkCode, string selfCenterID, string selfStationID)
 {
     return dal.GetEventInfoList(pageSize, pageIndex, start, end, mainSuit, telephoneNumber, localAddress, patientName, sendAddress,
                        dispatcher, driver, doctor, nurse, stretcher, eventType, illnessJudgment, eventCode, station, ambulanceCode,
                        eventSource, em,selfWorkCode,selfCenterID,selfStationID);
 }
예제 #3
0
 //查询事件信息列表
 public object GetEventInfoList(int pageSize, int pageIndex, DateTime start, DateTime end, string mainSuit, string telephoneNumber, string localAddress, string patientName, string sendAddress,
                                string dispatcher, string driver, string doctor, string nurse, string stretcher, string eventType, string illnessJudgment, string eventCode, string station, string ambulanceCode,
                                string eventSource, E_StatisticsPermisson em, string selfWorkCode, string selfCenterID, string selfStationID)
 {
     return(dal.GetEventInfoList(pageSize, pageIndex, start, end, mainSuit, telephoneNumber, localAddress, patientName, sendAddress,
                                 dispatcher, driver, doctor, nurse, stretcher, eventType, illnessJudgment, eventCode, station, ambulanceCode,
                                 eventSource, em, selfWorkCode, selfCenterID, selfStationID));
 }
예제 #4
0
        public ActionResult DataLoad()
        {
            //获取页容量
            int pageSize = int.Parse(Request.Form["rows"]);
            //获取请求的页码
            int pageIndex = int.Parse(Request.Form["page"]);
            //获取查询条件
            DateTime start             = Convert.ToDateTime(Request.Form["start"]);
            DateTime end               = Convert.ToDateTime(Request.Form["end"]);
            string   mainSuit          = Request.Form["mainSuit"];
            string   telephoneNumber   = Request.Form["telephoneNumber"];
            string   localAddress      = Request.Form["localAddress"];
            string   patientName       = Request.Form["patientName"];
            string   sendAddress       = Request.Form["sendAddress"];
            string   dispatcher        = Request.Form["dispatcher"];
            string   driver            = Request.Form["driver"];
            string   doctor            = Request.Form["doctor"];
            string   nurse             = Request.Form["nurse"];
            string   stretcher         = Request.Form["stretcher"];
            string   eventType         = Request.Form["eventType"];
            string   illnessJudgment   = Request.Form["illnessState"];
            string   eventCode         = Request.Form["eventCode"];
            string   station           = Request.Form["station"];
            string   carCode           = Request.Form["ambulanceCode"];
            string   eventSource       = Request.Form["eventSource"];
            E_StatisticsPermisson em   = UserOperateContext.Current.getMaxPerForStatistics();
            string       selfWorkCode  = UserOperateContext.Current.Session_UsrInfo.WorkCode;
            string       selfCenterID  = UserOperateContext.Current.Session_UsrInfo.P_Department.DispatchSubCenterID;
            string       selfStationID = UserOperateContext.Current.Session_UsrInfo.P_Department.DispatchSationID;
            EventInfoBLL bll           = new EventInfoBLL();
            var          list          = bll.GetEventInfoList(pageSize, pageIndex, start, end, mainSuit, telephoneNumber, localAddress, patientName, sendAddress, dispatcher,
                                                              driver, doctor, nurse, stretcher, eventType, illnessJudgment, eventCode, station, carCode, eventSource,
                                                              em, selfWorkCode, selfCenterID, selfStationID);
            JsonResult j = this.Json(list, "appliction/json", JsonRequestBehavior.AllowGet);

            return(j);
        }
예제 #5
0
        /// <summary>
        /// 事件信息列表
        /// </summary>
        /// <param name="pageSize"></param>
        /// <param name="pageIndex"></param>
        /// <param name="start"></param>
        /// <param name="end"></param>
        /// <param name="mainSuit"></param>
        /// <param name="telephoneNumber"></param>
        /// <param name="localAddress"></param>
        /// <param name="patientName"></param>
        /// <param name="sendAddress"></param>
        /// <param name="dispatcher"></param>
        /// <param name="driver"></param>
        /// <param name="doctor"></param>
        /// <param name="nurse"></param>
        /// <param name="eventType"></param>
        /// <param name="illnessJudgment"></param>
        /// <param name="eventCode"></param>
        /// <param name="station"></param>
        /// <param name="ambulanceCode"></param>
        /// <param name="eventSource"></param>
        /// <returns></returns>
        public object GetEventInfoList(int pageSize, int pageIndex, DateTime start, DateTime end, string mainSuit, string telephoneNumber, string localAddress, string patientName, string sendAddress,
                                       string dispatcher, string driver, string doctor, string nurse, string stretcher, string eventType, string illnessJudgment, string eventCode, string station, string ambulanceCode,
                                       string eventSource, E_StatisticsPermisson em, string selfWorkCode, string selfCenterID, string selfStationID)
        {
            List <EventInfo> list = new List <EventInfo>();
            StringBuilder    sb   = new StringBuilder();

            sb.Append(@"select distinct identity(int,1,1) as 行号,tae.事件编码,首次呼救电话,事件名称=现场地址+患者姓名,受理次数,首次调度员编码
                     ,首次受理时刻,事件类型=tzaet.名称,事件来源=tzaeo.名称,派车次数=(select count(*) from dbo.TTask tt where tt.事件编码=tae.事件编码)
                     ,正常完成=(select count(*) from dbo.TTask tt where tt.事件编码=tae.事件编码 and tt.是否正常结束=1) 
                     into #tempa 
                    from TAlarmEvent tae                     
                    left join TZAlarmEventType tzaet on tae.事件类型编码 = tzaet.编码 
                    left join TZAlarmEventOrigin tzaeo on tae.事件来源编码 = tzaeo.编码 
                    left join TTask tt on tae.事件编码 = tt.事件编码
					left join TTaskPersonLink ttpl on tt.任务编码 = ttpl.任务编码
                    left join TStation ts on ts.编码 = tt.分站编码
                    where 是否测试=0 ");
            WhereClauseUtility.AddStringEqual("tae.事件编码", eventCode, sb);
            WhereClauseUtility.AddStringLike("tae.主诉", mainSuit, sb);
            WhereClauseUtility.AddStringLike("tae.首次呼救电话", telephoneNumber, sb);
            WhereClauseUtility.AddStringLike("tae.现场地址", localAddress, sb);
            WhereClauseUtility.AddStringEqual("tae.患者姓名", patientName, sb);
            WhereClauseUtility.AddStringLike("tae.送往地点", sendAddress, sb);
            WhereClauseUtility.AddStringEqual("tae.首次调度员编码", dispatcher, sb);
            //WhereClauseUtility.AddStringEqual("ttpl.人员编码", driver, sb);
            //WhereClauseUtility.AddStringEqual("ttpl.人员编码", doctor, sb);
            //WhereClauseUtility.AddStringEqual("ttpl.人员编码", nurse, sb);
            //WhereClauseUtility.AddStringEqual("ttpl.人员编码", stretcher, sb);
            WhereClauseUtility.AddStringEqual("tae.事件类型编码", eventType, sb);
            WhereClauseUtility.AddStringEqual("tae.病情编码", illnessJudgment, sb);
            WhereClauseUtility.AddStringEqual("tt.车辆编码", ambulanceCode, sb);
            WhereClauseUtility.AddDateTimeGreaterThan("tae.首次受理时刻", start, sb);
            WhereClauseUtility.AddDateTimeLessThan("tae.首次受理时刻", end, sb);
            // WhereClauseUtility.AddStringEqual("ts.名称", station, sb);
            WhereClauseUtility.AddIntEqual("tae.事故类型编码", -1, sb);
            WhereClauseUtility.AddStringEqual("tae.事件来源编码", eventSource, sb);

            if (em == E_StatisticsPermisson.None)
            {
                return(null);
            }

            else if (em == E_StatisticsPermisson.ALL)
            {
                WhereClauseUtility.AddStringEqual("ttpl.人员编码", driver, sb);
                WhereClauseUtility.AddStringEqual("ttpl.人员编码", doctor, sb);
                WhereClauseUtility.AddStringEqual("ttpl.人员编码", nurse, sb);
                WhereClauseUtility.AddStringEqual("ttpl.人员编码", stretcher, sb);
                WhereClauseUtility.AddStringEqual("ts.名称", station, sb);
                sb.Append(@" 
                    order by 首次受理时刻 desc 

                    select * into #temp from #tempa where 1=1 ");

                sb.Append(@"
                    select top " + pageSize + " A.*  from #temp A where 行号>" + (pageIndex - 1) * pageSize + " order by 行号 ");
                sb.Append(@"
                    SELECT count(*) FROM #temp t
                    drop table #tempa,#temp ");

                DataSet ds = SqlHelper.ExecuteDataSet(SqlHelper.AttemperConnectionString, CommandType.Text, sb.ToString(), null);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    foreach (DataRow dr in ds.Tables[0].Rows)
                    {
                        EventInfo info = new EventInfo();
                        info.callPhone       = dr["首次呼救电话"].ToString();
                        info.acceptTimes     = Convert.ToInt32(dr["受理次数"]);
                        info.eventName       = dr["事件名称"].ToString();
                        info.firstAcceptTime = dr["首次受理时刻"].ToString();
                        info.firstDispatcher = dr["首次调度员编码"].ToString();
                        info.sendCarTimes    = Convert.ToInt32(dr["派车次数"]);
                        info.finishedTimes   = Convert.ToInt32(dr["正常完成"]);
                        list.Add(info);
                    }
                }
                int total  = Convert.ToInt32(ds.Tables[1].Rows[0][0]);
                var result = new { total = total, rows = list };
                return(result);
            }
            else if (em == E_StatisticsPermisson.CENTER)
            {
                WhereClauseUtility.AddStringEqual("ttpl.人员编码", driver, sb);
                WhereClauseUtility.AddStringEqual("ttpl.人员编码", doctor, sb);
                WhereClauseUtility.AddStringEqual("ttpl.人员编码", nurse, sb);
                WhereClauseUtility.AddStringEqual("ttpl.人员编码", stretcher, sb);
                WhereClauseUtility.AddStringEqual("tae.中心编码", selfCenterID, sb);
                WhereClauseUtility.AddStringEqual("tt.分站编码", station, sb);

                sb.Append(@" 
                    order by 首次受理时刻 desc 

                    select * into #temp from #tempa where 1=1 ");

                sb.Append(@"
                    select top " + pageSize + " A.*  from #temp A where 行号>" + (pageIndex - 1) * pageSize + " order by 行号 ");
                sb.Append(@"
                    SELECT count(*) FROM #temp t
                    drop table #tempa,#temp ");

                DataSet ds = SqlHelper.ExecuteDataSet(SqlHelper.AttemperConnectionString, CommandType.Text, sb.ToString(), null);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    foreach (DataRow dr in ds.Tables[0].Rows)
                    {
                        EventInfo info = new EventInfo();
                        info.callPhone       = dr["首次呼救电话"].ToString();
                        info.acceptTimes     = Convert.ToInt32(dr["受理次数"]);
                        info.eventName       = dr["事件名称"].ToString();
                        info.firstAcceptTime = dr["首次受理时刻"].ToString();
                        info.firstDispatcher = dr["首次调度员编码"].ToString();
                        info.sendCarTimes    = Convert.ToInt32(dr["派车次数"]);
                        info.finishedTimes   = Convert.ToInt32(dr["正常完成"]);
                        list.Add(info);
                    }
                }
                int total  = Convert.ToInt32(ds.Tables[1].Rows[0][0]);
                var result = new { total = total, rows = list };
                return(result);
            }
            else if (em == E_StatisticsPermisson.STATION)
            {
                WhereClauseUtility.AddStringEqual("ttpl.人员编码", driver, sb);
                WhereClauseUtility.AddStringEqual("ttpl.人员编码", doctor, sb);
                WhereClauseUtility.AddStringEqual("ttpl.人员编码", nurse, sb);
                WhereClauseUtility.AddStringEqual("ttpl.人员编码", stretcher, sb);
                WhereClauseUtility.AddStringEqual("tt.分站编码", selfStationID, sb);

                sb.Append(@" 
                    order by 首次受理时刻 desc 

                    select * into #temp from #tempa where 1=1 ");

                sb.Append(@"
                    select top " + pageSize + " A.*  from #temp A where 行号>" + (pageIndex - 1) * pageSize + " order by 行号 ");
                sb.Append(@"
                    SELECT count(*) FROM #temp t
                    drop table #tempa,#temp ");

                DataSet ds = SqlHelper.ExecuteDataSet(SqlHelper.AttemperConnectionString, CommandType.Text, sb.ToString(), null);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    foreach (DataRow dr in ds.Tables[0].Rows)
                    {
                        EventInfo info = new EventInfo();
                        info.callPhone       = dr["首次呼救电话"].ToString();
                        info.acceptTimes     = Convert.ToInt32(dr["受理次数"]);
                        info.eventName       = dr["事件名称"].ToString();
                        info.firstAcceptTime = dr["首次受理时刻"].ToString();
                        info.firstDispatcher = dr["首次调度员编码"].ToString();
                        info.sendCarTimes    = Convert.ToInt32(dr["派车次数"]);
                        info.finishedTimes   = Convert.ToInt32(dr["正常完成"]);
                        list.Add(info);
                    }
                }
                int total  = Convert.ToInt32(ds.Tables[1].Rows[0][0]);
                var result = new { total = total, rows = list };
                return(result);
            }
            else if (em == E_StatisticsPermisson.SELF)
            {
                sb.Append("and ttpl.人员编码 = '" + selfWorkCode + @"' ");

                sb.Append(@" 
                    order by 首次受理时刻 desc 

                    select * into #temp from #tempa where 1=1 ");

                sb.Append(@"
                    select top " + pageSize + " A.*  from #temp A where 行号>" + (pageIndex - 1) * pageSize + " order by 行号 ");
                sb.Append(@"
                    SELECT count(*) FROM #temp t
                    drop table #tempa,#temp ");

                DataSet ds = SqlHelper.ExecuteDataSet(SqlHelper.AttemperConnectionString, CommandType.Text, sb.ToString(), null);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    foreach (DataRow dr in ds.Tables[0].Rows)
                    {
                        EventInfo info = new EventInfo();
                        info.callPhone       = dr["首次呼救电话"].ToString();
                        info.acceptTimes     = Convert.ToInt32(dr["受理次数"]);
                        info.eventName       = dr["事件名称"].ToString();
                        info.firstAcceptTime = dr["首次受理时刻"].ToString();
                        info.firstDispatcher = dr["首次调度员编码"].ToString();
                        info.sendCarTimes    = Convert.ToInt32(dr["派车次数"]);
                        info.finishedTimes   = Convert.ToInt32(dr["正常完成"]);
                        list.Add(info);
                    }
                }
                int total  = Convert.ToInt32(ds.Tables[1].Rows[0][0]);
                var result = new { total = total, rows = list };
                return(result);
            }
            else
            {
                return(null);
            }
        }
예제 #6
0
        /// <summary>
        /// 事件信息列表
        /// </summary>
        /// <param name="pageSize"></param>
        /// <param name="pageIndex"></param>
        /// <param name="start"></param>
        /// <param name="end"></param>
        /// <param name="mainSuit"></param>
        /// <param name="telephoneNumber"></param>
        /// <param name="localAddress"></param>
        /// <param name="patientName"></param>
        /// <param name="sendAddress"></param>
        /// <param name="dispatcher"></param>
        /// <param name="driver"></param>
        /// <param name="doctor"></param>
        /// <param name="nurse"></param>
        /// <param name="eventType"></param>
        /// <param name="illnessJudgment"></param>
        /// <param name="eventCode"></param>
        /// <param name="station"></param>
        /// <param name="ambulanceCode"></param>
        /// <param name="eventSource"></param>
        /// <returns></returns>
        public object GetEventInfoList(int pageSize, int pageIndex, DateTime start, DateTime end, string mainSuit, string telephoneNumber, string localAddress, string patientName, string sendAddress,
            string dispatcher, string driver, string doctor, string nurse,string stretcher, string eventType, string illnessJudgment, string eventCode, string station, string ambulanceCode,
            string eventSource, E_StatisticsPermisson em, string selfWorkCode, string selfCenterID, string selfStationID)
        {
            List<EventInfo> list = new List<EventInfo>();
            StringBuilder sb = new StringBuilder();
            sb.Append(@"select distinct identity(int,1,1) as 行号,tae.事件编码,首次呼救电话,事件名称=现场地址+患者姓名,受理次数,首次调度员编码
                     ,首次受理时刻,事件类型=tzaet.名称,事件来源=tzaeo.名称,派车次数=(select count(*) from dbo.TTask tt where tt.事件编码=tae.事件编码)
                     ,正常完成=(select count(*) from dbo.TTask tt where tt.事件编码=tae.事件编码 and tt.是否正常结束=1)
                     into #tempa
                    from TAlarmEvent tae
                    left join TZAlarmEventType tzaet on tae.事件类型编码 = tzaet.编码
                    left join TZAlarmEventOrigin tzaeo on tae.事件来源编码 = tzaeo.编码
                    left join TTask tt on tae.事件编码 = tt.事件编码
                    left join TTaskPersonLink ttpl on tt.任务编码 = ttpl.任务编码
                    left join TStation ts on ts.编码 = tt.分站编码
                    where 是否测试=0 ");
            WhereClauseUtility.AddStringEqual("tae.事件编码", eventCode, sb);
            WhereClauseUtility.AddStringLike("tae.主诉", mainSuit, sb);
            WhereClauseUtility.AddStringLike("tae.首次呼救电话", telephoneNumber, sb);
            WhereClauseUtility.AddStringLike("tae.现场地址", localAddress, sb);
            WhereClauseUtility.AddStringEqual("tae.患者姓名", patientName, sb);
            WhereClauseUtility.AddStringLike("tae.送往地点", sendAddress, sb);
            WhereClauseUtility.AddStringEqual("tae.首次调度员编码", dispatcher, sb);
            //WhereClauseUtility.AddStringEqual("ttpl.人员编码", driver, sb);
            //WhereClauseUtility.AddStringEqual("ttpl.人员编码", doctor, sb);
            //WhereClauseUtility.AddStringEqual("ttpl.人员编码", nurse, sb);
            //WhereClauseUtility.AddStringEqual("ttpl.人员编码", stretcher, sb);
            WhereClauseUtility.AddStringEqual("tae.事件类型编码", eventType, sb);
            WhereClauseUtility.AddStringEqual("tae.病情编码", illnessJudgment, sb);
            WhereClauseUtility.AddStringEqual("tt.车辆编码", ambulanceCode, sb);
            WhereClauseUtility.AddDateTimeGreaterThan("tae.首次受理时刻", start, sb);
            WhereClauseUtility.AddDateTimeLessThan("tae.首次受理时刻", end, sb);
            // WhereClauseUtility.AddStringEqual("ts.名称", station, sb);
            WhereClauseUtility.AddIntEqual("tae.事故类型编码", -1, sb);
            WhereClauseUtility.AddStringEqual("tae.事件来源编码", eventSource, sb);

            if (em == E_StatisticsPermisson.None)
                return null;

            else if (em == E_StatisticsPermisson.ALL)
            {
                WhereClauseUtility.AddStringEqual("ttpl.人员编码", driver, sb);
                WhereClauseUtility.AddStringEqual("ttpl.人员编码", doctor, sb);
                WhereClauseUtility.AddStringEqual("ttpl.人员编码", nurse, sb);
                WhereClauseUtility.AddStringEqual("ttpl.人员编码", stretcher, sb);
                WhereClauseUtility.AddStringEqual("ts.名称", station, sb);
                sb.Append(@"
                    order by 首次受理时刻 desc

                    select * into #temp from #tempa where 1=1 ");

                sb.Append(@"
                    select top " + pageSize + " A.*  from #temp A where 行号>" + (pageIndex - 1) * pageSize + " order by 行号 ");
                sb.Append(@"
                    SELECT count(*) FROM #temp t
                    drop table #tempa,#temp ");

            DataSet ds = SqlHelper.ExecuteDataSet(SqlHelper.AttemperConnectionString, CommandType.Text, sb.ToString(), null);
            if (ds.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    EventInfo info = new EventInfo();
                    info.callPhone = dr["首次呼救电话"].ToString();
                    info.acceptTimes = Convert.ToInt32(dr["受理次数"]);
                    info.eventName = dr["事件名称"].ToString();
                    info.firstAcceptTime = dr["首次受理时刻"].ToString();
                    info.firstDispatcher = dr["首次调度员编码"].ToString();
                    info.sendCarTimes = Convert.ToInt32(dr["派车次数"]);
                    info.finishedTimes = Convert.ToInt32(dr["正常完成"]);
                    list.Add(info);
                }
            }
            int total = Convert.ToInt32(ds.Tables[1].Rows[0][0]);
            var result = new { total = total, rows = list };
            return result;

            }
            else if (em == E_StatisticsPermisson.CENTER)
            {
                WhereClauseUtility.AddStringEqual("ttpl.人员编码", driver, sb);
                WhereClauseUtility.AddStringEqual("ttpl.人员编码", doctor, sb);
                WhereClauseUtility.AddStringEqual("ttpl.人员编码", nurse, sb);
                WhereClauseUtility.AddStringEqual("ttpl.人员编码", stretcher, sb);
                WhereClauseUtility.AddStringEqual("tae.中心编码", selfCenterID, sb);
                WhereClauseUtility.AddStringEqual("tt.分站编码", station, sb);

                sb.Append(@"
                    order by 首次受理时刻 desc

                    select * into #temp from #tempa where 1=1 ");

                sb.Append(@"
                    select top " + pageSize + " A.*  from #temp A where 行号>" + (pageIndex - 1) * pageSize + " order by 行号 ");
                sb.Append(@"
                    SELECT count(*) FROM #temp t
                    drop table #tempa,#temp ");

            DataSet ds = SqlHelper.ExecuteDataSet(SqlHelper.AttemperConnectionString, CommandType.Text, sb.ToString(), null);
            if (ds.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    EventInfo info = new EventInfo();
                    info.callPhone = dr["首次呼救电话"].ToString();
                    info.acceptTimes = Convert.ToInt32(dr["受理次数"]);
                    info.eventName = dr["事件名称"].ToString();
                    info.firstAcceptTime = dr["首次受理时刻"].ToString();
                    info.firstDispatcher = dr["首次调度员编码"].ToString();
                    info.sendCarTimes = Convert.ToInt32(dr["派车次数"]);
                    info.finishedTimes = Convert.ToInt32(dr["正常完成"]);
                    list.Add(info);
                }
            }
            int total = Convert.ToInt32(ds.Tables[1].Rows[0][0]);
            var result = new { total = total, rows = list };
            return result;

            }
            else if (em == E_StatisticsPermisson.STATION)
            {
                WhereClauseUtility.AddStringEqual("ttpl.人员编码", driver, sb);
                WhereClauseUtility.AddStringEqual("ttpl.人员编码", doctor, sb);
                WhereClauseUtility.AddStringEqual("ttpl.人员编码", nurse, sb);
                WhereClauseUtility.AddStringEqual("ttpl.人员编码", stretcher, sb);
                WhereClauseUtility.AddStringEqual("tt.分站编码", selfStationID, sb);

               sb.Append(@"
                    order by 首次受理时刻 desc

                    select * into #temp from #tempa where 1=1 ");

               sb.Append(@"
                    select top " + pageSize + " A.*  from #temp A where 行号>" + (pageIndex - 1) * pageSize + " order by 行号 ");
               sb.Append(@"
                    SELECT count(*) FROM #temp t
                    drop table #tempa,#temp ");

            DataSet ds = SqlHelper.ExecuteDataSet(SqlHelper.AttemperConnectionString, CommandType.Text, sb.ToString(), null);
            if (ds.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    EventInfo info = new EventInfo();
                    info.callPhone = dr["首次呼救电话"].ToString();
                    info.acceptTimes = Convert.ToInt32(dr["受理次数"]);
                    info.eventName = dr["事件名称"].ToString();
                    info.firstAcceptTime = dr["首次受理时刻"].ToString();
                    info.firstDispatcher = dr["首次调度员编码"].ToString();
                    info.sendCarTimes = Convert.ToInt32(dr["派车次数"]);
                    info.finishedTimes = Convert.ToInt32(dr["正常完成"]);
                    list.Add(info);
                }
            }
            int total = Convert.ToInt32(ds.Tables[1].Rows[0][0]);
            var result = new { total = total, rows = list };
            return result;

            }
            else if (em == E_StatisticsPermisson.SELF)
            {
                sb.Append("and ttpl.人员编码 = '" + selfWorkCode + @"' ");

                sb.Append(@"
                    order by 首次受理时刻 desc

                    select * into #temp from #tempa where 1=1 ");

                sb.Append(@"
                    select top " + pageSize + " A.*  from #temp A where 行号>" + (pageIndex - 1) * pageSize + " order by 行号 ");
                sb.Append(@"
                    SELECT count(*) FROM #temp t
                    drop table #tempa,#temp ");

            DataSet ds = SqlHelper.ExecuteDataSet(SqlHelper.AttemperConnectionString, CommandType.Text, sb.ToString(), null);
            if (ds.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    EventInfo info = new EventInfo();
                    info.callPhone = dr["首次呼救电话"].ToString();
                    info.acceptTimes = Convert.ToInt32(dr["受理次数"]);
                    info.eventName = dr["事件名称"].ToString();
                    info.firstAcceptTime = dr["首次受理时刻"].ToString();
                    info.firstDispatcher = dr["首次调度员编码"].ToString();
                    info.sendCarTimes = Convert.ToInt32(dr["派车次数"]);
                    info.finishedTimes = Convert.ToInt32(dr["正常完成"]);
                    list.Add(info);
                }
            }
            int total = Convert.ToInt32(ds.Tables[1].Rows[0][0]);
            var result = new { total = total, rows = list };
            return result;

            }
            else
            {
                return null;
            }
        }
예제 #7
0
        public DataTable Get_LS_FZXZTDY(DateTime beginTime, DateTime endTime, string center, string station, string carNumber, string workCode, string name,
            E_StatisticsPermisson em, string selfWorkCode, string selfCenterID, string selfStationID)
        {
            StringBuilder sb = new StringBuilder();
            sb.Append(@"

                select
                     Center=tc.名称,
                     Sation=ts.名称,
                     CarNumber=tam.实际标识,
                     RecordTime=tpr.操作时刻1,Operator1=tp1.姓名,
                     EndTime=tpr.操作时刻2,Operator2=tp2.姓名,
                     PauseTime=datediff(ss,tpr.操作时刻1,tpr.操作时刻2),
                     PauseReason=tzpr.名称,
                     DriverWorkNumber=tdriver.工号,
                     Driver=tdriver.姓名
                    ,Doctor=dbo.CodeToName(tpr.医生编码),Stretcher=dbo.CodeToName(tpr.担架工编码)
                from (select 车辆编码=tp.车辆编码,操作时刻1=tp.操作时刻,操作时刻2=min(tpr.操作时刻),
                             暂停原因编码=tp.暂停原因编码,tp.司机编码,tp.医生编码,tp.担架工编码
                      from (select 车辆编码,操作时刻,暂停原因编码,司机编码,医生编码,担架工编码   from TPauseRecord  where 是否暂停操作 = 1 ) tp
                      left join ( select 车辆编码,操作时刻,暂停原因编码,司机编码,医生编码,担架工编码
                                  from TPauseRecord  where 是否暂停操作 = 0 ) tpr on tpr.车辆编码=tp.车辆编码 and tpr.操作时刻 > tp.操作时刻
                      group by tp.车辆编码,tp.操作时刻,tp.暂停原因编码,tp.司机编码,tp.医生编码,tp.担架工编码
                   ) tpr
                left join TAmbulance tam on tpr.车辆编码 = tam.车辆编码
                left join TCenter tc on tc.编码=tam.中心编码
                left join TStation ts on ts.编码=tam.分站编码
                left join TZPauseReason tzpr on tpr.暂停原因编码 = tzpr.编码
                left join TPerson tdriver on tdriver.编码 = tpr.司机编码
                left join TPauseRecord tpau1 on tpau1.车辆编码=tpr.车辆编码 and tpau1.操作时刻=tpr.操作时刻1
                left join TPerson tp1 on tp1.编码=tpau1.操作人员编码
                left join TPauseRecord tpau2 on tpau2.车辆编码=tpr.车辆编码 and tpau2.操作时刻=tpr.操作时刻2
                left join TPerson tp2 on tp2.编码=tpau2.操作人员编码
                where tpr.操作时刻1>='" + beginTime + "' and tpr.操作时刻1<='" + endTime + @"'
            ");
            if (em == E_StatisticsPermisson.None)
                return null;

            else if (em == E_StatisticsPermisson.ALL)
            {
                WhereClauseUtility.AddStringLike("tdriver.姓名", name, sb);
                WhereClauseUtility.AddInSelectQuery("tc.编码", center, sb);
                WhereClauseUtility.AddInSelectQuery("ts.编码", station, sb);
                WhereClauseUtility.AddStringLike("tdriver.工号", workCode, sb);
                WhereClauseUtility.AddStringLike("tam.实际标识", carNumber, sb);
                sb.Append("order by tc.顺序号,ts.顺序号,tpr.操作时刻1");

                DataSet ds = SqlHelper.ExecuteDataSet(SqlHelper.AttemperConnectionString, CommandType.Text, sb.ToString(), null);
                return ds.Tables[0];
            }
            else if (em == E_StatisticsPermisson.CENTER)
            {
                WhereClauseUtility.AddStringLike("tdriver.姓名", name, sb);
                WhereClauseUtility.AddStringEqual("tc.编码", selfCenterID, sb);
                WhereClauseUtility.AddInSelectQuery("ts.编码", station, sb);
                WhereClauseUtility.AddStringLike("tdriver.工号", workCode, sb);
                WhereClauseUtility.AddStringLike("tam.实际标识", carNumber, sb);
                sb.Append("order by tc.顺序号,ts.顺序号,tpr.操作时刻1");

                DataSet ds = SqlHelper.ExecuteDataSet(SqlHelper.AttemperConnectionString, CommandType.Text, sb.ToString(), null);
                return ds.Tables[0];
            }
            else if (em == E_StatisticsPermisson.STATION)
            {
                WhereClauseUtility.AddStringLike("tdriver.姓名", name, sb);
                WhereClauseUtility.AddStringEqual("ts.编码", selfStationID, sb);
                WhereClauseUtility.AddStringLike("tdriver.工号", workCode, sb);
                WhereClauseUtility.AddStringLike("tam.实际标识", carNumber, sb);
                sb.Append("order by tc.顺序号,ts.顺序号,tpr.操作时刻1");

                DataSet ds = SqlHelper.ExecuteDataSet(SqlHelper.AttemperConnectionString, CommandType.Text, sb.ToString(), null);
                return ds.Tables[0];
            }
            else
            {
                return null;
            }
        }
예제 #8
0
        public DataTable Get_LS_FZRYSXB(DateTime beginTime, DateTime endTime, string center, string station, string role, string carNumber, string workCode, string name,
            E_StatisticsPermisson em, string selfName, string selfWorkCode, string selfCenterID, string selfStationID)
        {
            StringBuilder sb = new StringBuilder();
            sb.Append(@"
                     SET NOCOUNT ON
                     select  Center=tc.名称
                            ,Sation=ts.名称
                            ,Name=tp.姓名
                            ,PersonCode=t.人员编码
                            ,WorkNumber=tp.工号
                            ,CarCode=t.车辆编码
                            ,Role=tr.名称
                            ,CarNumber=ta.实际标识
                            ,OnDutyOperateMoment=t.操作时刻
                            ,OnDutyType=上班方式
                            ,OffDutyOperateMoment=t1.操作时刻
                            ,OffDutyType=下班方式
                     from (select 人员编码,
                                  操作时刻,人员类型编码,车辆编码,操作人编码,是否上班操作,操作来源编码,上次操作时刻
                                  ,tzoo.名称 as 上班方式
                            from TAmbulancePersonSign taps
                            left join TZOperationOrigin tzoo on taps.操作来源编码=tzoo.编码
                            where 操作时刻 >= '" + beginTime + "' and 操作时刻 <= '" + endTime + @"' and 是否上班操作 = 1
                            )t
                    left join (select 人员编码,
                                      操作时刻,人员类型编码,车辆编码,操作人编码,是否上班操作,操作来源编码,上次操作时刻
                                  ,tzoo.名称 as 下班方式
                              from TAmbulancePersonSign taps
                              left join TZOperationOrigin tzoo on taps.操作来源编码=tzoo.编码
                               where 操作时刻 >=  '" + beginTime + "' and 操作时刻 <= '" + endTime + @"' and 是否上班操作 = 0
                               )t1 on t.操作时刻 = t1.上次操作时刻 and t.人员编码=t1.人员编码 and t.人员类型编码=t1.人员类型编码
                    left join TPerson tp on t.人员编码=tp.编码
                    left join TAmbulance tam on t.车辆编码=tam.车辆编码
                    left join dbo.TCenter tc on tam.中心编码=tc.编码
                    left join dbo.TStation ts on tam.分站编码 = ts.编码
                    left join TRole tr on t.人员类型编码=tr.编码
                    left join TAmbulance ta on t.车辆编码=ta.车辆编码
                    where 1=1
                    ");
            if (em == E_StatisticsPermisson.None)
                return null;
            else if (em == E_StatisticsPermisson.ALL)
            {

                WhereClauseUtility.AddStringLike("tp.姓名", name, sb);
                WhereClauseUtility.AddInSelectQuery("tc.编码", center, sb);
                WhereClauseUtility.AddInSelectQuery("ts.编码", station, sb);
                WhereClauseUtility.AddInSelectQuery("tr.编码", role, sb);
                WhereClauseUtility.AddStringLike("tp.工号", workCode, sb);
                WhereClauseUtility.AddStringLike("ta.实际标识", carNumber, sb);
                sb.Append("order by tc.顺序号,t.车辆编码,t.操作时刻");

                DataSet ds = SqlHelper.ExecuteDataSet(SqlHelper.AttemperConnectionString, CommandType.Text, sb.ToString(), null);
                return ds.Tables[0];
            }
            else if (em == E_StatisticsPermisson.CENTER)
            {

                WhereClauseUtility.AddStringLike("tp.姓名", name, sb);
                WhereClauseUtility.AddStringEqual("tc.编码", selfCenterID, sb);
                WhereClauseUtility.AddInSelectQuery("ts.编码", station, sb);
                WhereClauseUtility.AddInSelectQuery("tr.编码", role, sb);
                WhereClauseUtility.AddStringLike("tp.工号", workCode, sb);
                WhereClauseUtility.AddStringLike("ta.实际标识", carNumber, sb);
                sb.Append("order by tc.顺序号,t.车辆编码,t.操作时刻");
                DataSet ds = SqlHelper.ExecuteDataSet(SqlHelper.AttemperConnectionString, CommandType.Text, sb.ToString(), null);
                return ds.Tables[0];
            }
            else if (em == E_StatisticsPermisson.STATION)
            {
                WhereClauseUtility.AddStringLike("tp.姓名", name, sb);
                WhereClauseUtility.AddStringEqual("ts.编码", selfStationID, sb);
                WhereClauseUtility.AddInSelectQuery("tr.编码", role, sb);
                WhereClauseUtility.AddStringLike("tp.工号", workCode, sb);
                WhereClauseUtility.AddStringLike("ta.实际标识", carNumber, sb);
                sb.Append("order by tc.顺序号,t.车辆编码,t.操作时刻");
                DataSet ds = SqlHelper.ExecuteDataSet(SqlHelper.AttemperConnectionString, CommandType.Text, sb.ToString(), null);
                return ds.Tables[0];
            }
            else if (em == E_StatisticsPermisson.SELF)
            {
                WhereClauseUtility.AddStringLike("tp.姓名", selfName, sb);
                WhereClauseUtility.AddInSelectQuery("tr.编码", role, sb);
                WhereClauseUtility.AddStringEqual("tp.工号", selfWorkCode, sb);
                WhereClauseUtility.AddStringLike("ta.实际标识", carNumber, sb);
                sb.Append("order by tc.顺序号,t.车辆编码,t.操作时刻");
                DataSet ds = SqlHelper.ExecuteDataSet(SqlHelper.AttemperConnectionString, CommandType.Text, sb.ToString(), null);
                return ds.Tables[0];
            }
            else
            {
                return null;
            }
        }
예제 #9
0
        public DataTable Get_LS_BLTXSJ(DateTime beginTime, DateTime endTime, string workCode, string centerID,
            string stationID, E_StatisticsPermisson em, string selfWorkCode, string selfCenterID, string selfStationID)
        {
            StringBuilder sb = new StringBuilder();
            sb.Append(@"
                   select CallOrder=pr.CallOrder,
                   Name=pr.Name,
                   LocalAddress=pr.LocalAddress,
                   Driver=pr.Driver,
                   StretcherBearersI=pr.StretcherBearersI,
                   DoctorAndNurse=pr.DoctorAndNurse,
                   AgentName=pr.AgentName,
                   AgentWorkID=pr.AgentWorkID,
                   BeginFillPatientTime=pr.BeginFillPatientTime,
                   MedicalRecordGenerationTime=pr.MedicalRecordGenerationTime,
                   SubmitTime=pr.SubmitTime,
                   MedicalState=case when pr.MedicalStateCode = 0  then '暂存' else '提交' end

                   from M_PatientRecord pr
                   left join P_Department d on d.DispatchSationID = pr.OutStationCode
                   where MedicalRecordGenerationTime>='" + beginTime + "' and  MedicalRecordGenerationTime<'" + endTime + "'");

            if (em == E_StatisticsPermisson.None)
                return null;

            else if (em == E_StatisticsPermisson.ALL)
            {
                WhereClauseUtility.AddStringEqual("pr.AgentWorkID", workCode, sb);
                WhereClauseUtility.AddInSelectQuery("d.DispatchSubCenterID", centerID, sb);
                WhereClauseUtility.AddInSelectQuery("d.DispatchSationID", stationID, sb);
                sb.Append("order by TaskCode");
                DataSet ds = SqlHelper.ExecuteDataSet(SqlHelper.MainConnectionString, CommandType.Text, sb.ToString(), null);
                return ds.Tables[0];
            }
            else if (em == E_StatisticsPermisson.CENTER)
            {
                WhereClauseUtility.AddStringEqual("d.DispatchSubCenterID", selfCenterID, sb);
                WhereClauseUtility.AddInSelectQuery("d.DispatchSationID", stationID, sb);
                WhereClauseUtility.AddStringEqual("pr.AgentWorkID", workCode, sb);
                sb.Append("order by TaskCode");
                DataSet ds = SqlHelper.ExecuteDataSet(SqlHelper.MainConnectionString, CommandType.Text, sb.ToString(), null);
                return ds.Tables[0];
            }
            else if (em == E_StatisticsPermisson.STATION)
            {
                WhereClauseUtility.AddStringEqual("d.DispatchSationID", selfStationID, sb);
                WhereClauseUtility.AddStringEqual("pr.AgentWorkID", workCode, sb);
                sb.Append("order by TaskCode");
                DataSet ds = SqlHelper.ExecuteDataSet(SqlHelper.MainConnectionString, CommandType.Text, sb.ToString(), null);
                return ds.Tables[0];
            }
            else if (em == E_StatisticsPermisson.SELF)
            {
                sb.Append("and AgentWorkID = '" + selfWorkCode + @"'
                   order by TaskCode");
                DataSet ds = SqlHelper.ExecuteDataSet(SqlHelper.MainConnectionString, CommandType.Text, sb.ToString(), null);
                return ds.Tables[0];
            }
            else
            {
                return null;
            }
        }