select b.xm,c.JZKH,a.PKEY,a.CJRQ,c.JJKS,a.cfh,a.FYCK,a.FYYF,a.FYZT,a.SFDY,a.SFTY,a.PYZT,a.SHZT,b.XB,c.JZNL,c.ISJZ,a.JGID,a.HZPKEY,a.JZPKEY,a.MZFPPKEY,a.ZDZBPKEY,a.PYR,a.PYRQ,a.SHR,a.SHRQ,a.FYR,a.FYRQ,a.LOCKFLAG from HIS_MMS_MZDFYZB a left join HIS_HZINFO b on a.hzpkey=b.pkey left join HIS_JZ_BASEINFO c on a.jzpkey=c.pkey where a.JGID=? and a.PKEY=?
12
12
select a.PKEY,a.YZX,a.YZMX,a.YZDJ,a.YZSL,a.DFYPKEY,a.FYMXPKEY,a.HZBQ,a.HZKS,a.FYKS,a.HZPKEY,a.YPFL,a.JZPKEY,a.TYPE,a.CJR,a.CJRQ,a.XGR,a.XGRQ,a.JGID,a.YZDL,b.YZMC,b.YZDW,b.YZJL,b.YZJLDW,b.YZPC,b.YZLC,b.YZJE,b.YZBZ,b.YZXZYS,b.YZXZKS,b.YZDJSL,b.PKEY YZPKEY,b.YZYF,b.YPYZJBDW JBDW,b.YZJZZHXS,b.YPYZJBJG,a.TYSL,a.SFSL,a.FYZT,a.LOCKFLAG,c.WZGG,c.WZCS,d.ybbm,d.ybmc,a.ZSMCJ from HIS_MMS_PYB a left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_MMS_WZZD c on a.YZX=c.WZBM and a.JGID=c.JGID left join his_sfx d on c.wzbm=d.glbm and d.JGID=c.JGID where a.JGID=? and a.DFYPKEY=? order by a.pkey
YZPKEY
YZDJSL
HZPKEY
JZPKEY
JGID
12
12
select PKEY,YZX,YZMX,YZDJ,YZSL,FYBPKEY,HZBQ,HZKS,FYKS,HZPKEY,YPFL,JZPKEY,TYPE,YZDL,TYSL,CJR,CJRQ,XGR,XGRQ,JGID,KSKCPKEY,KSKCPCPKEY,LOCKFLAG from HIS_MMS_MZFYMXB where 1=2
select PKEY,HZPKEY,JZPKEY,MZFPPKEY,ZDZBPKEY,FYCK,FYYF,FYZT,SFDY,SFTY,CFH,PYZT,SHZT,PYR,PYRQ,SHR,SHRQ,DFYBPKEY,CJR,CJRQ,XGR,XGRQ,JGID,FYR,FYRQ,LOCKFLAG from HIS_MMS_MZFYZB where 1=2
=? and a.CJRQ <=? order by a.CJRQ desc)]]>
12
93
93
select a.PKEY,a.HZPKEY,a.JZPKEY,a.MZFPPKEY,a.ZDZBPKEY,a.FYCK,a.FYYF,a.FYZT,a.SFDY,a.SFTY,a.CFH,a.PYZT,a.SHZT,a.PYR,a.PYRQ,a.SHR,a.SHRQ,a.DFYBPKEY,a.CJR,a.CJRQ,a.XGR,a.XGRQ,a.JGID,b.JZZDPKEY,a.LOCKFLAG from HIS_MMS_MZFYZB a left join HIS_SFZD_ZB b on b.JZZDPKEY=a.ZDZBPKEY and a.JGID=b.JGID where b.JSZT=1 and b.ISHC=0 and a.JGID=? and b.JZZDPKEY=? order by a.CJRQ desc
12
12
select a.PKEY,a.YZX,a.YZMX,a.YZDJ,a.YZSL,a.FYBPKEY,a.HZBQ,a.HZKS,a.FYKS,a.HZPKEY,a.YPFL,a.JZPKEY,a.TYPE,a.YZDL,a.TYSL,a.CJR,a.CJRQ,a.XGR,a.XGRQ,a.JGID,a.KSKCPKEY,a.KSKCPCPKEY,b.CFH,b.YZMC,b.YZDW,b.YZJL,b.YZJLDW,b.YZPC,b.YZLC,b.YZJE,b.YZBZ,b.YZXZYS,b.YZXZKS,b.YZDJSL,b.PKEY YZPKEY,b.YZYF,b.YPYZJBDW JBDW,b.YZJZZHXS,b.YPYZJBJG,a.LOCKFLAG from HIS_MMS_MZFYMXB a left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_MMS_MZFYZB c on a.FYBPKEY=c.PKEY and a.JGID=c.JGID left join HIS_SFZD_ZB d on d.JZZDPKEY=c.ZDZBPKEY and d.JGID=c.JGID where a.JGID=? and c.pkey=? and d.JSZT=1 and d.ISHC=0 order by b.cfh,a.pkey
12
12
select PKEY,HZPKEY,JZPKEY,MZFPPKEY,ZDZBPKEY,JZZDPKEY,JZMZFPPKEY,MZFYBPKEY,TYYF,TYRY,FYYF,TYYY,CJR,CJRQ,XGR,XGRQ,JGID,FYRQ,ISCX,CFH,LOCKFLAG from HIS_MMS_MZTYZB where 1=2
select PKEY,YZX,YZMX,YZDJ,TYSL,HZBQ,HZKS,TYKS,HZPKEY,YPFL,JZPKEY,TYBPKEY,TYPE,KSKCPKEY,KSKCPCPKEY,CJR,CJRQ,XGR,XGRQ,JGID,MZFYMXBPKEY,PYBPKEY,TYDH,TYYY,BED,CFH,ZYNO,LOCKFLAG,ZSMCJ from HIS_MMS_MZTYMXB where 1=2
=? and e.zxtime <= ?
]]>
PKEY
YZMX
FYMXPKEY
FYZT
FYCX
EXECPKEY
YZMX
JZPKEY
SFFLAG
ISACTION
ZXFLAG
12
12
93
93
=? and e.zxtime <= ? group by b.YZZXKS
]]>
12
93
93
select PKEY,FYBPKEY,JZPKEY,HZPKEY,ZYNO,CFH,PYBPKEY,YZXPKEY,YZMX,YZDJ,YZSL,BED,YPFL,YZDL,TYSL,KSKCPKEY,KSKCPCPKEY,CJR,CJRQ,XGR,XGRQ,JGID,EXEPKEY,LOCKFLAG from HIS_MMS_ZYFYMXB where 1=2
select PKEY,FYR,FYKS,FYTIME,HZBQ,PRINTFLAG,PRINTTIME,FYLB,FYKSSJ,FYJSSJ,FYDH,FYITEMS,CJR,CJRQ,XGR,XGRQ,JGID,HZKS,LOCKFLAG from HIS_MMS_ZYFYZB where 1=2
select PKEY,TYDH,HZPKEY,JZPKEY,ZYNO,BED,WARD,SQKS,JSKS,JJKS,EXEPKEY,PYBPKEY,YZMX,YZXPKEY,CFH,SQSL,YZDJ,YZJE,STATE,KDYS,SQR,CJR,CJRQ,XGR,XGRQ,JGID,TYR,TYRQ,LOCKFLAG from HIS_MMS_ZYTYSQB where 1=2
select TYDH,CJR,CJRQ,JGID,LOCKFLAG from HIS_MMS_ZYTYSQBZB where 1=2
select * from (select distinct a.yzmx||'|'||a.QUERYCODE flagcode,a.PKEY,a.JZPKEY,a.HZPKEY,a.YZMX,a.YZXPKEY,a.ZXFLAG,a.ZXR,a.ZXTIME,a.ZXRKS,a.ZXRWARD,a.PRINTFLAG,a.PRINTMAN,a.PRINTTIME,a.BBCJFLAG,a.BBCJMAN,a.BBCJTIME,a.BBTM,a.QUERYCODE,a.SFFLAG,a.ZXSL,a.ZXDW,a.ZXJE,a.YZBEGINSJ,a.YZZXBEGINSJ,a.YZTZSJ,a.YZMS,a.JZBZ,a.ZDZBPKEY,a.CXR,a.CXSJ,a.TZR,a.TZSJ,a.CJR,a.CJRQ,a.XGR,a.XGRQ,a.JGID,a.CFH,a.YZMC,a.ISACTION,e.PKEY pybpkey,e.SFLYSH,e.SFYSSH,e.LYSHR,e.LYSHRQ,e.YSSHR,e.YSSHRQ,e.FYZT
,(select sum(YZSL) YZSL from HIS_MMS_ZYFYMXB where PYBPKEY=e.pkey and yzmx=e.yzmx and JGID=e.JGID) FYMXBYZSL
,(select sum(TYSL) TYSL from HIS_MMS_ZYFYMXB where PYBPKEY=e.pkey and yzmx=e.yzmx and JGID=e.JGID) FYMXBTYSL
,e.YPFL,e.TYSL,fyzb.FYKS,f.YZXZYS,f.YZLB,h.zyno,h.zybah,h.bed,i.xm,h.ward,a.TYDNUM,h.jjks,(select sum(sqsl) sqsl from HIS_MMS_ZYTYSQB where exepkey=a.pkey and JGID=a.JGID and STATE != 2) sqsl,f.YZJZZHXS,f.YPYZJBDW,g.TYDH,e.LOCKFLAG
from HIS_YZ_EXEC a left join HIS_MMS_PYB e on a.pkey=e.DFYPKEY and a.JGID=e.JGID left join HIS_YZ_MXB f on a.YZMX=f.pkey and a.JGID=f.JGID left join HIS_JZ_BASEINFO h on a.jzpkey=h.pkey and a.JGID=h.JGID left join HIS_HZINFO i on a.hzpkey=i.pkey and a.JGID=i.JGID left join HIS_MMS_ZYTYSQB g on g.exepkey=a.pkey and g.JGID=a.JGID left join HIS_MMS_ZYFYMXB fymx on fymx.YZMX=a.yzmx and fymx.JGID=a.JGID left join HIS_MMS_ZYFYZB fyzb on fymx.FYBPKEY=fyzb.pkey and fyzb.JGID=fymx.JGID
where a.JGID=? #query# and (a.ZXFLAG=2 or a.ZXFLAG=3) and e.FYZT=1 and (h.JZLX='Z' or (h.JZLX='J' OR h.SFLG='1')) and h.ISZZCWJS != '1' and g.state=0 order by a.ZXTIME desc ) where (nvl(FYMXBYZSL,0)-nvl(FYMXBTYSL,0))>0 and nvl(sqsl,0) > 0
PKEY
SFFLAG
ISACTION
ZXFLAG
JGID
TYDNUM
12
select g.PKEY,g.TYDH,g.HZPKEY,g.JZPKEY,g.ZYNO,g.BED,g.WARD,g.SQKS,g.JSKS,g.JJKS,g.EXEPKEY,g.PYBPKEY,g.YZMX,g.YZXPKEY,g.CFH,g.SQSL,g.YZDJ,g.YZJE,g.STATE,g.KDYS,g.SQR,g.CJR,g.CJRQ,g.XGR,g.XGRQ,g.JGID,i.xm,g.TYR,g.TYRQ,g.LOCKFLAG
from HIS_MMS_ZYTYSQB g
left join HIS_YZ_EXEC a on a.pkey=g.exepkey and a.JGID=g.JGID
left join HIS_MMS_PYB e on a.pkey=e.DFYPKEY and a.JGID=e.JGID
left join HIS_JZ_BASEINFO h on a.jzpkey=h.pkey and a.JGID=h.JGID
left join HIS_HZINFO i on a.hzpkey=i.pkey and a.JGID=i.JGID
where a.JGID=? #query# and (a.ZXFLAG=2 or a.ZXFLAG=3) and e.FYZT=1 and h.JZLX='Z' and h.JZZT='Z' and h.ISZZCWJS != '1' and g.STATE=0 order by a.ZXTIME desc
12
select fymxb.PKEY,fymxb.FYBPKEY,fymxb.JZPKEY,fymxb.HZPKEY,fymxb.ZYNO,fymxb.CFH,fymxb.PYBPKEY,fymxb.YZXPKEY,fymxb.YZMX,fymxb.YZDJ,fymxb.YZSL,fymxb.BED,fymxb.YPFL,fymxb.YZDL,fymxb.TYSL,fymxb.KSKCPKEY,fymxb.KSKCPCPKEY,fymxb.CJR,fymxb.CJRQ,fymxb.XGR,fymxb.XGRQ,fymxb.JGID,fymxb.EXEPKEY,b.YZMC,b.YZDW,b.YZJL,b.YZJLDW,b.YZPC,b.YZLC,b.YZJE,b.YZBZ,b.YZXZYS,b.YZXZKS,b.YZDJSL,b.YZYF,b.YPYZJBDW JBDW,b.YZJZZHXS,b.YPYZJBJG,i.XM,fymxb.LOCKFLAG from HIS_MMS_ZYFYMXB fymxb
left join HIS_YZ_EXEC a on a.pkey=fymxb.exepkey and a.JGID=fymxb.JGID
left join HIS_MMS_PYB e on a.pkey=e.DFYPKEY and a.JGID=e.JGID
left join HIS_JZ_BASEINFO h on a.jzpkey=h.pkey and a.JGID=h.JGID
left join HIS_HZINFO i on a.hzpkey=i.pkey and a.JGID=i.JGID
left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID
left join HIS_MMS_ZYTYSQB g on g.exepkey=a.pkey and g.JGID=a.JGID
where a.JGID=? #query# and (a.ZXFLAG=2 or a.ZXFLAG=3) and e.FYZT=1 and h.JZLX='Z' and h.JZZT='Z' and g.STATE=0 and h.ISZZCWJS != '1' order by a.ZXTIME desc
12
=? and a.CJRQ <=? order by c.ISJZ desc,a.CJRQ)
]]>
12
12
12
93
93
=? and a.CJRQ <=? order by a.CJRQ desc)]]>
12
93
93
select b.xm,c.JZKH,a.PKEY,a.CJRQ,c.JJKS,a.cfh,a.FYCK,a.FYYF,a.FYZT,a.SFDY,a.SFTY,a.PYZT,a.SHZT,b.XB,c.JZNL,c.ISJZ,a.JGID,a.HZPKEY,a.JZPKEY,a.MZFPPKEY,a.ZDZBPKEY,a.PYR,a.PYRQ,a.SHR,a.SHRQ,a.LOCKFLAG from HIS_MMS_MZDFYZB a left join HIS_HZINFO b on a.hzpkey=b.pkey left join HIS_JZ_BASEINFO c on a.jzpkey=c.pkey left join HIS_MZJS_MZFPZB d on a.MZFPPKEY=d.pkey and a.JGID=d.JGID where a.JGID=? and a.JZPKEY=? and a.FYYF=? and d.SFZT=1 and a.FYZT=0 order by c.ISJZ desc,a.cfh
12
12
12
select a.PKEY,a.YZX,a.YZMX,a.YZDJ,a.YZSL/b.YZJZZHXS YZSL,a.FYBPKEY,a.HZBQ,a.HZKS,a.FYKS,a.HZPKEY,a.YPFL,a.JZPKEY,a.TYPE,a.CJR,a.CJRQ,a.XGR,a.XGRQ,a.JGID,a.YZDL,b.YZMC,b.YZDW,b.YZJL,b.YZJLDW,b.YZPC,b.YZLC,b.YZJE,b.YZBZ,b.YZXZYS,b.YZXZKS,b.YZDJSL,c.WZGG,c.WZCS,b.PKEY YZPKEY,b.YZYF,c.JBDW,b.YZJZZHXS,b.YPYZJBJG,a.TYSL/b.YZJZZHXS TYSL,a.LOCKFLAG,d.ybbm,d.ybmc from HIS_MMS_MZFYMXB a left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_MMS_WZZD c on a.YZX=c.WZBM left join his_sfx d on c.wzbm=d.glbm and d.JGID=c.JGID where a.JGID=? and a.FYBPKEY=? order by a.pkey
YZPKEY
YZDJSL
HZPKEY
JZPKEY
JGID
PKEY
YZX
YZMX
JGID
HZPKEY
JZPKEY
12
12
select b.xm,c.JZKH,a.PKEY,a.CJRQ,c.JJKS,a.cfh,a.FYCK,a.FYYF,a.FYZT,a.SFDY,a.SFTY,a.PYZT,a.SHZT,b.XB,c.JZNL,c.ISJZ,a.JGID,a.HZPKEY,a.JZPKEY,a.MZFPPKEY,a.ZDZBPKEY,a.PYR,a.PYRQ,a.SHR,a.SHRQ,a.fyr,a.fyrq,a.LOCKFLAG from HIS_MMS_MZFYZB a left join HIS_HZINFO b on a.hzpkey=b.pkey left join HIS_JZ_BASEINFO c on a.jzpkey=c.pkey where a.JGID=? and a.JZPKEY=? and a.FYYF=? order by c.ISJZ desc,a.cfh
12
12
12
select a.cfh,a.PKEY FYBPKEY,a.CJRQ FYRQ,c.pkey MZFPPKEY,b.HZPKEY,b.JZPKEY,b.pkey ZDZBPKEY from HIS_MMS_MZFYZB a left join HIS_SFZD_ZB b on b.JZZDPKEY=a.ZDZBPKEY and a.JGID=b.JGID left join HIS_MZJS_MZFPZB c on b.PKEY=c.GLZDBPKEY and b.JGID=c.JGID where b.JSZT=1 and b.ISHC=0 and a.JGID=? and a.HZPKEY=? order by a.CJRQ desc
12
12
select * from (select a.MZFPPKEY,a.SQZT,a.SQRY,a.SQRQ,a.SHZT,a.SHRY,a.SHRQ,a.ZXZT,a.ZXRY,a.ZXRQ,a.CJR,a.CJRQ,a.JGID,a.SHBHBZ,a.TFYY,a.HZPKEY,a.JZPKEY,a.ZDZBPKEY,c.PKEY FYBPKEY,c.cfh,(select sum(tfsl) from HIS_SFZD_YZMXB where JGID=a.JGID and cfh=c.cfh) tfsl,a.LOCKFLAG from HIS_MZJS_MZFPCHSQ a left join HIS_SFZD_ZB b on a.ZDZBPKEY=b.PKEY and a.JGID=b.JGID left join HIS_MMS_MZFYZB c on b.JZZDPKEY=c.ZDZBPKEY where a.JGID=? and (1=? or c.FYYF=?) and a.ZXZT=0 and a.HZPKEY=? order by a.SQRQ desc) where tfsl > 0
12
12
12
12
select a.YZX,a.YZMX,a.TYKS,a.TYSL from HIS_MMS_MZTYMXB a left join HIS_MMS_MZTYZB b on a.TYBPKEY=b.pkey and a.JGID=b.JGID where b.ISCX=0 AND b.JGID=? and b.ZDZBPKEY=?
12
12
= ? and fyzb.FYRQ <=? group by a.HZPKEY,a.JZPKEY,a.JZH,a.CFH,a.YZSHZT,a.YZSFZT,a.JGID,a.YZLB,a.YZLX,b.jjks,c.xm,zdb.JBMC,f.JSSJ,fyzb.fyyf,fyzb.fyrq,fyzb.FYYF,fyzb.PYR,fyzb.fyr order by a.CFH
]]>
12
93
93
select PKEY,YZX,YZMX,YZDJ,YZSL,FYBPKEY,HZBQ,HZKS,FYKS,HZPKEY,YPFL,JZPKEY,TYPE,YZDL,TYSL,CJR,CJRQ,XGR,XGRQ,JGID,KSKCPKEY,KSKCPCPKEY from HIS_MMS_MZFYMXB where JGID=? and hzpkey=? and jzpkey=? and YZMX=? order by CJRQ
12
12
12
12
select PKEY,YZX,YZMX,YZDJ,TYSL,HZBQ,HZKS,TYKS,HZPKEY,YPFL,JZPKEY,TYBPKEY,TYPE,KSKCPKEY,KSKCPCPKEY,CJR,CJRQ,XGR,XGRQ,JGID,MZFYMXBPKEY,PYBPKEY,TYDH,TYYY,BED,CFH,ZYNO from HIS_MMS_MZTYMXB where JGID=? and hzpkey=? and jzpkey=? and YZMX=? order by CJRQ
12
12
12
12
=? and e.zxtime <= ? ) group by ward,YZMC,YPYZJBDW,YPYZJBJG,YZJX,wzgg,YPFL,yzx,YZLX,YZZCYFS,dwview,wzcs,fyks,bm
]]>
12
93
93
=? and e.zxtime <= ?
]]>
PKEY
YZMX
FYMXPKEY
FYZT
FYCX
EXECPKEY
YZMX
JZPKEY
SFFLAG
ISACTION
ZXFLAG
12
93
93
= ? and fyzb.FYTIME <=? group by a.HZPKEY,a.JZPKEY,b.ZYNO,a.CFH,a.YZSHZT,a.YZSFZT,a.JGID,a.YZLB,a.YZLX,b.jjks,c.xm,zdb.JBMC,fyzb.FYKS,fyzb.FYTIME,fyzb.fyr order by a.CFH
]]>
12
93
93
select PKEY,HZPKEY,JZPKEY,JZH,CFH,YZCL,YZLB,YZLX,YZXPKEY,YZSHZT,YZJL,YZJLDW,YZPC,YZTS,YZYF,YZZCYYF,YZZCYYFMS,YZTZH,YZXZSJ,YZXZYS,YZLRYS,YZJE,YZSL,YZJX,YZBEGINJDSJ,YZENDJDSJ,YZBEGINZXSJ,YZZXSJ,YZYTZSJ,YZTZSJ,YZDJ,YZBEGINJDHS,YZENDJDHS,YZTZYS,YZZT,YZFYLB,YZDAYCS,YZJDBZ,YZYX,YZZDY,YZXZSXYS,YZTZSXYS,ZYCS,YZXZRLX,YZCXR,YZCXBZ,YZCXSJ,YZCXYY,YZFYZH,YZSFZYZ,YZSCZXC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