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_YFFY_ZYFYMXB where PYBPKEY=e.pkey and yzmx=e.yzmx and JGID=e.JGID) YZSL ,(select sum(TYSL) TYSL from HIS_YFFY_ZYFYMXB where PYBPKEY=e.pkey and yzmx=e.yzmx and JGID=e.JGID) TYSL ,e.YPFL,e.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_YFFY_ZYTYSQB where exepkey=a.pkey and JGID=a.JGID) sqsl,'' SELECTFLAG,f.YPYZJBDW,j.fydw,j.SFBZDWFY,j.YPYZZHXS from HIS_YZ_EXEC a left join HIS_YFFY_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_YFFY_ZYTYSQB g on a.pkey=g.exepkey and a.JGID=g.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_YFFY_ZYFYMXB j on j.PYBPKEY=e.pkey and j.yzmx=e.yzmx and j.JGID=e.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' AND h.SFLG='1')) and h.JZZT='Z' and h.ISZZCWJS != '1' order by a.ZXTIME desc PKEYZXFLAGSFFLAGISACTIONTYDNUM

12

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 from HIS_YFFY_ZYTYSQB where 1=2 PKEYJGID
select TYDH,CJR,CJRQ,JGID from HIS_YFFY_ZYTYSQBZB where 1=2 TYDH
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_YFFY_ZYFYMXB where PYBPKEY=e.pkey and yzmx=e.yzmx and JGID=e.JGID) FYMXBYZSL ,(select sum(TYSL) TYSL from HIS_YFFY_ZYFYMXB where PYBPKEY=e.pkey and yzmx=e.yzmx and JGID=e.JGID) FYMXBTYSL ,e.YPFL,e.TYSL,e.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_YFFY_ZYTYSQB where exepkey=a.pkey and JGID=a.JGID and STATE != 2) sqsl,ypxx.CSXX,ypxx.JX,f.YZJZZHXS,f.YPYZJBDW,g.TYDH,e.LOCKFLAG,d.fydw,d.SFBZDWFY,d.YPYZZHXS,d.YPFYSJMS from HIS_YZ_EXEC a left join HIS_YFFY_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_YPXX ypxx on ypxx.bm=a.yzxpkey left join HIS_YFFY_ZYTYSQB g on g.exepkey=a.pkey and g.JGID=a.JGID left join HIS_YFFY_ZYFYMXB d on d.PYBPKEY=e.pkey and d.yzmx=e.yzmx and d.JGID=e.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.JZZT='Z' 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 TYSLPYBPKEYYZMXJGID
PKEYSFFLAGISACTIONZXFLAGJGIDTYDNUM

12

select '' yzxpkey,'' YZMC,'' YZSL,'' TYSL,'' SQSL,'' dw,'' jx,'' cs,0 yzjzzhxs from dual where 1=2 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_YFFY_ZYTYSQB g left join HIS_YZ_EXEC a on a.pkey=g.exepkey and a.JGID=g.JGID left join HIS_YFFY_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 PKEYSTATE

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,fymxb.SFSL,fymxb.FYDW,fymxb.PCSJ,fymxb.PCJBSJ,fymxb.SFBZDWFY,fymxb.YPYZZHXS,fymxb.FYJE,fymxb.YPFYSJMS,fymxb.TYJE,fymxb.STSL,fymxb.PCDJ,fymxb.PCJBDJ,fymxb.FYJJJE,fymxb.TYJJJE,fymxb.SFXPKEY,b.YPYZBZJG from HIS_YFFY_ZYFYMXB fymxb left join HIS_YZ_EXEC a on a.pkey=fymxb.exepkey and a.JGID=fymxb.JGID left join HIS_YFFY_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_YFFY_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 PKEYJGIDEXEPKEYTYSL

12

select PKEY,FUNCTIONPKEY,YZXPKEY,CJR,CJRQ,XGR,XGRQ,JGID from HIS_ZY_FUNCTION_ITEMS where JGID=? and (FUNCTIONPKEY='tjhl' or FUNCTIONPKEY='yjhl' or FUNCTIONPKEY='ejhl' or FUNCTIONPKEY='sjhl') order by pkey PKEYFUNCTIONPKEYYZXPKEYJGID

