public AlarmEventInfo GetAlarmEventInfoByCode(string EventCode) { AlarmEventInfo aeInfo = new AlarmEventInfo(); StringBuilder strSQL = new StringBuilder(); strSQL.Append(@"SELECT 事件编码,首次呼救电话,首次受理时刻,事件名称=(现场地址+患者姓名), 首次调度员编码,受理次数,区域,执行任务总数,当前执行任务数,等车地址, 是否挂起,TZET.名称 as 事件类型,TZEO.名称 as 事件来源 ,TZAT.名称 as 事故类型,TZAL.名称 as 事故等级,TP.姓名 as 首次调度员, 首次调度员工号=tp.工号,TAE.是否测试 ,TAE.中心编码,中心名称=tc.名称 FROM TAlarmEvent TAE left join TZAlarmEventType TZET on TZET.编码 = TAE.事件类型编码 left join TZAlarmEventOrigin TZEO on TZEO.编码 =TAE.事件来源编码 left join TZAccidentType TZAT on TZAT.编码 = TAE.事故类型编码 left join TZAccidentLevel TZAL on TZAL.编码 =TAE.事故等级编码 left join TPerson TP on TP.编码=TAE.首次调度员编码 left join TCenter tc on tc.编码=TAE.中心编码 where tae.事件编码 = '" + EventCode + @"'"); using (SqlDataReader sdr = SqlHelper.ExecuteReader(SqlHelper.AttemperConnectionString, CommandType.Text, strSQL.ToString(), null)) { if (sdr.Read()) { aeInfo.EventCode = sdr["事件编码"].ToString(); aeInfo.FirstAlarmCall = sdr["首次呼救电话"].ToString(); aeInfo.EvetnName = sdr["事件名称"].ToString(); aeInfo.FirstAcceptTime = DBConvert.ConvertNullableToNullableTime(sdr["首次受理时刻"].ToString()); // aeInfo.FirstDisptcher = sdr["首次调度员编码"].ToString(); aeInfo.FirstDisptcherWorkID = sdr["首次调度员工号"].ToString();//2013.04.11 刘爱青 add aeInfo.AcceptCount = Convert.ToInt32(sdr["受理次数"]); // aeInfo.FirstSendAmbTime = DBConvert.ConvertNullableToNullableTime(sdr["首次派车时刻"].ToString()); aeInfo.Area = sdr["区域"].ToString(); aeInfo.TransactTaskCount = Convert.ToInt32(sdr["执行任务总数"]); aeInfo.NonceTransactTaskCount = Convert.ToInt32(sdr["当前执行任务数"]); aeInfo.IsHangUp = Convert.ToBoolean(sdr["是否挂起"]); aeInfo.EventType = sdr["事件类型"].ToString(); // aeInfo.EventTypeCode = Convert.ToInt32(sdr["事件类型编码"]); aeInfo.EventSource = sdr["事件来源"].ToString(); // aeInfo.EventSourceCode = Convert.ToInt32(sdr["事件来源编码"]); aeInfo.AccidentType = sdr["事故类型"].ToString(); // aeInfo.AccidentTypeCode = Convert.ToInt32(sdr["事故类型编码"]); aeInfo.AccidentLevel = sdr["事故等级"].ToString(); // aeInfo.AccidentLevelCode = Convert.ToInt32(sdr["事故等级编码"]); aeInfo.FirstDisptcherName = sdr["首次调度员"].ToString(); aeInfo.IsTest = Convert.ToBoolean(sdr["是否测试"]); aeInfo.CenterCode = Convert.ToInt32(sdr["中心编码"]); aeInfo.CenterName = sdr["中心名称"].ToString(); } } return(aeInfo); }
public AcceptEventInfo GetAcceptEventInfoByCode(string code, int orderNum) { AcceptEventInfo AEinfo; StringBuilder sb = new StringBuilder(); sb.Append(@"SELECT 事件编码=tae.事件编码,受理序号=tae.受理序号,受理类型编码,受理类型子编码,责任受理人编码,呼救电话=tae.呼救电话 ,电话振铃时刻=tae.电话振铃时刻,开始受理时刻=tae.开始受理时刻,结束受理时刻=tae.结束受理时刻,发送指令时刻,现场地址,等车地址 ,送往地点,往救地点类型编码,送往地点类型编码,联系人,联系电话,分机,患者姓名,性别 ,年龄,国籍,主诉,病种判断,病情编码=tale.病情编码,是否需要担架,伤亡人数,特殊要求,是否标注 ,X坐标,Y坐标,派车列表, 备注=tale.备注,TZET.名称 as 受理类型,TP.姓名 as 责任受理人,病情=tzis.名称 ,往救地点类型=tzlat.名称,送往地点类型=tzsat.名称,责任受理人工号=tp.工号 FROM TAcceptEvent TAE inner join TZAcceptEventType TZET on TZET.编码 = TAE.受理类型编码 inner join TPerson TP on TP.编码 = TAE.责任受理人编码 left join TAlarmEvent tale on tae.事件编码= tale.事件编码 left join TZIllState tzis on tzis.编码 = tale.病情编码 left join TZLocalAddrType tzlat on tzlat.编码 = tale.往救地点类型编码 left join TZSendAddrType tzsat on tzsat.编码 = tale.送往地点类型编码 left join TTask tk on tae.事件编码 =tk.事件编码 where tae.事件编码 = '" + code + @"' and tae.受理序号='" + orderNum + @"'"); using (SqlDataReader dr = SqlHelper.ExecuteReader(SqlHelper.AttemperConnectionString, CommandType.Text, sb.ToString(), null)) { AEinfo = new AcceptEventInfo(); if (dr.Read()) { AEinfo.EventCode = DBConvert.ConvertStringToString(dr["事件编码"]); AEinfo.AcceptOrder = Convert.ToInt32(dr["受理序号"]); AEinfo.TypeId = Convert.ToInt32(dr["受理类型编码"]); AEinfo.DetailReasonId = Convert.ToInt32(dr["受理类型子编码"]); AEinfo.AcceptPersonCode = DBConvert.ConvertStringToString(dr["责任受理人编码"]); AEinfo.AcceptPersonWorkID = DBConvert.ConvertStringToString(dr["责任受理人工号"]); AEinfo.AlarmTel = DBConvert.ConvertStringToString(dr["呼救电话"]); // AEinfo.HangUpTime = DBConvert.ConvertNullableToNullableTime(dr["挂起时刻"].ToString()); AEinfo.RingTime = DBConvert.ConvertNullableToNullableTime(dr["电话振铃时刻"].ToString()); AEinfo.AcceptBeginTime = DBConvert.ConvertNullableToNullableTime(dr["开始受理时刻"].ToString()); AEinfo.AcceptEndTime = DBConvert.ConvertNullableToNullableTime(dr["结束受理时刻"].ToString()); AEinfo.CommandTime = DBConvert.ConvertNullableToNullableTime(dr["发送指令时刻"].ToString()); AEinfo.LocalAddr = DBConvert.ConvertStringToString(dr["现场地址"]); AEinfo.WaitAddr = DBConvert.ConvertStringToString(dr["等车地址"]); AEinfo.SendAddr = DBConvert.ConvertStringToString(dr["送往地点"]); AEinfo.LocalAddrTypeId = Convert.ToInt32(dr["往救地点类型编码"]); AEinfo.SendAddrTypeId = Convert.ToInt32(dr["送往地点类型编码"]); AEinfo.LinkMan = DBConvert.ConvertStringToString(dr["联系人"]); AEinfo.LinkTel = DBConvert.ConvertStringToString(dr["联系电话"]); AEinfo.Extension = DBConvert.ConvertStringToString(dr["分机"]); AEinfo.PatientName = DBConvert.ConvertStringToString(dr["患者姓名"]); AEinfo.Sex = DBConvert.ConvertStringToString(dr["性别"]); AEinfo.Age = DBConvert.ConvertStringToString(dr["年龄"]); // AEinfo.Folk = DBConvert.ConvertStringToString(dr["民族"]); AEinfo.National = DBConvert.ConvertStringToString(dr["国籍"]); AEinfo.AlarmReason = DBConvert.ConvertStringToString(dr["主诉"]); AEinfo.Judge = DBConvert.ConvertStringToString(dr["病种判断"]); AEinfo.IllStateId = Convert.ToInt32(dr["病情编码"]); AEinfo.IsNeedLitter = Convert.ToBoolean(dr["是否需要担架"]); AEinfo.PatientCount = Convert.ToInt32(dr["伤亡人数"]); AEinfo.SpecialNeed = DBConvert.ConvertStringToString(dr["特殊要求"]); AEinfo.IsLabeled = Convert.ToBoolean(dr["是否标注"]); AEinfo.X = Convert.ToDouble(dr["X坐标"]); AEinfo.Y = Convert.ToDouble(dr["Y坐标"]); AEinfo.AmbulanceList = DBConvert.ConvertStringToString(dr["派车列表"]); AEinfo.Remark = DBConvert.ConvertStringToString(dr["备注"]); AEinfo.AcceptType = DBConvert.ConvertStringToString(dr["受理类型"]); AEinfo.Dispatcher = DBConvert.ConvertStringToString(dr["责任受理人"]); AEinfo.IllState = DBConvert.ConvertStringToString(dr["病情"]); AEinfo.LocalAddrType = DBConvert.ConvertStringToString(dr["往救地点类型"]); AEinfo.SendAddrType = DBConvert.ConvertStringToString(dr["送往地点类型"]); //AEinfo.AcceptPersonWorkID = DBConvert.ConvertStringToString(dr["责任受理人工号"]); // AEinfo.BackUpOne = DBConvert.ConvertStringToString(dr["保留字段1"]); //AEinfo.BackUpTwo = DBConvert.ConvertStringToString(dr["保留字段2"]); // AEinfo.HangUpTime = DBConvert.ConvertNullableToNullableTime(dr["挂起时刻"].ToString()); } return(AEinfo); } }