@ -115,83 +115,88 @@
<datasource >
<dao id= "mzdptjdao" log= "true" type= "1" >
<dao id= "cfdp_sjdao" log= "true" type= "1" >
<sql >
SELECT distinct dp.CFH ,dp.CZRQ,a.JZNL ,
(SELECT LISTAGG(zd.JBMC,';') WITHIN GROUP (ORDER BY zd.JBBM) FROM HIS_JZ_MZZD zd WHERE zd.JGID =dp.JGID AND zd.HZPKEY =dp.HZPKEY AND zd.JZPKEY =dp.JZPKEY AND zd.ZDLX='003') zdmc,
dp.YPPZS ,dp.KJYPZS,
decode(nvl(dp.KJYPZS,0),0,'0','1') kjy,
decode(nvl(dp.ZSYPZS,0),0,'0','1') zsj,
dp.JBYPZS ,dp.YPTYMS ,dp.YPZJE ,dp.JBYWJE ,dp.KJYWJE ,mx.YZXZYS ,ys.NAME cfys,dp.CZR ,cz.NAME shr,
decode(nvl(dp.CFDPZT,'null'),'0','合理','1','不合理') hlzt ,
(SELECT LISTAGG(zd.mc,'') WITHIN GROUP (ORDER BY zd.BH) FROM HIS_CFDP_ZB_BM bm left join MAIN_ZDB zd on zd.ZDZB_BH = 'CFDP01' and zd.BH = bm.CODE WHERE bm.JGID=dp.JGID AND bm.DPZBPKEY=dp.PKEY AND bm.CODE!='0') dpmc,
(SELECT LISTAGG(wz.MESSAGE,';') WITHIN GROUP (ORDER BY wz.MESSAGE) FROM HIS_CFDP_ZB_WZ wz WHERE wz.JGID=dp.JGID AND wz.DPZBPKEY=dp.PKEY) dpwz,
(SELECT LISTAGG(zd.BH,';') WITHIN GROUP (ORDER BY zd.BH) FROM HIS_CFDP_ZB_BM bm left join MAIN_ZDB zd on zd.ZDZB_BH = 'CFDP01' and zd.BH = bm.CODE WHERE bm.JGID=dp.JGID AND bm.DPZBPKEY=dp.PKEY AND bm.CODE!='0') dpbm,
'处方点评' cfly,mx.YZZXKS fy,yf.DPTNAME fyname,mx.YZLX,mx.YZXZKS ks,ks.DPTNAME ksname
FROM HIS_CFDP_ZB dp
LEFT JOIN HIS_JZ_BASEINFO a ON dp.JGID = a.JGID AND dp.JZPKEY = a.PKEY
LEFT JOIN HIS_HZINFO b ON dp.JGID = b.JGID AND dp.HZPKEY = b.PKEY
LEFT JOIN HIS_YZ_MXB mx ON dp.JGID=mx.JGID AND dp.CFH=mx.CFH AND (mx.yzlb='01' or mx.yzlb='02' or mx.yzlb='03')
LEFT JOIN MAIN_YHXX ys ON mx.YZXZYS=ys.USERACCOUNT
LEFT JOIN MAIN_YHXX cz ON dp.CZR=cz.USERACCOUNT
LEFT JOIN MAIN_KS yf ON mx.YZZXKS=yf.DPTID AND mx.JGID=yf.JGID
LEFT JOIN MAIN_KS ks ON mx.YZXZKS=ks.DPTID AND mx.JGID=ks.JGID
WHERE dp.CFDPZT IS NOT NULL AND a.jzlx='M'
AND dp.JGID=?
AND dp.CZRQ between ? and ?
select PKEY,ZBPKEY,JGID,CZR,CFH from HIS_CFDP_SJ where JGID=? and CZR =?
</sql>
//CFH,CZRQ,JZNL,ZDMC,YPPZS,KJYPZS,KJY,ZSJ,JBYPZS,YPTYMS,YPZJE,JBYWJE,KJYWJE,YZXZYS,CFYS,CZR,SHR,HLZT,DPMC,DPWZ,DPBM,CFLY,FY,FYNAME,YZLX,KS,KSNAME
<tables >
<table name= "HIS_CFDP_SJ" insert= "true" update= "true" delete= "true" >
<primary > PKEY</primary>
<primary > ZBPKEY</primary>
<primary > JGID</primary>
<primary > CZR</primary>
</table>
</tables>
//PKEY,JGID,CZR
<fields >
<f name= "PKEY" type= "12" table= "HIS_CFDP_SJ" />
<f name= "ZBPKEY" type= "12" table= "HIS_CFDP_SJ" />
<f name= "JGID" type= "12" table= "HIS_CFDP_SJ" />
<f name= "CZR" type= "12" table= "HIS_CFDP_SJ" />
<f name= "CFH" type= "12" table= "HIS_CFDP_SJ" />
</fields>
<parameter >
<p > 12</p>
<p > 12</p>
</parameter>
</dao>
<dao id= "cfdp_mzdptjdao" log= "true" type= "1" >
<sql > < ![CDATA[
SELECT
PKEY,CFH,CZRQ,JZNL
FROM (
SELECT distinct dp.pkey,dp.CFH ,dp.CZRQ,a.JZNL
FROM HIS_CFDP_ZB dp
LEFT JOIN HIS_JZ_BASEINFO a ON dp.JGID = a.JGID AND dp.JZPKEY = a.PKEY
LEFT JOIN HIS_HZINFO b ON dp.JGID = b.JGID AND dp.HZPKEY = b.PKEY
LEFT JOIN HIS_YZ_MXB mx ON dp.JGID=mx.JGID AND dp.CFH=mx.CFH AND (mx.yzlb='01' or mx.yzlb='02' or mx.yzlb='03')
LEFT JOIN MAIN_YHXX ys ON mx.YZXZYS=ys.USERACCOUNT
LEFT JOIN MAIN_YHXX cz ON dp.CZR=cz.USERACCOUNT
LEFT JOIN MAIN_KS yf ON mx.YZZXKS=yf.DPTID AND mx.JGID=yf.JGID
LEFT JOIN MAIN_KS ks ON mx.YZXZKS=ks.DPTID AND mx.JGID=ks.JGID
WHERE dp.CFDPZT IS NOT NULL AND a.jzlx='M'
AND dp.JGID=?
AND (1=? OR (dp.CZRQ between ? AND ?))
AND (1=? OR (mx.YZXZSJ between ? AND ?))
AND (1=? OR nvl(dp.KJYPZS,0)>0)
AND (1=? OR nvl(dp.ZSYPZS,0)>0)
AND (1=? OR nvl(dp.JBYPZS,0)>0)
ORDER BY dbms_random.value
) WHERE 1=1 AND (1=? OR rownum< =?)
]]></sql>
//PKEY,CFH,CZRQ,JZNL,ZDMC,YPPZS,KJYPZS,KJY,ZSJ,JBYPZS,YPTYMS,YPZJE,JBYWJE,KJYWJE,YZXZYS,CFYS,CZR,SHR,HLZT,DPMC,DPWZ,DPBM,CFLY,FY,FYNAME,YZLX,KS,KSNAME,YZXZSJ
<fields >
<f name= "PKEY" type= "12" />
<f name= "CFH" type= "12" />
<f name= "CZRQ" type= "93" />
<f name= "JZNL" type= "12" />
<f name= "ZDMC" type= "12" />
<f name= "YPPZS" type= "4" />
<f name= "KJYPZS" type= "4" />
<f name= "KJY" type= "12" />
<f name= "ZSJ" type= "12" />
<f name= "JBYPZS" type= "4" />
<f name= "YPTYMS" type= "4" />
<f name= "YPZJE" type= "8" />
<f name= "JBYWJE" type= "8" />
<f name= "KJYWJE" type= "8" />
<f name= "YZXZYS" type= "12" />
<f name= "CFYS" type= "12" />
<f name= "CZR" type= "12" />
<f name= "SHR" type= "12" />
<f name= "HLZT" type= "12" />
<f name= "DPMC" type= "12" />
<f name= "DPWZ" type= "12" />
<f name= "DPBM" type= "12" />
<f name= "CFLY" type= "1" />
<f name= "FY" type= "12" />
<f name= "FYNAME" type= "12" />
<f name= "YZLX" type= "12" />
<f name= "KS" type= "12" />
<f name= "KSNAME" type= "12" />
</fields>
<parameter >
<p > 12</p>
<p > 93</p>
<p > 93</p>
</parameter>
<parameter >
<p > 12</p>
<p > 12</p>
<p > 93</p>
<p > 93</p>
<p > 12</p>
<p > 93</p>
<p > 93</p>
<p > 12</p>
<p > 12</p>
<p > 12</p>
<p > 12</p>
<p > 12</p>
</parameter>
</dao>
<dao id= "zydptjdao" log= "true" type= "1" >
<sql >
SELECT distinct a.zyno CFH ,dp.CZRQ,a.JZNL ,
(SELECT LISTAGG(zd.JBMC,';') WITHIN GROUP (ORDER BY zd.JBBM) FROM HIS_JZ_MZZD zd WHERE zd.JGID =dp.JGID AND zd.HZPKEY =dp.HZPKEY AND zd.JZPKEY =dp.JZPKEY AND zd.ZDLX='001') ryzdmc,
(SELECT LISTAGG(zd.JBMC,';') WITHIN GROUP (ORDER BY zd.JBBM) FROM HIS_JZ_MZZD zd WHERE zd.JGID =dp.JGID AND zd.HZPKEY =dp.HZPKEY AND zd.JZPKEY =dp.JZPKEY AND zd.ZDLX='002') cyzdmc,
dp.YPPZS ,dp.KJYPZS,
decode(nvl(dp.KJYPZS,0),0,'0','1') kjy,
decode(nvl(dp.ZSYPZS,0),0,'0','1') zsj,
dp.JBYPZS ,dp.YPTYMS ,dp.YPZJE ,dp.JBYWJE ,dp.KJYWJE ,mx.YZXZYS ,ys.NAME cfys,dp.CZR ,cz.NAME shr,
decode(nvl(dp.CFDPZT,'null'),'0','合理','1','不合理') hlzt ,
(SELECT LISTAGG(zd.mc,'') WITHIN GROUP (ORDER BY zd.BH) FROM HIS_CFDP_ZB_BM bm left join MAIN_ZDB zd on zd.ZDZB_BH = 'CFDP01' and zd.BH = bm.CODE WHERE bm.JGID=dp.JGID AND bm.DPZBPKEY=dp.PKEY AND bm.CODE!='0') dpmc,
(SELECT LISTAGG(wz.MESSAGE,';') WITHIN GROUP (ORDER BY wz.MESSAGE) FROM HIS_CFDP_ZB_WZ wz WHERE wz.JGID=dp.JGID AND wz.DPZBPKEY=dp.PKEY) dpwz,
(SELECT LISTAGG(zd.BH,';') WITHIN GROUP (ORDER BY zd.BH) FROM HIS_CFDP_ZB_BM bm left join MAIN_ZDB zd on zd.ZDZB_BH = 'CFDP01' and zd.BH = bm.CODE WHERE bm.JGID=dp.JGID AND bm.DPZBPKEY=dp.PKEY AND bm.CODE!='0') dpbm,
'处方点评' cfly,mx.YZZXKS fy,yf.DPTNAME fyname,mx.YZLX,mx.YZXZKS ks,ks.DPTNAME ksname
<dao id= "cfdp_zydptjdao" log= "true" type= "1" >
<sql > < ![CDATA[
SELECT
PKEY,CFH,CZRQ,JZNL
FROM (
SELECT distinct dp.pkey,a.zyno CFH ,dp.CZRQ,a.JZNL
FROM HIS_CFDP_ZB dp
LEFT JOIN HIS_JZ_BASEINFO a ON dp.JGID = a.JGID AND dp.JZPKEY = a.PKEY
LEFT JOIN HIS_HZINFO b ON dp.JGID = b.JGID AND dp.HZPKEY = b.PKEY
@ -201,44 +206,23 @@
LEFT JOIN MAIN_KS yf ON mx.YZZXKS=yf.DPTID AND mx.JGID=yf.JGID
LEFT JOIN MAIN_KS ks ON mx.YZXZKS=ks.DPTID AND mx.JGID=ks.JGID
WHERE dp.CFDPZT IS NOT NULL AND a.jzlx='Z'
AND dp.JGID=?
AND dp.CZRQ between ? and ?
</sql>
AND dp.JGID=? AND dp.CZRQ between ? AND ?
ORDER BY dbms_random.value
) WHERE 1=1 AND (1=? OR rownum< =?)
]]></sql>
//CFH,CZRQ,JZNL,ZDMC,YPPZS,KJYPZS,KJY,ZSJ,JBYPZS,YPTYMS,YPZJE,JBYWJE,KJYWJE,YZXZYS,CFYS,CZR,SHR,HLZT,DPMC,DPWZ,DPBM,CFLY,FY,FYNAME,YZLX,KS,KSNAME
<fields >
<f name= "PKEY" type= "12" />
<f name= "CFH" type= "12" />
<f name= "CZRQ" type= "93" />
<f name= "JZNL" type= "12" />
<f name= "RYZDMC" type= "12" />
<f name= "CYZDMC" type= "12" />
<f name= "YPPZS" type= "4" />
<f name= "KJYPZS" type= "4" />
<f name= "KJY" type= "12" />
<f name= "ZSJ" type= "12" />
<f name= "JBYPZS" type= "4" />
<f name= "YPTYMS" type= "4" />
<f name= "YPZJE" type= "8" />
<f name= "JBYWJE" type= "8" />
<f name= "KJYWJE" type= "8" />
<f name= "YZXZYS" type= "12" />
<f name= "CFYS" type= "12" />
<f name= "CZR" type= "12" />
<f name= "SHR" type= "12" />
<f name= "HLZT" type= "12" />
<f name= "DPMC" type= "12" />
<f name= "DPWZ" type= "12" />
<f name= "DPBM" type= "12" />
<f name= "CFLY" type= "1" />
<f name= "FY" type= "12" />
<f name= "FYNAME" type= "12" />
<f name= "YZLX" type= "12" />
<f name= "KS" type= "12" />
<f name= "KSNAME" type= "12" />
</fields>
<parameter >
<p > 12</p>
<p > 93</p>
<p > 93</p>
<p > 12</p>
<p > 12</p>
</parameter>
</dao>