delphi 連接oracle對接代碼
阿新 • • 發佈:2019-04-15
com enable for lag master src dtd _id reat
left join li004_jyxx t3 on t3.organid=t.organid and t3.itm_id=t.res_itm_id
left join tsfieldmode t4 on t4.vclen60=t.organid
where t.organid=:organid and t.positive_flag=‘1‘ and (t3.itm_id = :itm_id and t2.itr_id = :itr_id and t.res_date >= :res_date1 and t.res_date <= :res_date2)
:organid(VARCHAR[6])=‘A10001‘
:itm_id(VARCHAR[10])=‘CI00001298‘
:itr_id(VARCHAR[3])=‘KLP‘
:res_date1(DATE)=2017-09-08 10:09:02
:res_date2(DATE)=2019-04-15 10:09:02
select
t4.vclen60 as pat_d_codename,
t4.vclen60 as pat_sexname,
t1.pat_sex,t1.pat_d_code,t1.pat_in_no,t1.pat_bedno,t1.pat_age_exp,
t1.pat_name,t2.itr_name,t3.itm_name,t.*
from li014_ptjgb t
inner join li015_patin t1 on t1.organid=t.organid and t.res_id=t1.pat_id and t1.pat_chk_flag=1
left join li003_yqzd t2 on t2.organid=t.organid and t2.itr_id=t.res_itr_id
left join li004_jyxx t3 on t3.organid=t.organid and t3.itm_id=t.res_itm_id
left join tsfieldmode t4 on t4.vclen60=t.organid
where t.organid=:organid and t.positive_flag=‘1‘ and (t3.itm_id = :itm_id and t2.itr_id = :itr_id and t.res_date >= :res_date1 and t.res_date <= :res_date2)
:organid(VARCHAR[6])=‘A10001‘
:itr_id(VARCHAR[3])=‘KLP‘
:res_date1(DATE)=2017-09-08 10:09:02
:res_date2(DATE)=2019-04-15 10:09:02
SQL如上
代碼如下
if edtDateStart.DateTime > edtDateEnd.DateTime then begin InformationDlg(Tit, ‘起始日期時間不能大於結束日期時間!‘); // edtDateEnd.DateTime:=LocalDM.GetCurrTime;// edtDateStart.DateTime:=LocalDM.GetCurrTime-7; Exit; end; // add by zys on 2017-01-16 for LIS-1500 end if Trim(edtitm.RDKeyValue) <> ‘‘ then begin loParams.CreateParam(ftString, ‘itm_id‘, ptInput, ‘t3.itm_id‘, ‘=‘, ‘and‘).Value := Trim(edtitm.RDKeyValue); end; //====hupo add begin if Trim(rdsrchyiqi.RDKeyValue) <> ‘‘ then begin loParams.CreateParam(ftString, ‘itr_id‘, ptInput, ‘t2.itr_id‘, ‘=‘, ‘and‘).Value := Trim(rdsrchyiqi.RDKeyValue); end; if Trim(rdsrchkeshi.RDKeyValue) <> ‘‘ then begin loParams.CreateParam(ftString, ‘deptid‘, ptInput, ‘t1.pat_d_code‘, ‘=‘, ‘and‘).Value := Trim(rdsrchkeshi.RDKeyValue); end; //==end loParams.CreateParam(ftDateTime, ‘res_date1‘, ptInput, ‘t.res_date‘, ‘>=‘, ‘and‘).Value := edtDateStart.DateTime; loParams.CreateParam(ftDateTime, ‘res_date2‘, ptInput, ‘t.res_date‘, ‘<=‘, ‘and‘).Value := edtDateEnd.DateTime; cdsMaster.Params.Clear; loParam := CreateConditParam(loParams); if LocalDM.sysComm.GetSystemData(‘420703001‘, ‘4207030‘, loParam, loData, lsErrMsg) then begin cdsMaster.Data := loData; ConvertDataName(LocalDM.cdsDict, ‘dictid‘, ‘dictName‘, cdsMaster, ‘pat_sex=‘‘117‘‘‘, ‘typeid‘); ConvertDataName(LocalDM.cdsDeptID, ‘DeptID‘, ‘DeptName‘, cdsMaster, ‘pat_d_code=‘); CheckFuncRight; // Added by xxx 2019-03-28 10:03:28 LIS-3283 更新按鈕Enable end else begin Exit; end; finally loParams.Free; end;
delphi 連接oracle對接代碼