12

select PKEY,FUNCTIONPKEY,YZXPKEY,CJR,CJRQ,XGR,XGRQ,JGID from HIS_ZY_FUNCTION_ITEMS where JGID=? and (FUNCTIONPKEY='bzyz' or FUNCTIONPKEY='bwyz' or FUNCTIONPKEY='bqzcyz') order by pkey PKEYFUNCTIONPKEYYZXPKEYJGID

12

=? and c.ZXTIME <=? ]]>

12

12

12

12

12

12

93

93

select c.PKEY,c.JZPKEY,c.HZPKEY,c.ZYNO,c.YZMX,c.YZXPKEY,c.ZXFLAG,c.ZXR,c.ZXTIME,c.ZXRKS,c.ZXRWARD,c.PRINTFLAG,c.PRINTMAN,c.PRINTTIME,c.BBCJFLAG,c.BBCJMAN,c.BBCJTIME,c.BBTM,c.QUERYCODE,c.SFFLAG,c.ZXSL,c.ZXDW,c.ZXJE,c.YZBEGINSJ,c.YZZXBEGINSJ,c.YZTZSJ,c.YZMS,c.JZBZ,c.ZDZBPKEY,c.CXR,c.CXSJ,c.TZR,c.TZSJ,c.CJR,c.CJRQ,c.XGR,c.XGRQ,c.JGID,c.cfh,c.YZMC,c.ISACTION,a.YZZXKS from HIS_YZ_EXEC c left join HIS_YZ_MXB a on c.yzmx=a.pkey and c.jzpkey=a.jzpkey where a.JGID=? and a.HZPKEY=? and a.JZPKEY =? and a.YZSHZT=1 and c.zxflag ='1' and a.yzlx='7' and a.BDEXECPKEY=? order by c.ZXTIME PKEYZXFLAGJGIDISACTION

12

12

12

12

select '' daystr,PKEY,JZPKEY,HZPKEY,ZYNO,YZMX,YZXPKEY,ZXFLAG,ZXR,ZXTIME,ZXRKS,ZXRWARD,PRINTFLAG,PRINTMAN,PRINTTIME,BBCJFLAG,BBCJMAN,BBCJTIME,BBTM,QUERYCODE,SFFLAG,ZXSL,ZXDW,ZXJE,YZBEGINSJ,YZZXBEGINSJ,YZTZSJ,YZMS,JZBZ,ZDZBPKEY,CXR,CXSJ,TZR,TZSJ,CJR,CJRQ,XGR,XGRQ,JGID,CFH,YZMC,ISACTION,YFBDZYZPKEY,BDYF,BDEXECPKEY,BDZC,CWJS,'' YZZXKS from HIS_YZ_EXEC where 1=2 PKEYSFFLAGZXFLAGISACTION
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,YZSCZXCS,YZZTPKEY,YZDS,YZJJBZ,CJR,CJRQ,JGID,YZLC,YZGLYZ,YZSYCS,YZZXKS,YZKZXTS,PS,PSBZ,YZFJSM,YZFB,YZSYLS,YZLSDW,YZSFPY,YZCLTM,YZCLYY,YZBZ,YZBBLX,YZDW,YZXZKS,YZZL,YZJZJLXS,YZJZZHXS,YPYZJBJG,YPYZJBDW,YPYZBZJG,YPYZBZDW,YPYZDXDW,YPYZDXSL,YPYZZHXS,YZMC,YZSFZT,YZTFSL,YZDJSL,YZYL,YZZCYFSKEY,YZZCYFS,YZZCYJX,YZZCYDJF,ISDJJS,DJJSSL,ISZCYDJCL,IZZCYDJFJF,ISGFFJ,YZZCYBZ,SQDTYPE,SQDPKEY,SQDJSPKEY,SQDTFJE,ZYYZFL,YZSHYS,YZSHRQ,ISZPC,YZZPC,YZPCFFSJ,YZXH,PSJG,ZCYGLCZLX,YZZFR,YZZFSJ,YZZFYY,PSJGSJ,PSJGR,ISDPBCL,HZSZKS,LOCKFLAG,YFBDZYZPKEY,BDYF,BDEXECPKEY,BDZC,SFXSYZ,GLLX,OPAPKEY,ANESPKEY,ISOPAORDER,ISANESORDER,SMORDERPKEY,LMT_USED_FLAG,XZSYFW,CHRGITM_LV,YBBM,YBMC,YZGG,YZDXRL,YPFYSJMS,YPPCSJ,YPPCJBSJ,YPMRPC,YZZCYCFZT,SFYFJJFY,YZHOURBEGIN,YZHOUREND,DMJYZ,DMJSFZ,DMJDBRSFZ,DMJDBRXM,DMJDBRDH,YZCFLX,YZSFKS,YZSFYS,YZSFTIME,YZSFBZ,YZYWBZ,YZPSYPPC,YZPSDS,YZPSDSBEGIN,YZPSDSMINUTE,PSDSMAN,PSDSTIME,PSZXKS,DDD,YZTPKEY,SFQYSHCF,SHCFZT,DCZDJL,MTZDJL,ZDL,SZSYTS from HIS_YZ_MXB where 1=2 PKEY

