• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

delphi连接oracle对接代码

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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'
: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

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;

 


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
MATLAB 函数句柄的用法发布时间:2022-07-18
下一篇:
Matlab中的函数句柄@ - 疯子123发布时间:2022-07-18
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap