<?xml version="1.0" encoding="UTF-8"?>
<datasource >
<!-- 1 表示 sql语句dao 2表示存储过程dao 默认为sql语句dao -->
<dao id= "wzAccountMainDao" log= "true" type= "1" memo= "台账查询主dao" >
<sql > < ![CDATA[
select a.JGID,a.PKEY,a.SFX_BM,a.SL,a.KYSL,a.DJSL,a.HWM_BM,b.JBDW,b.ZHXS,b.RKDW,b.JG,b.JBJG,c.WZGG,c.WZCS,b.DWVIEW,a.DPTID,d.KSSL bkssl,d.JSSL bjssl,e.KSSL ekssl,e.JSSL ejssl,c.WZBM,c.WZMC,(select sum(jbsl) zjsl from HIS_KSKCJL where JGID=a.JGID and DPTID=a.DPTID and SFX_BM=a.SFX_BM and SL >0 and CZRQ >=? and CZRQ < = ? ) zjsl,(select sum(jbsl) jssl from HIS_KSKCJL where JGID=a.JGID and DPTID=a.DPTID and SFX_BM=a.SFX_BM and SL <0 a n d C Z R Q > =? and CZRQ < = ? ) jssl,b.KCFL,b.ybbm,b.ybmc
from HIS_KSKC a
left join HIS_SFX b on a.JGID=b.JGID and a.SFX_BM=b.BM
left join HIS_MMS_WZZD c on c.WZBM=b.GLBM and c.JGID=b.JGID
left join HIS_KSRKC d on a.SFX_BM=d.SFX_BM and a.JGID=d.JGID and a.DPTID=d.DPTID and d.RQVERSION=?
left join HIS_KSRKC e on a.SFX_BM=e.SFX_BM and a.JGID=e.JGID and a.DPTID=e.DPTID and e.RQVERSION=?
where a.JGID=? and b.GLLX='W' #select# order by a.SFX_BM,a.DPTID
]]></sql>
<fields >
<f name= "JGID" type= "12" />
<f name= "PKEY" type= "12" />
<f name= "SFX_BM" type= "12" />
<f name= "SL" type= "8" />
<f name= "KYSL" type= "8" />
<f name= "DJSL" type= "8" />
<f name= "HWM_BM" type= "12" />
<f name= "JBDW" type= "12" />
<f name= "ZHXS" type= "8" />
<f name= "RKDW" type= "12" />
<f name= "JG" type= "8" />
<f name= "JBJG" type= "8" />
<f name= "WZGG" type= "12" />
<f name= "WZCS" type= "12" />
<f name= "DWVIEW" type= "12" />
<f name= "DPTID" type= "12" />
<f name= "BKSSL" type= "8" />
<f name= "BJSSL" type= "8" />
<f name= "EKSSL" type= "8" />
<f name= "EJSSL" type= "8" />
<f name= "WZBM" type= "12" />
<f name= "WZMC" type= "12" />
<f name= "ZJSL" type= "4" />
<f name= "JSSL" type= "4" />
<f name= "KCFL" type= "12" />
<f name= "YBBM" type= "12" />
<f name= "YBMC" type= "12" />
</fields>
<parameter >
<p > 93</p>
<p > 93</p>
<p > 93</p>
<p > 93</p>
<p > 12</p>
<p > 12</p>
<p > 12</p>
</parameter>
</dao>
<dao id= "wzAccountFindBeginDao" log= "true" type= "1" memo= "台账查询中查找期初记录dao" >
<sql > < ![CDATA[
select * from (select PKEY,JGID,SFX_BM,DPTID,KSSL,JSSL,RQ,RQVERSION from HIS_KSRKC where JGID=? and DPTID=? and SFX_BM=? and RQ < ? order by RQ desc ) where rownum=1
]]></sql>
<fields >
<f name= "PKEY" type= "12" />
<f name= "JGID" type= "12" />
<f name= "SFX_BM" type= "12" />
<f name= "DPTID" type= "12" />
<f name= "KSSL" type= "8" />
<f name= "JSSL" type= "8" />
<f name= "RQ" type= "93" />
<f name= "RQVERSION" type= "12" />
</fields>
<parameter >
<p > 12</p>
<p > 12</p>
<p > 12</p>
<p > 93</p>
</parameter>
</dao>
<dao id= "wzAccountFindEndDao" log= "true" type= "1" memo= "台账查询中查找期末记录dao" >
<sql > < ![CDATA[
select * from (select PKEY,JGID,SFX_BM,DPTID,KSSL,JSSL,RQ,RQVERSION from HIS_KSRKC where JGID=? and DPTID=? and SFX_BM=? and RQ > ? order by RQ ) where rownum=1
]]></sql>
<fields >
<f name= "PKEY" type= "12" />
<f name= "JGID" type= "12" />
<f name= "SFX_BM" type= "12" />
<f name= "DPTID" type= "12" />
<f name= "KSSL" type= "8" />
<f name= "JSSL" type= "8" />
<f name= "RQ" type= "93" />
<f name= "RQVERSION" type= "12" />
</fields>
<parameter >
<p > 12</p>
<p > 12</p>
<p > 12</p>
<p > 93</p>
</parameter>
</dao>
<dao id= "wzAccountDetailDao" log= "true" type= "1" memo= "台账查询 明细dao" >
<sql > < ![CDATA[
select a.PKEY,a.JGID,a.DPTID,a.SFX_BM,a.KSKC_PC_PKEY,a.CZRQ,a.CZR,a.DJH,a.LX,a.SL,a.DW,a.DJ,a.JE,a.JYSL,a.LOCKFLAG,b.PH,b.YXQ,a.JBDW,a.JBSL,a.JBJYSL from HIS_KSKCJL a left join HIS_KSKC_PC b on a.KSKC_PC_PKEY=b.pkey and a.JGID=b.JGID where a.JGID=? and a.DPTID=? and a.SFX_BM=? and a.CZRQ >=? and a.CZRQ < = ? order by a.CZRQ
]]></sql>
<fields >
<f name= "PKEY" type= "12" />
<f name= "JGID" type= "12" />
<f name= "DPTID" type= "12" />
<f name= "SFX_BM" type= "12" />
<f name= "KSKC_PC_PKEY" type= "12" />
<f name= "CZRQ" type= "93" />
<f name= "CZR" type= "12" />
<f name= "DJH" type= "12" />
<f name= "LX" type= "12" />
<f name= "SL" type= "8" />
<f name= "DW" type= "12" />
<f name= "DJ" type= "8" />
<f name= "JE" type= "8" />
<f name= "JYSL" type= "8" />
<f name= "LOCKFLAG" type= "-5" />
<f name= "PH" type= "12" />
<f name= "YXQ" type= "93" />
<f name= "JBDW" type= "12" />
<f name= "JBSL" type= "12" />
<f name= "JBJYSL" type= "12" />
</fields>
<parameter >
<p > 12</p>
<p > 12</p>
<p > 12</p>
<p > 93</p>
<p > 93</p>
</parameter>
</dao>
<dao id= "wzkcdxMainDao" log= "true" type= "1" memo= "药品库存动销查询主dao" >
<sql > < ![CDATA[
select a.JGID,a.PKEY,a.SFX_BM,a.SL,a.KYSL,a.DJSL,a.HWM_BM,b.JBDW,b.ZHXS,b.RKDW,b.JG,b.JBJG,c.WZGG,c.WZCS,b.DWVIEW,a.DPTID,c.WZBM,c.WZMC,(select sum(jbsl) zjsl from HIS_KSKCJL where JGID=a.JGID and DPTID=a.DPTID and SFX_BM=a.SFX_BM and SL >0 and CZRQ >=? and CZRQ < = ? ) zjsl,(select sum(jbsl) jssl from HIS_KSKCJL where JGID=a.JGID and DPTID=a.DPTID and SFX_BM=a.SFX_BM and SL <0 a n d C Z R Q > =? and CZRQ < = ? ) jssl,b.KCFL,b.ybbm,b.ybmc
from HIS_KSKC a
left join HIS_SFX b on a.JGID=b.JGID and a.SFX_BM=b.BM
left join HIS_MMS_WZZD c on c.WZBM=b.GLBM and c.JGID=b.JGID
where a.JGID=? and b.GLLX='W' #select# order by a.SFX_BM,a.DPTID
]]></sql>
<fields >
<f name= "JGID" type= "12" />
<f name= "PKEY" type= "12" />
<f name= "SFX_BM" type= "12" />
<f name= "SL" type= "8" />
<f name= "KYSL" type= "8" />
<f name= "DJSL" type= "8" />
<f name= "HWM_BM" type= "12" />
<f name= "JBDW" type= "12" />
<f name= "ZHXS" type= "8" />
<f name= "RKDW" type= "12" />
<f name= "JG" type= "8" />
<f name= "JBJG" type= "8" />
<f name= "WZGG" type= "12" />
<f name= "WZCS" type= "12" />
<f name= "DWVIEW" type= "12" />
<f name= "DPTID" type= "12" />
<f name= "WZBM" type= "12" />
<f name= "WZMC" type= "12" />
<f name= "ZJSL" type= "4" />
<f name= "JSSL" type= "4" />
<f name= "KCFL" type= "12" />
<f name= "YBBM" type= "12" />
<f name= "YBMC" type= "12" />
</fields>
<parameter >
<p > 93</p>
<p > 93</p>
<p > 93</p>
<p > 93</p>
<p > 12</p>
</parameter>
</dao>
<dao id= "wzkcxqbjDao" log= "true" type= "1" memo= "物资库存效期报警dao" >
<sql >
select '' ISSHOW,'' zt,a.PKEY,b.DPTID,a.JGID,a.KSKC_PKEY,a.PH,a.YXQ,a.SL,a.KYSL,a.DJSL,a.DJ,a.JBDJ,a.SJ,a.JBSJ,a.YSPKEY,a.LOCKFLAG,b.HWM_BM,c.bm,c.MC,c.JBDW,c.RKDW,c.ZHXS,d.WZGG,d.WZCS,c.KCFL,'' zhycgys,'' sxts,c.ybbm,c.ybmc from HIS_KSKC_PC a left join HIS_KSKC b on a.KSKC_PKEY=b.pkey and a.JGID=b.JGID left join HIS_SFX c on b.SFX_BM=c.bm and b.JGID=c.JGID left join HIS_MMS_WZZD d on d.WZBM=c.GLBM and d.JGID=c.JGID where a.JGID=? and c.GLLX='W' #select# and a.YXQ >? order by c.bm,a.ph
</sql>
<fields >
<f name= "ISSHOW" type= "1" />
<f name= "ZT" type= "1" />
<f name= "PKEY" type= "12" />
<f name= "DPTID" type= "12" />
<f name= "JGID" type= "12" />
<f name= "KSKC_PKEY" type= "12" />
<f name= "PH" type= "12" />
<f name= "YXQ" type= "93" />
<f name= "SL" type= "8" />
<f name= "KYSL" type= "8" />
<f name= "DJSL" type= "8" />
<f name= "DJ" type= "8" />
<f name= "JBDJ" type= "8" />
<f name= "SJ" type= "8" />
<f name= "JBSJ" type= "8" />
<f name= "YSPKEY" type= "12" />
<f name= "LOCKFLAG" type= "-5" />
<f name= "HWM_BM" type= "12" />
<f name= "BM" type= "12" />
<f name= "MC" type= "12" />
<f name= "JBDW" type= "12" />
<f name= "RKDW" type= "12" />
<f name= "ZHXS" type= "8" />
<f name= "WZGG" type= "12" />
<f name= "WZCS" type= "12" />
<f name= "KCFL" type= "12" />
<f name= "ZHYCGYS" type= "8" />
<f name= "SXTS" type= "8" />
<f name= "YBBM" type= "12" />
<f name= "YBMC" type= "12" />
</fields>
<parameter >
<p > 12</p>
<p > 93</p>
</parameter>
</dao>
<dao id= "wzkcbjByXhlDao" log= "true" type= "1" memo= "库存报警按消耗量dao(只统计类型为3门诊发药 4门诊退药 5 门诊药房撤销退药单 6住院发药 7住院退药的药品)" >
<sql > < ![CDATA[
select a.JGID,a.PKEY,a.SFX_BM,a.SL,a.KYSL,a.DJSL,a.HWM_BM,b.JBDW,b.ZHXS,b.RKDW,b.JG,b.JBJG,c.WZGG,c.WZCS,b.DWVIEW,a.DPTID,c.WZBM,c.WZMC,(select sum(jbsl) xhsl from HIS_KSKCJL where JGID=a.JGID and DPTID=a.DPTID and SFX_BM=a.SFX_BM and (LX='3' or LX='4' or LX='5' or LX='6' or LX='7') and CZRQ >=? and CZRQ < = ? ) zxhsl,b.KCFL,'' rxhl,'' xql,b.ybbm,b.ybmc
from HIS_KSKC a
left join HIS_SFX b on a.JGID=b.JGID and a.SFX_BM=b.BM
left join HIS_MMS_WZZD c on c.WZBM=b.GLBM and c.JGID=b.JGID
where a.JGID=? and b.GLLX='W' #select# order by a.SFX_BM,a.DPTID
]]></sql>
<fields >
<f name= "JGID" type= "12" />
<f name= "PKEY" type= "12" />
<f name= "SFX_BM" type= "12" />
<f name= "SL" type= "8" />
<f name= "KYSL" type= "8" />
<f name= "DJSL" type= "8" />
<f name= "HWM_BM" type= "12" />
<f name= "JBDW" type= "12" />
<f name= "ZHXS" type= "8" />
<f name= "RKDW" type= "12" />
<f name= "JG" type= "8" />
<f name= "JBJG" type= "8" />
<f name= "WZGG" type= "12" />
<f name= "WZCS" type= "12" />
<f name= "DWVIEW" type= "12" />
<f name= "DPTID" type= "12" />
<f name= "WZBM" type= "12" />
<f name= "WZMC" type= "12" />
<f name= "ZXHSL" type= "4" />
<f name= "KCFL" type= "12" />
<f name= "RXHL" type= "12" />
<f name= "XQL" type= "12" />
<f name= "YBBM" type= "12" />
<f name= "YBMC" type= "12" />
</fields>
<parameter >
<p > 93</p>
<p > 93</p>
<p > 12</p>
</parameter>
</dao>
<dao id= "processYpWzDWShowDao" log= "true" type= "1" memo= "处理药品物资单位显示dao" >
<sql >
select JGID,BM,MC,JBDW,FYDL,FYZL,HSZFL,KJZFL,MZZFL,ZYZFL,BASYFL,KCFL,RKDW,ZHXS,MZFYDW,ZYFYDW,JG,SFYJ,SFXMSM,BZ,ZT,JBJG,YBBM,YBMC,GLLX,GLBM,GLRQ,DWVIEW,LOCKFLAG from HIS_SFX where JGID=? and (GLLX='Y' or GLLX='W')
</sql>
<tables >
<table name= "HIS_SFX" insert= "true" update= "true" delete= "true" >
<primary > JGID</primary>
<primary > BM</primary>
</table>
</tables>
<fields >
<f name= "JGID" type= "12" table= "HIS_SFX" />
<f name= "BM" type= "12" table= "HIS_SFX" />
<f name= "MC" type= "12" table= "HIS_SFX" />
<f name= "JBDW" type= "12" table= "HIS_SFX" />
<f name= "FYDL" type= "12" table= "HIS_SFX" />
<f name= "FYZL" type= "12" table= "HIS_SFX" />
<f name= "HSZFL" type= "12" table= "HIS_SFX" />
<f name= "KJZFL" type= "12" table= "HIS_SFX" />
<f name= "MZZFL" type= "12" table= "HIS_SFX" />
<f name= "ZYZFL" type= "12" table= "HIS_SFX" />
<f name= "BASYFL" type= "12" table= "HIS_SFX" />
<f name= "KCFL" type= "12" table= "HIS_SFX" />
<f name= "RKDW" type= "12" table= "HIS_SFX" />
<f name= "ZHXS" type= "8" table= "HIS_SFX" />
<f name= "MZFYDW" type= "12" table= "HIS_SFX" />
<f name= "ZYFYDW" type= "12" table= "HIS_SFX" />
<f name= "JG" type= "8" table= "HIS_SFX" />
<f name= "SFYJ" type= "12" table= "HIS_SFX" />
<f name= "SFXMSM" type= "12" table= "HIS_SFX" />
<f name= "BZ" type= "12" table= "HIS_SFX" />
<f name= "ZT" type= "12" table= "HIS_SFX" />
<f name= "JBJG" type= "8" table= "HIS_SFX" />
<f name= "YBBM" type= "12" table= "HIS_SFX" />
<f name= "YBMC" type= "12" table= "HIS_SFX" />
<f name= "GLLX" type= "12" table= "HIS_SFX" />
<f name= "GLBM" type= "12" table= "HIS_SFX" />
<f name= "GLRQ" type= "93" table= "HIS_SFX" />
<f name= "DWVIEW" type= "12" table= "HIS_SFX" />
<f name= "LOCKFLAG" type= "-5" table= "HIS_SFX" />
</fields>
<parameter >
<p > 12</p>
</parameter>
</dao>
<dao id= "zyyffhcmxAllDao" log= "true" type= "1" memo= "住院发耗材统计查询的发耗材明细dao" >
<sql > < ![CDATA[
select a.PKEY,a.FYBPKEY,a.JZPKEY,a.HZPKEY,a.ZYNO,a.CFH,a.PYBPKEY,a.YZXPKEY,a.YZMX,a.YZDJ,a.YZSL,a.BED,a.YPFL,a.YZDL,a.TYSL,a.KSKCPKEY,a.KSKCPCPKEY,a.CJR,a.CJRQ,a.XGR,a.XGRQ,a.JGID,a.EXEPKEY,e.zxtime,a.yzsl jzyzsl,b.YPYZJBDW,b.YZJZZHXS,b.YZMC,c.WZGG,b.YZJL,b.YZJLDW,b.YZPC,b.yzcl,e.pkey execpkey,e.SFFLAG,b.YPYZJBJG,a.yzsl*b.YPYZJBJG je,b.YZJX,a.YZSL jzsfsl,e.zxsl,e.zxje,b.YZXZSJ,e.ISACTION,b.YZLX,b.YZZCYFS,b.YZYF,c.WZCS,g.FYR,g.FYKS,g.FYTIME,g.HZBQ,g.HZKS,f.xm,g.FYLB,a.YZSL/b.YZJZZHXS*h.DJ jjje from HIS_MMS_ZYFYMXB 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.YZXPKEY=c.WZBM left join HIS_YZ_EXEC e on a.EXEPKEY=e.pkey and a.JGID=e.JGID left join HIS_MMS_ZYFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_HZINFO f on a.hzpkey=f.pkey and a.JGID=f.JGID left join HIS_KSKC_PC h on a.KSKCPCPKEY=h.pkey and a.JGID=h.JGID where a.JGID=? and nvl(a.YZSL,0)>0 #hzbq# and g.FYTIME >=? and g.FYTIME < =? order by a.bed,a.YZMX,e.zxtime
]]></sql>
<tables >
<table name= "HIS_YZ_MXB" insert= "true" update= "true" delete= "true" >
<primary > PKEY</primary>
</table>
<table name= "HIS_MMS_WZZD" insert= "false" update= "false" delete= "false" >
<primary > GG</primary>
</table>
<table name= "HIS_MMS_ZYFYZB" insert= "true" update= "true" delete= "true" >
<primary > PKEY</primary>
</table>
<table name= "HIS_MMS_ZYFYMXB" insert= "true" update= "true" delete= "true" >
<primary > PKEY</primary>
</table>
<table name= "HIS_YZ_EXEC" insert= "false" update= "false" delete= "false" >
<primary > PKEY</primary>
</table>
</tables>
<fields >
<f name= "PKEY" type= "12" table= "HIS_YZ_MXB,HIS_MMS_ZYFYZB,HIS_MMS_ZYFYMXB" />
<f name= "FYBPKEY" type= "12" table= "HIS_MMS_ZYFYMXB" />
<f name= "JZPKEY" type= "12" table= "HIS_YZ_MXB,HIS_MMS_ZYFYMXB" />
<f name= "HZPKEY" type= "12" table= "HIS_YZ_MXB,HIS_MMS_ZYFYMXB" />
<f name= "ZYNO" type= "12" table= "HIS_MMS_ZYFYMXB" />
<f name= "CFH" type= "12" table= "HIS_YZ_MXB,HIS_MMS_ZYFYMXB" />
<f name= "PYBPKEY" type= "12" table= "HIS_MMS_ZYFYMXB" />
<f name= "YZXPKEY" type= "12" table= "HIS_YZ_MXB,HIS_MMS_ZYFYMXB" />
<f name= "YZMX" type= "12" table= "HIS_MMS_ZYFYMXB" />
<f name= "YZDJ" type= "12" table= "HIS_YZ_MXB,HIS_MMS_ZYFYMXB" />
<f name= "YZSL" type= "12" table= "HIS_YZ_MXB,HIS_MMS_ZYFYMXB" />
<f name= "BED" type= "12" table= "HIS_MMS_ZYFYMXB" />
<f name= "YPFL" type= "12" table= "HIS_MMS_ZYFYMXB" />
<f name= "YZDL" type= "12" table= "HIS_MMS_ZYFYMXB" />
<f name= "TYSL" type= "12" table= "HIS_MMS_ZYFYMXB" />
<f name= "KSKCPKEY" type= "12" table= "HIS_MMS_ZYFYMXB" />
<f name= "KSKCPCPKEY" type= "12" table= "HIS_MMS_ZYFYMXB" />
<f name= "CJR" type= "12" table= "HIS_YZ_MXB,HIS_MMS_ZYFYZB,HIS_MMS_ZYFYMXB" />
<f name= "CJRQ" type= "93" table= "HIS_YZ_MXB,HIS_MMS_ZYFYZB,HIS_MMS_ZYFYMXB" />
<f name= "XGR" type= "12" table= "HIS_MMS_ZYFYZB,HIS_MMS_ZYFYMXB" />
<f name= "XGRQ" type= "93" table= "HIS_MMS_ZYFYZB,HIS_MMS_ZYFYMXB" />
<f name= "JGID" type= "12" table= "HIS_YZ_MXB,HIS_MMS_ZYFYZB,HIS_MMS_ZYFYMXB" />
<f name= "EXEPKEY" type= "12" table= "HIS_MMS_ZYFYMXB" />
<f name= "ZXTIME" type= "93" />
<f name= "JZYZSL" type= "12" />
<f name= "YPYZJBDW" type= "12" table= "HIS_YZ_MXB" />
<f name= "YZJZZHXS" type= "12" table= "HIS_YZ_MXB" />
<f name= "YZMC" type= "12" table= "HIS_YZ_MXB" />
<f name= "WZGG" type= "12" />
<f name= "YZJL" type= "12" table= "HIS_YZ_MXB" />
<f name= "YZJLDW" type= "12" table= "HIS_YZ_MXB" />
<f name= "YZPC" type= "12" table= "HIS_YZ_MXB" />
<f name= "YZCL" type= "12" table= "HIS_YZ_MXB" />
<f name= "EXECPKEY" type= "12" />
<f name= "SFFLAG" type= "12" />
<f name= "YPYZJBJG" type= "12" table= "HIS_YZ_MXB" />
<f name= "JE" type= "4" />
<f name= "YZJX" type= "12" table= "HIS_YZ_MXB" />
<f name= "JZSFSL" type= "12" />
<f name= "ZXSL" type= "8" />
<f name= "ZXJE" type= "8" />
<f name= "YZXZSJ" type= "93" table= "HIS_YZ_MXB" />
<f name= "ISACTION" type= "12" />
<f name= "YZLX" type= "12" table= "HIS_YZ_MXB" />
<f name= "YZZCYFS" type= "12" table= "HIS_YZ_MXB" />
<f name= "YZYF" type= "12" table= "HIS_YZ_MXB" />
<f name= "WZCS" type= "12" />
<f name= "FYR" type= "12" table= "HIS_MMS_ZYFYZB" />
<f name= "FYKS" type= "12" table= "HIS_MMS_ZYFYZB" />
<f name= "FYTIME" type= "93" table= "HIS_MMS_ZYFYZB" />
<f name= "HZBQ" type= "12" table= "HIS_MMS_ZYFYZB" />
<f name= "HZKS" type= "12" table= "HIS_MMS_ZYFYZB" />
<f name= "XM" type= "12" />
<f name= "FYLB" type= "12" />
<f name= "JJJE" type= "12" />
</fields>
<parameter >
<p > 12</p>
<p > 93</p>
<p > 93</p>
</parameter>
</dao>
<dao id= "mzfhcAllDao" log= "true" type= "1" memo= "已发耗材明细列表" >
<sql > < ![CDATA[
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,b.cfh,f.xm,a.YZSL/b.YZJZZHXS*h.DJ jjje 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_MMS_MZFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_HZINFO f on a.hzpkey=f.pkey and a.JGID=f.JGID left join HIS_KSKC_PC h on a.KSKCPCPKEY=h.pkey and a.JGID=h.JGID where a.JGID=? #hzbq# and g.FYRQ >=? and g.FYRQ < =? order by g.FYRQ
]]></sql>
<tables >
<table name= "HIS_YZ_MXB" insert= "true" update= "true" delete= "true" >
<primary > YZPKEY</primary>
<primary > YZDJSL</primary>
<primary > HZPKEY</primary>
<primary > JZPKEY</primary>
<primary > JGID</primary>
</table>
<table name= "HIS_MMS_MZFYMXB" insert= "true" update= "true" delete= "true" >
<primary > PKEY</primary>
<primary > YZX</primary>
<primary > YZMX</primary>
<primary > JGID</primary>
<primary > HZPKEY</primary>
<primary > JZPKEY</primary>
</table>
</tables>
<fields >
<f name= "PKEY" type= "12" table= "HIS_MMS_MZFYMXB" />
<f name= "YZX" type= "12" table= "HIS_MMS_MZFYMXB" />
<f name= "YZMX" type= "12" table= "HIS_MMS_MZFYMXB" />
<f name= "YZDJ" type= "12" table= "HIS_MMS_MZFYMXB" />
<f name= "YZSL" type= "12" table= "HIS_MMS_MZFYMXB" />
<f name= "FYBPKEY" type= "12" table= "HIS_MMS_MZFYMXB" />
<f name= "HZBQ" type= "12" table= "HIS_MMS_MZFYMXB" />
<f name= "HZKS" type= "12" table= "HIS_MMS_MZFYMXB" />
<f name= "FYKS" type= "12" table= "HIS_MMS_MZFYMXB" />
<f name= "HZPKEY" type= "12" table= "HIS_YZ_MXB,HIS_MMS_MZFYMXB" />
<f name= "YPFL" type= "12" table= "HIS_MMS_MZFYMXB" />
<f name= "JZPKEY" type= "12" table= "HIS_YZ_MXB,HIS_MMS_MZFYMXB" />
<f name= "TYPE" type= "12" table= "HIS_MMS_MZFYMXB" />
<f name= "CJR" type= "12" table= "HIS_MMS_MZFYMXB" />
<f name= "CJRQ" type= "93" table= "HIS_MMS_MZFYMXB" />
<f name= "XGR" type= "12" table= "HIS_MMS_MZFYMXB" />
<f name= "XGRQ" type= "93" table= "HIS_MMS_MZFYMXB" />
<f name= "JGID" type= "12" table= "HIS_YZ_MXB,HIS_MMS_MZFYMXB" />
<f name= "YZDL" type= "12" table= "HIS_MMS_MZFYMXB" />
<f name= "YZMC" type= "12" />
<f name= "YZDW" type= "12" />
<f name= "YZJL" type= "12" />
<f name= "YZJLDW" type= "12" />
<f name= "YZPC" type= "12" />
<f name= "YZLC" type= "12" />
<f name= "YZJE" type= "12" />
<f name= "YZBZ" type= "12" />
<f name= "YZXZYS" type= "12" />
<f name= "YZXZKS" type= "12" />
<f name= "YZDJSL" type= "12" table= "HIS_YZ_MXB" />
<f name= "WZGG" type= "12" />
<f name= "WZCS" type= "12" />
<f name= "YZPKEY" schemaname= "PKEY" type= "12" table= "HIS_YZ_MXB" />
<f name= "YZYF" type= "12" table= "HIS_YZ_MXB" />
<f name= "JBDW" type= "12" />
<f name= "YZJZZHXS" type= "12" table= "HIS_YZ_MXB" />
<f name= "YPYZJBJG" type= "12" table= "HIS_YZ_MXB" />
<f name= "TYSL" type= "12" />
<f name= "CFH" type= "12" />
<f name= "XM" type= "12" />
<f name= "JJJE" type= "12" />
</fields>
<parameter >
<p > 12</p>
<p > 93</p>
<p > 93</p>
</parameter>
</dao>
<!-- 调拨单统计明细 -->
<dao id= "mmshisdbdtjmxdao" log= "true" type= "1" >
<sql > select a.PKEY,a.JGID,a.DJH,a.XH,a.SFX_BM,a.KSKC_PC_PKEY,a.DBSQMX_PKEY,a.SL,a.DW,a.DJ,a.SJ,a.JE,a.SJJE,b.MC,b.JBDW,b.RKDW,b.ZHXS,b.JG,b.JBJG,c.KYSL,c.PH,c.KSKC_PKEY,c.YXQ,
b.DWVIEW,c.DJ PCDJ,c.JBDJ PCJBDJ,c.SJ PCSJ,c.JBSJ PCJBSJ,y.wzcs,y.wzgg,a.LOCKFLAG,b.ybbm,b.ybmc,dbd.SQKS,dbd.JSKS,dbd.ZYLX,dbd.CKRQ,y.ZCZH, rkd.gys
from HIS_MMS_KC_DBD_MX a
left join HIS_SFX b on a.JGID=b.JGID and a.SFX_BM=b.BM
left join HIS_KSKC_PC c on a.JGID=c.JGID and c.PKEY=a.KSKC_PC_PKEY
left join HIS_MMS_WZZD y on b.BM=y.WZBM
left join HIS_MMS_KC_DBD dbd on a.djh=dbd.djh and a.JGID=dbd.JGID
left join HIS_YFYK_DBD_LOG log on a.pkey=log.DBDMXPKEY and a.JGID=log.JGID
left join HIS_MMS_KC_RKD_MX rkdmx on log.FIRST_KSKC_PC_PKEY = rkdmx.KSKC_PC_PKEY and rkdmx.JGID=log.JGID
left join HIS_MMS_KC_RKD rkd on rkdmx.djh = rkd.djh and rkd.JGID=rkdmx.JGID
where a.JGID=? and dbd.SHZT='1' and dbd.RKZT='1' order by a.djh,a.XH</sql>
<tables >
<table name= "HIS_YFYK_DBD_MX" insert= "true" update= "true" delete= "true" >
<primary > PKEY</primary>
<primary > JGID</primary>
</table>
</tables>
<fields >
<f name= "PKEY" type= "12" table= "HIS_YFYK_DBD_MX" />
<f name= "JGID" type= "12" table= "HIS_YFYK_DBD_MX" />
<f name= "DJH" type= "12" table= "HIS_YFYK_DBD_MX" />
<f name= "XH" type= "-5" table= "HIS_YFYK_DBD_MX" />
<f name= "SFX_BM" type= "12" table= "HIS_YFYK_DBD_MX" />
<f name= "KSKC_PC_PKEY" type= "12" table= "HIS_YFYK_DBD_MX" />
<f name= "DBSQMX_PKEY" type= "12" table= "HIS_YFYK_DBD_MX" />
<f name= "SL" type= "8" table= "HIS_YFYK_DBD_MX" />
<f name= "DW" type= "12" table= "HIS_YFYK_DBD_MX" />
<f name= "DJ" type= "8" table= "HIS_YFYK_DBD_MX" />
<f name= "SJ" type= "8" table= "HIS_YFYK_DBD_MX" />
<f name= "JE" type= "8" table= "HIS_YFYK_DBD_MX" />
<f name= "SJJE" type= "8" table= "HIS_YFYK_DBD_MX" />
<f name= "MC" type= "12" />
<f name= "JBDW" type= "12" />
<f name= "RKDW" type= "12" />
<f name= "ZHXS" type= "8" />
<f name= "JG" type= "8" />
<f name= "JBJG" type= "8" />
<f name= "KYSL" type= "8" />
<f name= "PH" type= "12" />
<f name= "KSKC_PKEY" type= "12" />
<f name= "YXQ" type= "93" />
<f name= "DWVIEW" type= "12" />
<f name= "PCDJ" type= "8" />
<f name= "PCJBDJ" type= "8" />
<f name= "PCSJ" type= "8" />
<f name= "PCJBSJ" type= "8" />
<f name= "wzcs" type= "12" />
<f name= "wzgg" type= "12" />
<f name= "LOCKFLAG" type= "-5" table= "HIS_YFYK_DBD_MX" />
<f name= "YBBM" type= "12" />
<f name= "YBMC" type= "12" />
<f name= "SQKS" type= "12" />
<f name= "JSKS" type= "12" />
<f name= "ZYLX" type= "12" />
<f name= "CKRQ" type= "93" />
<f name= "ZCZH" type= "12" />
<f name= "GYS" type= "12" />
</fields>
<parameter >
<p > 12</p>
</parameter>
</dao>
<dao id= "mmshiskctztjmxdao" log= "true" type= "1" memo= "物资库存调整统计" >
<sql > select a.PKEY,a.CJR,a.CJRQ,a.XGR,a.XGRQ,a.JGID,a.XH,a.SFX_BM,a.DJH,a.KSKC_PC_PKEY,a.DW,a.DJ,a.SJ,a.SL,a.JE,a.SJJE,b.MC,b.JBDW,b.RKDW,b.ZHXS,b.DWVIEW,c.wzcs,c.wzgg,
e.PH,e.YXQ,e.SL PCSL,e.KYSL,e.DJ PCDJ,e.JBDJ PCJBDJ,e.SJ PCSJ,e.JBSJ PCJBSJ,a.LOCKFLAG,c.ZCZH,kctz.DPTID,kctz.SHRQ
from HIS_MMS_KC_KCTZ_MX a
left join HIS_SFX b on a.JGID=b.JGID and a.SFX_BM=b.BM
left join HIS_MMS_WZZD c on c.WZBM=b.BM
left join HIS_KSKC_PC e on a.JGID=e.JGID and e.PKEY=a.KSKC_PC_PKEY
left join HIS_MMS_KC_KCTZ kctz on a.djh=kctz.djh and a.JGID=kctz.JGID
where a.JGID=? order by a.djh,a.XH</sql>
<tables >
<table name= "HIS_YFYK_KCTZ_MX" insert= "true" update= "true" delete= "true" >
<primary > PKEY</primary>
</table>
</tables>
<fields >
<f name= "PKEY" type= "12" table= "HIS_YFYK_KCTZ_MX" />
<f name= "CJR" type= "12" table= "HIS_YFYK_KCTZ_MX" />
<f name= "CJRQ" type= "93" table= "HIS_YFYK_KCTZ_MX" />
<f name= "XGR" type= "12" table= "HIS_YFYK_KCTZ_MX" />
<f name= "XGRQ" type= "93" table= "HIS_YFYK_KCTZ_MX" />
<f name= "JGID" type= "12" table= "HIS_YFYK_KCTZ_MX" />
<f name= "XH" type= "-5" table= "HIS_YFYK_KCTZ_MX" />
<f name= "SFX_BM" type= "12" table= "HIS_YFYK_KCTZ_MX" />
<f name= "DJH" type= "12" table= "HIS_YFYK_KCTZ_MX" />
<f name= "KSKC_PC_PKEY" type= "12" table= "HIS_YFYK_KCTZ_MX" />
<f name= "DW" type= "12" table= "HIS_YFYK_KCTZ_MX" />
<f name= "DJ" type= "8" table= "HIS_YFYK_KCTZ_MX" />
<f name= "SJ" type= "8" table= "HIS_YFYK_KCTZ_MX" />
<f name= "SL" type= "8" table= "HIS_YFYK_KCTZ_MX" />
<f name= "JE" type= "8" table= "HIS_YFYK_KCTZ_MX" />
<f name= "SJJE" type= "8" table= "HIS_YFYK_KCTZ_MX" />
<f name= "MC" type= "12" />
<f name= "JBDW" type= "12" />
<f name= "RKDW" type= "12" />
<f name= "ZHXS" type= "8" />
<f name= "DWVIEW" type= "12" />
<f name= "wzcs" type= "12" />
<f name= "wzgg" type= "12" />
<f name= "PH" type= "12" />
<f name= "YXQ" type= "93" table= "HIS_YFYK_KCTZ_MX" />
<f name= "PCSL" type= "8" />
<f name= "KYSL" type= "8" />
<f name= "PCDJ" type= "8" />
<f name= "PCJBDJ" type= "8" />
<f name= "PCSJ" type= "8" />
<f name= "PCJBSJ" type= "8" />
<f name= "LOCKFLAG" type= "-5" table= "HIS_YFYK_KCTZ_MX" />
<f name= "ZCZH" type= "12" />
<f name= "DPTID" type= "12" />
<f name= "SHRQ" type= "93" />
</fields>
<parameter >
<p > 12</p>
</parameter>
</dao>
<!-- 库存报损明细信息 -->
<dao id= "mmshiskcshtjmxdao" log= "true" type= "1" memo= "物资库存报损统计明细" >
<sql > select a.PKEY,a.CJR,a.CJRQ,a.XGR,a.XGRQ,a.JGID,a.XH,a.SFX_BM,a.DJH,a.KSKC_PC_PKEY,a.DW,a.DJ,a.SJ,a.SL,a.JE,a.SJJE,b.MC,b.JBDW,b.RKDW,b.JBJG,b.JG,b.ZHXS,c.wzcs,c.wzgg,
e.PH,e.YXQ,e.SL PCSL,e.KYSL,e.DJ PCDJ,e.JBDJ PCJBDJ,e.SJ PCSJ,e.JBSJ PCJBSJ,b.DWVIEW,a.LOCKFLAG,c.ZCZH,kcsh.DPTID,kcsh.SHRQ
from HIS_MMS_KC_KCSH_MX a
left join HIS_SFX b on a.JGID=b.JGID and a.SFX_BM=b.BM
left join HIS_MMS_WZZD c on c.WZBM=b.BM
left join HIS_KSKC_PC e on a.JGID=e.JGID and e.PKEY=a.KSKC_PC_PKEY
left join HIS_MMS_KC_KCSH kcsh on a.djh=kcsh.djh and a.JGID=kcsh.JGID
where a.JGID=? order by a.djh,a.XH</sql>
<tables >
<table name= "HIS_YFYK_KCSH_MX" insert= "true" update= "true" delete= "true" >
<primary > PKEY</primary>
</table>
</tables>
<fields >
<f name= "PKEY" type= "12" table= "HIS_YFYK_KCSH_MX" />
<f name= "CJR" type= "12" table= "HIS_YFYK_KCSH_MX" />
<f name= "CJRQ" type= "93" table= "HIS_YFYK_KCSH_MX" />
<f name= "XGR" type= "12" table= "HIS_YFYK_KCSH_MX" />
<f name= "XGRQ" type= "93" table= "HIS_YFYK_KCSH_MX" />
<f name= "JGID" type= "12" table= "HIS_YFYK_KCSH_MX" />
<f name= "XH" type= "-5" table= "HIS_YFYK_KCSH_MX" />
<f name= "SFX_BM" type= "12" table= "HIS_YFYK_KCSH_MX" />
<f name= "DJH" type= "12" table= "HIS_YFYK_KCSH_MX" />
<f name= "KSKC_PC_PKEY" type= "12" table= "HIS_YFYK_KCSH_MX" />
<f name= "DW" type= "12" table= "HIS_YFYK_KCSH_MX" />
<f name= "DJ" type= "8" table= "HIS_YFYK_KCSH_MX" />
<f name= "SJ" type= "8" table= "HIS_YFYK_KCSH_MX" />
<f name= "SL" type= "8" table= "HIS_YFYK_KCSH_MX" />
<f name= "JE" type= "8" table= "HIS_YFYK_KCSH_MX" />
<f name= "SJJE" type= "8" table= "HIS_YFYK_KCSH_MX" />
<f name= "MC" type= "12" />
<f name= "JBDW" type= "12" />
<f name= "RKDW" type= "12" />
<f name= "JBJG" type= "8" />
<f name= "JG" type= "8" />
<f name= "ZHXS" type= "8" />
<f name= "wzcs" type= "12" />
<f name= "wzgg" type= "12" />
<f name= "PH" type= "12" />
<f name= "YXQ" type= "93" />
<f name= "PCSL" type= "8" />
<f name= "KYSL" type= "8" />
<f name= "PCDJ" type= "8" />
<f name= "PCJBDJ" type= "8" />
<f name= "PCSJ" type= "8" />
<f name= "PCJBSJ" type= "8" />
<f name= "DWVIEW" type= "12" />
<f name= "LOCKFLAG" type= "-5" table= "HIS_YFYK_KCSH_MX" />
<f name= "ZCZH" type= "12" />
<f name= "DPTID" type= "12" />
<f name= "SHRQ" type= "93" />
</fields>
<parameter >
<p > 12</p>
</parameter>
</dao>
<dao id= "mmshisthdtjmxdao" type= "1" memo= "物资库存退货统计" >
<sql > select a.PKEY,a.JGID,a.DJH,a.XH,a.RKDMX_PKEY,a.SL,a.THYY,a.DW,a.DJ,a.SJ,a.JE,a.SJJE,a.FPHM,a.FPJE,a.PCJG,a.BZ,b.MC,b.JBDW,b.ZHXS,c.wzcs,r.SFX_BM,r.PH,r.YXQ,r.SL RKSL,r.KSKC_PC_PKEY,r.DPTID,r.DW RKDW,r.DJ RKDJ,r.SJ RKSJ,e.PKEY PCPKEY,e.KYSL,e.DJSL,e.KSKC_PKEY,
b.DWVIEW,a.LOCKFLAG,c.ZCZH,thd.ZDRQ,thd.GYS
from HIS_MMS_KC_THD_MX a
left join HIS_YFYK_RKD_MX r on a.JGID=r.JGID and a.RKDMX_PKEY=r.PKEY
left join HIS_SFX b on r.JGID=b.JGID and r.SFX_BM=b.BM
left join HIS_MMS_WZZD c on c.WZBM=b.BM
left join HIS_KSKC_PC e on r.JGID=e.JGID and e.PKEY=r.KSKC_PC_PKEY
left join HIS_MMS_KC_THD thd on a.djh=thd.djh and a.JGID=thd.JGID
where a.JGID=? order by a.djh,a.XH</sql>
<tables >
<table name= "HIS_YFYK_THD_MX" insert= "true" update= "true" delete= "true" >
<primary > PKEY</primary>
</table>
</tables>
<fields >
<f name= "PKEY" type= "12" table= "HIS_YFYK_THD_MX" />
<f name= "JGID" type= "12" table= "HIS_YFYK_THD_MX" />
<f name= "DJH" type= "12" table= "HIS_YFYK_THD_MX" />
<f name= "XH" type= "-5" table= "HIS_YFYK_THD_MX" />
<f name= "RKDMX_PKEY" type= "12" table= "HIS_YFYK_THD_MX" />
<f name= "SL" type= "8" table= "HIS_YFYK_THD_MX" />
<f name= "THYY" type= "12" table= "HIS_YFYK_THD_MX" />
<f name= "DW" type= "12" table= "HIS_YFYK_THD_MX" />
<f name= "DJ" type= "8" table= "HIS_YFYK_THD_MX" />
<f name= "SJ" type= "8" table= "HIS_YFYK_THD_MX" />
<f name= "JE" type= "8" table= "HIS_YFYK_THD_MX" />
<f name= "SJJE" type= "8" table= "HIS_YFYK_THD_MX" />
<f name= "FPHM" type= "12" table= "HIS_YFYK_THD_MX" />
<f name= "FPJE" type= "8" table= "HIS_YFYK_THD_MX" />
<f name= "PCJG" type= "8" table= "HIS_YFYK_THD_MX" />
<f name= "BZ" type= "12" table= "HIS_YFYK_THD_MX" />
<f name= "MC" type= "12" />
<f name= "JBDW" type= "12" />
<f name= "ZHXS" type= "8" />
<f name= "wzcs" type= "12" />
<f name= "SFX_BM" type= "12" />
<f name= "PH" type= "12" />
<f name= "YXQ" type= "93" />
<f name= "RKSL" type= "8" />
<f name= "KSKC_PC_PKEY" type= "12" />
<f name= "DPTID" type= "12" />
<f name= "RKDW" type= "12" />
<f name= "RKDJ" type= "8" />
<f name= "RKSJ" type= "8" />
<f name= "PCPKEY" type= "12" />
<f name= "KYSL" type= "8" />
<f name= "DJSL" type= "8" />
<f name= "KSKC_PKEY" type= "12" />
<f name= "DWVIEW" type= "12" />
<f name= "LOCKFLAG" type= "-5" table= "HIS_YFYK_THD_MX" />
<f name= "ZCZH" type= "12" />
<f name= "ZDRQ" type= "93" />
<f name= "GYS" type= "12" />
</fields>
<parameter >
<p > 12</p>
</parameter>
</dao>
<dao id= "mmsdjypByYzmxbDao" log= "true" type= "1" memo= "冻结耗材在医嘱里面的信息dao" >
<sql > < ![CDATA[
select PKEY,HZPKEY,JZPKEY,yzmc,cfh,JGID,YZSFZT,YZSHZT,YZDJSL,YZSHRQ,YZLB,YZJZZHXS,YZXPKEY,YZZXKS,YZXZSJ from HIS_YZ_MXB where JGID=? and YZDJSL > 0 AND YZSHZT='1' and yzxpkey=?
]]></sql>
<fields >
<f name= "PKEY" type= "12" />
<f name= "HZPKEY" type= "12" />
<f name= "JZPKEY" type= "12" />
<f name= "YZMC" type= "12" />
<f name= "CFH" type= "12" />
<f name= "JGID" type= "12" />
<f name= "YZSFZT" type= "12" />
<f name= "YZSHZT" type= "12" />
<f name= "YZDJSL" type= "12" />
<f name= "YZSHRQ" type= "93" />
<f name= "YZLB" type= "12" />
<f name= "YZJZZHXS" type= "12" />
<f name= "YZXPKEY" type= "12" />
<f name= "YZZXKS" type= "12" />
<f name= "YZXZSJ" type= "93" />
</fields>
<parameter >
<p > 12</p>
<p > 12</p>
</parameter>
</dao>
<dao id= "mmsdjypByYpDbdDao" log= "true" type= "1" memo= "冻结耗材在耗材调拨单" >
<sql >
select a.DJH,a.SL,a.DW from HIS_MMS_KC_DBD_MX a left join HIS_MMS_KC_DBD b on a.DJH=b.DJH and a.JGID=b.JGID where b.JGID=? and b.SHZT=1 and b.RKZT=0 and a.sfx_bm=?
</sql>
<fields >
<f name= "DJH" type= "12" />
<f name= "SL" type= "8" />
<f name= "DW" type= "12" />
</fields>
<parameter >
<p > 12</p>
<p > 12</p>
</parameter>
</dao>
<dao id= "mmsdjypByYpPdDao" log= "true" type= "1" memo= "冻结耗材在耗材盘点表" >
<sql >
select a.DJH,a.SPS,a.DW,a.SYS,a.ZPS from HIS_MMS_KC_PD_MX a left join HIS_MMS_KC_PD b on a.DJH=b.DJH and a.JGID=b.JGID where b.JGID=? and b.WCZT=1 and b.SPZT=0 and a.sfx_bm=?
</sql>
<fields >
<f name= "DJH" type= "12" />
<f name= "SPS" type= "8" />
<f name= "DW" type= "12" />
<f name= "SYS" type= "8" />
<f name= "ZPS" type= "8" />
</fields>
<parameter >
<p > 12</p>
<p > 12</p>
</parameter>
</dao>
<dao id= "mmsdjypByYpThdDao" log= "true" type= "1" memo= "冻结耗材在退货单" >
<sql >
select a.DJH,a.SL,a.DW from HIS_MMS_KC_THD_MX a left join HIS_MMS_KC_THD b on a.DJH=b.DJH and a.JGID=b.JGID left join HIS_MMS_KC_RKD_MX c on a.RKDMX_PKEY =c.PKEY and a.JGID=c.JGID where b.JGID=? and b.WCZT=1 and b.SHZT=0 and c.sfx_bm=?
</sql>
<fields >
<f name= "DJH" type= "12" />
<f name= "SL" type= "8" />
<f name= "DW" type= "12" />
</fields>
<parameter >
<p > 12</p>
<p > 12</p>
</parameter>
</dao>
<dao id= "mmsDbslmxDao" log= "true" type= "1" >
<sql > < ![CDATA[
select b.SQKS,b.JSKS,b.RKSHR,b.RKSHRQ,d.value2 kclz,e.WZGG,c.MC,f.ph,e.ZCZH,a.SL,a.DW,a.DJ,a.SJ,a.JE,a.SJJE,f.YXQ,e.WZCS,c.ZHXS,c.JBDW,c.RKDW,c.bm from HIS_MMS_KC_DBD_MX a left join HIS_MMS_KC_DBD b on a.DJH=b.DJH and a.JGID=b.JGID left join HIS_SFX c on a.SFX_BM=c.bm and a.JGID=c.JGID left join MAIN_JGZDB d on c.kcfl=d.bh and d.jgzdlb_bh='Z00008' and d.JGID=c.JGID left join HIS_MMS_WZZD e on c.BM=e.WZBM left join HIS_KSKC_PC f on a.KSKC_PC_PKEY=f.pkey and a.JGID=f.JGID where a.JGID=? and b.SHZT=1 and b.RKZT=1 and (b.SQKS like ? or b.JSKS like ? ) and b.RKSHRQ >= ? and b.RKSHRQ < =? order by b.RKSHRQ,a.SFX_BM
]]></sql>
<fields >
<f name= "SQKS" type= "12" />
<f name= "JSKS" type= "12" />
<f name= "RKSHR" type= "12" />
<f name= "RKSHRQ" type= "93" />
<f name= "KCLZ" type= "12" />
<f name= "WZGG" type= "12" />
<f name= "MC" type= "12" />
<f name= "PH" type= "12" />
<f name= "ZCZH" type= "12" />
<f name= "SL" type= "8" />
<f name= "DW" type= "12" />
<f name= "DJ" type= "8" />
<f name= "SJ" type= "8" />
<f name= "JE" type= "8" />
<f name= "SJJE" type= "8" />
<f name= "YXQ" type= "93" />
<f name= "WZCS" type= "12" />
<f name= "ZHXS" type= "8" />
<f name= "JBDW" type= "12" />
<f name= "RKDW" type= "12" />
<f name= "BM" type= "12" />
</fields>
<parameter >
<p > 12</p>
<p > 12</p>
<p > 12</p>
<p > 93</p>
<p > 93</p>
</parameter>
</dao>
<dao id= "wzJxcKcpcDao" log= "true" type= "1" memo= "物资进销存查询主dao" >
<sql > < ![CDATA[
select a.JGID,a.PKEY,a.SFX_BM,pc.SL,pc.KYSL,pc.DJSL,a.HWM_BM,b.JBDW,b.ZHXS,b.RKDW,b.JG,b.JBJG,c.WZGG,c.WZCS,b.DWVIEW,a.DPTID,d.KSSL bkssl,d.JSSL bjssl,e.KSSL ekssl,e.JSSL ejssl,c.WZBM,c.WZMC,(select sum(jbsl) zjsl from HIS_KSKCJL where JGID=a.JGID and KSKC_PC_PKEY=pc.pkey and DPTID=a.DPTID and SFX_BM=a.SFX_BM and (LX != 8 and LX != 9 and LX != 10 and LX != 13 and LX != 14 ) and SL >0 and CZRQ >=? and CZRQ < = ? ) zjsl,(select sum(jbsl) jssl from HIS_KSKCJL where JGID=a.JGID and KSKC_PC_PKEY=pc.pkey and DPTID=a.DPTID and SFX_BM=a.SFX_BM and (LX != 8 and LX != 9 and LX != 10 and LX != 13 and LX != 14 ) and SL <0 a n d C Z R Q > =? and CZRQ < = ? ) jssl,b.KCFL,b.ybbm,b.ybmc,pc.DJ,pc.JBDJ,pc.SJ,pc.JBSJ,pc.pkey kcpcpkey,(select sum(jbsl) zjsl from HIS_KSKCJL where JGID=a.JGID and KSKC_PC_PKEY=pc.pkey and DPTID=a.DPTID and SFX_BM=a.SFX_BM and (LX = 8 or LX = 9 or LX = 10 or LX = 13 or LX = 14 ) and SL >0 and CZRQ >=? and CZRQ < = ? ) pdzjsl,(select sum(jbsl) jssl from HIS_KSKCJL where JGID=a.JGID and KSKC_PC_PKEY=pc.pkey and DPTID=a.DPTID and SFX_BM=a.SFX_BM and (LX = 8 or LX = 9 or LX = 10 or LX = 13 or LX = 14 ) and SL <0 a n d C Z R Q > =? and CZRQ < = ? ) pdjssl
from HIS_KSKC a
left join HIS_KSKC_PC pc on a.PKEY=pc.KSKC_PKEY and a.JGID=pc.JGID
left join HIS_SFX b on a.JGID=b.JGID and a.SFX_BM=b.BM
left join HIS_MMS_WZZD c on c.WZBM=b.GLBM and c.JGID=b.JGID
left join HIS_KSRKC_PC d on a.SFX_BM=d.SFX_BM and d.KSKC_PC_PKEY=pc.pkey and a.JGID=d.JGID and a.DPTID=d.DPTID and d.RQVERSION=?
left join HIS_KSRKC_PC e on a.SFX_BM=e.SFX_BM and e.KSKC_PC_PKEY=pc.pkey and a.JGID=e.JGID and a.DPTID=e.DPTID and e.RQVERSION=?
where a.JGID=? and b.GLLX='W' #select# order by a.SFX_BM,a.DPTID
]]></sql>
<fields >
<f name= "JGID" type= "12" />
<f name= "PKEY" type= "12" />
<f name= "SFX_BM" type= "12" />
<f name= "SL" type= "8" />
<f name= "KYSL" type= "8" />
<f name= "DJSL" type= "8" />
<f name= "HWM_BM" type= "12" />
<f name= "JBDW" type= "12" />
<f name= "ZHXS" type= "8" />
<f name= "RKDW" type= "12" />
<f name= "JG" type= "8" />
<f name= "JBJG" type= "8" />
<f name= "WZGG" type= "12" />
<f name= "WZCS" type= "12" />
<f name= "DWVIEW" type= "12" />
<f name= "DPTID" type= "12" />
<f name= "BKSSL" type= "8" />
<f name= "BJSSL" type= "8" />
<f name= "EKSSL" type= "8" />
<f name= "EJSSL" type= "8" />
<f name= "WZBM" type= "12" />
<f name= "WZMC" type= "12" />
<f name= "ZJSL" type= "4" />
<f name= "JSSL" type= "4" />
<f name= "KCFL" type= "12" />
<f name= "YBBM" type= "12" />
<f name= "YBMC" type= "12" />
<f name= "DJ" type= "8" />
<f name= "JBDJ" type= "8" />
<f name= "SJ" type= "8" />
<f name= "JBSJ" type= "8" />
<f name= "KCPCPKEY" type= "12" />
<f name= "PDZJSL" type= "4" />
<f name= "PDJSSL" type= "4" />
</fields>
<parameter >
<p > 93</p>
<p > 93</p>
<p > 93</p>
<p > 93</p>
<p > 93</p>
<p > 93</p>
<p > 93</p>
<p > 93</p>
<p > 12</p>
<p > 12</p>
<p > 12</p>
</parameter>
</dao>
</datasource>