12

12

12

12

12

12

12

12

12

select c.PKEY,c.JZPKEY,c.HZPKEY,c.ZYNO,c.YZMX,c.YZXPKEY,c.ZXFLAG,c.ZXR,c.ZXTIME,c.ZXRKS,c.ZXRWARD,c.PRINTFLAG,c.PRINTMAN,c.PRINTTIME,c.BBCJFLAG,c.BBCJMAN,c.BBCJTIME,c.BBTM,c.QUERYCODE,c.SFFLAG,c.ZXSL,c.ZXDW,c.ZXJE,c.YZBEGINSJ,c.YZZXBEGINSJ,c.YZTZSJ,c.YZMS,c.JZBZ,c.ZDZBPKEY,c.CXR,c.CXSJ,c.TZR,c.TZSJ,c.CJR,c.CJRQ,c.XGR,c.XGRQ,c.JGID,c.cfh,c.YZMC,c.ISACTION,c.YFBDZYZPKEY,c.BDYF,c.BDEXECPKEY,c.BDZC,c.CWJS from HIS_YZ_EXEC c left join HIS_YZ_MXB a on c.yzmx=a.pkey and c.jzpkey=a.jzpkey where a.JGID=? and a.HZPKEY=? and a.JZPKEY =? and a.YZSHZT=1 and c.zxflag ='1' and a.yzlx='7' order by c.ZXTIME PKEYZXFLAGJGIDISACTION

12

12

12

PYBPKEYJZPKEYHZPKEYYZMXSFLYSHSFYSSHFYZTLOCKFLAG
PKEYJZPKEYSFFLAGYZMXJGIDTYDNUMZXFLAG

12

12

12

12

select PKEY,BM,MC,MS,CJR,CJRQ,XGR,XGRQ,SCR,SCRQ,SCBZ,JGID from HIS_BQFJLX where SCBZ = 1 and JGID = ? order by PKEY PKEYBMSCBZJGID

12

select PKEY,BM,MC,MS,FJLX,FJTZXZ,CJR,CJRQ,XGR,XGRQ,SCR,SCRQ,SCBZ,JGID,BQPKEY from HIS_BQFJ where SCBZ=1 and JGID=? order by bm PKEYBMSCBZJGID

12

select PKEY,HZPKEY,JZPKEY,TYPE,YKS,XKS,YBQ,XBQ,YCW,XCW,CZHS,CZRQ,CJR,CJRQ,XGR,XGRQ,JGID,LOCKFLAG from HIS_ZY_ZKZQ_LOG where JGID=? and hzpkey=? and jzpkey=? order by pkey desc PKEYJGID

12

12

12

select PKEY,HZPKEY,JZPKEY,TYPE,YKS,XKS,YBQ,XBQ,YCW,XCW,CZHS,CZRQ,CJR,CJRQ,XGR,XGRQ,JGID,LOCKFLAG from HIS_ZY_ZKZQ_LOG where 1=2 PKEYJGID
select PKEY,HZPKEY,JZPKEY,FMZT,CJR,CJRQ,XGR,XGRQ,JGID,LOCKFLAG from HIS_ZY_FM_LOG where JGID=? and hzpkey=? and jzpkey=? order by pkey PKEYJGID

12

12

12

select PKEY,MQHZPKEY,MQJZPKEY,YEHZPKEY,YEJZPKEY,YENO,YEFMJG,YEFMFS,YENAME,YENAMEJX,YEXB,YEBIRTHDAY,APGAR1,APGAR5,APGAR10,APGAR20,CJR,CJRQ,XGR,XGRQ,JGID,LOCKFLAG from HIS_ZY_FM_YEINFO where JGID=? and mqhzpkey=? and mqjzpkey=? order by yeno PKEYJGID

12

12

12

select count(*) num from HIS_ZY_FM_YEINFO where JGID=? and MQHZPKEY=? and MQJZPKEY=?

12

12

12

select a.PKEY,a.HZPKEY,a.JZPKEY,a.YZMX,a.JJFYR,a.JJFYRQ,a.JJFYYY,a.JJFYZT,a.CJR,a.CJRQ,a.XGR,a.XGRQ,a.JGID,a.LOCKFLAG,b.jjks,b.bed,b.ward,b.jzno,d.yzmc,d.yzzxks,d.YZXPKEY,d.yzsl,d.yzdw,c.xm,d.YZCL,b.zyno from HIS_YFFY_JJFY a left join HIS_JZ_BASEINFO b on a.jzpkey=b.pkey and a.JGID=b.JGID left join HIS_HZINFO c on a.hzpkey=c.pkey and a.JGID=c.JGID left join his_yz_mxb d on a.yzmx=d.pkey and a.JGID=d.JGID where a.JGID=? and a.hzpkey=? and a.jzpkey=? order by a.JJFYRQ PKEYJGID

12

12

12

select a.PKEY,a.HZPKEY,a.JZPKEY,a.YZMX,a.JJFYR,a.JJFYRQ,a.JJFYYY,a.JJFYZT,a.CJR,a.CJRQ,a.XGR,a.XGRQ,a.JGID,a.LOCKFLAG,b.jjks,b.bed,b.ward,b.jzno,d.yzmc,d.yzzxks,d.YZXPKEY,d.yzsl,d.yzdw,c.xm,d.YZCL,b.zyno from HIS_YFFY_JJFY a left join HIS_JZ_BASEINFO b on a.jzpkey=b.pkey and a.JGID=b.JGID left join HIS_HZINFO c on a.hzpkey=c.pkey and a.JGID=c.JGID left join his_yz_mxb d on a.yzmx=d.pkey and a.JGID=d.JGID where a.JGID=? order by a.JJFYRQ desc PKEYJGID

12

select count(1) num from HIS_YFFY_JJFY a left join HIS_JZ_BASEINFO b on a.jzpkey=b.pkey and a.JGID=b.JGID left join HIS_HZINFO c on a.hzpkey=c.pkey and a.JGID=c.JGID left join his_yz_mxb d on a.yzmx=d.pkey and a.JGID=d.JGID where a.JGID=? and a.hzpkey=? and a.jzpkey=? and a.JJFYZT='1' order by a.JJFYRQ

12

12

12

SELECT '' jbmc, '' jbbm, to_char( jfrq, 'YYYY-MM-DD' ) jfrqstr, PKEY, ZDZBPKEY, YZX, YZMX, SFX, SFXDJ, SFXSL, SFXZKL, SFXZFY, SFXZKFY, HZYBZF, HZZFZF, JFRQ, CJR, CJRQ, JGID, FYDL, FYZL, EXEPKEY, ISHC, HCDJPKEY, JSZT, ZYZFL, BM, MC, ZXFLAG, yzdw, gg, yzmc, zxdw, LOCKFLAG, HZPKEY, JZPKEY, xzsyfw, zyno, mzno, xm, xb, jznl, sfzh, jjrq, cyrq, jjks, jjys, yzxzys, jzlx FROM ( SELECT a.PKEY, a.ZDZBPKEY, a.YZX, a.YZMX, a.SFX, a.SFXDJ, a.SFXSL, a.SFXZKL, a.SFXZFY, a.SFXZKFY, a.HZYBZF, a.HZZFZF, a.JFRQ, a.CJR, a.CJRQ, a.JGID, a.FYDL, a.FYZL, a.EXEPKEY, a.ISHC, a.HCDJPKEY, a.JSZT, b.ZYZFL, b.BM, b.MC, c.ZXFLAG, d.yzdw, y.gg, d.yzmc, c.zxdw, a.LOCKFLAG, a.HZPKEY, a.JZPKEY, g.xzsyfw, e.zyno, e.mzno, f.xm, f.xb, e.jznl, f.sfzh, e.jjrq, e.cyrq, e.jjks, e.jjys, d.yzxzys, e.jzlx FROM HIS_SFZD_SFXMXB a LEFT JOIN HIS_SFX b ON a.sfx = b.bm AND a.JGID = b.JGID LEFT JOIN HIS_YZ_EXEC c ON a.EXEPKEY = c.pkey AND a.JGID = c.JGID LEFT JOIN HIS_YZ_MXB d ON a.yzmx = d.pkey AND a.JGID = d.JGID LEFT JOIN HIS_YPXX y ON d.yzxpkey = y.bm LEFT JOIN HIS_JZ_BASEINFO e ON a.jzpkey = e.pkey AND a.JGID = e.JGID LEFT JOIN HIS_HZINFO f ON a.hzpkey = f.pkey AND a.JGID = f.JGID LEFT JOIN his_yb_ml g ON b.YBPKEY = g.rid WHERE ( b.gllx IS NULL OR b.gllx != 'W' ) AND a.JGID =? AND ( ( e.jzlx = 'Z' AND e.jzzt = 'C' ) OR e.jzlx = 'M' ) AND c.zxflag LIKE '1' union all select a.PKEY,a.ZDZBPKEY,a.YZX,a.YZMX,a.SFX,a.SFXDJ,a.SFXSL,a.SFXZKL,a.SFXZFY,a.SFXZKFY,a.HZYBZF,a.HZZFZF,a.JFRQ,a.CJR,a.CJRQ,a.JGID,a.FYDL,a.FYZL,a.EXEPKEY,a.ISHC,a.HCDJPKEY,a.JSZT,b.ZYZFL,b.BM,b.MC,c.ZXFLAG,d.yzdw,w.wzgg gg,d.yzmc,c.zxdw,a.LOCKFLAG,a.HZPKEY,a.JZPKEY,g.xzsyfw,e.zyno,e.mzno,f.xm,f.xb,e.jznl,f.sfzh,e.jjrq,e.cyrq,e.jjks,e.jjys,d.yzxzys,e.jzlx from HIS_SFZD_SFXMXB a left join HIS_SFX b on a.sfx=b.bm and a.JGID=b.JGID left join HIS_YZ_EXEC c on a.EXEPKEY=c.pkey and a.JGID=c.JGID left join HIS_YZ_MXB d on a.yzmx=d.pkey and a.JGID=d.JGID left join HIS_MMS_WZZD w on b.glbm=w.wzbm and b.JGID=w.JGID left join HIS_JZ_BASEINFO e on a.jzpkey=e.pkey and a.JGID=e.JGID left join HIS_HZINFO f on a.hzpkey=f.pkey and a.JGID=f.JGID left join his_yb_ml g on b.YBPKEY=g.rid where b.gllx = 'W' and a.JGID=? and ((e.jzlx='Z' and e.jzzt='C') or e.jzlx='M') and c.zxflag like '1' )order by jfrqstr,jzpkey,zyzfl,yzx,bm

12

12