You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
3175 lines
194 KiB
3175 lines
194 KiB
<?xml version="1.0" encoding="UTF-8"?>
|
|
<datasource>
|
|
<!-- 1 表示 sql语句dao 2表示存储过程dao 默认为sql语句dao-->
|
|
|
|
<dao id="ygyyMzjbqkfxShowDao" log="true" type="1" memo="阳光用药-门诊基本情况分析显示Dao">
|
|
<sql>
|
|
select '' 日期,'' 处方人次,'' 抗菌药物人次,'' 注射药物人次,'' 抗菌注射药物人次,'' 静脉给药人次,'' 抗菌静脉给药人次,'' 处方张数,'' 处方金额,'' 处方药品种数,'' 处方用药天数,'' 抗菌药物处方张数,'' 抗菌药物处方金额,'' 抗菌处方用药品种数,'' 抗菌处方用药天数,'' 抗菌注射药物金额,'' 注射剂处方张数,'' 注射药物金额,'' 抗菌静脉药物金额,'' 中草药处方张数,'' 中草药处方金额,'' 药占比,'' 药占比警戒线 from dual where 1=2
|
|
</sql>
|
|
<fields>
|
|
<f name="日期" type="1" />
|
|
<f name="处方人次" type="1" />
|
|
<f name="抗菌药物人次" type="1" />
|
|
<f name="注射药物人次" type="1" />
|
|
<f name="抗菌注射药物人次" type="1" />
|
|
<f name="静脉给药人次" type="1" />
|
|
<f name="抗菌静脉给药人次" type="1" />
|
|
<f name="处方张数" type="1" />
|
|
<f name="处方金额" type="1" />
|
|
<f name="处方药品种数" type="1" />
|
|
<f name="处方用药天数" type="1" />
|
|
<f name="抗菌药物处方张数" type="1" />
|
|
<f name="抗菌药物处方金额" type="1" />
|
|
<f name="抗菌处方用药品种数" type="1" />
|
|
<f name="抗菌处方用药天数" type="1" />
|
|
<f name="抗菌注射药物金额" type="1" />
|
|
<f name="注射剂处方张数" type="1" />
|
|
<f name="注射药物金额" type="1" />
|
|
<f name="抗菌静脉药物金额" type="1" />
|
|
<f name="中草药处方张数" type="1" />
|
|
<f name="中草药处方金额" type="1" />
|
|
<f name="药占比" type="1" />
|
|
<f name="药占比警戒线" type="1" />
|
|
</fields>
|
|
</dao>
|
|
|
|
|
|
<dao id="ygyyMzjbqkfxtwoShowDao" log="true" type="1" memo="阳光用药-门诊基本情况分析2显示Dao">
|
|
<sql>
|
|
select '' 日期,'' 处方张数人次,'' 处方金额人次,'' 处方平均金额,'' 处方平均用药品种数,'' 处方平均用药天数,'' 抗菌处方平均金额,'' 抗菌处方平均用药品种数,'' 抗菌处方平均用药天数,'' 抗菌药物使用率,'' 抗菌处方张数占比,'' 抗菌处方金额占比,'' 抗菌注射剂使用率,'' 抗菌注射药物金额占比,'' 注射剂使用率,'' 抗菌静脉给药率,'' 注射剂金额占比,'' 门诊静脉给药率,'' 抗菌药占比警戒线,'' 门诊抗菌药物处方人次使用率 from dual where 1=2
|
|
</sql>
|
|
<fields>
|
|
<f name="日期" type="1" />
|
|
<f name="处方张数人次" type="1" />
|
|
<f name="处方金额人次" type="1" />
|
|
<f name="处方平均金额" type="1" />
|
|
<f name="处方平均用药品种数" type="1" />
|
|
<f name="处方平均用药天数" type="1" />
|
|
<f name="抗菌处方平均金额" type="1" />
|
|
<f name="抗菌处方平均用药品种数" type="1" />
|
|
<f name="抗菌处方平均用药天数" type="1" />
|
|
<f name="抗菌药物使用率" type="1" />
|
|
<f name="抗菌处方张数占比" type="1" />
|
|
<f name="抗菌处方金额占比" type="1" />
|
|
<f name="抗菌注射剂使用率" type="1" />
|
|
<f name="抗菌注射药物金额占比" type="1" />
|
|
<f name="注射剂使用率" type="1" />
|
|
<f name="抗菌静脉给药率" type="1" />
|
|
<f name="注射剂金额占比" type="1" />
|
|
<f name="门诊静脉给药率" type="1" />
|
|
<f name="抗菌药占比警戒线" type="1" />
|
|
<f name="门诊抗菌药物处方人次使用率" type="1" />
|
|
</fields>
|
|
</dao>
|
|
|
|
<dao id="ygyyMzjbqkfxMzrcAndJeDao" log="true" type="1" memo="阳光用药-处方总人次,处方总金额,是按照病人挂号接诊时间为主,只要病人挂号交费并开有医生处方就算一个处方人次dao">
|
|
<sql><![CDATA[
|
|
select count(*) mzrc,sum(fy) fy,tjrq from (select sum(d.SFXSJZFY) fy,to_char(c.SFRQ,'yyyy-mm') tjrq,a.pkey from HIS_JZ_BASEINFO a left join HIS_SFZD_ZB b on a.pkey=b.jzpkey and a.JGID=b.JGID left join HIS_MZJS_MZFPZB c on b.pkey=c.GLZDBPKEY and b.JGID=c.JGID left join HIS_SFZD_SFXMXB d on b.pkey=d.ZDZBPKEY and b.JGID=d.JGID where a.JGID=? and c.SFRQ >=? and c.SFRQ <= ? and (a.JZLX='M' or a.JZLX='J' ) and c.SFZT = 1 and a.JZZT='J' group by to_char(c.SFRQ,'yyyy-mm'),a.pkey order by to_char(c.SFRQ,'yyyy-mm')) group by tjrq order by tjrq
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="mzrc" type="4" />
|
|
<f name="fy" type="12" />
|
|
<f name="tjrq" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
|
|
<dao id="ygyyMzjbqkfxCfzsAndJeDao" log="true" type="1" memo="阳光用药-处方张数、处方金额,是按照以药房发药的为标准,部分退药的处方,不减处方张数,会减掉处方金额dao">
|
|
<sql><![CDATA[
|
|
select fyrq,sum(cfje) cfje,count(*) cfs from (select b.cfh,sum((nvl(a.YZSL,0)-nvl(a.TYSL,0))*a.YZDJ) cfje,to_char(b.FYRQ,'yyyy-mm') fyrq from HIS_YFFY_MZFYMXB a left join HIS_YFFY_MZFYZB b on a.FYBPKEY=b.pkey and a.JGID=b.JGID where a.JGID=? and b.FYRQ>=? and b.FYRQ<=? and b.FYZT=1 and (nvl(a.YZSL,0)-nvl(a.TYSL,0)) > 0 group by b.cfh,to_char(b.FYRQ,'yyyy-mm') order by to_char(b.FYRQ,'yyyy-mm')) group by fyrq order by fyrq
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="fyrq" type="12" />
|
|
<f name="cfje" type="12" />
|
|
<f name="cfs" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
|
|
|
|
<dao id="ygyyMzjbqkfxYpzsDao" log="true" type="1" memo="阳光用药-药品总数,是按照每张处方药品品种数累加dao">
|
|
<sql><![CDATA[
|
|
select count(*) ypzs,fyrq from (select count(*) yps,to_char(b.FYRQ,'yyyy-mm') fyrq,a.yzx from HIS_YFFY_MZFYMXB a left join HIS_YFFY_MZFYZB b on a.FYBPKEY=b.pkey and a.JGID=b.JGID where a.JGID=? and b.FYRQ>=? and b.FYRQ<=? and b.FYZT=1 and (nvl(a.YZSL,0)-nvl(a.TYSL,0)) > 0 group by to_char(b.FYRQ,'yyyy-mm'),a.yzx order by to_char(b.FYRQ,'yyyy-mm')) group by fyrq order by fyrq
|
|
]]></sql>
|
|
<fields>
|
|
<f name="ypzs" type="12" />
|
|
<f name="fyrq" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
|
|
<dao id="ygyyMzjbqkfxYytsDao" log="true" type="1" memo="阳光用药-处方用药天数,是按照每张处方最大用药天数之和dao">
|
|
<sql><![CDATA[
|
|
select fyrq,sum(maxts) yyts from (select fyrq,cfh,max(nvl(yzts,0)) maxts from (select to_char(b.FYRQ,'yyyy-mm') fyrq,b.cfh,a.yzx,c.yzts from HIS_YFFY_MZFYMXB a left join HIS_YFFY_MZFYZB b on a.FYBPKEY=b.pkey and a.JGID=b.JGID left join HIS_YZ_MXB c on a.yzmx=c.pkey and a.JGID=c.JGID where a.JGID=? and b.FYRQ>=? and b.FYRQ<=? and b.FYZT=1 and (nvl(a.YZSL,0)-nvl(a.TYSL,0)) > 0 ) group by fyrq,cfh order by fyrq,cfh) group by fyrq order by fyrq
|
|
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="fyrq" type="12" />
|
|
<f name="yyts" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
|
|
|
|
<dao id="ygyyMzjbqkfxJmgyRcAndJeDao" log="true" type="1" memo="阳光用药-静脉给药人次和静脉给药金额,是按照是使用过静脉给药的门诊人次dao">
|
|
<sql><![CDATA[
|
|
select fyrq,sum(cfje) cfje,count(*) rc from (
|
|
select b.JZPKEY,sum((nvl(a.YZSL,0)-nvl(a.TYSL,0))*a.YZDJ) cfje,to_char(b.FYRQ,'yyyy-mm') fyrq from HIS_YFFY_MZFYMXB a left join HIS_YFFY_MZFYZB b on a.FYBPKEY=b.pkey and a.JGID=b.JGID left join HIS_YZ_MXB c on a.yzmx=c.pkey and a.JGID=c.JGID left join HIS_YZ_YPYF d on c.YZYF=d.BM and c.JGID=d.JGID where a.JGID=? and b.FYRQ >=? and b.FYRQ <= ? and b.FYZT=1 and (nvl(a.YZSL,0)-nvl(a.TYSL,0)) > 0 and d.ISJMGY=1 group by b.JZPKEY,to_char(b.FYRQ,'yyyy-mm') order by to_char(b.FYRQ,'yyyy-mm')) group by fyrq order by fyrq
|
|
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="fyrq" type="12" />
|
|
<f name="cfje" type="12" />
|
|
<f name="rc" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
<dao id="ygyyMzjbqkfxZsgyRcAndJeDao" log="true" type="1" memo="阳光用药-注射给药人次和注射给药金额,是按照是使用过注射给药的门诊人次,静脉也是属于注射类dao">
|
|
<sql><![CDATA[
|
|
select fyrq,sum(cfje) cfje,count(*) rc from (
|
|
select b.JZPKEY,sum((nvl(a.YZSL,0)-nvl(a.TYSL,0))*a.YZDJ) cfje,to_char(b.FYRQ,'yyyy-mm') fyrq from HIS_YFFY_MZFYMXB a left join HIS_YFFY_MZFYZB b on a.FYBPKEY=b.pkey and a.JGID=b.JGID left join HIS_YZ_MXB c on a.yzmx=c.pkey and a.JGID=c.JGID left join HIS_YZ_YPYF d on c.YZYF=d.BM and c.JGID=d.JGID where a.JGID=? and b.FYRQ >=? and b.FYRQ <= ? and b.FYZT=1 and (nvl(a.YZSL,0)-nvl(a.TYSL,0)) > 0 and (d.ISZSGY=1 or d.ISJMGY=1) group by b.JZPKEY,to_char(b.FYRQ,'yyyy-mm') order by to_char(b.FYRQ,'yyyy-mm')) group by fyrq order by fyrq
|
|
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="fyrq" type="12" />
|
|
<f name="cfje" type="12" />
|
|
<f name="rc" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
|
|
|
|
<dao id="ygyyMzjbqkfxKjlywRcAndJeDao" log="true" type="1" memo="阳光用药-抗菌药物门诊人次和金额,是按照使用过抗菌药物的门诊人次dao">
|
|
<sql><![CDATA[
|
|
select fyrq,sum(cfje) cfje,count(*) rc from (
|
|
select b.JZPKEY,sum((nvl(a.YZSL,0)-nvl(a.TYSL,0))*a.YZDJ) cfje,to_char(b.FYRQ,'yyyy-mm') fyrq from HIS_YFFY_MZFYMXB a left join HIS_YFFY_MZFYZB b on a.FYBPKEY=b.pkey and a.JGID=b.JGID left join HIS_YPXX e on a.yzx=e.BM where a.JGID=? and b.FYRQ >=? and b.FYRQ <= ? and b.FYZT=1 and (nvl(a.YZSL,0)-nvl(a.TYSL,0)) > 0 and (e.GZFL='KSS1' or e.GZFL='KZL1' or e.GZFL='KSS2') group by b.JZPKEY,to_char(b.FYRQ,'yyyy-mm') order by to_char(b.FYRQ,'yyyy-mm')) group by fyrq order by fyrq
|
|
]]></sql>
|
|
<fields>
|
|
<f name="fyrq" type="12" />
|
|
<f name="cfje" type="12" />
|
|
<f name="rc" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
<dao id="ygyyMzjbqkfxKjywCfzsAndJeDao" log="true" type="1" memo="阳光用药-抗菌药物处方张数、处方金额,是按照以药房发药的为标准,部分退药的处方,不减处方张数,会减掉处方金额dao">
|
|
<sql><![CDATA[
|
|
select fyrq,sum(cfje) cfje,count(*) cfs from (select b.cfh,sum((nvl(a.YZSL,0)-nvl(a.TYSL,0))*a.YZDJ) cfje,to_char(b.FYRQ,'yyyy-mm') fyrq from HIS_YFFY_MZFYMXB a left join HIS_YFFY_MZFYZB b on a.FYBPKEY=b.pkey and a.JGID=b.JGID left join HIS_YPXX e on a.yzx=e.BM where a.JGID=? and b.FYRQ>=? and b.FYRQ<=? and b.FYZT=1 and (nvl(a.YZSL,0)-nvl(a.TYSL,0)) > 0 and (e.GZFL='KSS1' or e.GZFL='KZL1' or e.GZFL='KSS2') group by b.cfh,to_char(b.FYRQ,'yyyy-mm') order by to_char(b.FYRQ,'yyyy-mm')) group by fyrq order by fyrq
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="fyrq" type="12" />
|
|
<f name="cfje" type="12" />
|
|
<f name="cfs" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
|
|
<dao id="ygyyMzjbqkfxKjywYpzsDao" log="true" type="1" memo="阳光用药-抗菌药物药品种数,是按照每张处方药品品种数累加dao">
|
|
<sql><![CDATA[
|
|
select count(*) ypzs,fyrq from (select count(*) yps,to_char(b.FYRQ,'yyyy-mm') fyrq,a.yzx from HIS_YFFY_MZFYMXB a left join HIS_YFFY_MZFYZB b on a.FYBPKEY=b.pkey and a.JGID=b.JGID left join HIS_YPXX e on a.yzx=e.BM where a.JGID=? and b.FYRQ>=? and b.FYRQ<=? and b.FYZT=1 and (nvl(a.YZSL,0)-nvl(a.TYSL,0)) > 0 and (e.GZFL='KSS1' or e.GZFL='KZL1' or e.GZFL='KSS2') group by to_char(b.FYRQ,'yyyy-mm'),a.yzx order by to_char(b.FYRQ,'yyyy-mm')) group by fyrq order by fyrq
|
|
]]></sql>
|
|
<fields>
|
|
<f name="ypzs" type="12" />
|
|
<f name="fyrq" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
|
|
<dao id="ygyyMzjbqkfxKjywYytsDao" log="true" type="1" memo="阳光用药-抗菌药物处方用药天数,是按照每张处方最大用药天数之和dao">
|
|
<sql><![CDATA[
|
|
select fyrq,sum(maxts) yyts from (select fyrq,cfh,max(nvl(yzts,0)) maxts from (select to_char(b.FYRQ,'yyyy-mm') fyrq,b.cfh,a.yzx,c.yzts from HIS_YFFY_MZFYMXB a left join HIS_YFFY_MZFYZB b on a.FYBPKEY=b.pkey and a.JGID=b.JGID left join HIS_YZ_MXB c on a.yzmx=c.pkey and a.JGID=c.JGID left join HIS_YPXX e on a.yzx=e.BM where a.JGID=? and b.FYRQ>=? and b.FYRQ<=? and b.FYZT=1 and (nvl(a.YZSL,0)-nvl(a.TYSL,0)) > 0 and (e.GZFL='KSS1' or e.GZFL='KZL1' or e.GZFL='KSS2')) group by fyrq,cfh order by fyrq,cfh) group by fyrq order by fyrq
|
|
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="fyrq" type="12" />
|
|
<f name="yyts" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
|
|
<dao id="ygyyMzjbqkfxZsyyCfzsAndjeDao" log="true" type="1" memo="阳光用药-注射用药处方张数、处方金额,是按照以药房发药的为标准,部分退药的处方,不减处方张数,会减掉处方金额dao">
|
|
<sql><![CDATA[
|
|
select fyrq,sum(cfje) cfje,count(*) cfs from (select b.cfh,sum((nvl(a.YZSL,0)-nvl(a.TYSL,0))*a.YZDJ) cfje,to_char(b.FYRQ,'yyyy-mm') fyrq from HIS_YFFY_MZFYMXB a left join HIS_YFFY_MZFYZB b on a.FYBPKEY=b.pkey and a.JGID=b.JGID left join HIS_YZ_MXB c on a.yzmx=c.pkey and a.JGID=c.JGID left join HIS_YZ_YPYF d on c.YZYF=d.BM and c.JGID=d.JGID where a.JGID=? and b.FYRQ>=? and b.FYRQ<=? and b.FYZT=1 and (nvl(a.YZSL,0)-nvl(a.TYSL,0)) > 0 and (d.ISZSGY=1 or d.ISJMGY=1) group by b.cfh,to_char(b.FYRQ,'yyyy-mm') order by to_char(b.FYRQ,'yyyy-mm')) group by fyrq order by fyrq
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="fyrq" type="12" />
|
|
<f name="cfje" type="12" />
|
|
<f name="cfs" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
|
|
<dao id="ygyyMzjbqkfxKjywZsgyRcAndJeDao" log="true" type="1" memo="阳光用药-抗菌类注射给药人次和金额,是按照是使用过注射抗菌药物的门诊人次dao">
|
|
<sql><![CDATA[
|
|
select fyrq,sum(cfje) cfje,count(*) rc from (
|
|
select b.JZPKEY,sum((nvl(a.YZSL,0)-nvl(a.TYSL,0))*a.YZDJ) cfje,to_char(b.FYRQ,'yyyy-mm') fyrq from HIS_YFFY_MZFYMXB a left join HIS_YFFY_MZFYZB b on a.FYBPKEY=b.pkey and a.JGID=b.JGID left join HIS_YZ_MXB c on a.yzmx=c.pkey and a.JGID=c.JGID left join HIS_YZ_YPYF d on c.YZYF=d.BM and c.JGID=d.JGID left join HIS_YPXX e on a.yzx=e.BM where a.JGID=? and b.FYRQ >=? and b.FYRQ <= ? and b.FYZT=1 and (nvl(a.YZSL,0)-nvl(a.TYSL,0)) > 0 and (d.ISZSGY=1 or d.ISJMGY=1) and (e.GZFL='KSS1' or e.GZFL='KZL1' or e.GZFL='KSS2') group by b.JZPKEY,to_char(b.FYRQ,'yyyy-mm') order by to_char(b.FYRQ,'yyyy-mm')) group by fyrq order by fyrq
|
|
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="fyrq" type="12" />
|
|
<f name="cfje" type="12" />
|
|
<f name="rc" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
|
|
<dao id="ygyyMzjbqkfxKjywJmgyRcAndJeDao" log="true" type="1" memo="阳光用药-抗菌类静脉给药人次和金额,是按照是使用过静脉抗菌药物的门诊人次dao">
|
|
<sql><![CDATA[
|
|
select fyrq,sum(cfje) cfje,count(*) rc from (
|
|
select b.JZPKEY,sum((nvl(a.YZSL,0)-nvl(a.TYSL,0))*a.YZDJ) cfje,to_char(b.FYRQ,'yyyy-mm') fyrq from HIS_YFFY_MZFYMXB a left join HIS_YFFY_MZFYZB b on a.FYBPKEY=b.pkey and a.JGID=b.JGID left join HIS_YZ_MXB c on a.yzmx=c.pkey and a.JGID=c.JGID left join HIS_YZ_YPYF d on c.YZYF=d.BM and c.JGID=d.JGID left join HIS_YPXX e on a.yzx=e.BM where a.JGID=? and b.FYRQ >=? and b.FYRQ <= ? and b.FYZT=1 and (nvl(a.YZSL,0)-nvl(a.TYSL,0)) > 0 and d.ISJMGY=1 and (e.GZFL='KSS1' or e.GZFL='KZL1' or e.GZFL='KSS2') group by b.JZPKEY,to_char(b.FYRQ,'yyyy-mm') order by to_char(b.FYRQ,'yyyy-mm')) group by fyrq order by fyrq
|
|
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="fyrq" type="12" />
|
|
<f name="cfje" type="12" />
|
|
<f name="rc" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
<dao id="ygyyMzjbqkfxZcyCfzsAndJeDao" log="true" type="1" memo="阳光用药-中草药处方张数、处方金额,是按照以药房发药的为标准,部分退药的处方,不减处方张数,会减掉处方金额dao">
|
|
<sql><![CDATA[
|
|
select fyrq,sum(cfje) cfje,count(*) cfs from (select b.cfh,sum((nvl(a.YZSL,0)-nvl(a.TYSL,0))*a.YZDJ) cfje,to_char(b.FYRQ,'yyyy-mm') fyrq from HIS_YFFY_MZFYMXB a left join HIS_YFFY_MZFYZB b on a.FYBPKEY=b.pkey and a.JGID=b.JGID left join HIS_YZ_MXB c on a.yzmx=c.pkey and a.JGID=c.JGID where a.JGID=? and b.FYRQ>=? and b.FYRQ<=? and b.FYZT=1 and c.YZLB='03' and (nvl(a.YZSL,0)-nvl(a.TYSL,0)) > 0 group by b.cfh,to_char(b.FYRQ,'yyyy-mm') order by to_char(b.FYRQ,'yyyy-mm')) group by fyrq order by fyrq
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="fyrq" type="12" />
|
|
<f name="cfje" type="12" />
|
|
<f name="cfs" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
|
|
|
|
<dao id="ygyyMzksyyjkShowDao" log="true" type="1" memo="阳光用药-门诊科室用药监控显示Dao">
|
|
<sql>
|
|
select '' 排名,'' 科室,'' 处方张数,'' 处方金额,'' 处方金额张数,'' 处方药品种数,'' 处方药品种数张数,'' 处方用药天数,'' 处方用药天数张数 from dual where 1=2
|
|
</sql>
|
|
<fields>
|
|
<f name="排名" type="1" />
|
|
<f name="科室" type="1" />
|
|
<f name="处方张数" type="1" />
|
|
<f name="处方金额" type="1" />
|
|
<f name="处方金额张数" type="1" />
|
|
<f name="处方药品种数" type="1" />
|
|
<f name="处方药品种数张数" type="1" />
|
|
<f name="处方用药天数" type="1" />
|
|
<f name="处方用药天数张数" type="1" />
|
|
</fields>
|
|
</dao>
|
|
|
|
<dao id="ygyyMzksyyjkSCfzsAndJeDao" log="true" type="1" memo="阳光用药-门诊科室用药监控-处方张数、处方金额,是按照以药房发药的为标准,部分退药的处方,不减处方张数,会减掉处方金额dao">
|
|
<sql><![CDATA[
|
|
select jjks,cfje,cfs from (select jjks,sum(cfje) cfje,count(*) cfs from (select c.jjks,b.cfh,sum((nvl(a.YZSL,0)-nvl(a.TYSL,0))*a.YZDJ) cfje from HIS_YFFY_MZFYMXB a left join HIS_YFFY_MZFYZB b on a.FYBPKEY=b.pkey and a.JGID=b.JGID left join HIS_JZ_BASEINFO c on b.jzpkey=c.pkey and b.JGID=c.JGID where a.JGID=? and c.jjks like ? and b.FYRQ>=? and b.FYRQ<=? and b.FYZT=1 and (nvl(a.YZSL,0)-nvl(a.TYSL,0)) > 0 group by c.jjks,b.cfh) group by jjks )order by cfje desc
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="jjks" type="12" />
|
|
<f name="cfje" type="12" />
|
|
<f name="cfs" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
|
|
<dao id="ygyyMzksyyjkSYpzsDao" log="true" type="1" memo="阳光用药-门诊科室用药监控-药品总数,是按照每张处方药品品种数累加dao">
|
|
<sql><![CDATA[
|
|
select count(*) ypzs,jjks from (select c.jjks,count(*) yps,a.yzx from HIS_YFFY_MZFYMXB a left join HIS_YFFY_MZFYZB b on a.FYBPKEY=b.pkey and a.JGID=b.JGID left join HIS_JZ_BASEINFO c on b.jzpkey=c.pkey and b.JGID=c.JGID where a.JGID=? and c.jjks like ? and b.FYRQ>=? and b.FYRQ<=? and b.FYZT=1 and (nvl(a.YZSL,0)-nvl(a.TYSL,0)) > 0 group by c.jjks,a.yzx) group by jjks
|
|
]]></sql>
|
|
<fields>
|
|
<f name="ypzs" type="12" />
|
|
<f name="jjks" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
<dao id="ygyyMzksyyjkSYytsDao" log="true" type="1" memo="阳光用药-门诊科室用药监控-处方用药天数,是按照每张处方最大用药天数之和dao">
|
|
<sql><![CDATA[
|
|
select jjks,sum(maxts) yyts from (select jjks,cfh,max(nvl(yzts,0)) maxts from (select d.jjks,b.cfh,a.yzx,c.yzts from HIS_YFFY_MZFYMXB a left join HIS_YFFY_MZFYZB b on a.FYBPKEY=b.pkey and a.JGID=b.JGID left join HIS_YZ_MXB c on a.yzmx=c.pkey and a.JGID=c.JGID left join HIS_JZ_BASEINFO d on b.jzpkey=d.pkey and b.JGID=d.JGID where a.JGID=? and d.jjks like ? and b.FYRQ>=? and b.FYRQ<=? and b.FYZT=1 and (nvl(a.YZSL,0)-nvl(a.TYSL,0)) > 0 ) group by jjks,cfh order by jjks,cfh) group by jjks
|
|
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="jjks" type="12" />
|
|
<f name="yyts" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
<dao id="ygyyMzysyyjkShowDao" log="true" type="1" memo="阳光用药-门诊医生用药监控显示Dao">
|
|
<sql>
|
|
select '' 排名,'' 医生,'' 处方张数,'' 处方金额,'' 处方金额张数,'' 处方药品种数,'' 处方药品种数张数,'' 处方用药天数,'' 处方用药天数张数 from dual where 1=2
|
|
</sql>
|
|
<fields>
|
|
<f name="排名" type="1" />
|
|
<f name="医生" type="1" />
|
|
<f name="处方张数" type="1" />
|
|
<f name="处方金额" type="1" />
|
|
<f name="处方金额张数" type="1" />
|
|
<f name="处方药品种数" type="1" />
|
|
<f name="处方药品种数张数" type="1" />
|
|
<f name="处方用药天数" type="1" />
|
|
<f name="处方用药天数张数" type="1" />
|
|
</fields>
|
|
</dao>
|
|
|
|
|
|
<dao id="ygyyMzysyyjkSCfzsAndJeDao" log="true" type="1" memo="阳光用药-门诊医生用药监控-处方张数、处方金额,是按照以药房发药的为标准,部分退药的处方,不减处方张数,会减掉处方金额dao">
|
|
<sql><![CDATA[
|
|
select JJYS,cfje,cfs from (select JJYS,sum(cfje) cfje,count(*) cfs from (select c.JJYS,b.cfh,sum((nvl(a.YZSL,0)-nvl(a.TYSL,0))*a.YZDJ) cfje from HIS_YFFY_MZFYMXB a left join HIS_YFFY_MZFYZB b on a.FYBPKEY=b.pkey and a.JGID=b.JGID left join HIS_JZ_BASEINFO c on b.jzpkey=c.pkey and b.JGID=c.JGID where a.JGID=? and c.jjys like ? and b.FYRQ>=? and b.FYRQ<=? and b.FYZT=1 and (nvl(a.YZSL,0)-nvl(a.TYSL,0)) > 0 group by c.JJYS,b.cfh) group by JJYS )order by cfje desc
|
|
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="JJYS" type="12" />
|
|
<f name="cfje" type="12" />
|
|
<f name="cfs" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
|
|
<dao id="ygyyMzysyyjkSYpzsDao" log="true" type="1" memo="阳光用药-门诊医生用药监控-药品总数,是按照每张处方药品品种数累加dao">
|
|
<sql><![CDATA[
|
|
select count(*) ypzs,JJYS from (select c.JJYS,count(*) yps,a.yzx from HIS_YFFY_MZFYMXB a left join HIS_YFFY_MZFYZB b on a.FYBPKEY=b.pkey and a.JGID=b.JGID left join HIS_JZ_BASEINFO c on b.jzpkey=c.pkey and b.JGID=c.JGID where a.JGID=? and c.jjys like ? and b.FYRQ>=? and b.FYRQ<=? and b.FYZT=1 and (nvl(a.YZSL,0)-nvl(a.TYSL,0)) > 0 group by c.JJYS,a.yzx) group by JJYS
|
|
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="ypzs" type="12" />
|
|
<f name="JJYS" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
<dao id="ygyyMzysyyjkSYytsDao" log="true" type="1" memo="阳光用药-门诊医生用药监控-处方用药天数,是按照每张处方最大用药天数之和dao">
|
|
<sql><![CDATA[
|
|
select JJYS,sum(maxts) yyts from (select JJYS,cfh,max(nvl(yzts,0)) maxts from (select d.JJYS,b.cfh,a.yzx,c.yzts from HIS_YFFY_MZFYMXB a left join HIS_YFFY_MZFYZB b on a.FYBPKEY=b.pkey and a.JGID=b.JGID left join HIS_YZ_MXB c on a.yzmx=c.pkey and a.JGID=c.JGID left join HIS_JZ_BASEINFO d on b.jzpkey=d.pkey and b.JGID=d.JGID where a.JGID=? and d.jjys like ? and b.FYRQ>=? and b.FYRQ<=? and b.FYZT=1 and (nvl(a.YZSL,0)-nvl(a.TYSL,0)) > 0 ) group by JJYS,cfh order by JJYS,cfh) group by JJYS
|
|
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="JJYS" type="12" />
|
|
<f name="yyts" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
|
|
<dao id="ygyyMzKsyyzhfxShowDao" log="true" type="1" memo="阳光用药-门诊科室用药综合分析显示Dao">
|
|
<sql>
|
|
select '' 科室,'' 就诊人次,'' 使用抗菌药物人次,'' 门诊抗菌药物使用率,'' 门诊抗菌药物使用率警戒,'' 处方张数,'' 处方金额,'' 处方药品种数,'' 处方用药天数,'' 抗菌药物处方张数,'' 抗菌药物处方金额,'' 抗菌处方用药品种数,'' 抗菌处方用药天数,'' 抗菌注射药物金额,'' 注射剂处方张数,'' 注射药物金额,'' 处方平均金额,'' 处方平均用药品种数,'' 平均用药天数,'' 抗菌处方占比,'' 抗菌处方金额占比,'' 抗菌处方平均用药品种数,'' 抗菌处方平均用药天数,'' 抗菌注射药物金额比例,'' 注射药物金额比例,'' 抗菌药占比警戒,'' 中草药处方张数,'' 中草药处方金额,'' 抗菌注射药物人次,'' 注射药物人次 from dual where 1=2
|
|
</sql>
|
|
<fields>
|
|
<f name="科室" type="1" />
|
|
<f name="就诊人次" type="1" />
|
|
<f name="使用抗菌药物人次" type="1" />
|
|
<f name="门诊抗菌药物使用率" type="1" />
|
|
<f name="门诊抗菌药物使用率警戒" type="1" />
|
|
<f name="处方张数" type="1" />
|
|
<f name="处方金额" type="1" />
|
|
<f name="处方药品种数" type="1" />
|
|
<f name="处方用药天数" type="1" />
|
|
<f name="抗菌药物处方张数" type="1" />
|
|
<f name="抗菌药物处方金额" type="1" />
|
|
<f name="抗菌处方用药品种数" type="1" />
|
|
<f name="抗菌处方用药天数" type="1" />
|
|
<f name="抗菌注射药物金额" type="1" />
|
|
<f name="注射剂处方张数" type="1" />
|
|
<f name="注射药物金额" type="1" />
|
|
<f name="处方平均金额" type="1" />
|
|
<f name="处方平均用药品种数" type="1" />
|
|
<f name="平均用药天数" type="1" />
|
|
<f name="抗菌处方占比" type="1" />
|
|
<f name="抗菌处方金额占比" type="1" />
|
|
<f name="抗菌处方平均用药品种数" type="1" />
|
|
<f name="抗菌处方平均用药天数" type="1" />
|
|
<f name="抗菌注射药物金额比例" type="1" />
|
|
<f name="注射药物金额比例" type="1" />
|
|
<f name="抗菌药占比警戒" type="1" />
|
|
<f name="中草药处方张数" type="1" />
|
|
<f name="中草药处方金额" type="1" />
|
|
<f name="抗菌注射药物人次" type="1" />
|
|
<f name="注射药物人次" type="1" />
|
|
</fields>
|
|
</dao>
|
|
|
|
|
|
<dao id="ygyyMzKsyyzhfxMzrcAndJeDao" log="true" type="1" memo="阳光用药-门诊科室用药综合分析-处方总人次,处方总金额,是按照病人挂号接诊时间为主,只要病人挂号交费并开有医生处方就算一个处方人次dao">
|
|
<sql><![CDATA[
|
|
select count(*) mzrc,sum(fy) fy,jjks from (select sum(d.SFXSJZFY) fy,a.jjks,a.pkey from HIS_JZ_BASEINFO a left join HIS_SFZD_ZB b on a.pkey=b.jzpkey and a.JGID=b.JGID left join HIS_MZJS_MZFPZB c on b.pkey=c.GLZDBPKEY and b.JGID=c.JGID left join HIS_SFZD_SFXMXB d on b.pkey=d.ZDZBPKEY and b.JGID=d.JGID where a.JGID=? and a.jjks like ? and c.SFRQ >=? and c.SFRQ <= ? and (a.JZLX='M' or a.JZLX='J' ) and c.SFZT = 1 and a.JZZT='J' group by a.jjks,a.pkey order by a.jjks) group by jjks order by jjks
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="mzrc" type="4" />
|
|
<f name="fy" type="12" />
|
|
<f name="jjks" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
|
|
|
|
<dao id="ygyyMzKsyyzhfxCfzsAndJeDao" log="true" type="1" memo="阳光用药-门诊科室用药综合分析-处方张数、处方金额,是按照以药房发药的为标准,部分退药的处方,不减处方张数,会减掉处方金额dao">
|
|
<sql><![CDATA[
|
|
select jjks,sum(cfje) cfje,count(*) cfs from (select b.cfh,sum((nvl(a.YZSL,0)-nvl(a.TYSL,0))*a.YZDJ) cfje,c.jjks from HIS_YFFY_MZFYMXB a left join HIS_YFFY_MZFYZB b on a.FYBPKEY=b.pkey and a.JGID=b.JGID left join HIS_JZ_BASEINFO c on b.jzpkey=c.pkey and b.JGID=c.JGID where a.JGID=? and c.jjks like ? and b.FYRQ>=? and b.FYRQ<=? and b.FYZT=1 and (nvl(a.YZSL,0)-nvl(a.TYSL,0)) > 0 group by b.cfh,c.jjks order by c.jjks) group by jjks order by jjks
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="jjks" type="12" />
|
|
<f name="cfje" type="12" />
|
|
<f name="cfs" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
|
|
|
|
<dao id="ygyyMzKsyyzhfxYpzsDao" log="true" type="1" memo="阳光用药-门诊科室用药综合分析-药品总数,是按照每张处方药品品种数累加dao">
|
|
<sql><![CDATA[
|
|
select count(*) ypzs,jjks from (select count(*) yps,c.jjks,a.yzx from HIS_YFFY_MZFYMXB a left join HIS_YFFY_MZFYZB b on a.FYBPKEY=b.pkey and a.JGID=b.JGID left join HIS_JZ_BASEINFO c on b.jzpkey=c.pkey and b.JGID=c.JGID where a.JGID=? and c.jjks like ? and b.FYRQ>=? and b.FYRQ<=? and b.FYZT=1 and (nvl(a.YZSL,0)-nvl(a.TYSL,0)) > 0 group by c.jjks,a.yzx order by c.jjks ) group by jjks order by jjks
|
|
]]></sql>
|
|
<fields>
|
|
<f name="ypzs" type="12" />
|
|
<f name="jjks" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
|
|
<dao id="ygyyMzKsyyzhfxYytsDao" log="true" type="1" memo="阳光用药-门诊科室用药综合分析-处方用药天数,是按照每张处方最大用药天数之和dao">
|
|
<sql><![CDATA[
|
|
select jjks,sum(maxts) yyts from (select jjks,cfh,max(nvl(yzts,0)) maxts from (select d.jjks,b.cfh,a.yzx,c.yzts from HIS_YFFY_MZFYMXB a left join HIS_YFFY_MZFYZB b on a.FYBPKEY=b.pkey and a.JGID=b.JGID left join HIS_YZ_MXB c on a.yzmx=c.pkey and a.JGID=c.JGID left join HIS_JZ_BASEINFO d on b.jzpkey=d.pkey and b.JGID=d.JGID where a.JGID=? and d.jjks like ? and b.FYRQ>=? and b.FYRQ<=? and b.FYZT=1 and (nvl(a.YZSL,0)-nvl(a.TYSL,0)) > 0 ) group by jjks,cfh order by jjks,cfh) group by jjks order by jjks
|
|
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="jjks" type="12" />
|
|
<f name="yyts" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
<dao id="ygyyMzKsyyzhfxJmgyRcAndJeDao" log="true" type="1" memo="阳光用药-门诊科室用药综合分析-静脉给药人次和静脉给药金额,是按照是使用过静脉给药的门诊人次dao">
|
|
<sql><![CDATA[
|
|
select jjks,sum(cfje) cfje,count(*) rc from (
|
|
select b.JZPKEY,sum((nvl(a.YZSL,0)-nvl(a.TYSL,0))*a.YZDJ) cfje,e.jjks from HIS_YFFY_MZFYMXB a left join HIS_YFFY_MZFYZB b on a.FYBPKEY=b.pkey and a.JGID=b.JGID left join HIS_YZ_MXB c on a.yzmx=c.pkey and a.JGID=c.JGID left join HIS_YZ_YPYF d on c.YZYF=d.BM and c.JGID=d.JGID left join HIS_JZ_BASEINFO e on b.jzpkey=e.pkey and b.JGID=e.JGID where a.JGID=? and e.jjks like ? and b.FYRQ >=? and b.FYRQ <= ? and b.FYZT=1 and (nvl(a.YZSL,0)-nvl(a.TYSL,0)) > 0 and d.ISJMGY=1 group by b.JZPKEY,e.jjks order by e.jjks) group by jjks order by jjks
|
|
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="jjks" type="12" />
|
|
<f name="cfje" type="12" />
|
|
<f name="rc" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
<dao id="ygyyMzKsyyzhfxZsgyRcAndJeDao" log="true" type="1" memo="阳光用药-门诊科室用药综合分析-注射给药人次和注射给药金额,是按照是使用过注射给药的门诊人次,静脉也是属于注射类dao">
|
|
<sql><![CDATA[
|
|
select jjks,sum(cfje) cfje,count(*) rc from (
|
|
select b.JZPKEY,sum((nvl(a.YZSL,0)-nvl(a.TYSL,0))*a.YZDJ) cfje,e.jjks from HIS_YFFY_MZFYMXB a left join HIS_YFFY_MZFYZB b on a.FYBPKEY=b.pkey and a.JGID=b.JGID left join HIS_YZ_MXB c on a.yzmx=c.pkey and a.JGID=c.JGID left join HIS_YZ_YPYF d on c.YZYF=d.BM and c.JGID=d.JGID left join HIS_JZ_BASEINFO e on b.jzpkey=e.pkey and b.JGID=e.JGID where a.JGID=? and e.jjks like ? and b.FYRQ >=? and b.FYRQ <= ? and b.FYZT=1 and (nvl(a.YZSL,0)-nvl(a.TYSL,0)) > 0 and (d.ISZSGY=1 or d.ISJMGY=1) group by b.JZPKEY,e.jjks order by e.jjks) group by jjks order by jjks
|
|
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="jjks" type="12" />
|
|
<f name="cfje" type="12" />
|
|
<f name="rc" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
|
|
|
|
<dao id="ygyyMzKsyyzhfxKjlywRcAndJeDao" log="true" type="1" memo="阳光用药-门诊科室用药综合分析-抗菌药物门诊人次和金额,是按照使用过抗菌药物的门诊人次dao">
|
|
<sql><![CDATA[
|
|
select jjks,sum(cfje) cfje,count(*) rc from (
|
|
select b.JZPKEY,sum((nvl(a.YZSL,0)-nvl(a.TYSL,0))*a.YZDJ) cfje,c.jjks from HIS_YFFY_MZFYMXB a left join HIS_YFFY_MZFYZB b on a.FYBPKEY=b.pkey and a.JGID=b.JGID left join HIS_YPXX e on a.yzx=e.BM left join HIS_JZ_BASEINFO c on b.jzpkey=c.pkey and b.JGID=c.JGID where a.JGID=? and c.jjks like ? and b.FYRQ >=? and b.FYRQ <= ? and b.FYZT=1 and (nvl(a.YZSL,0)-nvl(a.TYSL,0)) > 0 and (e.GZFL='KSS1' or e.GZFL='KZL1' or e.GZFL='KSS2') group by b.JZPKEY,c.jjks order by c.jjks) group by jjks order by jjks
|
|
]]></sql>
|
|
<fields>
|
|
<f name="jjks" type="12" />
|
|
<f name="cfje" type="12" />
|
|
<f name="rc" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
<dao id="ygyyMzKsyyzhfxKjywCfzsAndJeDao" log="true" type="1" memo="阳光用药-门诊科室用药综合分析-抗菌药物处方张数、处方金额,是按照以药房发药的为标准,部分退药的处方,不减处方张数,会减掉处方金额dao">
|
|
<sql><![CDATA[
|
|
select jjks,sum(cfje) cfje,count(*) cfs from (select b.cfh,sum((nvl(a.YZSL,0)-nvl(a.TYSL,0))*a.YZDJ) cfje,c.jjks from HIS_YFFY_MZFYMXB a left join HIS_YFFY_MZFYZB b on a.FYBPKEY=b.pkey and a.JGID=b.JGID left join HIS_YPXX e on a.yzx=e.BM left join HIS_JZ_BASEINFO c on b.jzpkey=c.pkey and b.JGID=c.JGID where a.JGID=? and c.jjks like ? and b.FYRQ>=? and b.FYRQ<=? and b.FYZT=1 and (nvl(a.YZSL,0)-nvl(a.TYSL,0)) > 0 and (e.GZFL='KSS1' or e.GZFL='KZL1' or e.GZFL='KSS2') group by b.cfh,c.jjks order by c.jjks) group by jjks order by jjks
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="jjks" type="12" />
|
|
<f name="cfje" type="12" />
|
|
<f name="cfs" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
|
|
<dao id="ygyyMzKsyyzhfxKjywYpzsDao" log="true" type="1" memo="阳光用药-门诊科室用药综合分析-抗菌药物药品种数,是按照每张处方药品品种数累加dao">
|
|
<sql><![CDATA[
|
|
select count(*) ypzs,jjks from (select count(*) yps,c.jjks,a.yzx from HIS_YFFY_MZFYMXB a left join HIS_YFFY_MZFYZB b on a.FYBPKEY=b.pkey and a.JGID=b.JGID left join HIS_YPXX e on a.yzx=e.BM left join HIS_JZ_BASEINFO c on b.jzpkey=c.pkey and b.JGID=c.JGID where a.JGID=? and c.jjks like ? and b.FYRQ>=? and b.FYRQ<=? and b.FYZT=1 and (nvl(a.YZSL,0)-nvl(a.TYSL,0)) > 0 and (e.GZFL='KSS1' or e.GZFL='KZL1' or e.GZFL='KSS2') group by c.jjks,a.yzx order by c.jjks) group by jjks order by jjks
|
|
]]></sql>
|
|
<fields>
|
|
<f name="ypzs" type="12" />
|
|
<f name="jjks" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
|
|
<dao id="ygyyMzKsyyzhfxKjywYytsDao" log="true" type="1" memo="阳光用药-门诊科室用药综合分析-抗菌药物处方用药天数,是按照每张处方最大用药天数之和dao">
|
|
<sql><![CDATA[
|
|
select jjks,sum(maxts) yyts from (select jjks,cfh,max(nvl(yzts,0)) maxts from (select d.jjks,b.cfh,a.yzx,c.yzts from HIS_YFFY_MZFYMXB a left join HIS_YFFY_MZFYZB b on a.FYBPKEY=b.pkey and a.JGID=b.JGID left join HIS_YZ_MXB c on a.yzmx=c.pkey and a.JGID=c.JGID left join HIS_YPXX e on a.yzx=e.BM left join HIS_JZ_BASEINFO d on b.jzpkey=d.pkey and b.JGID=d.JGID where a.JGID=? and d.jjks like ? and b.FYRQ>=? and b.FYRQ<=? and b.FYZT=1 and (nvl(a.YZSL,0)-nvl(a.TYSL,0)) > 0 and (e.GZFL='KSS1' or e.GZFL='KZL1' or e.GZFL='KSS2')) group by jjks,cfh order by jjks,cfh) group by jjks order by jjks
|
|
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="jjks" type="12" />
|
|
<f name="yyts" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
|
|
<dao id="ygyyMzKsyyzhfxZsyyCfzsAndjeDao" log="true" type="1" memo="阳光用药-门诊科室用药综合分析-注射用药处方张数、处方金额,是按照以药房发药的为标准,部分退药的处方,不减处方张数,会减掉处方金额dao">
|
|
<sql><![CDATA[
|
|
select jjks,sum(cfje) cfje,count(*) cfs from (select b.cfh,sum((nvl(a.YZSL,0)-nvl(a.TYSL,0))*a.YZDJ) cfje,e.jjks from HIS_YFFY_MZFYMXB a left join HIS_YFFY_MZFYZB b on a.FYBPKEY=b.pkey and a.JGID=b.JGID left join HIS_YZ_MXB c on a.yzmx=c.pkey and a.JGID=c.JGID left join HIS_YZ_YPYF d on c.YZYF=d.BM and c.JGID=d.JGID left join HIS_JZ_BASEINFO e on b.jzpkey=e.pkey and b.JGID=e.JGID where a.JGID=? and e.jjks like ? and b.FYRQ>=? and b.FYRQ<=? and b.FYZT=1 and (nvl(a.YZSL,0)-nvl(a.TYSL,0)) > 0 and (d.ISZSGY=1 or d.ISJMGY=1) group by b.cfh,e.jjks order by e.jjks) group by jjks order by jjks
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="jjks" type="12" />
|
|
<f name="cfje" type="12" />
|
|
<f name="cfs" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
|
|
<dao id="ygyyMzKsyyzhfxKjywZsgyRcAndJeDao" log="true" type="1" memo="阳光用药-门诊科室用药综合分析-抗菌类注射给药人次和金额,是按照是使用过注射抗菌药物的门诊人次dao">
|
|
<sql><![CDATA[
|
|
select jjks,sum(cfje) cfje,count(*) rc from (
|
|
select b.JZPKEY,sum((nvl(a.YZSL,0)-nvl(a.TYSL,0))*a.YZDJ) cfje,f.jjks from HIS_YFFY_MZFYMXB a left join HIS_YFFY_MZFYZB b on a.FYBPKEY=b.pkey and a.JGID=b.JGID left join HIS_YZ_MXB c on a.yzmx=c.pkey and a.JGID=c.JGID left join HIS_YZ_YPYF d on c.YZYF=d.BM and c.JGID=d.JGID left join HIS_YPXX e on a.yzx=e.BM left join HIS_JZ_BASEINFO f on b.jzpkey=f.pkey and b.JGID=f.JGID where a.JGID=? and f.jjks like ? and b.FYRQ >=? and b.FYRQ <= ? and b.FYZT=1 and (nvl(a.YZSL,0)-nvl(a.TYSL,0)) > 0 and (d.ISZSGY=1 or d.ISJMGY=1) and (e.GZFL='KSS1' or e.GZFL='KZL1' or e.GZFL='KSS2') group by b.JZPKEY,f.jjks order by f.jjks) group by jjks order by jjks
|
|
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="jjks" type="12" />
|
|
<f name="cfje" type="12" />
|
|
<f name="rc" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
|
|
<dao id="ygyyMzKsyyzhfxKjywJmgyRcAndJeDao" log="true" type="1" memo="阳光用药-门诊科室用药综合分析-抗菌类静脉给药人次和金额,是按照是使用过静脉抗菌药物的门诊人次dao">
|
|
<sql><![CDATA[
|
|
select jjks,sum(cfje) cfje,count(*) rc from (
|
|
select b.JZPKEY,sum((nvl(a.YZSL,0)-nvl(a.TYSL,0))*a.YZDJ) cfje,f.jjks from HIS_YFFY_MZFYMXB a left join HIS_YFFY_MZFYZB b on a.FYBPKEY=b.pkey and a.JGID=b.JGID left join HIS_YZ_MXB c on a.yzmx=c.pkey and a.JGID=c.JGID left join HIS_YZ_YPYF d on c.YZYF=d.BM and c.JGID=d.JGID left join HIS_YPXX e on a.yzx=e.BM left join HIS_JZ_BASEINFO f on b.jzpkey=f.pkey and b.JGID=f.JGID where a.JGID=? and f.jjks like ? and b.FYRQ >=? and b.FYRQ <= ? and b.FYZT=1 and (nvl(a.YZSL,0)-nvl(a.TYSL,0)) > 0 and d.ISJMGY=1 and (e.GZFL='KSS1' or e.GZFL='KZL1' or e.GZFL='KSS2') group by b.JZPKEY,f.jjks order by f.jjks) group by jjks order by jjks
|
|
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="jjks" type="12" />
|
|
<f name="cfje" type="12" />
|
|
<f name="rc" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
<dao id="ygyyMzKsyyzhfxZcyCfzsAndJeDao" log="true" type="1" memo="阳光用药-门诊科室用药综合分析-中草药处方张数、处方金额,是按照以药房发药的为标准,部分退药的处方,不减处方张数,会减掉处方金额dao">
|
|
<sql><![CDATA[
|
|
select jjks,sum(cfje) cfje,count(*) cfs from (select b.cfh,sum((nvl(a.YZSL,0)-nvl(a.TYSL,0))*a.YZDJ) cfje,f.jjks from HIS_YFFY_MZFYMXB a left join HIS_YFFY_MZFYZB b on a.FYBPKEY=b.pkey and a.JGID=b.JGID left join HIS_YZ_MXB c on a.yzmx=c.pkey and a.JGID=c.JGID left join HIS_JZ_BASEINFO f on b.jzpkey=f.pkey and b.JGID=f.JGID where a.JGID=? and f.jjks like ? and b.FYRQ>=? and b.FYRQ<=? and b.FYZT=1 and c.YZLB='03' and (nvl(a.YZSL,0)-nvl(a.TYSL,0)) > 0 group by b.cfh,f.jjks order by f.jjks) group by jjks order by jjks
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="jjks" type="12" />
|
|
<f name="cfje" type="12" />
|
|
<f name="cfs" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
|
|
<dao id="ygyyMzYsyyzhfxShowDao" log="true" type="1" memo="阳光用药-门诊医生用药综合分析显示Dao">
|
|
<sql>
|
|
select '' 医生,'' 就诊人次,'' 使用抗菌药物人次,'' 门诊抗菌药物使用率,'' 门诊抗菌药物使用率警戒,'' 处方张数,'' 处方金额,'' 处方药品种数,'' 处方用药天数,'' 抗菌药物处方张数,'' 抗菌药物处方金额,'' 抗菌处方用药品种数,'' 抗菌处方用药天数,'' 抗菌注射药物金额,'' 注射剂处方张数,'' 注射药物金额,'' 处方平均金额,'' 处方平均用药品种数,'' 平均用药天数,'' 抗菌处方占比,'' 抗菌处方金额占比,'' 抗菌处方平均用药品种数,'' 抗菌处方平均用药天数,'' 抗菌注射药物金额比例,'' 注射药物金额比例,'' 抗菌药占比警戒,'' 中草药处方张数,'' 中草药处方金额,'' 抗菌注射药物人次,'' 注射药物人次 from dual where 1=2
|
|
</sql>
|
|
<fields>
|
|
<f name="医生" type="1" />
|
|
<f name="就诊人次" type="1" />
|
|
<f name="使用抗菌药物人次" type="1" />
|
|
<f name="门诊抗菌药物使用率" type="1" />
|
|
<f name="门诊抗菌药物使用率警戒" type="1" />
|
|
<f name="处方张数" type="1" />
|
|
<f name="处方金额" type="1" />
|
|
<f name="处方药品种数" type="1" />
|
|
<f name="处方用药天数" type="1" />
|
|
<f name="抗菌药物处方张数" type="1" />
|
|
<f name="抗菌药物处方金额" type="1" />
|
|
<f name="抗菌处方用药品种数" type="1" />
|
|
<f name="抗菌处方用药天数" type="1" />
|
|
<f name="抗菌注射药物金额" type="1" />
|
|
<f name="注射剂处方张数" type="1" />
|
|
<f name="注射药物金额" type="1" />
|
|
<f name="处方平均金额" type="1" />
|
|
<f name="处方平均用药品种数" type="1" />
|
|
<f name="平均用药天数" type="1" />
|
|
<f name="抗菌处方占比" type="1" />
|
|
<f name="抗菌处方金额占比" type="1" />
|
|
<f name="抗菌处方平均用药品种数" type="1" />
|
|
<f name="抗菌处方平均用药天数" type="1" />
|
|
<f name="抗菌注射药物金额比例" type="1" />
|
|
<f name="注射药物金额比例" type="1" />
|
|
<f name="抗菌药占比警戒" type="1" />
|
|
<f name="中草药处方张数" type="1" />
|
|
<f name="中草药处方金额" type="1" />
|
|
<f name="抗菌注射药物人次" type="1" />
|
|
<f name="注射药物人次" type="1" />
|
|
</fields>
|
|
</dao>
|
|
|
|
|
|
<dao id="ygyyMzYsyyzhfxMzrcAndJeDao" log="true" type="1" memo="阳光用药-门诊医生用药综合分析-处方总人次,处方总金额,是按照病人挂号接诊时间为主,只要病人挂号交费并开有医生处方就算一个处方人次dao">
|
|
<sql><![CDATA[
|
|
select count(*) mzrc,sum(fy) fy,jjys from (select sum(d.SFXSJZFY) fy,a.jjys,a.pkey from HIS_JZ_BASEINFO a left join HIS_SFZD_ZB b on a.pkey=b.jzpkey and a.JGID=b.JGID left join HIS_MZJS_MZFPZB c on b.pkey=c.GLZDBPKEY and b.JGID=c.JGID left join HIS_SFZD_SFXMXB d on b.pkey=d.ZDZBPKEY and b.JGID=d.JGID where a.JGID=? and a.jjys like ? and c.SFRQ >=? and c.SFRQ <= ? and (a.JZLX='M' or a.JZLX='J' ) and c.SFZT = 1 and a.JZZT='J' group by a.jjys,a.pkey order by a.jjys) group by jjys order by jjys
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="mzrc" type="4" />
|
|
<f name="fy" type="12" />
|
|
<f name="jjys" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
|
|
|
|
<dao id="ygyyMzYsyyzhfxCfzsAndJeDao" log="true" type="1" memo="阳光用药-门诊医生用药综合分析-处方张数、处方金额,是按照以药房发药的为标准,部分退药的处方,不减处方张数,会减掉处方金额dao">
|
|
<sql><![CDATA[
|
|
select jjys,sum(cfje) cfje,count(*) cfs from (select b.cfh,sum((nvl(a.YZSL,0)-nvl(a.TYSL,0))*a.YZDJ) cfje,c.jjys from HIS_YFFY_MZFYMXB a left join HIS_YFFY_MZFYZB b on a.FYBPKEY=b.pkey and a.JGID=b.JGID left join HIS_JZ_BASEINFO c on b.jzpkey=c.pkey and b.JGID=c.JGID where a.JGID=? and c.jjys like ? and b.FYRQ>=? and b.FYRQ<=? and b.FYZT=1 and (nvl(a.YZSL,0)-nvl(a.TYSL,0)) > 0 group by b.cfh,c.jjys order by c.jjys) group by jjys order by jjys
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="jjys" type="12" />
|
|
<f name="cfje" type="12" />
|
|
<f name="cfs" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
|
|
|
|
<dao id="ygyyMzYsyyzhfxYpzsDao" log="true" type="1" memo="阳光用药-门诊医生用药综合分析-药品总数,是按照每张处方药品品种数累加dao">
|
|
<sql><![CDATA[
|
|
select count(*) ypzs,jjys from (select count(*) yps,c.jjys,a.yzx from HIS_YFFY_MZFYMXB a left join HIS_YFFY_MZFYZB b on a.FYBPKEY=b.pkey and a.JGID=b.JGID left join HIS_JZ_BASEINFO c on b.jzpkey=c.pkey and b.JGID=c.JGID where a.JGID=? and c.jjys like ? and b.FYRQ>=? and b.FYRQ<=? and b.FYZT=1 and (nvl(a.YZSL,0)-nvl(a.TYSL,0)) > 0 group by c.jjys,a.yzx order by c.jjys ) group by jjys order by jjys
|
|
]]></sql>
|
|
<fields>
|
|
<f name="ypzs" type="12" />
|
|
<f name="jjys" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
|
|
<dao id="ygyyMzYsyyzhfxYytsDao" log="true" type="1" memo="阳光用药-门诊医生用药综合分析-处方用药天数,是按照每张处方最大用药天数之和dao">
|
|
<sql><![CDATA[
|
|
select jjys,sum(maxts) yyts from (select jjys,cfh,max(nvl(yzts,0)) maxts from (select d.jjys,b.cfh,a.yzx,c.yzts from HIS_YFFY_MZFYMXB a left join HIS_YFFY_MZFYZB b on a.FYBPKEY=b.pkey and a.JGID=b.JGID left join HIS_YZ_MXB c on a.yzmx=c.pkey and a.JGID=c.JGID left join HIS_JZ_BASEINFO d on b.jzpkey=d.pkey and b.JGID=d.JGID where a.JGID=? and d.jjys like ? and b.FYRQ>=? and b.FYRQ<=? and b.FYZT=1 and (nvl(a.YZSL,0)-nvl(a.TYSL,0)) > 0 ) group by jjys,cfh order by jjys,cfh) group by jjys order by jjys
|
|
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="jjys" type="12" />
|
|
<f name="yyts" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
<dao id="ygyyMzYsyyzhfxJmgyRcAndJeDao" log="true" type="1" memo="阳光用药-门诊医生用药综合分析-静脉给药人次和静脉给药金额,是按照是使用过静脉给药的门诊人次dao">
|
|
<sql><![CDATA[
|
|
select jjys,sum(cfje) cfje,count(*) rc from (
|
|
select b.JZPKEY,sum((nvl(a.YZSL,0)-nvl(a.TYSL,0))*a.YZDJ) cfje,e.jjys from HIS_YFFY_MZFYMXB a left join HIS_YFFY_MZFYZB b on a.FYBPKEY=b.pkey and a.JGID=b.JGID left join HIS_YZ_MXB c on a.yzmx=c.pkey and a.JGID=c.JGID left join HIS_YZ_YPYF d on c.YZYF=d.BM and c.JGID=d.JGID left join HIS_JZ_BASEINFO e on b.jzpkey=e.pkey and b.JGID=e.JGID where a.JGID=? and e.jjys like ? and b.FYRQ >=? and b.FYRQ <= ? and b.FYZT=1 and (nvl(a.YZSL,0)-nvl(a.TYSL,0)) > 0 and d.ISJMGY=1 group by b.JZPKEY,e.jjys order by e.jjys) group by jjys order by jjys
|
|
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="jjys" type="12" />
|
|
<f name="cfje" type="12" />
|
|
<f name="rc" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
<dao id="ygyyMzYsyyzhfxZsgyRcAndJeDao" log="true" type="1" memo="阳光用药-门诊医生用药综合分析-注射给药人次和注射给药金额,是按照是使用过注射给药的门诊人次,静脉也是属于注射类dao">
|
|
<sql><![CDATA[
|
|
select jjys,sum(cfje) cfje,count(*) rc from (
|
|
select b.JZPKEY,sum((nvl(a.YZSL,0)-nvl(a.TYSL,0))*a.YZDJ) cfje,e.jjys from HIS_YFFY_MZFYMXB a left join HIS_YFFY_MZFYZB b on a.FYBPKEY=b.pkey and a.JGID=b.JGID left join HIS_YZ_MXB c on a.yzmx=c.pkey and a.JGID=c.JGID left join HIS_YZ_YPYF d on c.YZYF=d.BM and c.JGID=d.JGID left join HIS_JZ_BASEINFO e on b.jzpkey=e.pkey and b.JGID=e.JGID where a.JGID=? and e.jjys like ? and b.FYRQ >=? and b.FYRQ <= ? and b.FYZT=1 and (nvl(a.YZSL,0)-nvl(a.TYSL,0)) > 0 and (d.ISZSGY=1 or d.ISJMGY=1) group by b.JZPKEY,e.jjys order by e.jjys) group by jjys order by jjys
|
|
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="jjys" type="12" />
|
|
<f name="cfje" type="12" />
|
|
<f name="rc" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
|
|
|
|
<dao id="ygyyMzYsyyzhfxKjlywRcAndJeDao" log="true" type="1" memo="阳光用药-门诊医生用药综合分析-抗菌药物门诊人次和金额,是按照使用过抗菌药物的门诊人次dao">
|
|
<sql><![CDATA[
|
|
select jjys,sum(cfje) cfje,count(*) rc from (
|
|
select b.JZPKEY,sum((nvl(a.YZSL,0)-nvl(a.TYSL,0))*a.YZDJ) cfje,c.jjys from HIS_YFFY_MZFYMXB a left join HIS_YFFY_MZFYZB b on a.FYBPKEY=b.pkey and a.JGID=b.JGID left join HIS_YPXX e on a.yzx=e.BM left join HIS_JZ_BASEINFO c on b.jzpkey=c.pkey and b.JGID=c.JGID where a.JGID=? and c.jjys like ? and b.FYRQ >=? and b.FYRQ <= ? and b.FYZT=1 and (nvl(a.YZSL,0)-nvl(a.TYSL,0)) > 0 and (e.GZFL='KSS1' or e.GZFL='KZL1' or e.GZFL='KSS2') group by b.JZPKEY,c.jjys order by c.jjys) group by jjys order by jjys
|
|
]]></sql>
|
|
<fields>
|
|
<f name="jjys" type="12" />
|
|
<f name="cfje" type="12" />
|
|
<f name="rc" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
<dao id="ygyyMzYsyyzhfxKjywCfzsAndJeDao" log="true" type="1" memo="阳光用药-门诊医生用药综合分析-抗菌药物处方张数、处方金额,是按照以药房发药的为标准,部分退药的处方,不减处方张数,会减掉处方金额dao">
|
|
<sql><![CDATA[
|
|
select jjys,sum(cfje) cfje,count(*) cfs from (select b.cfh,sum((nvl(a.YZSL,0)-nvl(a.TYSL,0))*a.YZDJ) cfje,c.jjys from HIS_YFFY_MZFYMXB a left join HIS_YFFY_MZFYZB b on a.FYBPKEY=b.pkey and a.JGID=b.JGID left join HIS_YPXX e on a.yzx=e.BM left join HIS_JZ_BASEINFO c on b.jzpkey=c.pkey and b.JGID=c.JGID where a.JGID=? and c.jjys like ? and b.FYRQ>=? and b.FYRQ<=? and b.FYZT=1 and (nvl(a.YZSL,0)-nvl(a.TYSL,0)) > 0 and (e.GZFL='KSS1' or e.GZFL='KZL1' or e.GZFL='KSS2') group by b.cfh,c.jjys order by c.jjys) group by jjys order by jjys
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="jjys" type="12" />
|
|
<f name="cfje" type="12" />
|
|
<f name="cfs" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
|
|
<dao id="ygyyMzYsyyzhfxKjywYpzsDao" log="true" type="1" memo="阳光用药-门诊医生用药综合分析-抗菌药物药品种数,是按照每张处方药品品种数累加dao">
|
|
<sql><![CDATA[
|
|
select count(*) ypzs,jjys from (select count(*) yps,c.jjys,a.yzx from HIS_YFFY_MZFYMXB a left join HIS_YFFY_MZFYZB b on a.FYBPKEY=b.pkey and a.JGID=b.JGID left join HIS_YPXX e on a.yzx=e.BM left join HIS_JZ_BASEINFO c on b.jzpkey=c.pkey and b.JGID=c.JGID where a.JGID=? and c.jjys like ? and b.FYRQ>=? and b.FYRQ<=? and b.FYZT=1 and (nvl(a.YZSL,0)-nvl(a.TYSL,0)) > 0 and (e.GZFL='KSS1' or e.GZFL='KZL1' or e.GZFL='KSS2') group by c.jjys,a.yzx order by c.jjys) group by jjys order by jjys
|
|
]]></sql>
|
|
<fields>
|
|
<f name="ypzs" type="12" />
|
|
<f name="jjys" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
|
|
<dao id="ygyyMzYsyyzhfxKjywYytsDao" log="true" type="1" memo="阳光用药-门诊医生用药综合分析-抗菌药物处方用药天数,是按照每张处方最大用药天数之和dao">
|
|
<sql><![CDATA[
|
|
select jjys,sum(maxts) yyts from (select jjys,cfh,max(nvl(yzts,0)) maxts from (select d.jjys,b.cfh,a.yzx,c.yzts from HIS_YFFY_MZFYMXB a left join HIS_YFFY_MZFYZB b on a.FYBPKEY=b.pkey and a.JGID=b.JGID left join HIS_YZ_MXB c on a.yzmx=c.pkey and a.JGID=c.JGID left join HIS_YPXX e on a.yzx=e.BM left join HIS_JZ_BASEINFO d on b.jzpkey=d.pkey and b.JGID=d.JGID where a.JGID=? and d.jjys like ? and b.FYRQ>=? and b.FYRQ<=? and b.FYZT=1 and (nvl(a.YZSL,0)-nvl(a.TYSL,0)) > 0 and (e.GZFL='KSS1' or e.GZFL='KZL1' or e.GZFL='KSS2')) group by jjys,cfh order by jjys,cfh) group by jjys order by jjys
|
|
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="jjys" type="12" />
|
|
<f name="yyts" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
|
|
<dao id="ygyyMzYsyyzhfxZsyyCfzsAndjeDao" log="true" type="1" memo="阳光用药-门诊医生用药综合分析-注射用药处方张数、处方金额,是按照以药房发药的为标准,部分退药的处方,不减处方张数,会减掉处方金额dao">
|
|
<sql><![CDATA[
|
|
select jjys,sum(cfje) cfje,count(*) cfs from (select b.cfh,sum((nvl(a.YZSL,0)-nvl(a.TYSL,0))*a.YZDJ) cfje,e.jjys from HIS_YFFY_MZFYMXB a left join HIS_YFFY_MZFYZB b on a.FYBPKEY=b.pkey and a.JGID=b.JGID left join HIS_YZ_MXB c on a.yzmx=c.pkey and a.JGID=c.JGID left join HIS_YZ_YPYF d on c.YZYF=d.BM and c.JGID=d.JGID left join HIS_JZ_BASEINFO e on b.jzpkey=e.pkey and b.JGID=e.JGID where a.JGID=? and e.jjys like ? and b.FYRQ>=? and b.FYRQ<=? and b.FYZT=1 and (nvl(a.YZSL,0)-nvl(a.TYSL,0)) > 0 and (d.ISZSGY=1 or d.ISJMGY=1) group by b.cfh,e.jjys order by e.jjys) group by jjys order by jjys
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="jjys" type="12" />
|
|
<f name="cfje" type="12" />
|
|
<f name="cfs" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
|
|
<dao id="ygyyMzYsyyzhfxKjywZsgyRcAndJeDao" log="true" type="1" memo="阳光用药-门诊医生用药综合分析-抗菌类注射给药人次和金额,是按照是使用过注射抗菌药物的门诊人次dao">
|
|
<sql><![CDATA[
|
|
select jjys,sum(cfje) cfje,count(*) rc from (
|
|
select b.JZPKEY,sum((nvl(a.YZSL,0)-nvl(a.TYSL,0))*a.YZDJ) cfje,f.jjys from HIS_YFFY_MZFYMXB a left join HIS_YFFY_MZFYZB b on a.FYBPKEY=b.pkey and a.JGID=b.JGID left join HIS_YZ_MXB c on a.yzmx=c.pkey and a.JGID=c.JGID left join HIS_YZ_YPYF d on c.YZYF=d.BM and c.JGID=d.JGID left join HIS_YPXX e on a.yzx=e.BM left join HIS_JZ_BASEINFO f on b.jzpkey=f.pkey and b.JGID=f.JGID where a.JGID=? and f.jjys like ? and b.FYRQ >=? and b.FYRQ <= ? and b.FYZT=1 and (nvl(a.YZSL,0)-nvl(a.TYSL,0)) > 0 and (d.ISZSGY=1 or d.ISJMGY=1) and (e.GZFL='KSS1' or e.GZFL='KZL1' or e.GZFL='KSS2') group by b.JZPKEY,f.jjys order by f.jjys) group by jjys order by jjys
|
|
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="jjys" type="12" />
|
|
<f name="cfje" type="12" />
|
|
<f name="rc" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
|
|
<dao id="ygyyMzYsyyzhfxKjywJmgyRcAndJeDao" log="true" type="1" memo="阳光用药-门诊医生用药综合分析-抗菌类静脉给药人次和金额,是按照是使用过静脉抗菌药物的门诊人次dao">
|
|
<sql><![CDATA[
|
|
select jjys,sum(cfje) cfje,count(*) rc from (
|
|
select b.JZPKEY,sum((nvl(a.YZSL,0)-nvl(a.TYSL,0))*a.YZDJ) cfje,f.jjys from HIS_YFFY_MZFYMXB a left join HIS_YFFY_MZFYZB b on a.FYBPKEY=b.pkey and a.JGID=b.JGID left join HIS_YZ_MXB c on a.yzmx=c.pkey and a.JGID=c.JGID left join HIS_YZ_YPYF d on c.YZYF=d.BM and c.JGID=d.JGID left join HIS_YPXX e on a.yzx=e.BM left join HIS_JZ_BASEINFO f on b.jzpkey=f.pkey and b.JGID=f.JGID where a.JGID=? and f.jjys like ? and b.FYRQ >=? and b.FYRQ <= ? and b.FYZT=1 and (nvl(a.YZSL,0)-nvl(a.TYSL,0)) > 0 and d.ISJMGY=1 and (e.GZFL='KSS1' or e.GZFL='KZL1' or e.GZFL='KSS2') group by b.JZPKEY,f.jjys order by f.jjys) group by jjys order by jjys
|
|
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="jjys" type="12" />
|
|
<f name="cfje" type="12" />
|
|
<f name="rc" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
<dao id="ygyyMzYsyyzhfxZcyCfzsAndJeDao" log="true" type="1" memo="阳光用药-门诊医生用药综合分析-中草药处方张数、处方金额,是按照以药房发药的为标准,部分退药的处方,不减处方张数,会减掉处方金额dao">
|
|
<sql><![CDATA[
|
|
select jjys,sum(cfje) cfje,count(*) cfs from (select b.cfh,sum((nvl(a.YZSL,0)-nvl(a.TYSL,0))*a.YZDJ) cfje,f.jjys from HIS_YFFY_MZFYMXB a left join HIS_YFFY_MZFYZB b on a.FYBPKEY=b.pkey and a.JGID=b.JGID left join HIS_YZ_MXB c on a.yzmx=c.pkey and a.JGID=c.JGID left join HIS_JZ_BASEINFO f on b.jzpkey=f.pkey and b.JGID=f.JGID where a.JGID=? and f.jjys like ? and b.FYRQ>=? and b.FYRQ<=? and b.FYZT=1 and c.YZLB='03' and (nvl(a.YZSL,0)-nvl(a.TYSL,0)) > 0 group by b.cfh,f.jjys order by f.jjys) group by jjys order by jjys
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="jjys" type="12" />
|
|
<f name="cfje" type="12" />
|
|
<f name="cfs" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
|
|
<dao id="ygyymzypfyfzbDao" log="true" type="1">
|
|
<sql><![CDATA[
|
|
select b.yzxpkey,b.yzmc,c.gg,a.YZSL,a.TYSL,f.ZHXS,c.JBDW,f.RKDW,d.JJYS,d.JJKS,f.FYZL,e.jbdj,b.YPYZJBJG,f.dwview,e.YXQ,e.PH,c.ZCZH,c.CSXX,rkd.GYS from HIS_YFFY_MZFYMXB a left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_YPXX c on a.YZX=c.BM left join HIS_JZ_BASEINFO d on a.JZPKEY=d.pkey and a.JGID=d.JGID left join HIS_KSKC_PC e on a.KSKCPCPKEY=e.pkey and a.JGID=e.JGID left join HIS_SFX f on a.yzx=f.bm and a.JGID=f.JGID left join HIS_YFFY_MZFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_YFYK_RKD_MX rkmx on e.pkey=rkmx.KSKC_PC_PKEY and e.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID where a.JGID=? #ypbm# and g.FYRQ >=? and g.FYRQ <=? order by d.JJYS
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="YZXPKEY" type="12" />
|
|
<f name="YZMC" type="12" />
|
|
<f name="GG" type="12" />
|
|
<f name="YZSL" type="12" />
|
|
<f name="TYSL" type="12" />
|
|
<f name="ZHXS" type="12" />
|
|
<f name="JBDW" type="12" />
|
|
<f name="RKDW" type="12" />
|
|
<f name="JJYS" type="12" />
|
|
<f name="JJKS" type="12" />
|
|
<f name="FYZL" type="12" />
|
|
<f name="JBDJ" type="8" />
|
|
<f name="YPYZJBJG" type="12" />
|
|
<f name="DWVIEW" type="12" />
|
|
<f name="YXQ" type="93" />
|
|
<f name="PH" type="12" />
|
|
<f name="ZCZH" type="12" />
|
|
<f name="CSXX" type="12" />
|
|
<f name="GYS" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
<dao id="ygyyzyypfyfzbDao" log="true" type="1">
|
|
<sql><![CDATA[
|
|
|
|
|
|
|
|
select b.yzxpkey,b.yzmc,c.gg,a.YZSL,a.TYSL,f.ZHXS,c.JBDW,f.RKDW,d.JJYS,d.JJKS,f.FYZL,e.jbdj,b.YPYZJBJG,f.dwview,e.YXQ,e.PH,c.ZCZH,c.CSXX,rkd.GYS from HIS_YFFY_ZYFYMXB a left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_YPXX c on a.YZXPKEY=c.BM left join HIS_JZ_BASEINFO d on a.JZPKEY=d.pkey and a.JGID=d.JGID left join HIS_KSKC_PC e on a.KSKCPCPKEY=e.pkey and a.JGID=e.JGID left join HIS_SFX f on a.yzxpkey=f.bm and a.JGID=f.JGID left join HIS_YFFY_ZYFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_YFYK_RKD_MX rkmx on e.pkey=rkmx.KSKC_PC_PKEY and e.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID where a.JGID=? #ypbm# and g.FYTIME >=? and g.FYTIME <=? order by d.JJYS
|
|
]]></sql>
|
|
<fields>
|
|
<f name="YZXPKEY" type="12" />
|
|
<f name="YZMC" type="12" />
|
|
<f name="GG" type="12" />
|
|
<f name="YZSL" type="12" />
|
|
<f name="TYSL" type="12" />
|
|
<f name="ZHXS" type="12" />
|
|
<f name="JBDW" type="12" />
|
|
<f name="RKDW" type="12" />
|
|
<f name="JJYS" type="12" />
|
|
<f name="JJKS" type="12" />
|
|
<f name="FYZL" type="12" />
|
|
<f name="JBDJ" type="8" />
|
|
<f name="YPYZJBJG" type="12" />
|
|
<f name="DWVIEW" type="12" />
|
|
<f name="YXQ" type="93" />
|
|
<f name="PH" type="12" />
|
|
<f name="ZCZH" type="12" />
|
|
<f name="CSXX" type="12" />
|
|
<f name="GYS" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
|
|
<dao id="ygyyallypfyfzbDao" log="true" type="1">
|
|
<sql><![CDATA[
|
|
|
|
|
|
SELECT yzxpkey,yzmc,gg,YZSL,TYSL,ZHXS,JBDW,RKDW,JJYS,JJKS,FYZL,jbdj,YPYZJBJG,dwview,FYRQ,YXQ,PH,ZCZH,CSXX,GYS FROM
|
|
(
|
|
select b.yzxpkey,b.yzmc,c.gg,a.YZSL,a.TYSL,f.ZHXS,c.JBDW,f.RKDW,d.JJYS,d.JJKS,f.FYZL,e.jbdj,b.YPYZJBJG,f.dwview,g.FYRQ,e.YXQ,e.PH,c.ZCZH,c.CSXX,rkd.GYS from HIS_YFFY_MZFYMXB a left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_YPXX c on a.YZX=c.BM left join HIS_JZ_BASEINFO d on a.JZPKEY=d.pkey and a.JGID=d.JGID left join HIS_KSKC_PC e on a.KSKCPCPKEY=e.pkey and a.JGID=e.JGID left join HIS_SFX f on a.yzx=f.bm and a.JGID=f.JGID left join HIS_YFFY_MZFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_YFYK_RKD_MX rkmx on e.pkey=rkmx.KSKC_PC_PKEY and e.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID where a.JGID=? #ypbm# and g.FYRQ >=? and g.FYRQ <=?
|
|
|
|
|
|
union all
|
|
|
|
select b.yzxpkey,b.yzmc,c.gg,a.YZSL,a.TYSL,f.ZHXS,c.JBDW,f.RKDW,d.JJYS,d.JJKS,f.FYZL,e.jbdj,b.YPYZJBJG,f.dwview,g.FYTIME FYRQ,e.YXQ,e.PH,c.ZCZH,c.CSXX,rkd.GYS from HIS_YFFY_ZYFYMXB a left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_YPXX c on a.YZXPKEY=c.BM left join HIS_JZ_BASEINFO d on a.JZPKEY=d.pkey and a.JGID=d.JGID left join HIS_KSKC_PC e on a.KSKCPCPKEY=e.pkey and a.JGID=e.JGID left join HIS_SFX f on a.yzxpkey=f.bm and a.JGID=f.JGID left join HIS_YFFY_ZYFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_YFYK_RKD_MX rkmx on e.pkey=rkmx.KSKC_PC_PKEY and e.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID where a.JGID=? #ypbm# and g.FYTIME >=? and g.FYTIME <=?
|
|
|
|
) ORDER BY JJYS
|
|
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="YZXPKEY" type="12" />
|
|
<f name="YZMC" type="12" />
|
|
<f name="GG" type="12" />
|
|
<f name="YZSL" type="12" />
|
|
<f name="TYSL" type="12" />
|
|
<f name="ZHXS" type="12" />
|
|
<f name="JBDW" type="12" />
|
|
<f name="RKDW" type="12" />
|
|
<f name="JJYS" type="12" />
|
|
<f name="JJKS" type="12" />
|
|
<f name="FYZL" type="12" />
|
|
<f name="JBDJ" type="8" />
|
|
<f name="YPYZJBJG" type="12" />
|
|
<f name="DWVIEW" type="12" />
|
|
<f name="FYRQ" type="93" />
|
|
<f name="YXQ" type="93" />
|
|
<f name="PH" type="12" />
|
|
<f name="ZCZH" type="12" />
|
|
<f name="CSXX" type="12" />
|
|
<f name="GYS" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
<dao id="ygyyypxstjbymx" type="1">
|
|
<sql>
|
|
select '' 编码, '' 药品名称, '' 规格, '' 单位数量,'' 单位, '' 成本单价, '' 成本金额, '' 零售单价 ,'' 零售金额, '' 单价差额, '' 总金额差, '' 医生,'' 科室, '' 费用类别,'' 有效期,'' 批次,'' 批准文号,'' 生产厂家,'' 供应商,'' 发药主键,'' 医嘱,'' 发票,'' 收费日期, '' 发药日期, '' 退药数量,'' 患者姓名,'' 性别,'' 就诊年龄,'' 诊断,'' 下嘱时间,'' 用法,'' 用量,'' 处方号 from dual where 1=2
|
|
|
|
</sql>
|
|
<fields>
|
|
<f name="编码" type="1" />
|
|
<f name="药品名称" type="1" />
|
|
<f name="规格" type="1" />
|
|
<f name="单位数量" type="1" />
|
|
<f name="单位" type="1" />
|
|
<f name="成本单价" type="1" />
|
|
<f name="成本金额" type="1" />
|
|
<f name="零售单价" type="1" />
|
|
<f name="零售金额" type="1" />
|
|
<f name="单价差额" type="1" />
|
|
<f name="总金额差" type="1" />
|
|
<f name="医生" type="1" />
|
|
<f name="科室" type="1" />
|
|
<f name="费用类别" type="1" />
|
|
<f name="有效期" type="1" />
|
|
<f name="批次" type="1" />
|
|
<f name="批准文号" type="1" />
|
|
<f name="生产厂家" type="1" />
|
|
<f name="供应商" type="1" />
|
|
<f name="发药主键" type="1" />
|
|
<f name="医嘱" type="1" />
|
|
<f name="发票" type="1" />
|
|
<f name="收费日期" type="1" />
|
|
<f name="发药日期" type="1" />
|
|
<f name="退药数量" type="1" />
|
|
<f name="患者姓名" type="1" />
|
|
<f name="性别" type="1" />
|
|
<f name="就诊年龄" type="1" />
|
|
<f name="诊断" type="1" />
|
|
<f name="下嘱时间" type="1" />
|
|
<f name="用法" type="1" />
|
|
<f name="用量" type="1" />
|
|
<f name="处方号" type="1" />
|
|
</fields>
|
|
</dao>
|
|
|
|
<!-- <dao id="ygyyypxstjbyhz" type="1">-->
|
|
<!-- <sql>-->
|
|
<!-- select '' 编码, '' 药品名称, '' 规格, '' 单位数量,'' 单位, '' 成本单价, '' 成本金额, '' 零售单价 ,'' 零售金额, '' 单价差额, '' 总金额差, '' 组织结构,'' 费用类别 from dual where 1=2-->
|
|
<!-- -->
|
|
<!-- </sql>-->
|
|
<!-- <fields>-->
|
|
<!-- <f name="编码" type="1" />-->
|
|
<!-- <f name="药品名称" type="1" />-->
|
|
<!-- <f name="规格" type="1" />-->
|
|
<!-- <f name="单位数量" type="1" />-->
|
|
<!-- <f name="单位" type="1" />-->
|
|
<!-- <f name="成本单价" type="1" />-->
|
|
<!-- <f name="成本金额" type="1" />-->
|
|
<!-- <f name="零售单价" type="1" />-->
|
|
<!-- <f name="零售金额" type="1" />-->
|
|
<!-- <f name="单价差额" type="1" />-->
|
|
<!-- <f name="总金额差" type="1" />-->
|
|
<!-- <f name="组织结构" type="1" />-->
|
|
<!-- <f name="费用类别" type="1" />-->
|
|
<!-- </fields>-->
|
|
<!-- </dao> -->
|
|
|
|
<dao id="ygyyypxstjbyhz" type="1">
|
|
<sql>
|
|
select '' 编码, '' 药品名称, '' 规格, '' 单位数量,'' 单位,'' 成本金额, '' 零售金额, '' 总金额差, '' 组织结构,'' 费用类别,'' 有效期,'' 批次,'' 批准文号,'' 生产厂家,'' 供应商,'' 退药数量 from dual where 1=2
|
|
|
|
</sql>
|
|
<fields>
|
|
<f name="编码" type="1" />
|
|
<f name="药品名称" type="1" />
|
|
<f name="规格" type="1" />
|
|
<f name="单位数量" type="1" />
|
|
<f name="单位" type="1" />
|
|
<f name="成本金额" type="1" />
|
|
<f name="零售金额" type="1" />
|
|
<f name="总金额差" type="1" />
|
|
<f name="组织结构" type="1" />
|
|
<f name="费用类别" type="1" />
|
|
<f name="有效期" type="1" />
|
|
<f name="批次" type="1" />
|
|
<f name="批准文号" type="1" />
|
|
<f name="生产厂家" type="1" />
|
|
<f name="供应商" type="1" />
|
|
<f name="退药数量" type="1" />
|
|
</fields>
|
|
</dao>
|
|
<dao id="ygyyallyphzbyJjysDao" log="true" type="1">
|
|
<sql><![CDATA[
|
|
|
|
SELECT yzxpkey,yzmc,gg,sum(fysl) fysl,sum(CBJE) cbje,sum(XSJE) xsje,ZHXS,JBDW,RKDW,JJYS,FYZL,dwview,YXQ,PH,ZCZH,CSXX,GYS FROM
|
|
(
|
|
select b.yzxpkey,b.yzmc,c.gg,a.yzsl,a.tysl,(nvl(a.YZSL,0)-nvl(a.TYSL,0)) fysl,(nvl(a.YZSL,0)-nvl(a.TYSL,0))*e.jbdj cbje,(nvl(a.YZSL,0)-nvl(a.TYSL,0))* b.YPYZJBJG xsje, f.ZHXS,c.JBDW,f.RKDW,d.JJYS,f.FYZL,f.dwview,e.YXQ,e.PH,c.ZCZH,c.CSXX,rkd.GYS from HIS_YFFY_MZFYMXB a left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_YPXX c on a.YZX=c.BM left join HIS_JZ_BASEINFO d on a.JZPKEY=d.pkey and a.JGID=d.JGID left join HIS_KSKC_PC e on a.KSKCPCPKEY=e.pkey and a.JGID=e.JGID left join HIS_SFX f on a.yzx=f.bm and a.JGID=f.JGID left join HIS_YFFY_MZFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_YFYK_RKD_MX rkmx on e.pkey=rkmx.KSKC_PC_PKEY and e.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID where a.JGID=? #ypbm# and g.FYRQ >=? and g.FYRQ <=?
|
|
|
|
|
|
union all
|
|
|
|
select b.yzxpkey,b.yzmc,c.gg,a.yzsl,a.tysl,(nvl(a.YZSL,0)-nvl(a.TYSL,0)) fysl,(nvl(a.YZSL,0)-nvl(a.TYSL,0))*e.jbdj cbje,(nvl(a.YZSL,0)-nvl(a.TYSL,0))* b.YPYZJBJG xsje,f.ZHXS,c.JBDW,f.RKDW,d.JJYS,f.FYZL,f.dwview,e.YXQ,e.PH,c.ZCZH,c.CSXX,rkd.GYS from HIS_YFFY_ZYFYMXB a left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_YPXX c on a.YZXPKEY=c.BM left join HIS_JZ_BASEINFO d on a.JZPKEY=d.pkey and a.JGID=d.JGID left join HIS_KSKC_PC e on a.KSKCPCPKEY=e.pkey and a.JGID=e.JGID left join HIS_SFX f on a.yzxpkey=f.bm and a.JGID=f.JGID left join HIS_YFFY_ZYFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_YFYK_RKD_MX rkmx on e.pkey=rkmx.KSKC_PC_PKEY and e.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID where a.JGID=? #ypbm# and g.FYTIME >=? and g.FYTIME <=?
|
|
|
|
) group by yzxpkey,yzmc,gg,ZHXS,JBDW,RKDW,JJYS,FYZL,dwview,yxq,ph,ZCZH,CSXX,GYS ORDER BY JJYS
|
|
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="YZXPKEY" type="12" />
|
|
<f name="YZMC" type="12" />
|
|
<f name="GG" type="12" />
|
|
<f name="FYSL" type="4" />
|
|
<f name="CBJE" type="4" />
|
|
<f name="XSJE" type="4" />
|
|
<f name="ZHXS" type="8" />
|
|
<f name="JBDW" type="12" />
|
|
<f name="RKDW" type="12" />
|
|
<f name="JJYS" type="12" />
|
|
<f name="FYZL" type="12" />
|
|
<f name="DWVIEW" type="12" />
|
|
<f name="YXQ" type="93" />
|
|
<f name="PH" type="12" />
|
|
<f name="ZCZH" type="12" />
|
|
<f name="CSXX" type="12" />
|
|
<f name="GYS" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
<dao id="ygyyzyyphzbyJjysDao" log="true" type="1">
|
|
<sql><![CDATA[
|
|
|
|
SELECT yzxpkey,yzmc,gg,sum(fysl) fysl,sum(CBJE) cbje,sum(XSJE) xsje,ZHXS,JBDW,RKDW,JJYS,FYZL,dwview,YXQ,PH,ZCZH,CSXX,GYS FROM
|
|
(
|
|
|
|
|
|
select b.yzxpkey,b.yzmc,c.gg,a.yzsl,a.tysl,(nvl(a.YZSL,0)-nvl(a.TYSL,0)) fysl,(nvl(a.YZSL,0)-nvl(a.TYSL,0))*e.jbdj cbje,(nvl(a.YZSL,0)-nvl(a.TYSL,0))* b.YPYZJBJG xsje,f.ZHXS,c.JBDW,f.RKDW,d.JJYS,f.FYZL,f.dwview,e.YXQ,e.PH,c.ZCZH,c.CSXX,rkd.GYS from HIS_YFFY_ZYFYMXB a left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_YPXX c on a.YZXPKEY=c.BM left join HIS_JZ_BASEINFO d on a.JZPKEY=d.pkey and a.JGID=d.JGID left join HIS_KSKC_PC e on a.KSKCPCPKEY=e.pkey and a.JGID=e.JGID left join HIS_SFX f on a.yzxpkey=f.bm and a.JGID=f.JGID left join HIS_YFFY_ZYFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_YFYK_RKD_MX rkmx on e.pkey=rkmx.KSKC_PC_PKEY and e.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID where a.JGID=? #ypbm# and g.FYTIME >=? and g.FYTIME <=?
|
|
|
|
) group by yzxpkey,yzmc,gg,ZHXS,JBDW,RKDW,JJYS,FYZL,dwview,yxq,ph,ZCZH,CSXX,GYS ORDER BY JJYS
|
|
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="YZXPKEY" type="12" />
|
|
<f name="YZMC" type="12" />
|
|
<f name="GG" type="12" />
|
|
<f name="FYSL" type="4" />
|
|
<f name="CBJE" type="4" />
|
|
<f name="XSJE" type="4" />
|
|
<f name="ZHXS" type="8" />
|
|
<f name="JBDW" type="12" />
|
|
<f name="RKDW" type="12" />
|
|
<f name="JJYS" type="12" />
|
|
<f name="FYZL" type="12" />
|
|
<f name="DWVIEW" type="12" />
|
|
<f name="YXQ" type="93" />
|
|
<f name="PH" type="12" />
|
|
<f name="ZCZH" type="12" />
|
|
<f name="CSXX" type="12" />
|
|
<f name="GYS" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
<dao id="ygyyMzyphzbyJjysDao" log="true" type="1">
|
|
<sql><![CDATA[
|
|
|
|
SELECT yzxpkey,yzmc,gg,sum(fysl) fysl,sum(CBJE) cbje,sum(XSJE) xsje,ZHXS,JBDW,RKDW,JJYS,FYZL,dwview,YXQ,PH,ZCZH,CSXX,GYS FROM
|
|
(
|
|
select b.yzxpkey,b.yzmc,c.gg,a.yzsl,a.tysl,(nvl(a.YZSL,0)-nvl(a.TYSL,0)) fysl,(nvl(a.YZSL,0)-nvl(a.TYSL,0))*e.jbdj cbje,(nvl(a.YZSL,0)-nvl(a.TYSL,0))* b.YPYZJBJG xsje, f.ZHXS,c.JBDW,f.RKDW,d.JJYS,f.FYZL,f.dwview,e.YXQ,e.PH,c.ZCZH,c.CSXX,rkd.GYS from HIS_YFFY_MZFYMXB a left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_YPXX c on a.YZX=c.BM left join HIS_JZ_BASEINFO d on a.JZPKEY=d.pkey and a.JGID=d.JGID left join HIS_KSKC_PC e on a.KSKCPCPKEY=e.pkey and a.JGID=e.JGID left join HIS_SFX f on a.yzx=f.bm and a.JGID=f.JGID left join HIS_YFFY_MZFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_YFYK_RKD_MX rkmx on e.pkey=rkmx.KSKC_PC_PKEY and e.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID where a.JGID=? #ypbm# and g.FYRQ >=? and g.FYRQ <=?
|
|
|
|
|
|
) group by yzxpkey,yzmc,gg,ZHXS,JBDW,RKDW,JJYS,FYZL,dwview,YXQ,PH,ZCZH,CSXX,GYS ORDER BY JJYS
|
|
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="YZXPKEY" type="12" />
|
|
<f name="YZMC" type="12" />
|
|
<f name="GG" type="12" />
|
|
<f name="FYSL" type="4" />
|
|
<f name="CBJE" type="4" />
|
|
<f name="XSJE" type="4" />
|
|
<f name="ZHXS" type="8" />
|
|
<f name="JBDW" type="12" />
|
|
<f name="RKDW" type="12" />
|
|
<f name="JJYS" type="12" />
|
|
<f name="FYZL" type="12" />
|
|
<f name="DWVIEW" type="12" />
|
|
<f name="YXQ" type="93" />
|
|
<f name="PH" type="12" />
|
|
<f name="ZCZH" type="12" />
|
|
<f name="CSXX" type="12" />
|
|
<f name="GYS" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
|
|
<dao id="ygyyallyphzbyJjksDao" log="true" type="1">
|
|
<sql><![CDATA[
|
|
|
|
SELECT yzxpkey,yzmc,gg,sum(fysl) fysl,sum(CBJE) cbje,sum(XSJE) xsje,ZHXS,JBDW,RKDW,JJKS,FYZL,dwview,YXQ,PH,ZCZH,CSXX,GYS FROM
|
|
(
|
|
select b.yzxpkey,b.yzmc,c.gg,a.yzsl,a.tysl,(nvl(a.YZSL,0)-nvl(a.TYSL,0)) fysl,(nvl(a.YZSL,0)-nvl(a.TYSL,0))*e.jbdj cbje,(nvl(a.YZSL,0)-nvl(a.TYSL,0))* b.YPYZJBJG xsje, f.ZHXS,c.JBDW,f.RKDW,d.JJKS,f.FYZL,f.dwview,e.YXQ,e.PH,c.ZCZH,c.CSXX,rkd.GYS from HIS_YFFY_MZFYMXB a left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_YPXX c on a.YZX=c.BM left join HIS_JZ_BASEINFO d on a.JZPKEY=d.pkey and a.JGID=d.JGID left join HIS_KSKC_PC e on a.KSKCPCPKEY=e.pkey and a.JGID=e.JGID left join HIS_SFX f on a.yzx=f.bm and a.JGID=f.JGID left join HIS_YFFY_MZFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_YFYK_RKD_MX rkmx on e.pkey=rkmx.KSKC_PC_PKEY and e.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID where a.JGID=? #ypbm# and g.FYRQ >=? and g.FYRQ <=?
|
|
|
|
|
|
union all
|
|
|
|
select b.yzxpkey,b.yzmc,c.gg,a.yzsl,a.tysl,(nvl(a.YZSL,0)-nvl(a.TYSL,0)) fysl,(nvl(a.YZSL,0)-nvl(a.TYSL,0))*e.jbdj cbje,(nvl(a.YZSL,0)-nvl(a.TYSL,0))* b.YPYZJBJG xsje,f.ZHXS,c.JBDW,f.RKDW,d.JJKS,f.FYZL,f.dwview,e.YXQ,e.PH,c.ZCZH,c.CSXX,rkd.GYS from HIS_YFFY_ZYFYMXB a left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_YPXX c on a.YZXPKEY=c.BM left join HIS_JZ_BASEINFO d on a.JZPKEY=d.pkey and a.JGID=d.JGID left join HIS_KSKC_PC e on a.KSKCPCPKEY=e.pkey and a.JGID=e.JGID left join HIS_SFX f on a.yzxpkey=f.bm and a.JGID=f.JGID left join HIS_YFFY_ZYFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_YFYK_RKD_MX rkmx on e.pkey=rkmx.KSKC_PC_PKEY and e.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID where a.JGID=? #ypbm# and g.FYTIME >=? and g.FYTIME <=?
|
|
|
|
) group by yzxpkey,yzmc,gg,ZHXS,JBDW,RKDW,JJKS,FYZL,dwview,YXQ,PH,ZCZH,CSXX,GYS ORDER BY JJKS
|
|
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="YZXPKEY" type="12" />
|
|
<f name="YZMC" type="12" />
|
|
<f name="GG" type="12" />
|
|
<f name="FYSL" type="4" />
|
|
<f name="CBJE" type="4" />
|
|
<f name="XSJE" type="4" />
|
|
<f name="ZHXS" type="8" />
|
|
<f name="JBDW" type="12" />
|
|
<f name="RKDW" type="12" />
|
|
<f name="JJKS" type="12" />
|
|
<f name="FYZL" type="12" />
|
|
<f name="DWVIEW" type="12" />
|
|
<f name="YXQ" type="93" />
|
|
<f name="PH" type="12" />
|
|
<f name="ZCZH" type="12" />
|
|
<f name="CSXX" type="12" />
|
|
<f name="GYS" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
<dao id="ygyyzyyphzbyJjksDao" log="true" type="1">
|
|
<sql><![CDATA[
|
|
|
|
SELECT yzxpkey,yzmc,gg,sum(fysl) fysl,sum(CBJE) cbje,sum(XSJE) xsje,ZHXS,JBDW,RKDW,JJKS,FYZL,dwview,YXQ,PH,ZCZH,CSXX,GYS FROM
|
|
(
|
|
|
|
|
|
select b.yzxpkey,b.yzmc,c.gg,a.yzsl,a.tysl,(nvl(a.YZSL,0)-nvl(a.TYSL,0)) fysl,(nvl(a.YZSL,0)-nvl(a.TYSL,0))*e.jbdj cbje,(nvl(a.YZSL,0)-nvl(a.TYSL,0))* b.YPYZJBJG xsje,f.ZHXS,c.JBDW,f.RKDW,d.JJKS,f.FYZL,f.dwview,e.YXQ,e.PH,c.ZCZH,c.CSXX,rkd.GYS from HIS_YFFY_ZYFYMXB a left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_YPXX c on a.YZXPKEY=c.BM left join HIS_JZ_BASEINFO d on a.JZPKEY=d.pkey and a.JGID=d.JGID left join HIS_KSKC_PC e on a.KSKCPCPKEY=e.pkey and a.JGID=e.JGID left join HIS_SFX f on a.yzxpkey=f.bm and a.JGID=f.JGID left join HIS_YFFY_ZYFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_YFYK_RKD_MX rkmx on e.pkey=rkmx.KSKC_PC_PKEY and e.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID where a.JGID=? #ypbm# and g.FYTIME >=? and g.FYTIME <=?
|
|
|
|
) group by yzxpkey,yzmc,gg,ZHXS,JBDW,RKDW,JJKS,FYZL,dwview,YXQ,PH,ZCZH,CSXX,GYS ORDER BY JJKS
|
|
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="YZXPKEY" type="12" />
|
|
<f name="YZMC" type="12" />
|
|
<f name="GG" type="12" />
|
|
<f name="FYSL" type="4" />
|
|
<f name="CBJE" type="4" />
|
|
<f name="XSJE" type="4" />
|
|
<f name="ZHXS" type="8" />
|
|
<f name="JBDW" type="12" />
|
|
<f name="RKDW" type="12" />
|
|
<f name="JJKS" type="12" />
|
|
<f name="FYZL" type="12" />
|
|
<f name="DWVIEW" type="12" />
|
|
<f name="YXQ" type="93" />
|
|
<f name="PH" type="12" />
|
|
<f name="ZCZH" type="12" />
|
|
<f name="CSXX" type="12" />
|
|
<f name="GYS" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
<dao id="ygyyMzyphzbyJjksDao" log="true" type="1">
|
|
<sql><![CDATA[
|
|
|
|
SELECT yzxpkey,yzmc,gg,sum(fysl) fysl,sum(CBJE) cbje,sum(XSJE) xsje,ZHXS,JBDW,RKDW,JJKS,FYZL,dwview,YXQ,PH,ZCZH,CSXX,GYS FROM
|
|
(
|
|
select b.yzxpkey,b.yzmc,c.gg,a.yzsl,a.tysl,(nvl(a.YZSL,0)-nvl(a.TYSL,0)) fysl,(nvl(a.YZSL,0)-nvl(a.TYSL,0))*e.jbdj cbje,(nvl(a.YZSL,0)-nvl(a.TYSL,0))* b.YPYZJBJG xsje, f.ZHXS,c.JBDW,f.RKDW,d.JJKS,f.FYZL,f.dwview,e.YXQ,e.PH,c.ZCZH,c.CSXX,rkd.GYS from HIS_YFFY_MZFYMXB a left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_YPXX c on a.YZX=c.BM left join HIS_JZ_BASEINFO d on a.JZPKEY=d.pkey and a.JGID=d.JGID left join HIS_KSKC_PC e on a.KSKCPCPKEY=e.pkey and a.JGID=e.JGID left join HIS_SFX f on a.yzx=f.bm and a.JGID=f.JGID left join HIS_YFFY_MZFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_YFYK_RKD_MX rkmx on e.pkey=rkmx.KSKC_PC_PKEY and e.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID where a.JGID=? #ypbm# and g.FYRQ >=? and g.FYRQ <=?
|
|
|
|
|
|
) group by yzxpkey,yzmc,gg,ZHXS,JBDW,RKDW,JJKS,FYZL,dwview,YXQ,PH,ZCZH,CSXX,GYS ORDER BY JJKS
|
|
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="YZXPKEY" type="12" />
|
|
<f name="YZMC" type="12" />
|
|
<f name="GG" type="12" />
|
|
<f name="FYSL" type="4" />
|
|
<f name="CBJE" type="4" />
|
|
<f name="XSJE" type="4" />
|
|
<f name="ZHXS" type="8" />
|
|
<f name="JBDW" type="12" />
|
|
<f name="RKDW" type="12" />
|
|
<f name="JJKS" type="12" />
|
|
<f name="FYZL" type="12" />
|
|
<f name="DWVIEW" type="12" />
|
|
<f name="YXQ" type="93" />
|
|
<f name="PH" type="12" />
|
|
<f name="ZCZH" type="12" />
|
|
<f name="CSXX" type="12" />
|
|
<f name="GYS" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
<dao id="ygyycgtjmxDao" type="1" memo="采购统计">
|
|
<sql><![CDATA[
|
|
select a.PKEY,a.JGID,a.DJH,a.DPTID,a.XH,a.SFX_BM,a.KSKC_PC_PKEY,a.PH,a.YXQ,a.DW,a.SL,a.DJ,a.SJ,a.JE,a.SJJE,a.ZK,a.FPHM,a.FPJE,a.PCJG,a.DDMX_PKEY,a.BZ,b.MC,b.JBDW,b.ZHXS,c.CSXX,b.DWVIEW,b.RKDW,a.LOCKFLAG,c.GG
|
|
,'' 零进差价,d.value2 kclz,b.ybbm,b.ybmc,c.ZCZH,rkd.GYS,rkd.ZDRQ,rkd.ZDR from HIS_YFYK_RKD_MX a
|
|
left join HIS_SFX b on a.JGID=b.JGID and a.SFX_BM=b.BM
|
|
left join HIS_YPXX c on c.BM=b.BM
|
|
left join MAIN_JGZDB d on B.kcfl=d.bh and d.jgzdlb_bh='Z00008' and d.JGID=b.JGID
|
|
left join HIS_YFYK_RKD rkd on a.djh=rkd.djh and a.JGID=rkd.JGID
|
|
where a.JGID=? #select# and rkd.SHZT='1' and rkd.ZDRQ >= ? and rkd.ZDRQ <=? order by a.djh,a.pkey
|
|
|
|
]]></sql>
|
|
<tables>
|
|
<table name="HIS_YFYK_RKD_MX" insert="true" update="true" delete="true">
|
|
<primary>PKEY</primary>
|
|
<primary>JGID</primary>
|
|
</table>
|
|
</tables>
|
|
<fields>
|
|
<f name="PKEY" type="12" table="HIS_YFYK_RKD_MX" />
|
|
<f name="JGID" type="12" table="HIS_YFYK_RKD_MX" />
|
|
<f name="DJH" type="12" table="HIS_YFYK_RKD_MX" />
|
|
<f name="DPTID" type="12" table="HIS_YFYK_RKD_MX" />
|
|
<f name="XH" type="-5" table="HIS_YFYK_RKD_MX" />
|
|
<f name="SFX_BM" type="12" table="HIS_YFYK_RKD_MX" />
|
|
<f name="KSKC_PC_PKEY" type="12" table="HIS_YFYK_RKD_MX" />
|
|
<f name="PH" type="12" table="HIS_YFYK_RKD_MX" />
|
|
<f name="YXQ" type="93" table="HIS_YFYK_RKD_MX" />
|
|
<f name="DW" type="12" table="HIS_YFYK_RKD_MX" />
|
|
<f name="SL" type="8" table="HIS_YFYK_RKD_MX" />
|
|
<f name="DJ" type="8" table="HIS_YFYK_RKD_MX" />
|
|
<f name="SJ" type="8" table="HIS_YFYK_RKD_MX" />
|
|
<f name="JE" type="8" table="HIS_YFYK_RKD_MX" />
|
|
<f name="SJJE" type="8" table="HIS_YFYK_RKD_MX" />
|
|
<f name="ZK" type="8" table="HIS_YFYK_RKD_MX" />
|
|
<f name="FPHM" type="12" table="HIS_YFYK_RKD_MX" />
|
|
<f name="FPJE" type="8" table="HIS_YFYK_RKD_MX" />
|
|
<f name="PCJG" type="8" table="HIS_YFYK_RKD_MX" />
|
|
<f name="DDMX_PKEY" type="12" table="HIS_YFYK_RKD_MX" />
|
|
<f name="BZ" type="12" table="HIS_YFYK_RKD_MX" />
|
|
<f name="MC" type="12"/>
|
|
<f name="JBDW" type="12"/>
|
|
<f name="ZHXS" type="8"/>
|
|
<f name="CSXX" type="12"/>
|
|
<f name="DWVIEW" type="12"/>
|
|
<f name="RKDW" type="12"/>
|
|
<f name="LOCKFLAG" type="-5" table="HIS_YFYK_RKD_MX" />
|
|
<f name="GG" type="12"/>
|
|
<f name="零进差价" type="12"/>
|
|
<f name="kclz" type="12"/>
|
|
<f name="YBBM" type="12" />
|
|
<f name="YBMC" type="12" />
|
|
<f name="ZCZH" type="12" />
|
|
<f name="GYS" type="12" />
|
|
<f name="ZDRQ" type="93" />
|
|
<f name="ZDR" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
<dao id="ygyyypcgtjbymx" type="1">
|
|
<sql>
|
|
select '' 科室,'' 采购日期, '' 编码, '' 药品名称, '' 规格, '' 单位数量,'' 包装,'' 进价, '' 进货金额, '' 有效期,'' 批次,'' 批准文号,'' 生产厂家,'' 供应商,'' 单据号,'' 售价, '' 售价金额,'' 差额,'' 入库单位,'' 制单人 from dual where 1=2
|
|
|
|
</sql>
|
|
<fields>
|
|
<f name="科室" type="1" />
|
|
<f name="采购日期" type="1" />
|
|
<f name="编码" type="1" />
|
|
<f name="药品名称" type="1" />
|
|
<f name="规格" type="1" />
|
|
<f name="单位数量" type="1" />
|
|
<f name="包装" type="1" />
|
|
<f name="进价" type="1" />
|
|
<f name="进货金额" type="1" />
|
|
<f name="有效期" type="1" />
|
|
<f name="批次" type="1" />
|
|
<f name="批准文号" type="1" />
|
|
<f name="生产厂家" type="1" />
|
|
<f name="供应商" type="1" />
|
|
<f name="单据号" type="1" />
|
|
<f name="售价" type="1" />
|
|
<f name="售价金额" type="1" />
|
|
<f name="差额" type="1" />
|
|
<f name="入库单位" type="1" />
|
|
<f name="制单人" type="1" />
|
|
</fields>
|
|
</dao>
|
|
|
|
<dao id="ygyyypcgtjbyhz" type="1">
|
|
<sql>
|
|
select '' 编码, '' 药品名称, '' 规格, '' 单位数量,'' 包装,'' 批准文号,'' 生产厂家,'' 供应商,'' 单据号 from dual where 1=2
|
|
|
|
</sql>
|
|
<fields>
|
|
<f name="编码" type="1" />
|
|
<f name="药品名称" type="1" />
|
|
<f name="规格" type="1" />
|
|
<f name="单位数量" type="1" />
|
|
<f name="包装" type="1" />
|
|
<f name="批准文号" type="1" />
|
|
<f name="生产厂家" type="1" />
|
|
<f name="供应商" type="1" />
|
|
<f name="单据号" type="1" />
|
|
</fields>
|
|
</dao>
|
|
|
|
|
|
<dao id="ygyyallyphzbyJjysDaoBySales" log="true" type="1">
|
|
<sql><![CDATA[
|
|
|
|
SELECT yzxpkey,yzmc,gg,sum(SFSL) fysl,sum(STSL) tysl,sum(FYJE) FYJE,sum(TYJE) TYJE,sum(FYJJJE) FYJJJE,sum(TYJJJE) TYJJJE,ZHXS,JBDW,RKDW,JJYS,FYZL,dwview,ZCZH,CSXX,GYS,FYDW FROM
|
|
(
|
|
select distinct a.pkey,b.pkey yzmx,b.yzxpkey,b.yzmc,c.gg,a.YZSL,a.TYSL,f.ZHXS,c.JBDW,f.RKDW,d.JJYS,d.JJKS,f.FYZL,e.jbdj,b.YPYZJBJG,f.dwview,e.YXQ,e.PH,c.ZCZH,c.CSXX,rkd.GYS,g.fyrq,a.SFSL,a.FYDW,a.FYJE,a.TYJE,a.STSL,a.FYJJJE,a.TYJJJE from HIS_YFFY_MZFYMXB a left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_YPXX c on a.YZX=c.BM left join HIS_JZ_BASEINFO d on a.JZPKEY=d.pkey and a.JGID=d.JGID left join HIS_KSKC_PC e on a.KSKCPCPKEY=e.pkey and a.JGID=e.JGID left join HIS_SFX f on a.yzx=f.bm and a.JGID=f.JGID left join HIS_YFFY_MZFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_YFYK_RKD_MX rkmx on e.pkey=rkmx.KSKC_PC_PKEY and e.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID right join HIS_SFZD_YZMXB h on b.pkey=h.yzmx and b.JGID=h.JGID left join HIS_MZJS_MZFPZB fpb on h.ZDZBPKEY=fpb.GLZDBPKEY and h.JGID=fpb.JGID where a.JGID=? #ypbm# and fpb.SFZT != '0' and fpb.pjzt=1 and a.CJRQ >? and a.CJRQ <=?
|
|
|
|
|
|
union all
|
|
|
|
select distinct a.pkey,b.pkey yzmx,b.yzxpkey,b.yzmc,c.gg,a.YZSL,a.TYSL,f.ZHXS,c.JBDW,f.RKDW,d.JJYS,d.JJKS,f.FYZL,e.jbdj,b.YPYZJBJG,f.dwview,e.YXQ,e.PH,c.ZCZH,c.CSXX,rkd.GYS,g.FYTIME fyrq,a.SFSL,a.FYDW,a.FYJE,a.TYJE,a.STSL,a.FYJJJE,a.TYJJJE from HIS_YFFY_ZYFYMXB a left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_YPXX c on a.YZXPKEY=c.BM left join HIS_JZ_BASEINFO d on a.JZPKEY=d.pkey and a.JGID=d.JGID left join HIS_KSKC_PC e on a.KSKCPCPKEY=e.pkey and a.JGID=e.JGID left join HIS_SFX f on a.yzxpkey=f.bm and a.JGID=f.JGID left join HIS_YFFY_ZYFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_YFYK_RKD_MX rkmx on e.pkey=rkmx.KSKC_PC_PKEY and e.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID right join HIS_SFZD_YZMXB h on b.pkey=h.yzmx and b.JGID=h.JGID left join HIS_MZJS_MZFPZB fpb on h.ZDZBPKEY=fpb.GLZDBPKEY and h.JGID=fpb.JGID where a.JGID=? #ypbm# and fpb.SFZT != '0' and fpb.pjzt=1 and a.CJRQ >? and a.CJRQ <=?
|
|
|
|
|
|
) group by yzxpkey,yzmc,gg,ZHXS,JBDW,RKDW,JJYS,FYZL,dwview,ZCZH,CSXX,GYS,FYDW ORDER BY JJYS
|
|
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="YZXPKEY" type="12" />
|
|
<f name="YZMC" type="12" />
|
|
<f name="GG" type="12" />
|
|
<f name="FYSL" type="4" />
|
|
<f name="TYSL" type="4" />
|
|
<f name="FYJE" type="4" />
|
|
<f name="TYJE" type="4" />
|
|
<f name="FYJJJE" type="4" />
|
|
<f name="TYJJJE" type="4" />
|
|
<f name="ZHXS" type="8" />
|
|
<f name="JBDW" type="12" />
|
|
<f name="RKDW" type="12" />
|
|
<f name="JJYS" type="12" />
|
|
<f name="FYZL" type="12" />
|
|
<f name="DWVIEW" type="12" />
|
|
<!-- <f name="YXQ" type="93" />-->
|
|
<!-- <f name="PH" type="12" />-->
|
|
<f name="ZCZH" type="12" />
|
|
<f name="CSXX" type="12" />
|
|
<f name="GYS" type="12" />
|
|
<f name="FYDW" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
<dao id="newygyyallyphzbyJjysDaoBySales" log="true" type="1">
|
|
<sql><![CDATA[
|
|
|
|
SELECT yzxpkey,yzmc,gg,sum(SFSL) fysl,sum(STSL) tysl,sum(FYJE) FYJE,sum(TYJE) TYJE,sum(FYJJJE) FYJJJE,sum(TYJJJE) TYJJJE,ZHXS,JBDW,RKDW,JJYS,FYZL,dwview,ZCZH,CSXX,GYS,FYDW FROM
|
|
(
|
|
select distinct a.pkey,b.pkey yzmx,b.yzxpkey,b.yzmc,c.gg,a.YZSL,a.TYSL,f.ZHXS,c.JBDW,f.RKDW,d.JJYS,d.JJKS,f.FYZL,e.jbdj,b.YPYZJBJG,f.dwview,e.YXQ,e.PH,c.ZCZH,c.CSXX,rkd.GYS,g.fyrq,a.SFSL,a.FYDW,a.FYJE,0 TYJE,'' STSL,a.FYJJJE,0 TYJJJE from HIS_YFFY_MZFYMXB a left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_YPXX c on a.YZX=c.BM left join HIS_JZ_BASEINFO d on a.JZPKEY=d.pkey and a.JGID=d.JGID left join HIS_KSKC_PC e on a.KSKCPCPKEY=e.pkey and a.JGID=e.JGID left join HIS_SFX f on a.yzx=f.bm and a.JGID=f.JGID left join HIS_YFFY_MZFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_YFYK_RKD_MX rkmx on e.pkey=rkmx.KSKC_PC_PKEY and e.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID where a.JGID=? #ypbm# and g.fyrq >? and g.fyrq <=?
|
|
|
|
union all
|
|
|
|
select distinct a.pkey,b.pkey yzmx,b.yzxpkey,b.yzmc,c.gg,a.YZSL,a.TYSL,f.ZHXS,c.JBDW,f.RKDW,d.JJYS,d.JJKS,f.FYZL,e.jbdj,b.YPYZJBJG,f.dwview,e.YXQ,e.PH,c.ZCZH,c.CSXX,rkd.GYS,g.fyrq,'' SFSL,a.FYDW,0 FYJE,tymxb.TYJE,tymxb.STSL,0 FYJJJE,tymxb.TYJJJE from HIS_YFFY_MZTYMXB tymxb left join HIS_YFFY_MZFYMXB a on tymxb.MZFYMXBPKEY=a.pkey and tymxb.JGID=a.JGID left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_YPXX c on a.YZX=c.BM left join HIS_JZ_BASEINFO d on a.JZPKEY=d.pkey and a.JGID=d.JGID left join HIS_KSKC_PC e on a.KSKCPCPKEY=e.pkey and a.JGID=e.JGID left join HIS_SFX f on a.yzx=f.bm and a.JGID=f.JGID left join HIS_YFFY_MZFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_YFYK_RKD_MX rkmx on e.pkey=rkmx.KSKC_PC_PKEY and e.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID where a.JGID=? #ypbm# and tymxb.CJRQ >? and tymxb.CJRQ <=?
|
|
|
|
|
|
|
|
union all
|
|
|
|
select distinct a.pkey,b.pkey yzmx,b.yzxpkey,b.yzmc,c.gg,a.YZSL,a.TYSL,f.ZHXS,c.JBDW,f.RKDW,d.JJYS,d.JJKS,f.FYZL,e.jbdj,b.YPYZJBJG,f.dwview,e.YXQ,e.PH,c.ZCZH,c.CSXX,rkd.GYS,g.FYTIME fyrq,a.SFSL,a.FYDW,a.FYJE,0 TYJE,'' STSL,a.FYJJJE,0 TYJJJE from HIS_YFFY_ZYFYMXB a left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_YPXX c on a.YZXPKEY=c.BM left join HIS_JZ_BASEINFO d on a.JZPKEY=d.pkey and a.JGID=d.JGID left join HIS_KSKC_PC e on a.KSKCPCPKEY=e.pkey and a.JGID=e.JGID left join HIS_SFX f on a.yzxpkey=f.bm and a.JGID=f.JGID left join HIS_YFFY_ZYFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_YFYK_RKD_MX rkmx on e.pkey=rkmx.KSKC_PC_PKEY and e.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID where a.JGID=? #ypbm# and g.FYTIME >? and g.FYTIME <=? and a.sfsl > 0
|
|
|
|
union all
|
|
|
|
select distinct a.pkey,b.pkey yzmx,b.yzxpkey,b.yzmc,c.gg,a.YZSL,a.TYSL,f.ZHXS,c.JBDW,f.RKDW,d.JJYS,d.JJKS,f.FYZL,e.jbdj,b.YPYZJBJG,f.dwview,e.YXQ,e.PH,c.ZCZH,c.CSXX,rkd.GYS,g.FYTIME fyrq,'' SFSL,a.FYDW,0 FYJE,tymxb.TYJE,tymxb.STSL,0 FYJJJE,tymxb.TYJJJE from HIS_YFFY_MZTYMXB tymxb left join HIS_YFFY_ZYFYMXB a on tymxb.MZFYMXBPKEY=a.pkey and tymxb.JGID=a.JGID left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_YPXX c on a.YZXPKEY=c.BM left join HIS_JZ_BASEINFO d on a.JZPKEY=d.pkey and a.JGID=d.JGID left join HIS_KSKC_PC e on a.KSKCPCPKEY=e.pkey and a.JGID=e.JGID left join HIS_SFX f on a.yzxpkey=f.bm and a.JGID=f.JGID left join HIS_YFFY_ZYFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_YFYK_RKD_MX rkmx on e.pkey=rkmx.KSKC_PC_PKEY and e.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID where a.JGID=? #ypbm# and tymxb.CJRQ >? and tymxb.CJRQ <=? and tymxb.stsl > 0
|
|
|
|
|
|
) group by yzxpkey,yzmc,gg,ZHXS,JBDW,RKDW,JJYS,FYZL,dwview,ZCZH,CSXX,GYS,FYDW ORDER BY JJYS
|
|
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="YZXPKEY" type="12" />
|
|
<f name="YZMC" type="12" />
|
|
<f name="GG" type="12" />
|
|
<f name="FYSL" type="4" />
|
|
<f name="TYSL" type="4" />
|
|
<f name="FYJE" type="4" />
|
|
<f name="TYJE" type="4" />
|
|
<f name="FYJJJE" type="4" />
|
|
<f name="TYJJJE" type="4" />
|
|
<f name="ZHXS" type="8" />
|
|
<f name="JBDW" type="12" />
|
|
<f name="RKDW" type="12" />
|
|
<f name="JJYS" type="12" />
|
|
<f name="FYZL" type="12" />
|
|
<f name="DWVIEW" type="12" />
|
|
<!-- <f name="YXQ" type="93" />-->
|
|
<!-- <f name="PH" type="12" />-->
|
|
<f name="ZCZH" type="12" />
|
|
<f name="CSXX" type="12" />
|
|
<f name="GYS" type="12" />
|
|
<f name="FYDW" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
|
|
<dao id="ygyyzyyphzbyJjysDaoBySales" log="true" type="1">
|
|
<sql><![CDATA[
|
|
|
|
SELECT yzxpkey,yzmc,gg,sum(SFSL) fysl,sum(STSL) tysl,sum(FYJE) FYJE,sum(TYJE) TYJE,sum(FYJJJE) FYJJJE,sum(TYJJJE) TYJJJE,ZHXS,JBDW,RKDW,JJYS,FYZL,dwview,ZCZH,CSXX,GYS,FYDW FROM
|
|
(
|
|
|
|
|
|
select distinct a.pkey,b.pkey yzmx,b.yzxpkey,b.yzmc,c.gg,a.YZSL,a.TYSL,f.ZHXS,c.JBDW,f.RKDW,d.JJYS,d.JJKS,f.FYZL,e.jbdj,b.YPYZJBJG,f.dwview,e.YXQ,e.PH,c.ZCZH,c.CSXX,rkd.GYS,g.FYTIME fyrq,a.SFSL,a.FYDW,a.FYJE,a.TYJE,a.STSL,a.FYJJJE,a.TYJJJE from HIS_YFFY_ZYFYMXB a left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_YPXX c on a.YZXPKEY=c.BM left join HIS_JZ_BASEINFO d on a.JZPKEY=d.pkey and a.JGID=d.JGID left join HIS_KSKC_PC e on a.KSKCPCPKEY=e.pkey and a.JGID=e.JGID left join HIS_SFX f on a.yzxpkey=f.bm and a.JGID=f.JGID left join HIS_YFFY_ZYFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_YFYK_RKD_MX rkmx on e.pkey=rkmx.KSKC_PC_PKEY and e.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID right join HIS_SFZD_YZMXB h on b.pkey=h.yzmx and b.JGID=h.JGID left join HIS_MZJS_MZFPZB fpb on h.ZDZBPKEY=fpb.GLZDBPKEY and h.JGID=fpb.JGID where a.JGID=? #ypbm# and fpb.SFZT != '0' and fpb.pjzt=1 and fpb.SFRQ >? and fpb.SFRQ <=? order by d.JJYS
|
|
|
|
|
|
) group by yzxpkey,yzmc,gg,ZHXS,JBDW,RKDW,JJYS,FYZL,dwview,ZCZH,CSXX,GYS,FYDW ORDER BY JJYS
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="YZXPKEY" type="12" />
|
|
<f name="YZMC" type="12" />
|
|
<f name="GG" type="12" />
|
|
<f name="FYSL" type="4" />
|
|
<f name="TYSL" type="4" />
|
|
<f name="FYJE" type="4" />
|
|
<f name="TYJE" type="4" />
|
|
<f name="FYJJJE" type="4" />
|
|
<f name="TYJJJE" type="4" />
|
|
<f name="ZHXS" type="8" />
|
|
<f name="JBDW" type="12" />
|
|
<f name="RKDW" type="12" />
|
|
<f name="JJYS" type="12" />
|
|
<f name="FYZL" type="12" />
|
|
<f name="DWVIEW" type="12" />
|
|
<!-- <f name="YXQ" type="93" />-->
|
|
<!-- <f name="PH" type="12" />-->
|
|
<f name="ZCZH" type="12" />
|
|
<f name="CSXX" type="12" />
|
|
<f name="GYS" type="12" />
|
|
<f name="FYDW" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
|
|
<dao id="newygyyzyyphzbyJjysDaoBySales" log="true" type="1">
|
|
<sql><![CDATA[
|
|
|
|
SELECT yzxpkey,yzmc,gg,sum(SFSL) fysl,sum(STSL) tysl,sum(FYJE) FYJE,sum(TYJE) TYJE,sum(FYJJJE) FYJJJE,sum(TYJJJE) TYJJJE,ZHXS,JBDW,RKDW,JJYS,FYZL,dwview,ZCZH,CSXX,GYS,FYDW FROM
|
|
(
|
|
|
|
|
|
select distinct a.pkey,b.pkey yzmx,b.yzxpkey,b.yzmc,c.gg,a.YZSL,a.TYSL,f.ZHXS,c.JBDW,f.RKDW,d.JJYS,d.JJKS,f.FYZL,e.jbdj,b.YPYZJBJG,f.dwview,e.YXQ,e.PH,c.ZCZH,c.CSXX,rkd.GYS,g.FYTIME fyrq,a.SFSL,a.FYDW,a.FYJE,0 TYJE,'' STSL,a.FYJJJE,0 TYJJJE from HIS_YFFY_ZYFYMXB a left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_YPXX c on a.YZXPKEY=c.BM left join HIS_JZ_BASEINFO d on a.JZPKEY=d.pkey and a.JGID=d.JGID left join HIS_KSKC_PC e on a.KSKCPCPKEY=e.pkey and a.JGID=e.JGID left join HIS_SFX f on a.yzxpkey=f.bm and a.JGID=f.JGID left join HIS_YFFY_ZYFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_YFYK_RKD_MX rkmx on e.pkey=rkmx.KSKC_PC_PKEY and e.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID right join HIS_SFZD_YZMXB h on b.pkey=h.yzmx and b.JGID=h.JGID left join HIS_MZJS_MZFPZB fpb on h.ZDZBPKEY=fpb.GLZDBPKEY and h.JGID=fpb.JGID where a.JGID=? #ypbm# and fpb.pjzt=1 and fpb.SFRQ >? and fpb.SFRQ <=? and a.sfsl > 0
|
|
|
|
union all
|
|
|
|
select distinct a.pkey,b.pkey yzmx,b.yzxpkey,b.yzmc,c.gg,a.YZSL,a.TYSL,f.ZHXS,c.JBDW,f.RKDW,d.JJYS,d.JJKS,f.FYZL,e.jbdj,b.YPYZJBJG,f.dwview,e.YXQ,e.PH,c.ZCZH,c.CSXX,rkd.GYS,g.FYTIME fyrq,'' SFSL,a.FYDW,0 FYJE,tymxb.TYJE,tymxb.STSL,0 FYJJJE,tymxb.TYJJJE from HIS_YFFY_MZTYMXB tymxb left join HIS_YFFY_ZYFYMXB a on tymxb.MZFYMXBPKEY=a.pkey and tymxb.JGID=a.JGID left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_YPXX c on a.YZXPKEY=c.BM left join HIS_JZ_BASEINFO d on a.JZPKEY=d.pkey and a.JGID=d.JGID left join HIS_KSKC_PC e on a.KSKCPCPKEY=e.pkey and a.JGID=e.JGID left join HIS_SFX f on a.yzxpkey=f.bm and a.JGID=f.JGID left join HIS_YFFY_ZYFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_YFYK_RKD_MX rkmx on e.pkey=rkmx.KSKC_PC_PKEY and e.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID right join HIS_SFZD_YZMXB h on b.pkey=h.yzmx and b.JGID=h.JGID left join HIS_MZJS_MZFPZB fpb on h.ZDZBPKEY=fpb.GLZDBPKEY and h.JGID=fpb.JGID where a.JGID=? #ypbm# and fpb.pjzt=1 and fpb.SFRQ >? and fpb.SFRQ <=? and tymxb.stsl > 0
|
|
|
|
) group by yzxpkey,yzmc,gg,ZHXS,JBDW,RKDW,JJYS,FYZL,dwview,ZCZH,CSXX,GYS,FYDW ORDER BY JJYS
|
|
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="YZXPKEY" type="12" />
|
|
<f name="YZMC" type="12" />
|
|
<f name="GG" type="12" />
|
|
<f name="FYSL" type="4" />
|
|
<f name="TYSL" type="4" />
|
|
<f name="FYJE" type="4" />
|
|
<f name="TYJE" type="4" />
|
|
<f name="FYJJJE" type="4" />
|
|
<f name="TYJJJE" type="4" />
|
|
<f name="ZHXS" type="8" />
|
|
<f name="JBDW" type="12" />
|
|
<f name="RKDW" type="12" />
|
|
<f name="JJYS" type="12" />
|
|
<f name="FYZL" type="12" />
|
|
<f name="DWVIEW" type="12" />
|
|
<!-- <f name="YXQ" type="93" />-->
|
|
<!-- <f name="PH" type="12" />-->
|
|
<f name="ZCZH" type="12" />
|
|
<f name="CSXX" type="12" />
|
|
<f name="GYS" type="12" />
|
|
<f name="FYDW" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
<dao id="ygyyMzyphzbyJjysDaooBySales" log="true" type="1">
|
|
<sql><![CDATA[
|
|
|
|
SELECT yzxpkey,yzmc,gg,sum(SFSL) fysl,sum(STSL) tysl,sum(FYJE) FYJE,sum(TYJE) TYJE,sum(FYJJJE) FYJJJE,sum(TYJJJE) TYJJJE,ZHXS,JBDW,RKDW,JJYS,FYZL,dwview,ZCZH,CSXX,GYS,FYDW FROM
|
|
(
|
|
select distinct a.pkey,b.pkey yzmx,b.yzxpkey,b.yzmc,c.gg,a.YZSL,a.TYSL,f.ZHXS,c.JBDW,f.RKDW,d.JJYS,d.JJKS,f.FYZL,e.jbdj,b.YPYZJBJG,f.dwview,e.YXQ,e.PH,c.ZCZH,c.CSXX,rkd.GYS,g.fyrq,a.SFSL,a.FYDW,a.FYJE,a.TYJE,a.STSL,a.FYJJJE,a.TYJJJE from HIS_YFFY_MZFYMXB a left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_YPXX c on a.YZX=c.BM left join HIS_JZ_BASEINFO d on a.JZPKEY=d.pkey and a.JGID=d.JGID left join HIS_KSKC_PC e on a.KSKCPCPKEY=e.pkey and a.JGID=e.JGID left join HIS_SFX f on a.yzx=f.bm and a.JGID=f.JGID left join HIS_YFFY_MZFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_YFYK_RKD_MX rkmx on e.pkey=rkmx.KSKC_PC_PKEY and e.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID right join HIS_SFZD_YZMXB h on b.pkey=h.yzmx and b.JGID=h.JGID left join HIS_MZJS_MZFPZB fpb on h.ZDZBPKEY=fpb.GLZDBPKEY and h.JGID=fpb.JGID where a.JGID=? #ypbm# and fpb.SFZT != '0' and fpb.pjzt=1 and a.CJRQ >? and a.CJRQ <=? order by d.JJYS
|
|
|
|
|
|
|
|
) group by yzxpkey,yzmc,gg,ZHXS,JBDW,RKDW,JJYS,FYZL,dwview,ZCZH,CSXX,GYS,FYDW ORDER BY JJYS
|
|
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="YZXPKEY" type="12" />
|
|
<f name="YZMC" type="12" />
|
|
<f name="GG" type="12" />
|
|
<f name="FYSL" type="4" />
|
|
<f name="TYSL" type="4" />
|
|
<f name="FYJE" type="4" />
|
|
<f name="TYJE" type="4" />
|
|
<f name="FYJJJE" type="4" />
|
|
<f name="TYJJJE" type="4" />
|
|
<f name="ZHXS" type="8" />
|
|
<f name="JBDW" type="12" />
|
|
<f name="RKDW" type="12" />
|
|
<f name="JJYS" type="12" />
|
|
<f name="FYZL" type="12" />
|
|
<f name="DWVIEW" type="12" />
|
|
<!-- <f name="YXQ" type="93" />-->
|
|
<f name="ZCZH" type="12" />
|
|
<f name="CSXX" type="12" />
|
|
<f name="GYS" type="12" />
|
|
<f name="FYDW" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
<dao id="newygyyMzyphzbyJjysDaooBySales" log="true" type="1">
|
|
<sql><![CDATA[
|
|
|
|
SELECT yzxpkey,yzmc,gg,sum(SFSL) fysl,sum(STSL) tysl,sum(FYJE) FYJE,sum(TYJE) TYJE,sum(FYJJJE) FYJJJE,sum(TYJJJE) TYJJJE,ZHXS,JBDW,RKDW,JJYS,FYZL,dwview,ZCZH,CSXX,GYS,FYDW FROM
|
|
(
|
|
select distinct a.pkey,b.pkey yzmx,b.yzxpkey,b.yzmc,c.gg,a.YZSL,a.TYSL,f.ZHXS,c.JBDW,f.RKDW,d.JJYS,d.JJKS,f.FYZL,e.jbdj,b.YPYZJBJG,f.dwview,e.YXQ,e.PH,c.ZCZH,c.CSXX,rkd.GYS,g.fyrq,a.SFSL,a.FYDW,a.FYJE,0 TYJE,'' STSL,a.FYJJJE,0 TYJJJE from HIS_YFFY_MZFYMXB a left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_YPXX c on a.YZX=c.BM left join HIS_JZ_BASEINFO d on a.JZPKEY=d.pkey and a.JGID=d.JGID left join HIS_KSKC_PC e on a.KSKCPCPKEY=e.pkey and a.JGID=e.JGID left join HIS_SFX f on a.yzx=f.bm and a.JGID=f.JGID left join HIS_YFFY_MZFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_YFYK_RKD_MX rkmx on e.pkey=rkmx.KSKC_PC_PKEY and e.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID where a.JGID=? #ypbm# and g.fyrq >? and g.fyrq <=?
|
|
|
|
union all
|
|
|
|
select distinct a.pkey,b.pkey yzmx,b.yzxpkey,b.yzmc,c.gg,a.YZSL,a.TYSL,f.ZHXS,c.JBDW,f.RKDW,d.JJYS,d.JJKS,f.FYZL,e.jbdj,b.YPYZJBJG,f.dwview,e.YXQ,e.PH,c.ZCZH,c.CSXX,rkd.GYS,g.fyrq,'' SFSL,a.FYDW,0 FYJE,tymxb.TYJE,tymxb.STSL,0 FYJJJE,tymxb.TYJJJE from HIS_YFFY_MZTYMXB tymxb left join HIS_YFFY_MZFYMXB a on tymxb.MZFYMXBPKEY=a.pkey and tymxb.JGID=a.JGID left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_YPXX c on a.YZX=c.BM left join HIS_JZ_BASEINFO d on a.JZPKEY=d.pkey and a.JGID=d.JGID left join HIS_KSKC_PC e on a.KSKCPCPKEY=e.pkey and a.JGID=e.JGID left join HIS_SFX f on a.yzx=f.bm and a.JGID=f.JGID left join HIS_YFFY_MZFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_YFYK_RKD_MX rkmx on e.pkey=rkmx.KSKC_PC_PKEY and e.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID where a.JGID=? #ypbm# and tymxb.CJRQ >? and tymxb.CJRQ <=?
|
|
|
|
) group by yzxpkey,yzmc,gg,ZHXS,JBDW,RKDW,JJYS,FYZL,dwview,ZCZH,CSXX,GYS,FYDW ORDER BY JJYS
|
|
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="YZXPKEY" type="12" />
|
|
<f name="YZMC" type="12" />
|
|
<f name="GG" type="12" />
|
|
<f name="FYSL" type="4" />
|
|
<f name="TYSL" type="4" />
|
|
<f name="FYJE" type="4" />
|
|
<f name="TYJE" type="4" />
|
|
<f name="FYJJJE" type="4" />
|
|
<f name="TYJJJE" type="4" />
|
|
<f name="ZHXS" type="8" />
|
|
<f name="JBDW" type="12" />
|
|
<f name="RKDW" type="12" />
|
|
<f name="JJYS" type="12" />
|
|
<f name="FYZL" type="12" />
|
|
<f name="DWVIEW" type="12" />
|
|
<!-- <f name="YXQ" type="93" />-->
|
|
<f name="ZCZH" type="12" />
|
|
<f name="CSXX" type="12" />
|
|
<f name="GYS" type="12" />
|
|
<f name="FYDW" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
<dao id="ygyyallyphzbyJjksDaoBySales" log="true" type="1">
|
|
<sql><![CDATA[
|
|
|
|
SELECT yzxpkey,yzmc,gg,sum(SFSL) fysl,sum(STSL) tysl,sum(FYJE) FYJE,sum(TYJE) TYJE,sum(FYJJJE) FYJJJE,sum(TYJJJE) TYJJJE,ZHXS,JBDW,RKDW,JJKS,FYZL,dwview,YXQ,PH,ZCZH,CSXX,GYS,FYDW FROM
|
|
(
|
|
select distinct a.pkey,b.pkey yzmx,b.yzxpkey,b.yzmc,c.gg,a.YZSL,a.TYSL,f.ZHXS,c.JBDW,f.RKDW,d.JJYS,d.JJKS,f.FYZL,e.jbdj,b.YPYZJBJG,f.dwview,e.YXQ,e.PH,c.ZCZH,c.CSXX,rkd.GYS,g.fyrq,a.SFSL,a.FYDW,a.FYJE,a.TYJE,a.STSL,a.FYJJJE,a.TYJJJE from HIS_YFFY_MZFYMXB a left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_YPXX c on a.YZX=c.BM left join HIS_JZ_BASEINFO d on a.JZPKEY=d.pkey and a.JGID=d.JGID left join HIS_KSKC_PC e on a.KSKCPCPKEY=e.pkey and a.JGID=e.JGID left join HIS_SFX f on a.yzx=f.bm and a.JGID=f.JGID left join HIS_YFFY_MZFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_YFYK_RKD_MX rkmx on e.pkey=rkmx.KSKC_PC_PKEY and e.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID right join HIS_SFZD_YZMXB h on b.pkey=h.yzmx and b.JGID=h.JGID left join HIS_MZJS_MZFPZB fpb on h.ZDZBPKEY=fpb.GLZDBPKEY and h.JGID=fpb.JGID where a.JGID=? #ypbm# and fpb.SFZT != '0' and fpb.pjzt=1 and fpb.SFRQ >? and fpb.SFRQ <=?
|
|
|
|
|
|
|
|
union all
|
|
|
|
select distinct a.pkey,b.pkey yzmx,b.yzxpkey,b.yzmc,c.gg,a.YZSL,a.TYSL,f.ZHXS,c.JBDW,f.RKDW,d.JJYS,d.JJKS,f.FYZL,e.jbdj,b.YPYZJBJG,f.dwview,e.YXQ,e.PH,c.ZCZH,c.CSXX,rkd.GYS,g.FYTIME fyrq,a.SFSL,a.FYDW,a.FYJE,a.TYJE,a.STSL,a.FYJJJE,a.TYJJJE from HIS_YFFY_ZYFYMXB a left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_YPXX c on a.YZXPKEY=c.BM left join HIS_JZ_BASEINFO d on a.JZPKEY=d.pkey and a.JGID=d.JGID left join HIS_KSKC_PC e on a.KSKCPCPKEY=e.pkey and a.JGID=e.JGID left join HIS_SFX f on a.yzxpkey=f.bm and a.JGID=f.JGID left join HIS_YFFY_ZYFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_YFYK_RKD_MX rkmx on e.pkey=rkmx.KSKC_PC_PKEY and e.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID right join HIS_SFZD_YZMXB h on b.pkey=h.yzmx and b.JGID=h.JGID left join HIS_MZJS_MZFPZB fpb on h.ZDZBPKEY=fpb.GLZDBPKEY and h.JGID=fpb.JGID where a.JGID=? #ypbm# and fpb.SFZT != '0' and fpb.pjzt=1 and fpb.SFRQ >? and fpb.SFRQ <=?
|
|
|
|
|
|
) group by yzxpkey,yzmc,gg,ZHXS,JBDW,RKDW,JJKS,FYZL,dwview,YXQ,PH,ZCZH,CSXX,GYS,FYDW ORDER BY JJKS
|
|
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="YZXPKEY" type="12" />
|
|
<f name="YZMC" type="12" />
|
|
<f name="GG" type="12" />
|
|
<f name="FYSL" type="4" />
|
|
<f name="TYSL" type="4" />
|
|
<f name="FYJE" type="4" />
|
|
<f name="TYJE" type="4" />
|
|
<f name="FYJJJE" type="4" />
|
|
<f name="TYJJJE" type="4" />
|
|
<f name="ZHXS" type="8" />
|
|
<f name="JBDW" type="12" />
|
|
<f name="RKDW" type="12" />
|
|
<f name="JJKS" type="12" />
|
|
<f name="FYZL" type="12" />
|
|
<f name="DWVIEW" type="12" />
|
|
<f name="YXQ" type="93" />
|
|
<f name="PH" type="12" />
|
|
<f name="ZCZH" type="12" />
|
|
<f name="CSXX" type="12" />
|
|
<f name="GYS" type="12" />
|
|
<f name="FYDW" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
<dao id="newygyyallyphzbyJjksDaoBySales" log="true" type="1">
|
|
<sql><![CDATA[
|
|
|
|
SELECT yzxpkey,yzmc,gg,sum(SFSL) fysl,sum(STSL) tysl,sum(FYJE) FYJE,sum(TYJE) TYJE,sum(FYJJJE) FYJJJE,sum(TYJJJE) TYJJJE,ZHXS,JBDW,RKDW,JJKS,FYZL,dwview,ZCZH,CSXX,GYS,FYDW FROM
|
|
(
|
|
select distinct a.pkey,b.pkey yzmx,b.yzxpkey,b.yzmc,c.gg,a.YZSL,a.TYSL,f.ZHXS,c.JBDW,f.RKDW,d.JJYS,d.JJKS,f.FYZL,e.jbdj,b.YPYZJBJG,f.dwview,e.YXQ,e.PH,c.ZCZH,c.CSXX,rkd.GYS,g.fyrq,a.SFSL,a.FYDW,a.FYJE,0 TYJE,'' STSL,a.FYJJJE,0 TYJJJE from HIS_YFFY_MZFYMXB a left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_YPXX c on a.YZX=c.BM left join HIS_JZ_BASEINFO d on a.JZPKEY=d.pkey and a.JGID=d.JGID left join HIS_KSKC_PC e on a.KSKCPCPKEY=e.pkey and a.JGID=e.JGID left join HIS_SFX f on a.yzx=f.bm and a.JGID=f.JGID left join HIS_YFFY_MZFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_YFYK_RKD_MX rkmx on e.pkey=rkmx.KSKC_PC_PKEY and e.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID where a.JGID=? #ypbm# and g.fyrq >? and g.fyrq <=?
|
|
|
|
union all
|
|
|
|
select distinct a.pkey,b.pkey yzmx,b.yzxpkey,b.yzmc,c.gg,a.YZSL,a.TYSL,f.ZHXS,c.JBDW,f.RKDW,d.JJYS,d.JJKS,f.FYZL,e.jbdj,b.YPYZJBJG,f.dwview,e.YXQ,e.PH,c.ZCZH,c.CSXX,rkd.GYS,g.fyrq,'' SFSL,a.FYDW,0 FYJE,tymxb.TYJE,tymxb.STSL,0 FYJJJE,tymxb.TYJJJE from HIS_YFFY_MZTYMXB tymxb left join HIS_YFFY_MZFYMXB a on tymxb.MZFYMXBPKEY=a.pkey and tymxb.JGID=a.JGID left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_YPXX c on a.YZX=c.BM left join HIS_JZ_BASEINFO d on a.JZPKEY=d.pkey and a.JGID=d.JGID left join HIS_KSKC_PC e on a.KSKCPCPKEY=e.pkey and a.JGID=e.JGID left join HIS_SFX f on a.yzx=f.bm and a.JGID=f.JGID left join HIS_YFFY_MZFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_YFYK_RKD_MX rkmx on e.pkey=rkmx.KSKC_PC_PKEY and e.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID where a.JGID=? #ypbm# and tymxb.CJRQ >? and tymxb.CJRQ <=?
|
|
|
|
|
|
|
|
union all
|
|
|
|
select distinct a.pkey,b.pkey yzmx,b.yzxpkey,b.yzmc,c.gg,a.YZSL,a.TYSL,f.ZHXS,c.JBDW,f.RKDW,d.JJYS,d.JJKS,f.FYZL,e.jbdj,b.YPYZJBJG,f.dwview,e.YXQ,e.PH,c.ZCZH,c.CSXX,rkd.GYS,g.FYTIME fyrq,a.SFSL,a.FYDW,a.FYJE,0 TYJE,'' STSL,a.FYJJJE,0 TYJJJE from HIS_YFFY_ZYFYMXB a left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_YPXX c on a.YZXPKEY=c.BM left join HIS_JZ_BASEINFO d on a.JZPKEY=d.pkey and a.JGID=d.JGID left join HIS_KSKC_PC e on a.KSKCPCPKEY=e.pkey and a.JGID=e.JGID left join HIS_SFX f on a.yzxpkey=f.bm and a.JGID=f.JGID left join HIS_YFFY_ZYFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_YFYK_RKD_MX rkmx on e.pkey=rkmx.KSKC_PC_PKEY and e.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID where a.JGID=? #ypbm# and g.FYTIME >? and g.FYTIME <=? and a.sfsl > 0
|
|
|
|
union all
|
|
|
|
select distinct a.pkey,b.pkey yzmx,b.yzxpkey,b.yzmc,c.gg,a.YZSL,a.TYSL,f.ZHXS,c.JBDW,f.RKDW,d.JJYS,d.JJKS,f.FYZL,e.jbdj,b.YPYZJBJG,f.dwview,e.YXQ,e.PH,c.ZCZH,c.CSXX,rkd.GYS,g.FYTIME fyrq,'' SFSL,a.FYDW,0 FYJE,tymxb.TYJE,tymxb.STSL,0 FYJJJE,tymxb.TYJJJE from HIS_YFFY_MZTYMXB tymxb left join HIS_YFFY_ZYFYMXB a on tymxb.MZFYMXBPKEY=a.pkey and tymxb.JGID=a.JGID left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_YPXX c on a.YZXPKEY=c.BM left join HIS_JZ_BASEINFO d on a.JZPKEY=d.pkey and a.JGID=d.JGID left join HIS_KSKC_PC e on a.KSKCPCPKEY=e.pkey and a.JGID=e.JGID left join HIS_SFX f on a.yzxpkey=f.bm and a.JGID=f.JGID left join HIS_YFFY_ZYFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_YFYK_RKD_MX rkmx on e.pkey=rkmx.KSKC_PC_PKEY and e.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID where a.JGID=? #ypbm# and tymxb.CJRQ >? and tymxb.CJRQ <=? and tymxb.stsl > 0
|
|
|
|
|
|
) group by yzxpkey,yzmc,gg,ZHXS,JBDW,RKDW,JJKS,FYZL,dwview,ZCZH,CSXX,GYS,FYDW ORDER BY JJKS
|
|
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="YZXPKEY" type="12" />
|
|
<f name="YZMC" type="12" />
|
|
<f name="GG" type="12" />
|
|
<f name="FYSL" type="4" />
|
|
<f name="TYSL" type="4" />
|
|
<f name="FYJE" type="4" />
|
|
<f name="TYJE" type="4" />
|
|
<f name="FYJJJE" type="4" />
|
|
<f name="TYJJJE" type="4" />
|
|
<f name="ZHXS" type="8" />
|
|
<f name="JBDW" type="12" />
|
|
<f name="RKDW" type="12" />
|
|
<f name="JJKS" type="12" />
|
|
<f name="FYZL" type="12" />
|
|
<f name="DWVIEW" type="12" />
|
|
<f name="ZCZH" type="12" />
|
|
<f name="CSXX" type="12" />
|
|
<f name="GYS" type="12" />
|
|
<f name="FYDW" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
<!-- 药品销售统计 -组织结构(全部) -->
|
|
<dao id="newygyyallyphzbyYpDaoBySales" log="true" type="1">
|
|
<sql><![CDATA[
|
|
|
|
SELECT yzxpkey,yzmc,gg,sum(SFSL) fysl,sum(STSL) tysl,sum(FYJE) FYJE,sum(TYJE) TYJE,sum(FYJJJE) FYJJJE,sum(TYJJJE) TYJJJE,ZHXS,JBDW,RKDW,FYZL,dwview,ZCZH,CSXX,GYS,FYDW FROM
|
|
(
|
|
select distinct a.pkey,b.pkey yzmx,b.yzxpkey,b.yzmc,c.gg,a.YZSL,a.TYSL,f.ZHXS,c.JBDW,f.RKDW,d.JJYS,d.JJKS,f.FYZL,e.jbdj,b.YPYZJBJG,f.dwview,e.YXQ,e.PH,c.ZCZH,c.CSXX,rkd.GYS,g.fyrq,a.SFSL,a.FYDW,a.FYJE,0 TYJE,'' STSL,a.FYJJJE,0 TYJJJE from HIS_YFFY_MZFYMXB a left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_YPXX c on a.YZX=c.BM left join HIS_JZ_BASEINFO d on a.JZPKEY=d.pkey and a.JGID=d.JGID left join HIS_KSKC_PC e on a.KSKCPCPKEY=e.pkey and a.JGID=e.JGID left join HIS_SFX f on a.yzx=f.bm and a.JGID=f.JGID left join HIS_YFFY_MZFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_YFYK_RKD_MX rkmx on e.pkey=rkmx.KSKC_PC_PKEY and e.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID where a.JGID=? #ypbm# and g.fyrq >? and g.fyrq <=?
|
|
|
|
union all
|
|
|
|
select distinct a.pkey,b.pkey yzmx,b.yzxpkey,b.yzmc,c.gg,a.YZSL,a.TYSL,f.ZHXS,c.JBDW,f.RKDW,d.JJYS,d.JJKS,f.FYZL,e.jbdj,b.YPYZJBJG,f.dwview,e.YXQ,e.PH,c.ZCZH,c.CSXX,rkd.GYS,g.fyrq,'' SFSL,a.FYDW,0 FYJE,tymxb.TYJE,tymxb.STSL,0 FYJJJE,tymxb.TYJJJE from HIS_YFFY_MZTYMXB tymxb left join HIS_YFFY_MZFYMXB a on tymxb.MZFYMXBPKEY=a.pkey and tymxb.JGID=a.JGID left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_YPXX c on a.YZX=c.BM left join HIS_JZ_BASEINFO d on a.JZPKEY=d.pkey and a.JGID=d.JGID left join HIS_KSKC_PC e on a.KSKCPCPKEY=e.pkey and a.JGID=e.JGID left join HIS_SFX f on a.yzx=f.bm and a.JGID=f.JGID left join HIS_YFFY_MZFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_YFYK_RKD_MX rkmx on e.pkey=rkmx.KSKC_PC_PKEY and e.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID where a.JGID=? #ypbm# and tymxb.CJRQ >? and tymxb.CJRQ <=?
|
|
|
|
|
|
|
|
union all
|
|
|
|
select distinct a.pkey,b.pkey yzmx,b.yzxpkey,b.yzmc,c.gg,a.YZSL,a.TYSL,f.ZHXS,c.JBDW,f.RKDW,d.JJYS,d.JJKS,f.FYZL,e.jbdj,b.YPYZJBJG,f.dwview,e.YXQ,e.PH,c.ZCZH,c.CSXX,rkd.GYS,g.FYTIME fyrq,a.SFSL,a.FYDW,a.FYJE,0 TYJE,'' STSL,a.FYJJJE,0 TYJJJE from HIS_YFFY_ZYFYMXB a left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_YPXX c on a.YZXPKEY=c.BM left join HIS_JZ_BASEINFO d on a.JZPKEY=d.pkey and a.JGID=d.JGID left join HIS_KSKC_PC e on a.KSKCPCPKEY=e.pkey and a.JGID=e.JGID left join HIS_SFX f on a.yzxpkey=f.bm and a.JGID=f.JGID left join HIS_YFFY_ZYFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_YFYK_RKD_MX rkmx on e.pkey=rkmx.KSKC_PC_PKEY and e.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID where a.JGID=? #ypbm# and g.FYTIME >? and g.FYTIME <=? and a.sfsl > 0
|
|
|
|
union all
|
|
|
|
select distinct a.pkey,b.pkey yzmx,b.yzxpkey,b.yzmc,c.gg,a.YZSL,a.TYSL,f.ZHXS,c.JBDW,f.RKDW,d.JJYS,d.JJKS,f.FYZL,e.jbdj,b.YPYZJBJG,f.dwview,e.YXQ,e.PH,c.ZCZH,c.CSXX,rkd.GYS,g.FYTIME fyrq,'' SFSL,a.FYDW,0 FYJE,tymxb.TYJE,tymxb.STSL,0 FYJJJE,tymxb.TYJJJE from HIS_YFFY_MZTYMXB tymxb left join HIS_YFFY_ZYFYMXB a on tymxb.MZFYMXBPKEY=a.pkey and tymxb.JGID=a.JGID left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_YPXX c on a.YZXPKEY=c.BM left join HIS_JZ_BASEINFO d on a.JZPKEY=d.pkey and a.JGID=d.JGID left join HIS_KSKC_PC e on a.KSKCPCPKEY=e.pkey and a.JGID=e.JGID left join HIS_SFX f on a.yzxpkey=f.bm and a.JGID=f.JGID left join HIS_YFFY_ZYFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_YFYK_RKD_MX rkmx on e.pkey=rkmx.KSKC_PC_PKEY and e.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID where a.JGID=? #ypbm# and tymxb.CJRQ >? and tymxb.CJRQ <=? and tymxb.stsl > 0
|
|
|
|
|
|
) group by yzxpkey,yzmc,gg,ZHXS,JBDW,RKDW,FYZL,dwview,ZCZH,CSXX,GYS,FYDW ORDER BY yzxpkey
|
|
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="YZXPKEY" type="12" />
|
|
<f name="YZMC" type="12" />
|
|
<f name="GG" type="12" />
|
|
<f name="FYSL" type="4" />
|
|
<f name="TYSL" type="4" />
|
|
<f name="FYJE" type="4" />
|
|
<f name="TYJE" type="4" />
|
|
<f name="FYJJJE" type="4" />
|
|
<f name="TYJJJE" type="4" />
|
|
<f name="ZHXS" type="8" />
|
|
<f name="JBDW" type="12" />
|
|
<f name="RKDW" type="12" />
|
|
<f name="FYZL" type="12" />
|
|
<f name="DWVIEW" type="12" />
|
|
<f name="ZCZH" type="12" />
|
|
<f name="CSXX" type="12" />
|
|
<f name="GYS" type="12" />
|
|
<f name="FYDW" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
<dao id="ygyyzyyphzbyJjksDaoBySales" log="true" type="1">
|
|
<sql><![CDATA[
|
|
|
|
SELECT yzxpkey,yzmc,gg,sum(SFSL) fysl,sum(STSL) tysl,sum(FYJE) FYJE,sum(TYJE) TYJE,sum(FYJJJE) FYJJJE,sum(TYJJJE) TYJJJE,ZHXS,JBDW,RKDW,JJKS,FYZL,dwview,YXQ,PH,ZCZH,CSXX,GYS,FYDW FROM
|
|
(
|
|
|
|
|
|
select distinct a.pkey,b.pkey yzmx,b.yzxpkey,b.yzmc,c.gg,a.YZSL,a.TYSL,f.ZHXS,c.JBDW,f.RKDW,d.JJYS,d.JJKS,f.FYZL,e.jbdj,b.YPYZJBJG,f.dwview,e.YXQ,e.PH,c.ZCZH,c.CSXX,rkd.GYS,g.FYTIME fyrq,a.SFSL,a.FYDW,a.FYJE,a.TYJE,a.STSL,a.FYJJJE,a.TYJJJE from HIS_YFFY_ZYFYMXB a left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_YPXX c on a.YZXPKEY=c.BM left join HIS_JZ_BASEINFO d on a.JZPKEY=d.pkey and a.JGID=d.JGID left join HIS_KSKC_PC e on a.KSKCPCPKEY=e.pkey and a.JGID=e.JGID left join HIS_SFX f on a.yzxpkey=f.bm and a.JGID=f.JGID left join HIS_YFFY_ZYFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_YFYK_RKD_MX rkmx on e.pkey=rkmx.KSKC_PC_PKEY and e.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID right join HIS_SFZD_YZMXB h on b.pkey=h.yzmx and b.JGID=h.JGID left join HIS_MZJS_MZFPZB fpb on h.ZDZBPKEY=fpb.GLZDBPKEY and h.JGID=fpb.JGID where a.JGID=? #ypbm# and fpb.SFZT != '0' and fpb.pjzt=1 and fpb.SFRQ >? and fpb.SFRQ <=? order by d.JJKS
|
|
|
|
|
|
) group by yzxpkey,yzmc,gg,ZHXS,JBDW,RKDW,JJKS,FYZL,dwview,YXQ,PH,ZCZH,CSXX,GYS,FYDW ORDER BY JJKS
|
|
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="YZXPKEY" type="12" />
|
|
<f name="YZMC" type="12" />
|
|
<f name="GG" type="12" />
|
|
<f name="FYSL" type="4" />
|
|
<f name="TYSL" type="4" />
|
|
<f name="FYJE" type="4" />
|
|
<f name="TYJE" type="4" />
|
|
<f name="FYJJJE" type="4" />
|
|
<f name="TYJJJE" type="4" />
|
|
<f name="ZHXS" type="8" />
|
|
<f name="JBDW" type="12" />
|
|
<f name="RKDW" type="12" />
|
|
<f name="JJKS" type="12" />
|
|
<f name="FYZL" type="12" />
|
|
<f name="DWVIEW" type="12" />
|
|
<f name="YXQ" type="93" />
|
|
<f name="PH" type="12" />
|
|
<f name="ZCZH" type="12" />
|
|
<f name="CSXX" type="12" />
|
|
<f name="GYS" type="12" />
|
|
<f name="FYDW" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
<dao id="newygyyzyyphzbyJjksDaoBySales" log="true" type="1">
|
|
<sql><![CDATA[
|
|
|
|
SELECT yzxpkey,yzmc,gg,sum(SFSL) fysl,sum(STSL) tysl,sum(FYJE) FYJE,sum(TYJE) TYJE,sum(FYJJJE) FYJJJE,sum(TYJJJE) TYJJJE,ZHXS,JBDW,RKDW,JJKS,FYZL,dwview,ZCZH,CSXX,GYS,FYDW FROM
|
|
(
|
|
|
|
|
|
select distinct a.pkey,b.pkey yzmx,b.yzxpkey,b.yzmc,c.gg,a.YZSL,a.TYSL,f.ZHXS,c.JBDW,f.RKDW,d.JJYS,d.JJKS,f.FYZL,e.jbdj,b.YPYZJBJG,f.dwview,e.YXQ,e.PH,c.ZCZH,c.CSXX,rkd.GYS,g.FYTIME fyrq,a.SFSL,a.FYDW,a.FYJE,0 TYJE,'' STSL,a.FYJJJE,0 TYJJJE from HIS_YFFY_ZYFYMXB a left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_YPXX c on a.YZXPKEY=c.BM left join HIS_JZ_BASEINFO d on a.JZPKEY=d.pkey and a.JGID=d.JGID left join HIS_KSKC_PC e on a.KSKCPCPKEY=e.pkey and a.JGID=e.JGID left join HIS_SFX f on a.yzxpkey=f.bm and a.JGID=f.JGID left join HIS_YFFY_ZYFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_YFYK_RKD_MX rkmx on e.pkey=rkmx.KSKC_PC_PKEY and e.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID where a.JGID=? #ypbm# and g.FYTIME >? and g.FYTIME <=? and a.sfsl > 0
|
|
|
|
union all
|
|
|
|
select distinct a.pkey,b.pkey yzmx,b.yzxpkey,b.yzmc,c.gg,a.YZSL,a.TYSL,f.ZHXS,c.JBDW,f.RKDW,d.JJYS,d.JJKS,f.FYZL,e.jbdj,b.YPYZJBJG,f.dwview,e.YXQ,e.PH,c.ZCZH,c.CSXX,rkd.GYS,g.FYTIME fyrq,'' SFSL,a.FYDW,0 FYJE,tymxb.TYJE,tymxb.STSL,0 FYJJJE,tymxb.TYJJJE from HIS_YFFY_MZTYMXB tymxb left join HIS_YFFY_ZYFYMXB a on tymxb.MZFYMXBPKEY=a.pkey and tymxb.JGID=a.JGID left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_YPXX c on a.YZXPKEY=c.BM left join HIS_JZ_BASEINFO d on a.JZPKEY=d.pkey and a.JGID=d.JGID left join HIS_KSKC_PC e on a.KSKCPCPKEY=e.pkey and a.JGID=e.JGID left join HIS_SFX f on a.yzxpkey=f.bm and a.JGID=f.JGID left join HIS_YFFY_ZYFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_YFYK_RKD_MX rkmx on e.pkey=rkmx.KSKC_PC_PKEY and e.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID where a.JGID=? #ypbm# and tymxb.CJRQ >? and tymxb.CJRQ <=? and tymxb.stsl > 0
|
|
|
|
) group by yzxpkey,yzmc,gg,ZHXS,JBDW,RKDW,JJKS,FYZL,dwview,ZCZH,CSXX,GYS,FYDW ORDER BY JJKS
|
|
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="YZXPKEY" type="12" />
|
|
<f name="YZMC" type="12" />
|
|
<f name="GG" type="12" />
|
|
<f name="FYSL" type="4" />
|
|
<f name="TYSL" type="4" />
|
|
<f name="FYJE" type="4" />
|
|
<f name="TYJE" type="4" />
|
|
<f name="FYJJJE" type="4" />
|
|
<f name="TYJJJE" type="4" />
|
|
<f name="ZHXS" type="8" />
|
|
<f name="JBDW" type="12" />
|
|
<f name="RKDW" type="12" />
|
|
<f name="JJKS" type="12" />
|
|
<f name="FYZL" type="12" />
|
|
<f name="DWVIEW" type="12" />
|
|
<!-- <f name="YXQ" type="93" />-->
|
|
<!-- <f name="PH" type="12" />-->
|
|
<f name="ZCZH" type="12" />
|
|
<f name="CSXX" type="12" />
|
|
<f name="GYS" type="12" />
|
|
<f name="FYDW" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
<!-- 药品销售统计 -组织结构(全部) -->
|
|
<dao id="newygyyzyyphzbyPyDaoBySales" log="true" type="1">
|
|
<sql><![CDATA[
|
|
|
|
SELECT yzxpkey,yzmc,gg,sum(SFSL) fysl,sum(STSL) tysl,sum(FYJE) FYJE,sum(TYJE) TYJE,sum(FYJJJE) FYJJJE,sum(TYJJJE) TYJJJE,ZHXS,JBDW,RKDW,FYZL,dwview,ZCZH,CSXX,GYS,FYDW FROM
|
|
(
|
|
|
|
|
|
select distinct a.pkey,b.pkey yzmx,b.yzxpkey,b.yzmc,c.gg,a.YZSL,a.TYSL,f.ZHXS,c.JBDW,f.RKDW,d.JJYS,d.JJKS,f.FYZL,e.jbdj,b.YPYZJBJG,f.dwview,e.YXQ,e.PH,c.ZCZH,c.CSXX,rkd.GYS,g.FYTIME fyrq,a.SFSL,a.FYDW,a.FYJE,0 TYJE,'' STSL,a.FYJJJE,0 TYJJJE from HIS_YFFY_ZYFYMXB a left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_YPXX c on a.YZXPKEY=c.BM left join HIS_JZ_BASEINFO d on a.JZPKEY=d.pkey and a.JGID=d.JGID left join HIS_KSKC_PC e on a.KSKCPCPKEY=e.pkey and a.JGID=e.JGID left join HIS_SFX f on a.yzxpkey=f.bm and a.JGID=f.JGID left join HIS_YFFY_ZYFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_YFYK_RKD_MX rkmx on e.pkey=rkmx.KSKC_PC_PKEY and e.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID where a.JGID=? #ypbm# and g.FYTIME >? and g.FYTIME <=? and a.sfsl > 0
|
|
|
|
union all
|
|
|
|
select distinct a.pkey,b.pkey yzmx,b.yzxpkey,b.yzmc,c.gg,a.YZSL,a.TYSL,f.ZHXS,c.JBDW,f.RKDW,d.JJYS,d.JJKS,f.FYZL,e.jbdj,b.YPYZJBJG,f.dwview,e.YXQ,e.PH,c.ZCZH,c.CSXX,rkd.GYS,g.FYTIME fyrq,'' SFSL,a.FYDW,0 FYJE,tymxb.TYJE,tymxb.STSL,0 FYJJJE,tymxb.TYJJJE from HIS_YFFY_MZTYMXB tymxb left join HIS_YFFY_ZYFYMXB a on tymxb.MZFYMXBPKEY=a.pkey and tymxb.JGID=a.JGID left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_YPXX c on a.YZXPKEY=c.BM left join HIS_JZ_BASEINFO d on a.JZPKEY=d.pkey and a.JGID=d.JGID left join HIS_KSKC_PC e on a.KSKCPCPKEY=e.pkey and a.JGID=e.JGID left join HIS_SFX f on a.yzxpkey=f.bm and a.JGID=f.JGID left join HIS_YFFY_ZYFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_YFYK_RKD_MX rkmx on e.pkey=rkmx.KSKC_PC_PKEY and e.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID where a.JGID=? #ypbm# and tymxb.CJRQ >? and tymxb.CJRQ <=? and tymxb.stsl > 0
|
|
|
|
) group by yzxpkey,yzmc,gg,ZHXS,JBDW,RKDW,FYZL,dwview,ZCZH,CSXX,GYS,FYDW ORDER BY JJKS
|
|
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="YZXPKEY" type="12" />
|
|
<f name="YZMC" type="12" />
|
|
<f name="GG" type="12" />
|
|
<f name="FYSL" type="4" />
|
|
<f name="TYSL" type="4" />
|
|
<f name="FYJE" type="4" />
|
|
<f name="TYJE" type="4" />
|
|
<f name="FYJJJE" type="4" />
|
|
<f name="TYJJJE" type="4" />
|
|
<f name="ZHXS" type="8" />
|
|
<f name="JBDW" type="12" />
|
|
<f name="RKDW" type="12" />
|
|
<!-- <f name="JJKS" type="12" /> -->
|
|
<f name="FYZL" type="12" />
|
|
<f name="DWVIEW" type="12" />
|
|
<!-- <f name="YXQ" type="93" />-->
|
|
<!-- <f name="PH" type="12" />-->
|
|
<f name="ZCZH" type="12" />
|
|
<f name="CSXX" type="12" />
|
|
<f name="GYS" type="12" />
|
|
<f name="FYDW" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
<dao id="ygyyMzyphzbyJjksDaoBySales" log="true" type="1">
|
|
<sql><![CDATA[
|
|
|
|
SELECT yzxpkey,yzmc,gg,sum(SFSL) fysl,sum(STSL) tysl,sum(FYJE) FYJE,sum(TYJE) TYJE,sum(FYJJJE) FYJJJE,sum(TYJJJE) TYJJJE,ZHXS,JBDW,RKDW,JJKS,FYZL,dwview,YXQ,PH,ZCZH,CSXX,GYS,FYDW FROM
|
|
(
|
|
select distinct a.pkey,b.pkey yzmx,b.yzxpkey,b.yzmc,c.gg,a.YZSL,a.TYSL,f.ZHXS,c.JBDW,f.RKDW,d.JJYS,d.JJKS,f.FYZL,e.jbdj,b.YPYZJBJG,f.dwview,e.YXQ,e.PH,c.ZCZH,c.CSXX,rkd.GYS,g.fyrq,a.SFSL,a.FYDW,a.FYJE,a.TYJE,a.STSL,a.FYJJJE,a.TYJJJE from HIS_YFFY_MZFYMXB a left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_YPXX c on a.YZX=c.BM left join HIS_JZ_BASEINFO d on a.JZPKEY=d.pkey and a.JGID=d.JGID left join HIS_KSKC_PC e on a.KSKCPCPKEY=e.pkey and a.JGID=e.JGID left join HIS_SFX f on a.yzx=f.bm and a.JGID=f.JGID left join HIS_YFFY_MZFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_YFYK_RKD_MX rkmx on e.pkey=rkmx.KSKC_PC_PKEY and e.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID right join HIS_SFZD_YZMXB h on b.pkey=h.yzmx and b.JGID=h.JGID left join HIS_MZJS_MZFPZB fpb on h.ZDZBPKEY=fpb.GLZDBPKEY and h.JGID=fpb.JGID where a.JGID=? #ypbm# and fpb.SFZT != '0' and fpb.pjzt=1 and fpb.SFRQ >? and fpb.SFRQ <=? order by d.JJKS
|
|
|
|
|
|
) group by yzxpkey,yzmc,gg,ZHXS,JBDW,RKDW,JJKS,FYZL,dwview,YXQ,PH,ZCZH,CSXX,GYS,FYDW ORDER BY JJKS
|
|
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="YZXPKEY" type="12" />
|
|
<f name="YZMC" type="12" />
|
|
<f name="GG" type="12" />
|
|
<f name="FYSL" type="4" />
|
|
<f name="TYSL" type="4" />
|
|
<f name="FYJE" type="4" />
|
|
<f name="TYJE" type="4" />
|
|
<f name="FYJJJE" type="4" />
|
|
<f name="TYJJJE" type="4" />
|
|
<f name="ZHXS" type="8" />
|
|
<f name="JBDW" type="12" />
|
|
<f name="RKDW" type="12" />
|
|
<f name="JJKS" type="12" />
|
|
<f name="FYZL" type="12" />
|
|
<f name="DWVIEW" type="12" />
|
|
<f name="YXQ" type="93" />
|
|
<f name="PH" type="12" />
|
|
<f name="ZCZH" type="12" />
|
|
<f name="CSXX" type="12" />
|
|
<f name="GYS" type="12" />
|
|
<f name="FYDW" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
<dao id="newygyyMzyphzbyJjksDaoBySales" log="true" type="1">
|
|
<sql><![CDATA[
|
|
|
|
SELECT yzxpkey,yzmc,gg,sum(SFSL) fysl,sum(STSL) tysl,sum(FYJE) FYJE,sum(TYJE) TYJE,sum(FYJJJE) FYJJJE,sum(TYJJJE) TYJJJE,ZHXS,JBDW,RKDW,JJKS,FYZL,dwview,ZCZH,CSXX,GYS,FYDW FROM
|
|
(
|
|
select distinct a.pkey,b.pkey yzmx,b.yzxpkey,b.yzmc,c.gg,a.YZSL,a.TYSL,f.ZHXS,c.JBDW,f.RKDW,d.JJYS,d.JJKS,f.FYZL,e.jbdj,b.YPYZJBJG,f.dwview,e.YXQ,e.PH,c.ZCZH,c.CSXX,rkd.GYS,g.fyrq,a.SFSL,a.FYDW,a.FYJE,0 TYJE,'' STSL,a.FYJJJE,0 TYJJJE from HIS_YFFY_MZFYMXB a left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_YPXX c on a.YZX=c.BM left join HIS_JZ_BASEINFO d on a.JZPKEY=d.pkey and a.JGID=d.JGID left join HIS_KSKC_PC e on a.KSKCPCPKEY=e.pkey and a.JGID=e.JGID left join HIS_SFX f on a.yzx=f.bm and a.JGID=f.JGID left join HIS_YFFY_MZFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_YFYK_RKD_MX rkmx on e.pkey=rkmx.KSKC_PC_PKEY and e.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID where a.JGID=? #ypbm# and g.fyrq >? and g.fyrq <=?
|
|
|
|
union all
|
|
|
|
select distinct a.pkey,b.pkey yzmx,b.yzxpkey,b.yzmc,c.gg,a.YZSL,a.TYSL,f.ZHXS,c.JBDW,f.RKDW,d.JJYS,d.JJKS,f.FYZL,e.jbdj,b.YPYZJBJG,f.dwview,e.YXQ,e.PH,c.ZCZH,c.CSXX,rkd.GYS,g.fyrq,'' SFSL,a.FYDW,0 FYJE,tymxb.TYJE,tymxb.STSL,0 FYJJJE,tymxb.TYJJJE from HIS_YFFY_MZTYMXB tymxb left join HIS_YFFY_MZFYMXB a on tymxb.MZFYMXBPKEY=a.pkey and tymxb.JGID=a.JGID left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_YPXX c on a.YZX=c.BM left join HIS_JZ_BASEINFO d on a.JZPKEY=d.pkey and a.JGID=d.JGID left join HIS_KSKC_PC e on a.KSKCPCPKEY=e.pkey and a.JGID=e.JGID left join HIS_SFX f on a.yzx=f.bm and a.JGID=f.JGID left join HIS_YFFY_MZFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_YFYK_RKD_MX rkmx on e.pkey=rkmx.KSKC_PC_PKEY and e.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID where a.JGID=? #ypbm# and tymxb.CJRQ >? and tymxb.CJRQ <=?
|
|
|
|
|
|
) group by yzxpkey,yzmc,gg,ZHXS,JBDW,RKDW,JJKS,FYZL,dwview,ZCZH,CSXX,GYS,FYDW ORDER BY JJKS
|
|
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="YZXPKEY" type="12" />
|
|
<f name="YZMC" type="12" />
|
|
<f name="GG" type="12" />
|
|
<f name="FYSL" type="4" />
|
|
<f name="TYSL" type="4" />
|
|
<f name="FYJE" type="4" />
|
|
<f name="TYJE" type="4" />
|
|
<f name="FYJJJE" type="4" />
|
|
<f name="TYJJJE" type="4" />
|
|
<f name="ZHXS" type="8" />
|
|
<f name="JBDW" type="12" />
|
|
<f name="RKDW" type="12" />
|
|
<f name="JJKS" type="12" />
|
|
<f name="FYZL" type="12" />
|
|
<f name="DWVIEW" type="12" />
|
|
<f name="ZCZH" type="12" />
|
|
<f name="CSXX" type="12" />
|
|
<f name="GYS" type="12" />
|
|
<f name="FYDW" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
<!-- 药品销售统计 -组织结构(全部) -->
|
|
<dao id="newygyyMzyphzbyYpDaoBySales" log="true" type="1">
|
|
<sql><![CDATA[
|
|
|
|
SELECT yzxpkey,yzmc,gg,sum(SFSL) fysl,sum(STSL) tysl,sum(FYJE) FYJE,sum(TYJE) TYJE,sum(FYJJJE) FYJJJE,sum(TYJJJE) TYJJJE,ZHXS,JBDW,RKDW,FYZL,dwview,ZCZH,CSXX,GYS,FYDW FROM
|
|
(
|
|
select distinct a.pkey,b.pkey yzmx,b.yzxpkey,b.yzmc,c.gg,a.YZSL,a.TYSL,f.ZHXS,c.JBDW,f.RKDW,d.JJYS,d.JJKS,f.FYZL,e.jbdj,b.YPYZJBJG,f.dwview,e.YXQ,e.PH,c.ZCZH,c.CSXX,rkd.GYS,g.fyrq,a.SFSL,a.FYDW,a.FYJE,0 TYJE,'' STSL,a.FYJJJE,0 TYJJJE from HIS_YFFY_MZFYMXB a left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_YPXX c on a.YZX=c.BM left join HIS_JZ_BASEINFO d on a.JZPKEY=d.pkey and a.JGID=d.JGID left join HIS_KSKC_PC e on a.KSKCPCPKEY=e.pkey and a.JGID=e.JGID left join HIS_SFX f on a.yzx=f.bm and a.JGID=f.JGID left join HIS_YFFY_MZFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_YFYK_RKD_MX rkmx on e.pkey=rkmx.KSKC_PC_PKEY and e.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID where a.JGID=? #ypbm# and g.fyrq >? and g.fyrq <=?
|
|
|
|
union all
|
|
|
|
select distinct a.pkey,b.pkey yzmx,b.yzxpkey,b.yzmc,c.gg,a.YZSL,a.TYSL,f.ZHXS,c.JBDW,f.RKDW,d.JJYS,d.JJKS,f.FYZL,e.jbdj,b.YPYZJBJG,f.dwview,e.YXQ,e.PH,c.ZCZH,c.CSXX,rkd.GYS,g.fyrq,'' SFSL,a.FYDW,0 FYJE,tymxb.TYJE,tymxb.STSL,0 FYJJJE,tymxb.TYJJJE from HIS_YFFY_MZTYMXB tymxb left join HIS_YFFY_MZFYMXB a on tymxb.MZFYMXBPKEY=a.pkey and tymxb.JGID=a.JGID left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_YPXX c on a.YZX=c.BM left join HIS_JZ_BASEINFO d on a.JZPKEY=d.pkey and a.JGID=d.JGID left join HIS_KSKC_PC e on a.KSKCPCPKEY=e.pkey and a.JGID=e.JGID left join HIS_SFX f on a.yzx=f.bm and a.JGID=f.JGID left join HIS_YFFY_MZFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_YFYK_RKD_MX rkmx on e.pkey=rkmx.KSKC_PC_PKEY and e.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID where a.JGID=? #ypbm# and tymxb.CJRQ >? and tymxb.CJRQ <=?
|
|
|
|
|
|
) group by yzxpkey,yzmc,gg,ZHXS,JBDW,RKDW,FYZL,dwview,ZCZH,CSXX,GYS,FYDW ORDER BY yzxpkey
|
|
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="YZXPKEY" type="12" />
|
|
<f name="YZMC" type="12" />
|
|
<f name="GG" type="12" />
|
|
<f name="FYSL" type="4" />
|
|
<f name="TYSL" type="4" />
|
|
<f name="FYJE" type="4" />
|
|
<f name="TYJE" type="4" />
|
|
<f name="FYJJJE" type="4" />
|
|
<f name="TYJJJE" type="4" />
|
|
<f name="ZHXS" type="8" />
|
|
<f name="JBDW" type="12" />
|
|
<f name="RKDW" type="12" />
|
|
<f name="FYZL" type="12" />
|
|
<f name="DWVIEW" type="12" />
|
|
<f name="ZCZH" type="12" />
|
|
<f name="CSXX" type="12" />
|
|
<f name="GYS" type="12" />
|
|
<f name="FYDW" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
<dao id="ygyyallypfyfzbDaoBySales" log="true" type="1">
|
|
<sql><![CDATA[
|
|
SELECT yzxpkey,yzmc,gg,YZSL,TYSL,ZHXS,JBDW,RKDW,JJYS,JJKS,FYZL,jbdj,YPYZJBJG,dwview,FYRQ,YXQ,PH,ZCZH,CSXX,GYS,SFSL,FYDW,FYJE,TYJE,STSL,FYJJJE,TYJJJE FROM
|
|
(
|
|
select distinct a.pkey,b.pkey yzmx,b.yzxpkey,b.yzmc,c.gg,a.YZSL,a.TYSL,f.ZHXS,c.JBDW,f.RKDW,d.JJYS,d.JJKS,f.FYZL,e.jbdj,b.YPYZJBJG,f.dwview,g.FYRQ,e.YXQ,e.PH,c.ZCZH,c.CSXX,rkd.GYS,a.SFSL,a.FYDW,a.FYJE,a.TYJE,a.STSL,a.FYJJJE,a.TYJJJE from HIS_YFFY_MZFYMXB a left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_YPXX c on a.YZX=c.BM left join HIS_JZ_BASEINFO d on a.JZPKEY=d.pkey and a.JGID=d.JGID left join HIS_KSKC_PC e on a.KSKCPCPKEY=e.pkey and a.JGID=e.JGID left join HIS_SFX f on a.yzx=f.bm and a.JGID=f.JGID left join HIS_YFFY_MZFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_YFYK_RKD_MX rkmx on e.pkey=rkmx.KSKC_PC_PKEY and e.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID right join HIS_SFZD_YZMXB h on b.pkey=h.yzmx and b.JGID=h.JGID left join HIS_MZJS_MZFPZB fpb on h.ZDZBPKEY=fpb.GLZDBPKEY and h.JGID=fpb.JGID where a.JGID=? #ypbm# and fpb.SFZT != '0' and fpb.pjzt=1 and fpb.SFRQ >? and fpb.SFRQ <=?
|
|
|
|
|
|
union all
|
|
|
|
select distinct a.pkey,b.pkey yzmx,b.yzxpkey,b.yzmc,c.gg,a.YZSL,a.TYSL,f.ZHXS,c.JBDW,f.RKDW,d.JJYS,d.JJKS,f.FYZL,e.jbdj,b.YPYZJBJG,f.dwview,g.FYTIME FYRQ,e.YXQ,e.PH,c.ZCZH,c.CSXX,rkd.GYS,a.SFSL,a.FYDW,a.FYJE,a.TYJE,a.STSL,a.FYJJJE,a.TYJJJE from HIS_YFFY_ZYFYMXB a left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_YPXX c on a.YZXPKEY=c.BM left join HIS_JZ_BASEINFO d on a.JZPKEY=d.pkey and a.JGID=d.JGID left join HIS_KSKC_PC e on a.KSKCPCPKEY=e.pkey and a.JGID=e.JGID left join HIS_SFX f on a.yzxpkey=f.bm and a.JGID=f.JGID left join HIS_YFFY_ZYFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_YFYK_RKD_MX rkmx on e.pkey=rkmx.KSKC_PC_PKEY and e.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID right join HIS_SFZD_YZMXB h on b.pkey=h.yzmx and b.JGID=h.JGID left join HIS_MZJS_MZFPZB fpb on h.ZDZBPKEY=fpb.GLZDBPKEY and h.JGID=fpb.JGID where a.JGID=? #ypbm# and fpb.SFZT !='0' and fpb.pjzt=1 and fpb.SFRQ >? and fpb.SFRQ <=?
|
|
|
|
) ORDER BY JJYS
|
|
|
|
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="YZXPKEY" type="12" />
|
|
<f name="YZMC" type="12" />
|
|
<f name="GG" type="12" />
|
|
<f name="YZSL" type="12" />
|
|
<f name="TYSL" type="12" />
|
|
<f name="ZHXS" type="8" />
|
|
<f name="JBDW" type="12" />
|
|
<f name="RKDW" type="12" />
|
|
<f name="JJYS" type="12" />
|
|
<f name="JJKS" type="12" />
|
|
<f name="FYZL" type="12" />
|
|
<f name="JBDJ" type="8" />
|
|
<f name="YPYZJBJG" type="12" />
|
|
<f name="DWVIEW" type="12" />
|
|
<f name="FYRQ" type="93" />
|
|
<f name="YXQ" type="93" />
|
|
<f name="PH" type="12" />
|
|
<f name="ZCZH" type="12" />
|
|
<f name="CSXX" type="12" />
|
|
<f name="GYS" type="12" />
|
|
<f name="SFSL" type="12" />
|
|
<f name="FYDW" type="12" />
|
|
<f name="FYJE" type="8" />
|
|
<f name="TYJE" type="8" />
|
|
<f name="STSL" type="12" />
|
|
<f name="FYJJJE" type="8" />
|
|
<f name="TYJJJE" type="8" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
|
|
<dao id="newygyyallypfyfzbDaoBySales" log="true" type="1">
|
|
<sql><![CDATA[
|
|
select distinct pkey,yzmx,yzxpkey,yzmc,gg,YZSL,TYSL,ZHXS,JBDW,RKDW,JJYS,JJKS,FYZL,jbdj,YPYZJBJG,dwview,YXQ,PH,ZCZH,CSXX,GYS,fyrq,SFSL,FYDW,FYJE,TYJE,STSL,FYJJJE,TYJJJE,rq,YPYZBZJG,PCSJ,PCJBSJ,SFBZDWFY,YPYZZHXS,PCDJ,PCJBDJ,YPFYSJMS FROM
|
|
(
|
|
select distinct a.pkey,b.pkey yzmx,b.yzxpkey,b.yzmc,c.gg,a.YZSL,a.TYSL,f.ZHXS,c.JBDW,f.RKDW,d.JJYS,d.JJKS,f.FYZL,e.jbdj,b.YPYZJBJG,f.dwview,e.YXQ,e.PH,c.ZCZH,c.CSXX,rkd.GYS,g.fyrq,a.SFSL,a.FYDW,a.FYJE,0 TYJE,'' STSL,a.FYJJJE,0 TYJJJE,g.fyrq rq,b.YPYZBZJG,a.PCSJ,a.PCJBSJ,a.SFBZDWFY,a.YPYZZHXS,a.PCDJ,a.PCJBDJ,a.YPFYSJMS from HIS_YFFY_MZFYMXB a left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_YPXX c on a.YZX=c.BM left join HIS_JZ_BASEINFO d on a.JZPKEY=d.pkey and a.JGID=d.JGID left join HIS_KSKC_PC e on a.KSKCPCPKEY=e.pkey and a.JGID=e.JGID left join HIS_SFX f on a.yzx=f.bm and a.JGID=f.JGID left join HIS_YFFY_MZFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_YFYK_RKD_MX rkmx on e.pkey=rkmx.KSKC_PC_PKEY and e.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID where a.JGID=? #ypbm# and g.fyrq >? and g.fyrq <=?
|
|
|
|
union all
|
|
|
|
select distinct a.pkey,b.pkey yzmx,b.yzxpkey,b.yzmc,c.gg,a.YZSL,a.TYSL,f.ZHXS,c.JBDW,f.RKDW,d.JJYS,d.JJKS,f.FYZL,e.jbdj,b.YPYZJBJG,f.dwview,e.YXQ,e.PH,c.ZCZH,c.CSXX,rkd.GYS,g.fyrq,'' SFSL,a.FYDW,0 FYJE,tymxb.TYJE,tymxb.STSL,0 FYJJJE,tymxb.TYJJJE,tymxb.CJRQ rq,b.YPYZBZJG,a.PCSJ,a.PCJBSJ,a.SFBZDWFY,a.YPYZZHXS,a.PCDJ,a.PCJBDJ,a.YPFYSJMS from HIS_YFFY_MZTYMXB tymxb left join HIS_YFFY_MZFYMXB a on tymxb.MZFYMXBPKEY=a.pkey and tymxb.JGID=a.JGID left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_YPXX c on a.YZX=c.BM left join HIS_JZ_BASEINFO d on a.JZPKEY=d.pkey and a.JGID=d.JGID left join HIS_KSKC_PC e on a.KSKCPCPKEY=e.pkey and a.JGID=e.JGID left join HIS_SFX f on a.yzx=f.bm and a.JGID=f.JGID left join HIS_YFFY_MZFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_YFYK_RKD_MX rkmx on e.pkey=rkmx.KSKC_PC_PKEY and e.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID where a.JGID=? #ypbm# and tymxb.CJRQ >? and tymxb.CJRQ <=?
|
|
|
|
union all
|
|
select distinct a.pkey,b.pkey yzmx,b.yzxpkey,b.yzmc,c.gg,a.YZSL,a.TYSL,f.ZHXS,c.JBDW,f.RKDW,d.JJYS,d.JJKS,f.FYZL,e.jbdj,b.YPYZJBJG,f.dwview,e.YXQ,e.PH,c.ZCZH,c.CSXX,rkd.GYS,g.FYTIME fyrq,a.SFSL,a.FYDW,a.FYJE,0 TYJE,'' STSL,a.FYJJJE,0 TYJJJE,g.FYTIME rq,b.YPYZBZJG,a.PCSJ,a.PCJBSJ,a.SFBZDWFY,a.YPYZZHXS,a.PCDJ,a.PCJBDJ,a.YPFYSJMS from HIS_YFFY_ZYFYMXB a left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_YPXX c on a.YZXPKEY=c.BM left join HIS_JZ_BASEINFO d on a.JZPKEY=d.pkey and a.JGID=d.JGID left join HIS_KSKC_PC e on a.KSKCPCPKEY=e.pkey and a.JGID=e.JGID left join HIS_SFX f on a.yzxpkey=f.bm and a.JGID=f.JGID left join HIS_YFFY_ZYFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_YFYK_RKD_MX rkmx on e.pkey=rkmx.KSKC_PC_PKEY and e.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID where a.JGID=? #ypbm# and g.FYTIME >? and g.FYTIME <=? and a.sfsl>0
|
|
|
|
union all
|
|
|
|
select distinct a.pkey,b.pkey yzmx,b.yzxpkey,b.yzmc,c.gg,a.YZSL,a.TYSL,f.ZHXS,c.JBDW,f.RKDW,d.JJYS,d.JJKS,f.FYZL,e.jbdj,b.YPYZJBJG,f.dwview,e.YXQ,e.PH,c.ZCZH,c.CSXX,rkd.GYS,g.FYTIME fyrq,'' SFSL,a.FYDW,0 FYJE,tymxb.TYJE,tymxb.STSL,0 FYJJJE,tymxb.TYJJJE,tymxb.CJRQ rq,b.YPYZBZJG,a.PCSJ,a.PCJBSJ,a.SFBZDWFY,a.YPYZZHXS,a.PCDJ,a.PCJBDJ,a.YPFYSJMS from HIS_YFFY_MZTYMXB tymxb left join HIS_YFFY_ZYFYMXB a on tymxb.MZFYMXBPKEY=a.pkey and tymxb.JGID=a.JGID left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_YPXX c on a.YZXPKEY=c.BM left join HIS_JZ_BASEINFO d on a.JZPKEY=d.pkey and a.JGID=d.JGID left join HIS_KSKC_PC e on a.KSKCPCPKEY=e.pkey and a.JGID=e.JGID left join HIS_SFX f on a.yzxpkey=f.bm and a.JGID=f.JGID left join HIS_YFFY_ZYFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_YFYK_RKD_MX rkmx on e.pkey=rkmx.KSKC_PC_PKEY and e.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID where a.JGID=? #ypbm# and tymxb.CJRQ >? and tymxb.CJRQ <=? and tymxb.stsl >0
|
|
|
|
) ORDER BY rq
|
|
|
|
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="PKEY" type="12" />
|
|
<f name="YZMX" type="12" />
|
|
<f name="YZXPKEY" type="12" />
|
|
<f name="YZMC" type="12" />
|
|
<f name="GG" type="12" />
|
|
<f name="YZSL" type="12" />
|
|
<f name="TYSL" type="12" />
|
|
<f name="ZHXS" type="8" />
|
|
<f name="JBDW" type="12" />
|
|
<f name="RKDW" type="12" />
|
|
<f name="JJYS" type="12" />
|
|
<f name="JJKS" type="12" />
|
|
<f name="FYZL" type="12" />
|
|
<f name="JBDJ" type="8" />
|
|
<f name="YPYZJBJG" type="12" />
|
|
<f name="DWVIEW" type="12" />
|
|
<f name="YXQ" type="93" />
|
|
<f name="PH" type="12" />
|
|
<f name="ZCZH" type="12" />
|
|
<f name="CSXX" type="12" />
|
|
<f name="GYS" type="12" />
|
|
<f name="FYRQ" type="93" />
|
|
<f name="SFSL" type="12" />
|
|
<f name="FYDW" type="12" />
|
|
<f name="FYJE" type="8" />
|
|
<f name="TYJE" type="8" />
|
|
<f name="STSL" type="12" />
|
|
<f name="FYJJJE" type="8" />
|
|
<f name="TYJJJE" type="8" />
|
|
<f name="RQ" type="93" />
|
|
<f name="YPYZBZJG" type="12" />
|
|
<f name="PCSJ" type="8" />
|
|
<f name="PCJBSJ" type="8" />
|
|
<f name="SFBZDWFY" type="12" />
|
|
<f name="YPYZZHXS" type="12" />
|
|
<f name="PCDJ" type="8" />
|
|
<f name="PCJBDJ" type="8" />
|
|
<f name="YPFYSJMS" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
<dao id="ygyyzyypfyfzbDaoBySales" log="true" type="1">
|
|
<sql><![CDATA[
|
|
|
|
|
|
select distinct a.pkey,b.pkey yzmx,b.yzxpkey,b.yzmc,c.gg,a.YZSL,a.TYSL,f.ZHXS,c.JBDW,f.RKDW,d.JJYS,d.JJKS,f.FYZL,e.jbdj,b.YPYZJBJG,f.dwview,e.YXQ,e.PH,c.ZCZH,c.CSXX,rkd.GYS,g.FYTIME fyrq,a.SFSL,a.FYDW,a.FYJE,a.TYJE,a.STSL,a.FYJJJE,a.TYJJJE from HIS_YFFY_ZYFYMXB a left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_YPXX c on a.YZXPKEY=c.BM left join HIS_JZ_BASEINFO d on a.JZPKEY=d.pkey and a.JGID=d.JGID left join HIS_KSKC_PC e on a.KSKCPCPKEY=e.pkey and a.JGID=e.JGID left join HIS_SFX f on a.yzxpkey=f.bm and a.JGID=f.JGID left join HIS_YFFY_ZYFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_YFYK_RKD_MX rkmx on e.pkey=rkmx.KSKC_PC_PKEY and e.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID right join HIS_SFZD_YZMXB h on b.pkey=h.yzmx and b.JGID=h.JGID left join HIS_MZJS_MZFPZB fpb on h.ZDZBPKEY=fpb.GLZDBPKEY and h.JGID=fpb.JGID where a.JGID=? #ypbm# and fpb.SFZT != '0' and fpb.pjzt=1 and fpb.SFRQ >? and fpb.SFRQ <=? order by d.JJYS
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="PKEY" type="12" />
|
|
<f name="YZMX" type="12" />
|
|
<f name="YZXPKEY" type="12" />
|
|
<f name="YZMC" type="12" />
|
|
<f name="GG" type="12" />
|
|
<f name="YZSL" type="12" />
|
|
<f name="TYSL" type="12" />
|
|
<f name="ZHXS" type="8" />
|
|
<f name="JBDW" type="12" />
|
|
<f name="RKDW" type="12" />
|
|
<f name="JJYS" type="12" />
|
|
<f name="JJKS" type="12" />
|
|
<f name="FYZL" type="12" />
|
|
<f name="JBDJ" type="8" />
|
|
<f name="YPYZJBJG" type="12" />
|
|
<f name="DWVIEW" type="12" />
|
|
<f name="YXQ" type="93" />
|
|
<f name="PH" type="12" />
|
|
<f name="ZCZH" type="12" />
|
|
<f name="CSXX" type="12" />
|
|
<f name="GYS" type="12" />
|
|
<f name="FYRQ" type="93" />
|
|
<f name="SFSL" type="12" />
|
|
<f name="FYDW" type="12" />
|
|
<f name="FYJE" type="8" />
|
|
<f name="TYJE" type="8" />
|
|
<f name="STSL" type="12" />
|
|
<f name="FYJJJE" type="8" />
|
|
<f name="TYJJJE" type="8" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
<dao id="newygyyzyypfyfzbDaoBySales" log="true" type="1">
|
|
<sql><![CDATA[
|
|
|
|
|
|
select distinct pkey,yzmx,yzxpkey,yzmc,gg,YZSL,TYSL,ZHXS,JBDW,RKDW,JJYS,JJKS,FYZL,jbdj,YPYZJBJG,dwview,YXQ,PH,ZCZH,CSXX,GYS,fyrq,SFSL,FYDW,FYJE,TYJE,STSL,FYJJJE,TYJJJE,rq,YPYZBZJG,PCSJ,PCJBSJ,SFBZDWFY,YPYZZHXS,PCDJ,PCJBDJ,YPFYSJMS from (
|
|
|
|
|
|
select distinct a.pkey,b.pkey yzmx,b.yzxpkey,b.yzmc,c.gg,a.YZSL,a.TYSL,f.ZHXS,c.JBDW,f.RKDW,d.JJYS,d.JJKS,f.FYZL,e.jbdj,b.YPYZJBJG,f.dwview,e.YXQ,e.PH,c.ZCZH,c.CSXX,rkd.GYS,g.FYTIME fyrq,a.SFSL,a.FYDW,a.FYJE,0 TYJE,'' STSL,a.FYJJJE,0 TYJJJE,g.FYTIME rq,b.YPYZBZJG,a.PCSJ,a.PCJBSJ,a.SFBZDWFY,a.YPYZZHXS,a.PCDJ,a.PCJBDJ,a.YPFYSJMS from HIS_YFFY_ZYFYMXB a left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_YPXX c on a.YZXPKEY=c.BM left join HIS_JZ_BASEINFO d on a.JZPKEY=d.pkey and a.JGID=d.JGID left join HIS_KSKC_PC e on a.KSKCPCPKEY=e.pkey and a.JGID=e.JGID left join HIS_SFX f on a.yzxpkey=f.bm and a.JGID=f.JGID left join HIS_YFFY_ZYFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_YFYK_RKD_MX rkmx on e.pkey=rkmx.KSKC_PC_PKEY and e.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID right join HIS_SFZD_YZMXB h on b.pkey=h.yzmx and b.JGID=h.JGID left join HIS_MZJS_MZFPZB fpb on h.ZDZBPKEY=fpb.GLZDBPKEY and h.JGID=fpb.JGID where a.JGID=? #ypbm# and fpb.SFZT != '0' and fpb.pjzt=1 and fpb.SFRQ >? and fpb.SFRQ <=? and a.sfsl>0
|
|
|
|
union all
|
|
|
|
select distinct a.pkey,b.pkey yzmx,b.yzxpkey,b.yzmc,c.gg,a.YZSL,a.TYSL,f.ZHXS,c.JBDW,f.RKDW,d.JJYS,d.JJKS,f.FYZL,e.jbdj,b.YPYZJBJG,f.dwview,e.YXQ,e.PH,c.ZCZH,c.CSXX,rkd.GYS,g.FYTIME fyrq,'' SFSL,a.FYDW,0 FYJE,tymxb.TYJE,tymxb.STSL,0 FYJJJE,tymxb.TYJJJE,tymxb.CJRQ rq,b.YPYZBZJG,a.PCSJ,a.PCJBSJ,a.SFBZDWFY,a.YPYZZHXS,a.PCDJ,a.PCJBDJ,a.YPFYSJMS from HIS_YFFY_MZTYMXB tymxb left join HIS_YFFY_ZYFYMXB a on tymxb.MZFYMXBPKEY=a.pkey and tymxb.JGID=a.JGID left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_YPXX c on a.YZXPKEY=c.BM left join HIS_JZ_BASEINFO d on a.JZPKEY=d.pkey and a.JGID=d.JGID left join HIS_KSKC_PC e on a.KSKCPCPKEY=e.pkey and a.JGID=e.JGID left join HIS_SFX f on a.yzxpkey=f.bm and a.JGID=f.JGID left join HIS_YFFY_ZYFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_YFYK_RKD_MX rkmx on e.pkey=rkmx.KSKC_PC_PKEY and e.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID right join HIS_SFZD_YZMXB h on b.pkey=h.yzmx and b.JGID=h.JGID left join HIS_MZJS_MZFPZB fpb on h.ZDZBPKEY=fpb.GLZDBPKEY and h.JGID=fpb.JGID where a.JGID=? #ypbm# and fpb.SFZT != '0' and fpb.pjzt=1 and fpb.SFRQ >? and fpb.SFRQ <=? and tymxb.stsl >0
|
|
|
|
) ORDER BY rq
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="PKEY" type="12" />
|
|
<f name="YZMX" type="12" />
|
|
<f name="YZXPKEY" type="12" />
|
|
<f name="YZMC" type="12" />
|
|
<f name="GG" type="12" />
|
|
<f name="YZSL" type="12" />
|
|
<f name="TYSL" type="12" />
|
|
<f name="ZHXS" type="8" />
|
|
<f name="JBDW" type="12" />
|
|
<f name="RKDW" type="12" />
|
|
<f name="JJYS" type="12" />
|
|
<f name="JJKS" type="12" />
|
|
<f name="FYZL" type="12" />
|
|
<f name="JBDJ" type="8" />
|
|
<f name="YPYZJBJG" type="12" />
|
|
<f name="DWVIEW" type="12" />
|
|
<f name="YXQ" type="93" />
|
|
<f name="PH" type="12" />
|
|
<f name="ZCZH" type="12" />
|
|
<f name="CSXX" type="12" />
|
|
<f name="GYS" type="12" />
|
|
<f name="FYRQ" type="93" />
|
|
<f name="SFSL" type="12" />
|
|
<f name="FYDW" type="12" />
|
|
<f name="FYJE" type="8" />
|
|
<f name="TYJE" type="8" />
|
|
<f name="STSL" type="12" />
|
|
<f name="FYJJJE" type="8" />
|
|
<f name="TYJJJE" type="8" />
|
|
<f name="RQ" type="93" />
|
|
<f name="YPYZBZJG" type="12" />
|
|
<f name="PCSJ" type="8" />
|
|
<f name="PCJBSJ" type="8" />
|
|
<f name="SFBZDWFY" type="12" />
|
|
<f name="YPYZZHXS" type="12" />
|
|
<f name="PCDJ" type="8" />
|
|
<f name="PCJBDJ" type="8" />
|
|
<f name="YPFYSJMS" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
|
|
<dao id="ygyymzypfyfzbDaoBySales" log="true" type="1">
|
|
<sql><![CDATA[
|
|
select distinct a.pkey,b.pkey yzmx,b.yzxpkey,b.yzmc,c.gg,a.YZSL,a.TYSL,f.ZHXS,c.JBDW,f.RKDW,d.JJYS,d.JJKS,f.FYZL,e.jbdj,b.YPYZJBJG,f.dwview,e.YXQ,e.PH,c.ZCZH,c.CSXX,rkd.GYS,g.fyrq,a.SFSL,a.FYDW,a.FYJE,a.TYJE,a.STSL,a.FYJJJE,a.TYJJJE from HIS_YFFY_MZFYMXB a left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_YPXX c on a.YZX=c.BM left join HIS_JZ_BASEINFO d on a.JZPKEY=d.pkey and a.JGID=d.JGID left join HIS_KSKC_PC e on a.KSKCPCPKEY=e.pkey and a.JGID=e.JGID left join HIS_SFX f on a.yzx=f.bm and a.JGID=f.JGID left join HIS_YFFY_MZFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_YFYK_RKD_MX rkmx on e.pkey=rkmx.KSKC_PC_PKEY and e.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID right join HIS_SFZD_YZMXB h on b.pkey=h.yzmx and b.JGID=h.JGID left join HIS_MZJS_MZFPZB fpb on h.ZDZBPKEY=fpb.GLZDBPKEY and h.JGID=fpb.JGID where a.JGID=? #ypbm# and fpb.SFZT != '0' and fpb.pjzt=1 and fpb.SFRQ >? and fpb.SFRQ <=? order by d.JJYS
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="PKEY" type="12" />
|
|
<f name="YZMX" type="12" />
|
|
<f name="YZXPKEY" type="12" />
|
|
<f name="YZMC" type="12" />
|
|
<f name="GG" type="12" />
|
|
<f name="YZSL" type="12" />
|
|
<f name="TYSL" type="12" />
|
|
<f name="ZHXS" type="8" />
|
|
<f name="JBDW" type="12" />
|
|
<f name="RKDW" type="12" />
|
|
<f name="JJYS" type="12" />
|
|
<f name="JJKS" type="12" />
|
|
<f name="FYZL" type="12" />
|
|
<f name="JBDJ" type="8" />
|
|
<f name="YPYZJBJG" type="12" />
|
|
<f name="DWVIEW" type="12" />
|
|
<f name="YXQ" type="93" />
|
|
<f name="PH" type="12" />
|
|
<f name="ZCZH" type="12" />
|
|
<f name="CSXX" type="12" />
|
|
<f name="GYS" type="12" />
|
|
<f name="FYRQ" type="93" />
|
|
<f name="SFSL" type="12" />
|
|
<f name="FYDW" type="12" />
|
|
<f name="FYJE" type="8" />
|
|
<f name="TYJE" type="8" />
|
|
<f name="STSL" type="12" />
|
|
<f name="FYJJJE" type="8" />
|
|
<f name="TYJJJE" type="8" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
<dao id="newygyymzypfyfzbDaoBySales" log="true" type="1">
|
|
<sql><![CDATA[
|
|
select distinct pkey,yzmx,yzxpkey,yzmc,gg,YZSL,TYSL,ZHXS,JBDW,RKDW,JJYS,JJKS,FYZL,jbdj,YPYZJBJG,dwview,YXQ,PH,ZCZH,CSXX,GYS,fyrq,SFSL,FYDW,FYJE,TYJE,STSL,FYJJJE,TYJJJE,rq,YPYZBZJG,PCSJ,PCJBSJ,SFBZDWFY,YPYZZHXS,PCDJ,PCJBDJ,YPFYSJMS from (
|
|
select distinct a.pkey,b.pkey yzmx,b.yzxpkey,b.yzmc,c.gg,a.YZSL,a.TYSL,f.ZHXS,c.JBDW,f.RKDW,d.JJYS,d.JJKS,f.FYZL,e.jbdj,b.YPYZJBJG,f.dwview,e.YXQ,e.PH,c.ZCZH,c.CSXX,rkd.GYS,g.fyrq,a.SFSL,a.FYDW,a.FYJE,0 TYJE,'' STSL,a.FYJJJE,0 TYJJJE,g.fyrq rq,b.YPYZBZJG,a.PCSJ,a.PCJBSJ,a.SFBZDWFY,a.YPYZZHXS,a.PCDJ,a.PCJBDJ,a.YPFYSJMS from HIS_YFFY_MZFYMXB a left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_YPXX c on a.YZX=c.BM left join HIS_JZ_BASEINFO d on a.JZPKEY=d.pkey and a.JGID=d.JGID left join HIS_KSKC_PC e on a.KSKCPCPKEY=e.pkey and a.JGID=e.JGID left join HIS_SFX f on a.yzx=f.bm and a.JGID=f.JGID left join HIS_YFFY_MZFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_YFYK_RKD_MX rkmx on e.pkey=rkmx.KSKC_PC_PKEY and e.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID where a.JGID=? #ypbm# and g.fyrq >? and g.fyrq <=?
|
|
|
|
union all
|
|
|
|
select distinct a.pkey,b.pkey yzmx,b.yzxpkey,b.yzmc,c.gg,a.YZSL,a.TYSL,f.ZHXS,c.JBDW,f.RKDW,d.JJYS,d.JJKS,f.FYZL,e.jbdj,b.YPYZJBJG,f.dwview,e.YXQ,e.PH,c.ZCZH,c.CSXX,rkd.GYS,g.fyrq,'' SFSL,a.FYDW,0 FYJE,tymxb.TYJE,tymxb.STSL,0 FYJJJE,tymxb.TYJJJE,tymxb.CJRQ rq,b.YPYZBZJG,a.PCSJ,a.PCJBSJ,a.SFBZDWFY,a.YPYZZHXS,a.PCDJ,a.PCJBDJ,a.YPFYSJMS from HIS_YFFY_MZTYMXB tymxb left join HIS_YFFY_MZFYMXB a on tymxb.MZFYMXBPKEY=a.pkey and tymxb.JGID=a.JGID left join HIS_YZ_MXB b on a.YZMX=b.PKEY and a.JGID=b.JGID left join HIS_YPXX c on a.YZX=c.BM left join HIS_JZ_BASEINFO d on a.JZPKEY=d.pkey and a.JGID=d.JGID left join HIS_KSKC_PC e on a.KSKCPCPKEY=e.pkey and a.JGID=e.JGID left join HIS_SFX f on a.yzx=f.bm and a.JGID=f.JGID left join HIS_YFFY_MZFYZB g on a.FYBPKEY=g.pkey and a.JGID=g.JGID left join HIS_YFYK_RKD_MX rkmx on e.pkey=rkmx.KSKC_PC_PKEY and e.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID where a.JGID=? #ypbm# and tymxb.CJRQ >? and tymxb.CJRQ <=?
|
|
|
|
) ORDER BY rq
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="PKEY" type="12" />
|
|
<f name="YZMX" type="12" />
|
|
<f name="YZXPKEY" type="12" />
|
|
<f name="YZMC" type="12" />
|
|
<f name="GG" type="12" />
|
|
<f name="YZSL" type="12" />
|
|
<f name="TYSL" type="12" />
|
|
<f name="ZHXS" type="8" />
|
|
<f name="JBDW" type="12" />
|
|
<f name="RKDW" type="12" />
|
|
<f name="JJYS" type="12" />
|
|
<f name="JJKS" type="12" />
|
|
<f name="FYZL" type="12" />
|
|
<f name="JBDJ" type="8" />
|
|
<f name="YPYZJBJG" type="12" />
|
|
<f name="DWVIEW" type="12" />
|
|
<f name="YXQ" type="93" />
|
|
<f name="PH" type="12" />
|
|
<f name="ZCZH" type="12" />
|
|
<f name="CSXX" type="12" />
|
|
<f name="GYS" type="12" />
|
|
<f name="FYRQ" type="93" />
|
|
<f name="SFSL" type="12" />
|
|
<f name="FYDW" type="12" />
|
|
<f name="FYJE" type="8" />
|
|
<f name="TYJE" type="8" />
|
|
<f name="STSL" type="12" />
|
|
<f name="FYJJJE" type="8" />
|
|
<f name="TYJJJE" type="8" />
|
|
<f name="RQ" type="93" />
|
|
<f name="YPYZBZJG" type="12" />
|
|
<f name="PCSJ" type="8" />
|
|
<f name="PCJBSJ" type="8" />
|
|
<f name="SFBZDWFY" type="12" />
|
|
<f name="YPYZZHXS" type="12" />
|
|
<f name="PCDJ" type="8" />
|
|
<f name="PCJBDJ" type="8" />
|
|
<f name="YPFYSJMS" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
<dao id="newygyymzypfyfzbDaoBySales2" log="true" type="1">
|
|
<sql><![CDATA[
|
|
select type,pkey,yzmx,yzxpkey,yzmc,gg,YZSL,TYSL,ZHXS,JBDW,RKDW,JJYS,JJKS,FYZL,jbdj,YPYZJBJG,dwview,YXQ,PH,ZCZH,CSXX,GYS,fyrq,SFSL,FYDW,FYJE,TYJE,STSL,FYJJJE,TYJJJE,rq,YPYZBZJG,PCSJ,PCJBSJ,SFBZDWFY,YPYZZHXS,PCDJ,PCJBDJ,YPFYSJMS,XM,XB,YZXZSJ,YZJL,YZJLDW,YZYF,JZPKEY,HZPKEY,JZNL,CFH from (
|
|
|
|
select distinct '1' type,f.pkey,e.pkey yzmx,e.yzxpkey,e.yzmc,ypxx.gg,f.YZSL,f.TYSL,sfx.ZHXS,ypxx.JBDW,sfx.RKDW,a.JJYS,a.JJKS,sfx.FYZL,pc.jbdj,e.YPYZJBJG,sfx.dwview,pc.YXQ,pc.PH,ypxx.ZCZH,ypxx.CSXX,rkd.GYS,g.fyrq,f.SFSL,f.FYDW,f.FYJE,0 TYJE,'' STSL,f.FYJJJE,0 TYJJJE,g.fyrq rq,e.YPYZBZJG,f.PCSJ,f.PCJBSJ,f.SFBZDWFY,f.YPYZZHXS,f.PCDJ,f.PCJBDJ,f.YPFYSJMS,hz.XM,hz.XB,e.YZXZSJ,e.YZJL,e.YZJLDW,e.YZYF ,a.PKEY as JZPKEY,hz.PKEY as HZPKEY,a.JZNL,e.CFH from HIS_JZ_BASEINFO a left join HIS_SFZD_ZB b on a.pkey=b.jzpkey and a.JGID=b.JGID left join HIS_MZJS_MZFPZB c on b.pkey=c.GLZDBPKEY and b.JGID=c.JGID left join HIS_SFZD_SFXMXB d on b.pkey=d.ZDZBPKEY and b.JGID=d.JGID left join HIS_YZ_MXB e on d.YZMX=e.pkey and d.JGID=e.JGID left join HIS_SFX sfx on d.sfx=sfx.bm and d.JGID=sfx.JGID left join HIS_YFFY_MZFYMXB f on f.YZMX=e.PKEY and f.JGID=e.JGID left join HIS_YPXX ypxx on f.YZX=ypxx.BM left join HIS_YFFY_MZFYZB g on f.FYBPKEY=g.pkey and f.JGID=g.JGID left join HIS_KSKC_PC pc on f.KSKCPCPKEY=pc.pkey and f.JGID=pc.JGID left join HIS_YFYK_RKD_MX rkmx on pc.pkey=rkmx.KSKC_PC_PKEY and pc.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID LEFT JOIN HIS_HZINFO hz on a.JGID = hz.JGID AND a.HZPKEY = hz.PKEY where a.JGID=? #ypbm# and c.PJLX='MS' and sfx.GLLX='Y' and c.SFRQ > ? and c.SFRQ <= ? and c.PJZT = 1 and f.sfsl > 0 and b.TFHSFZDPKEY is null
|
|
|
|
union all
|
|
|
|
select distinct '2' type,tymxb.pkey,e.pkey yzmx,e.yzxpkey,e.yzmc,ypxx.gg,f.YZSL,f.TYSL,sfx.ZHXS,ypxx.JBDW,sfx.RKDW,a.JJYS,a.JJKS,sfx.FYZL,pc.jbdj,e.YPYZJBJG,sfx.dwview,pc.YXQ,pc.PH,ypxx.ZCZH,ypxx.CSXX,rkd.GYS,g.fyrq,'' SFSL,f.FYDW,0 FYJE,tymxb.TYJE,tymxb.STSL,0 FYJJJE,tymxb.TYJJJE,g.fyrq rq,e.YPYZBZJG,f.PCSJ,f.PCJBSJ,f.SFBZDWFY,f.YPYZZHXS,f.PCDJ,f.PCJBDJ,f.YPFYSJMS,hz.XM,hz.XB,e.YZXZSJ,e.YZJL,e.YZJLDW,e.YZYF ,a.PKEY as JZPKEY,hz.PKEY as HZPKEY,a.JZNL,e.CFH from HIS_JZ_BASEINFO a left join HIS_SFZD_ZB b on a.pkey=b.jzpkey and a.JGID=b.JGID left join HIS_MZJS_MZFPZB c on b.pkey=c.GLZDBPKEY and b.JGID=c.JGID left join HIS_SFZD_SFXMXB d on b.pkey=d.ZDZBPKEY and b.JGID=d.JGID left join HIS_YZ_MXB e on d.YZMX=e.pkey and d.JGID=e.JGID left join HIS_SFX sfx on d.sfx=sfx.bm and d.JGID=sfx.JGID left join HIS_YFFY_MZTYMXB tymxb on tymxb.yzmx=e.pkey and tymxb.JGID = e.JGID left join HIS_YFFY_MZFYMXB f on tymxb.MZFYMXBPKEY=f.PKEY and tymxb.JGID=f.JGID left join HIS_YPXX ypxx on f.YZX=ypxx.BM left join HIS_YFFY_MZFYZB g on f.FYBPKEY=g.pkey and f.JGID=g.JGID left join HIS_KSKC_PC pc on f.KSKCPCPKEY=pc.pkey and f.JGID=pc.JGID left join HIS_YFYK_RKD_MX rkmx on pc.pkey=rkmx.KSKC_PC_PKEY and pc.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID LEFT JOIN HIS_HZINFO hz on a.JGID = hz.JGID AND a.HZPKEY = hz.PKEY where a.JGID=? #ypbm# and c.PJLX='MS' and sfx.GLLX='Y' and c.SFRQ > ? and c.SFRQ <= ? and c.pjzt=2 and c.SFZT != 0 and tymxb.stsl > 0
|
|
|
|
)
|
|
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="type" type="12" />
|
|
<f name="PKEY" type="12" />
|
|
<f name="YZMX" type="12" />
|
|
<f name="YZXPKEY" type="12" />
|
|
<f name="YZMC" type="12" />
|
|
<f name="GG" type="12" />
|
|
<f name="YZSL" type="12" />
|
|
<f name="TYSL" type="12" />
|
|
<f name="ZHXS" type="8" />
|
|
<f name="JBDW" type="12" />
|
|
<f name="RKDW" type="12" />
|
|
<f name="JJYS" type="12" />
|
|
<f name="JJKS" type="12" />
|
|
<f name="FYZL" type="12" />
|
|
<f name="JBDJ" type="8" />
|
|
<f name="YPYZJBJG" type="12" />
|
|
<f name="DWVIEW" type="12" />
|
|
<f name="YXQ" type="93" />
|
|
<f name="PH" type="12" />
|
|
<f name="ZCZH" type="12" />
|
|
<f name="CSXX" type="12" />
|
|
<f name="GYS" type="12" />
|
|
<f name="FYRQ" type="93" />
|
|
<f name="SFSL" type="12" />
|
|
<f name="FYDW" type="12" />
|
|
<f name="FYJE" type="8" />
|
|
<f name="TYJE" type="8" />
|
|
<f name="STSL" type="12" />
|
|
<f name="FYJJJE" type="8" />
|
|
<f name="TYJJJE" type="8" />
|
|
<f name="RQ" type="93" />
|
|
<f name="YPYZBZJG" type="12" />
|
|
<f name="PCSJ" type="8" />
|
|
<f name="PCJBSJ" type="8" />
|
|
<f name="SFBZDWFY" type="12" />
|
|
<f name="YPYZZHXS" type="12" />
|
|
<f name="PCDJ" type="8" />
|
|
<f name="PCJBDJ" type="8" />
|
|
<f name="YPFYSJMS" type="12" />
|
|
<f name="XM" type="12" />
|
|
<f name="XB" type="12" />
|
|
<f name="YZXZYS" type="8" />
|
|
<f name="YZJL" type="12" />
|
|
<f name="YZJLDW" type="12" />
|
|
<f name="YZYF" type="12" />
|
|
<f name="JZPKEY" type="12" />
|
|
<f name="HZPKEY" type="12" />
|
|
<f name="JZNL" type="12" />
|
|
<f name="CFH" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
<dao id="newygyymzypfyfzbDaoBySales3" log="true" type="1">
|
|
<sql><![CDATA[
|
|
select type,pkey,yzmx,yzxpkey,yzmc,gg,YZSL,TYSL,ZHXS,JBDW,RKDW,JJYS,JJKS,FYZL,jbdj,YPYZJBJG,dwview,YXQ,PH,ZCZH,CSXX,GYS,fyrq,SFSL,FYDW,FYJE,TYJE,STSL,FYJJJE,TYJJJE,rq,YPYZBZJG,PCSJ,PCJBSJ,SFBZDWFY,YPYZZHXS,PCDJ,PCJBDJ,YPFYSJMS from (
|
|
|
|
select distinct '1' type,f.pkey,e.pkey yzmx,e.yzxpkey,e.yzmc,ypxx.gg,f.YZSL,f.TYSL,sfx.ZHXS,ypxx.JBDW,sfx.RKDW,a.JJYS,a.JJKS,sfx.FYZL,pc.jbdj,e.YPYZJBJG,sfx.dwview,pc.YXQ,pc.PH,ypxx.ZCZH,ypxx.CSXX,rkd.GYS,g.fyrq,f.SFSL,f.FYDW,f.FYJE,0 TYJE,'' STSL,f.FYJJJE,0 TYJJJE,g.fyrq rq,e.YPYZBZJG,f.PCSJ,f.PCJBSJ,f.SFBZDWFY,f.YPYZZHXS,f.PCDJ,f.PCJBDJ,f.YPFYSJMS from HIS_JZ_BASEINFO a left join HIS_SFZD_ZB b on a.pkey=b.jzpkey and a.JGID=b.JGID left join HIS_MZJS_MZFPZB c on b.pkey=c.GLZDBPKEY and b.JGID=c.JGID left join HIS_YFFY_MZFYMXB f on b.jzpkey=f.jzpkey and b.JGID=f.JGID left join HIS_YZ_MXB e on f.YZMX=e.pkey and f.JGID=e.JGID left join HIS_SFX sfx on f.yzx=sfx.bm and f.JGID=sfx.JGID left join HIS_YPXX ypxx on f.YZX=ypxx.BM left join HIS_YFFY_MZFYZB g on f.FYBPKEY=g.pkey and f.JGID=g.JGID left join HIS_KSKC_PC pc on f.KSKCPCPKEY=pc.pkey and f.JGID=pc.JGID left join HIS_YFYK_RKD_MX rkmx on pc.pkey=rkmx.KSKC_PC_PKEY and pc.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID where a.JGID=? #ypbm# and c.PJLX='MS' and sfx.GLLX='Y' and c.SFRQ > ? and c.SFRQ <= ? and c.PJZT = 1 and f.sfsl > 0 and b.TFHSFZDPKEY is null
|
|
|
|
|
|
union all
|
|
|
|
|
|
select distinct '2' type,tymxb.pkey,e.pkey yzmx,e.yzxpkey,e.yzmc,ypxx.gg,f.YZSL,f.TYSL,sfx.ZHXS,ypxx.JBDW,sfx.RKDW,a.JJYS,a.JJKS,sfx.FYZL,pc.jbdj,e.YPYZJBJG,sfx.dwview,pc.YXQ,pc.PH,ypxx.ZCZH,ypxx.CSXX,rkd.GYS,g.fyrq,'' SFSL,f.FYDW,0 FYJE,tymxb.TYJE,tymxb.STSL,0 FYJJJE,tymxb.TYJJJE,g.fyrq rq,e.YPYZBZJG,f.PCSJ,f.PCJBSJ,f.SFBZDWFY,f.YPYZZHXS,f.PCDJ,f.PCJBDJ,f.YPFYSJMS from HIS_JZ_BASEINFO a left join HIS_SFZD_ZB b on a.pkey=b.jzpkey and a.JGID=b.JGID left join HIS_MZJS_MZFPZB c on b.pkey=c.GLZDBPKEY and b.JGID=c.JGID left join HIS_YFFY_MZTYMXB tymxb on tymxb.jzpkey=b.jzpkey and tymxb.JGID = b.JGID left join HIS_YZ_MXB e on tymxb.YZMX=e.pkey and tymxb.JGID=e.JGID left join HIS_SFX sfx on tymxb.yzx=sfx.bm and tymxb.JGID=sfx.JGID
|
|
left join HIS_YFFY_MZFYMXB f on tymxb.MZFYMXBPKEY=f.PKEY and tymxb.JGID=f.JGID left join HIS_YPXX ypxx on tymxb.YZX=ypxx.BM left join HIS_YFFY_MZFYZB g on f.FYBPKEY=g.pkey and f.JGID=g.JGID left join HIS_KSKC_PC pc on f.KSKCPCPKEY=pc.pkey and f.JGID=pc.JGID left join HIS_YFYK_RKD_MX rkmx on pc.pkey=rkmx.KSKC_PC_PKEY and pc.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID where a.JGID=? #ypbm# and c.PJLX='MS' and sfx.GLLX='Y' and c.SFRQ > ? and c.SFRQ <= ? and c.pjzt=2 and c.SFZT != 0 and tymxb.stsl > 0
|
|
|
|
|
|
)
|
|
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="type" type="12" />
|
|
<f name="PKEY" type="12" />
|
|
<f name="YZMX" type="12" />
|
|
<f name="YZXPKEY" type="12" />
|
|
<f name="YZMC" type="12" />
|
|
<f name="GG" type="12" />
|
|
<f name="YZSL" type="12" />
|
|
<f name="TYSL" type="12" />
|
|
<f name="ZHXS" type="8" />
|
|
<f name="JBDW" type="12" />
|
|
<f name="RKDW" type="12" />
|
|
<f name="JJYS" type="12" />
|
|
<f name="JJKS" type="12" />
|
|
<f name="FYZL" type="12" />
|
|
<f name="JBDJ" type="8" />
|
|
<f name="YPYZJBJG" type="12" />
|
|
<f name="DWVIEW" type="12" />
|
|
<f name="YXQ" type="93" />
|
|
<f name="PH" type="12" />
|
|
<f name="ZCZH" type="12" />
|
|
<f name="CSXX" type="12" />
|
|
<f name="GYS" type="12" />
|
|
<f name="FYRQ" type="93" />
|
|
<f name="SFSL" type="12" />
|
|
<f name="FYDW" type="12" />
|
|
<f name="FYJE" type="8" />
|
|
<f name="TYJE" type="8" />
|
|
<f name="STSL" type="12" />
|
|
<f name="FYJJJE" type="8" />
|
|
<f name="TYJJJE" type="8" />
|
|
<f name="RQ" type="93" />
|
|
<f name="YPYZBZJG" type="12" />
|
|
<f name="PCSJ" type="8" />
|
|
<f name="PCJBSJ" type="8" />
|
|
<f name="SFBZDWFY" type="12" />
|
|
<f name="YPYZZHXS" type="12" />
|
|
<f name="PCDJ" type="8" />
|
|
<f name="PCJBDJ" type="8" />
|
|
<f name="YPFYSJMS" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
<dao id="newygyyzyypfyfzbDaoBySales2" log="true" type="1">
|
|
<sql><![CDATA[
|
|
|
|
select type,pkey,yzmx,yzxpkey,yzmc,gg,YZSL,TYSL,ZHXS,JBDW,RKDW,JJYS,JJKS,FYZL,jbdj,YPYZJBJG,dwview,YXQ,PH,ZCZH,CSXX,GYS,fyrq,SFSL,FYDW,FYJE,TYJE,STSL,FYJJJE,TYJJJE,rq,YPYZBZJG,PCSJ,PCJBSJ,SFBZDWFY,YPYZZHXS,PCDJ,PCJBDJ,YPFYSJMS,XM,XB,YZXZSJ,YZJL,YZJLDW,YZYF,JZPKEY,
|
|
HZPKEY,JZNL,CFH from (
|
|
|
|
select distinct '1' type,f.pkey,e.pkey yzmx,e.yzxpkey,e.yzmc,ypxx.gg,f.YZSL,f.TYSL,sfx.ZHXS,ypxx.JBDW,sfx.RKDW,a.JJYS,a.JJKS,sfx.FYZL,pc.jbdj,e.YPYZJBJG,sfx.dwview,pc.YXQ,pc.PH,ypxx.ZCZH,ypxx.CSXX,rkd.GYS,g.FYTIME fyrq,f.SFSL,f.FYDW,f.FYJE,0 TYJE,'' STSL,f.FYJJJE,0 TYJJJE,g.FYTIME rq,e.YPYZBZJG,f.PCSJ,f.PCJBSJ,f.SFBZDWFY,f.YPYZZHXS,f.PCDJ,f.PCJBDJ,f.YPFYSJMS,hz.XM,hz.XB,e.YZXZSJ,e.YZJL,e.YZJLDW,e.YZYF ,a.PKEY as JZPKEY,hz.PKEY as HZPKEY,a.JZNL,e.CFH from HIS_JZ_BASEINFO a left join HIS_SFZD_ZB b on a.pkey=b.jzpkey and a.JGID=b.JGID left join HIS_MZJS_MZFPZB c on b.pkey=c.GLZDBPKEY and b.JGID=c.JGID left join HIS_SFZD_SFXMXB d on b.pkey=d.ZDZBPKEY and b.JGID=d.JGID left join HIS_YZ_MXB e on d.YZMX=e.pkey and d.JGID=e.JGID left join HIS_SFX sfx on d.sfx=sfx.bm and d.JGID=sfx.JGID left join HIS_YFFY_ZYFYMXB f on f.YZMX=e.PKEY and f.JGID=e.JGID left join HIS_YPXX ypxx on f.YZXPKEY=ypxx.BM left join HIS_YFFY_ZYFYZB g on f.FYBPKEY=g.pkey and f.JGID=g.JGID left join HIS_KSKC_PC pc on f.KSKCPCPKEY=pc.pkey and f.JGID=pc.JGID left join HIS_YFYK_RKD_MX rkmx on pc.pkey=rkmx.KSKC_PC_PKEY and pc.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID LEFT JOIN HIS_HZINFO hz on a.JGID = hz.JGID AND a.HZPKEY = hz.PKEY where a.JGID=? #ypbm# and c.PJLX='ZS' and sfx.GLLX='Y' and c.SFRQ > ? and c.SFRQ <= ? and c.PJZT = 1 and c.sfzt!=0 and f.sfsl > 0 and b.TFHSFZDPKEY is null
|
|
|
|
union all
|
|
|
|
select distinct '2' type,tymxb.pkey,e.pkey yzmx,e.yzxpkey,e.yzmc,ypxx.gg,f.YZSL,f.TYSL,sfx.ZHXS,ypxx.JBDW,sfx.RKDW,a.JJYS,a.JJKS,sfx.FYZL,pc.jbdj,e.YPYZJBJG,sfx.dwview,pc.YXQ,pc.PH,ypxx.ZCZH,ypxx.CSXX,rkd.GYS,g.FYTIME,'' SFSL,f.FYDW,0 FYJE,tymxb.TYJE,tymxb.STSL,0 FYJJJE,tymxb.TYJJJE,g.FYTIME rq,e.YPYZBZJG,f.PCSJ,f.PCJBSJ,f.SFBZDWFY,f.YPYZZHXS,f.PCDJ,f.PCJBDJ,f.YPFYSJMS,hz.XM,hz.XB,e.YZXZSJ,e.YZJL,e.YZJLDW,e.YZYF ,a.PKEY as JZPKEY,hz.PKEY as HZPKEY,a.JZNL,e.CFH from HIS_JZ_BASEINFO a left join HIS_SFZD_ZB b on a.pkey=b.jzpkey and a.JGID=b.JGID left join HIS_MZJS_MZFPZB c on b.pkey=c.GLZDBPKEY and b.JGID=c.JGID left join HIS_YZ_MXB e on e.jzpkey=b.pkey and e.JGID=b.JGID left join HIS_SFZD_SFXMXB d on d.yzx=e.pkey and d.JGID=e.JGID left join HIS_SFX sfx on d.sfx=sfx.bm and d.JGID=sfx.JGID left join HIS_YFFY_MZTYMXB tymxb on tymxb.yzmx=e.pkey and tymxb.JGID = e.JGID left join HIS_YFFY_ZYFYMXB f on tymxb.MZFYMXBPKEY=f.PKEY and tymxb.JGID=f.JGID left join HIS_YPXX ypxx on f.YZXPKEY=ypxx.BM left join HIS_YFFY_ZYFYZB g on f.FYBPKEY=g.pkey and f.JGID=g.JGID left join HIS_KSKC_PC pc on f.KSKCPCPKEY=pc.pkey and f.JGID=pc.JGID left join HIS_YFYK_RKD_MX rkmx on pc.pkey=rkmx.KSKC_PC_PKEY and pc.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID LEFT JOIN HIS_HZINFO hz on a.JGID = hz.JGID AND a.HZPKEY = hz.PKEY where a.JGID=? #ypbm# and c.PJLX='ZS' and sfx.GLLX='Y' and c.SFRQ > ? and c.SFRQ <= ? and ((c.pjzt=1 and c.sfzt != 0) or c.PJZT='2' ) and tymxb.stsl > 0
|
|
|
|
)
|
|
|
|
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="type" type="12" />
|
|
<f name="PKEY" type="12" />
|
|
<f name="YZMX" type="12" />
|
|
<f name="YZXPKEY" type="12" />
|
|
<f name="YZMC" type="12" />
|
|
<f name="GG" type="12" />
|
|
<f name="YZSL" type="12" />
|
|
<f name="TYSL" type="12" />
|
|
<f name="ZHXS" type="8" />
|
|
<f name="JBDW" type="12" />
|
|
<f name="RKDW" type="12" />
|
|
<f name="JJYS" type="12" />
|
|
<f name="JJKS" type="12" />
|
|
<f name="FYZL" type="12" />
|
|
<f name="JBDJ" type="8" />
|
|
<f name="YPYZJBJG" type="12" />
|
|
<f name="DWVIEW" type="12" />
|
|
<f name="YXQ" type="93" />
|
|
<f name="PH" type="12" />
|
|
<f name="ZCZH" type="12" />
|
|
<f name="CSXX" type="12" />
|
|
<f name="GYS" type="12" />
|
|
<f name="FYRQ" type="93" />
|
|
<f name="SFSL" type="12" />
|
|
<f name="FYDW" type="12" />
|
|
<f name="FYJE" type="8" />
|
|
<f name="TYJE" type="8" />
|
|
<f name="STSL" type="12" />
|
|
<f name="FYJJJE" type="8" />
|
|
<f name="TYJJJE" type="8" />
|
|
<f name="RQ" type="93" />
|
|
<f name="YPYZBZJG" type="12" />
|
|
<f name="PCSJ" type="8" />
|
|
<f name="PCJBSJ" type="8" />
|
|
<f name="SFBZDWFY" type="12" />
|
|
<f name="YPYZZHXS" type="12" />
|
|
<f name="PCDJ" type="8" />
|
|
<f name="PCJBDJ" type="8" />
|
|
<f name="YPFYSJMS" type="12" />
|
|
<f name="XM" type="12" />
|
|
<f name="XB" type="12" />
|
|
<f name="YZXZSJ" type="8" />
|
|
<f name="YZJL" type="12" />
|
|
<f name="YZJLDW" type="12" />
|
|
<f name="YZYF" type="12" />
|
|
<f name="JZPKEY" type="12" />
|
|
<f name="HZPKEY" type="12" />
|
|
<f name="JZNL" type="12" />
|
|
<f name="CFH" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
<dao id="newygyyallypfyfzbDaoBySales2" log="true" type="1">
|
|
<sql><![CDATA[
|
|
select distinct type,pkey,yzmx,yzxpkey,yzmc,gg,YZSL,TYSL,ZHXS,JBDW,RKDW,JJYS,JJKS,FYZL,jbdj,YPYZJBJG,dwview,YXQ,PH,ZCZH,CSXX,GYS,fyrq,SFSL,FYDW,FYJE,TYJE,STSL,FYJJJE,TYJJJE,rq,YPYZBZJG,PCSJ,PCJBSJ,SFBZDWFY,YPYZZHXS,PCDJ,PCJBDJ,YPFYSJMS,XM,XB,YZXZSJ,YZJL,YZJLDW,YZYF ,JZPKEY,HZPKEY,JZNL,CFH FROM
|
|
(
|
|
select distinct '1' type,f.pkey,e.pkey yzmx,e.yzxpkey,e.yzmc,ypxx.gg,f.YZSL,f.TYSL,sfx.ZHXS,ypxx.JBDW,sfx.RKDW,a.JJYS,a.JJKS,sfx.FYZL,pc.jbdj,e.YPYZJBJG,sfx.dwview,pc.YXQ,pc.PH,ypxx.ZCZH,ypxx.CSXX,rkd.GYS,g.fyrq,f.SFSL,f.FYDW,f.FYJE,0 TYJE,'' STSL,f.FYJJJE,0 TYJJJE,g.fyrq rq,e.YPYZBZJG,f.PCSJ,f.PCJBSJ,f.SFBZDWFY,f.YPYZZHXS,f.PCDJ,f.PCJBDJ,f.YPFYSJMS,hz.XM,hz.XB,e.YZXZSJ,e.YZJL,e.YZJLDW,e.YZYF ,a.PKEY as JZPKEY,hz.PKEY as HZPKEY,a.JZNL,e.CFH from HIS_JZ_BASEINFO a left join HIS_SFZD_ZB b on a.pkey=b.jzpkey and a.JGID=b.JGID left join HIS_MZJS_MZFPZB c on b.pkey=c.GLZDBPKEY and b.JGID=c.JGID left join HIS_SFZD_SFXMXB d on b.pkey=d.ZDZBPKEY and b.JGID=d.JGID left join HIS_YZ_MXB e on d.YZMX=e.pkey and d.JGID=e.JGID left join HIS_SFX sfx on d.sfx=sfx.bm and d.JGID=sfx.JGID left join HIS_YFFY_MZFYMXB f on f.YZMX=e.PKEY and f.JGID=e.JGID left join HIS_YPXX ypxx on f.YZX=ypxx.BM left join HIS_YFFY_MZFYZB g on f.FYBPKEY=g.pkey and f.JGID=g.JGID left join HIS_KSKC_PC pc on f.KSKCPCPKEY=pc.pkey and f.JGID=pc.JGID left join HIS_YFYK_RKD_MX rkmx on pc.pkey=rkmx.KSKC_PC_PKEY and pc.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID LEFT JOIN HIS_HZINFO hz on a.JGID = hz.JGID AND a.HZPKEY = hz.PKEY where a.JGID=? #ypbm# and c.PJLX='MS' and sfx.GLLX='Y' and c.SFRQ > ? and c.SFRQ <= ? and c.PJZT = 1 and f.sfsl > 0 and b.TFHSFZDPKEY is null
|
|
|
|
union all
|
|
|
|
select distinct '2' type,tymxb.pkey,e.pkey yzmx,e.yzxpkey,e.yzmc,ypxx.gg,f.YZSL,f.TYSL,sfx.ZHXS,ypxx.JBDW,sfx.RKDW,a.JJYS,a.JJKS,sfx.FYZL,pc.jbdj,e.YPYZJBJG,sfx.dwview,pc.YXQ,pc.PH,ypxx.ZCZH,ypxx.CSXX,rkd.GYS,g.fyrq,'' SFSL,f.FYDW,0 FYJE,tymxb.TYJE,tymxb.STSL,0 FYJJJE,tymxb.TYJJJE,g.fyrq rq,e.YPYZBZJG,f.PCSJ,f.PCJBSJ,f.SFBZDWFY,f.YPYZZHXS,f.PCDJ,f.PCJBDJ,f.YPFYSJMS,hz.XM,hz.XB,e.YZXZSJ,e.YZJL,e.YZJLDW,e.YZYF ,a.PKEY as JZPKEY,hz.PKEY as HZPKEY,a.JZNL,e.CFH from HIS_JZ_BASEINFO a left join HIS_SFZD_ZB b on a.pkey=b.jzpkey and a.JGID=b.JGID left join HIS_MZJS_MZFPZB c on b.pkey=c.GLZDBPKEY and b.JGID=c.JGID left join HIS_SFZD_SFXMXB d on b.pkey=d.ZDZBPKEY and b.JGID=d.JGID left join HIS_YZ_MXB e on d.YZMX=e.pkey and d.JGID=e.JGID left join HIS_SFX sfx on d.sfx=sfx.bm and d.JGID=sfx.JGID left join HIS_YFFY_MZTYMXB tymxb on tymxb.yzmx=e.pkey and tymxb.JGID = e.JGID left join HIS_YFFY_MZFYMXB f on tymxb.MZFYMXBPKEY=f.PKEY and tymxb.JGID=f.JGID left join HIS_YPXX ypxx on f.YZX=ypxx.BM left join HIS_YFFY_MZFYZB g on f.FYBPKEY=g.pkey and f.JGID=g.JGID left join HIS_KSKC_PC pc on f.KSKCPCPKEY=pc.pkey and f.JGID=pc.JGID left join HIS_YFYK_RKD_MX rkmx on pc.pkey=rkmx.KSKC_PC_PKEY and pc.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID LEFT JOIN HIS_HZINFO hz on a.JGID = hz.JGID AND a.HZPKEY = hz.PKEY where a.JGID=? #ypbm# and c.PJLX='MS' and sfx.GLLX='Y' and c.SFRQ > ? and c.SFRQ <= ? and c.pjzt=2 and c.SFZT != 0 and tymxb.stsl > 0
|
|
|
|
union all
|
|
select distinct '1' type,f.pkey,e.pkey yzmx,e.yzxpkey,e.yzmc,ypxx.gg,f.YZSL,f.TYSL,sfx.ZHXS,ypxx.JBDW,sfx.RKDW,a.JJYS,a.JJKS,sfx.FYZL,pc.jbdj,e.YPYZJBJG,sfx.dwview,pc.YXQ,pc.PH,ypxx.ZCZH,ypxx.CSXX,rkd.GYS,g.FYTIME fyrq,f.SFSL,f.FYDW,f.FYJE,0 TYJE,'' STSL,f.FYJJJE,0 TYJJJE,g.FYTIME rq,e.YPYZBZJG,f.PCSJ,f.PCJBSJ,f.SFBZDWFY,f.YPYZZHXS,f.PCDJ,f.PCJBDJ,f.YPFYSJMS,hz.XM,hz.XB,e.YZXZSJ,e.YZJL,e.YZJLDW,e.YZYF ,a.PKEY as JZPKEY,hz.PKEY as HZPKEY,a.JZNL,e.CFH from HIS_JZ_BASEINFO a left join HIS_SFZD_ZB b on a.pkey=b.jzpkey and a.JGID=b.JGID left join HIS_MZJS_MZFPZB c on b.pkey=c.GLZDBPKEY and b.JGID=c.JGID left join HIS_SFZD_SFXMXB d on b.pkey=d.ZDZBPKEY and b.JGID=d.JGID left join HIS_YZ_MXB e on d.YZMX=e.pkey and d.JGID=e.JGID left join HIS_SFX sfx on d.sfx=sfx.bm and d.JGID=sfx.JGID left join HIS_YFFY_ZYFYMXB f on f.YZMX=e.PKEY and f.JGID=e.JGID left join HIS_YPXX ypxx on f.YZXPKEY=ypxx.BM left join HIS_YFFY_ZYFYZB g on f.FYBPKEY=g.pkey and f.JGID=g.JGID left join HIS_KSKC_PC pc on f.KSKCPCPKEY=pc.pkey and f.JGID=pc.JGID left join HIS_YFYK_RKD_MX rkmx on pc.pkey=rkmx.KSKC_PC_PKEY and pc.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID LEFT JOIN HIS_HZINFO hz on a.JGID = hz.JGID AND a.HZPKEY = hz.PKEY where a.JGID=? #ypbm# and c.PJLX='ZS' and sfx.GLLX='Y' and c.SFRQ > ? and c.SFRQ <= ? and c.PJZT = 1 and f.sfsl > 0 and b.TFHSFZDPKEY is null
|
|
|
|
union all
|
|
|
|
select distinct '2' type,tymxb.pkey,e.pkey yzmx,e.yzxpkey,e.yzmc,ypxx.gg,f.YZSL,f.TYSL,sfx.ZHXS,ypxx.JBDW,sfx.RKDW,a.JJYS,a.JJKS,sfx.FYZL,pc.jbdj,e.YPYZJBJG,sfx.dwview,pc.YXQ,pc.PH,ypxx.ZCZH,ypxx.CSXX,rkd.GYS,g.FYTIME,'' SFSL,f.FYDW,0 FYJE,tymxb.TYJE,tymxb.STSL,0 FYJJJE,tymxb.TYJJJE,g.FYTIME rq,e.YPYZBZJG,f.PCSJ,f.PCJBSJ,f.SFBZDWFY,f.YPYZZHXS,f.PCDJ,f.PCJBDJ,f.YPFYSJMS,hz.XM,hz.XM,e.YZXZSJ,e.YZJL,e.YZJLDW,e.YZYF ,a.PKEY as JZPKEY,hz.PKEY as HZPKEY,a.JZNL,e.CFH from HIS_JZ_BASEINFO a left join HIS_SFZD_ZB b on a.pkey=b.jzpkey and a.JGID=b.JGID left join HIS_MZJS_MZFPZB c on b.pkey=c.GLZDBPKEY and b.JGID=c.JGID left join HIS_SFZD_SFXMXB d on b.pkey=d.ZDZBPKEY and b.JGID=d.JGID left join HIS_YZ_MXB e on d.YZMX=e.pkey and d.JGID=e.JGID left join HIS_SFX sfx on d.sfx=sfx.bm and d.JGID=sfx.JGID left join HIS_YFFY_MZTYMXB tymxb on tymxb.yzmx=e.pkey and tymxb.JGID = e.JGID left join HIS_YFFY_ZYFYMXB f on tymxb.MZFYMXBPKEY=f.PKEY and tymxb.JGID=f.JGID left join HIS_YPXX ypxx on f.YZXPKEY=ypxx.BM left join HIS_YFFY_ZYFYZB g on f.FYBPKEY=g.pkey and f.JGID=g.JGID left join HIS_KSKC_PC pc on f.KSKCPCPKEY=pc.pkey and f.JGID=pc.JGID left join HIS_YFYK_RKD_MX rkmx on pc.pkey=rkmx.KSKC_PC_PKEY and pc.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID LEFT JOIN HIS_HZINFO hz on a.JGID = hz.JGID AND a.HZPKEY = hz.PKEY where a.JGID=? #ypbm# and c.PJLX='ZS' and sfx.GLLX='Y' and c.SFRQ > ? and c.SFRQ <= ? and c.pjzt=1 and tymxb.stsl > 0
|
|
|
|
) ORDER BY rq
|
|
|
|
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="TYPE" type="12" />
|
|
<f name="PKEY" type="12" />
|
|
<f name="YZMX" type="12" />
|
|
<f name="YZXPKEY" type="12" />
|
|
<f name="YZMC" type="12" />
|
|
<f name="GG" type="12" />
|
|
<f name="YZSL" type="12" />
|
|
<f name="TYSL" type="12" />
|
|
<f name="ZHXS" type="8" />
|
|
<f name="JBDW" type="12" />
|
|
<f name="RKDW" type="12" />
|
|
<f name="JJYS" type="12" />
|
|
<f name="JJKS" type="12" />
|
|
<f name="FYZL" type="12" />
|
|
<f name="JBDJ" type="8" />
|
|
<f name="YPYZJBJG" type="12" />
|
|
<f name="DWVIEW" type="12" />
|
|
<f name="YXQ" type="93" />
|
|
<f name="PH" type="12" />
|
|
<f name="ZCZH" type="12" />
|
|
<f name="CSXX" type="12" />
|
|
<f name="GYS" type="12" />
|
|
<f name="FYRQ" type="93" />
|
|
<f name="SFSL" type="12" />
|
|
<f name="FYDW" type="12" />
|
|
<f name="FYJE" type="8" />
|
|
<f name="TYJE" type="8" />
|
|
<f name="STSL" type="12" />
|
|
<f name="FYJJJE" type="8" />
|
|
<f name="TYJJJE" type="8" />
|
|
<f name="RQ" type="93" />
|
|
<f name="YPYZBZJG" type="12" />
|
|
<f name="PCSJ" type="8" />
|
|
<f name="PCJBSJ" type="8" />
|
|
<f name="SFBZDWFY" type="12" />
|
|
<f name="YPYZZHXS" type="12" />
|
|
<f name="PCDJ" type="8" />
|
|
<f name="PCJBDJ" type="8" />
|
|
<f name="YPFYSJMS" type="12" />
|
|
<f name="XM" type="12" />
|
|
<f name="XB" type="12" />
|
|
<f name="YZXZYS" type="8" />
|
|
<f name="YZJL" type="12" />
|
|
<f name="YZJLDW" type="12" />
|
|
<f name="YZYF" type="12" />
|
|
<f name="JZPKEY" type="12" />
|
|
<f name="HZPKEY" type="12" />
|
|
<f name="JZNL" type="12" />
|
|
<f name="CFH" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
<dao id="newygyyzyypfyfzbDaoBySales3" log="true" type="1">
|
|
<sql><![CDATA[
|
|
|
|
select type,pkey,yzmx,yzxpkey,yzmc,gg,YZSL,TYSL,ZHXS,JBDW,RKDW,JJYS,JJKS,FYZL,jbdj,YPYZJBJG,dwview,YXQ,PH,ZCZH,CSXX,GYS,fyrq,SFSL,FYDW,FYJE,TYJE,STSL,FYJJJE,TYJJJE,rq,YPYZBZJG,PCSJ,PCJBSJ,SFBZDWFY,YPYZZHXS,PCDJ,PCJBDJ,YPFYSJMS from (
|
|
|
|
select distinct '1' type,f.pkey,e.pkey yzmx,e.yzxpkey,e.yzmc,ypxx.gg,f.YZSL,f.TYSL,sfx.ZHXS,ypxx.JBDW,sfx.RKDW,a.JJYS,a.JJKS,sfx.FYZL,pc.jbdj,e.YPYZJBJG,sfx.dwview,pc.YXQ,pc.PH,ypxx.ZCZH,ypxx.CSXX,rkd.GYS,g.FYTIME fyrq,f.SFSL,f.FYDW,f.FYJE,0 TYJE,'' STSL,f.FYJJJE,0 TYJJJE,g.FYTIME rq,e.YPYZBZJG,f.PCSJ,f.PCJBSJ,f.SFBZDWFY,f.YPYZZHXS,f.PCDJ,f.PCJBDJ,f.YPFYSJMS from HIS_JZ_BASEINFO a left join HIS_SFZD_ZB b on a.pkey=b.jzpkey and a.JGID=b.JGID left join HIS_MZJS_MZFPZB c on b.pkey=c.GLZDBPKEY and b.JGID=c.JGID left join HIS_YFFY_ZYFYMXB f on b.jzpkey=f.jzpkey and b.JGID=f.JGID left join HIS_YZ_MXB e on f.YZMX=e.pkey and f.JGID=e.JGID left join HIS_SFX sfx on f.YZXPKEY=sfx.bm and f.JGID=sfx.JGID left join HIS_YPXX ypxx on f.YZXPKEY=ypxx.BM left join HIS_YFFY_ZYFYZB g on f.FYBPKEY=g.pkey and f.JGID=g.JGID left join HIS_KSKC_PC pc on f.KSKCPCPKEY=pc.pkey and f.JGID=pc.JGID left join HIS_YFYK_RKD_MX rkmx on pc.pkey=rkmx.KSKC_PC_PKEY and pc.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID where a.JGID=? #ypbm# and c.PJLX='ZS' and sfx.GLLX='Y' and c.SFRQ > ? and c.SFRQ <= ? and c.PJZT = 1 and f.sfsl > 0 and b.TFHSFZDPKEY is null
|
|
|
|
|
|
|
|
union all
|
|
|
|
|
|
select distinct '2' type,tymxb.pkey,e.pkey yzmx,e.yzxpkey,e.yzmc,ypxx.gg,f.YZSL,f.TYSL,sfx.ZHXS,ypxx.JBDW,sfx.RKDW,a.JJYS,a.JJKS,sfx.FYZL,pc.jbdj,e.YPYZJBJG,sfx.dwview,pc.YXQ,pc.PH,ypxx.ZCZH,ypxx.CSXX,rkd.GYS,g.FYTIME fyrq,'' SFSL,f.FYDW,0 FYJE,tymxb.TYJE,tymxb.STSL,0 FYJJJE,tymxb.TYJJJE,g.FYTIME rq,e.YPYZBZJG,f.PCSJ,f.PCJBSJ,f.SFBZDWFY,f.YPYZZHXS,f.PCDJ,f.PCJBDJ,f.YPFYSJMS from HIS_JZ_BASEINFO a left join HIS_SFZD_ZB b on a.pkey=b.jzpkey and a.JGID=b.JGID left join HIS_MZJS_MZFPZB c on b.pkey=c.GLZDBPKEY and b.JGID=c.JGID left join HIS_YFFY_MZTYMXB tymxb on tymxb.jzpkey=b.jzpkey and tymxb.JGID = b.JGID left join HIS_YZ_MXB e on tymxb.YZMX=e.pkey and tymxb.JGID=e.JGID left join HIS_SFX sfx on tymxb.yzx=sfx.bm and tymxb.JGID=sfx.JGID
|
|
left join HIS_YFFY_ZYFYMXB f on tymxb.MZFYMXBPKEY=f.PKEY and tymxb.JGID=f.JGID left join HIS_YPXX ypxx on tymxb.YZX=ypxx.BM left join HIS_YFFY_ZYFYZB g on f.FYBPKEY=g.pkey and f.JGID=g.JGID left join HIS_KSKC_PC pc on f.KSKCPCPKEY=pc.pkey and f.JGID=pc.JGID left join HIS_YFYK_RKD_MX rkmx on pc.pkey=rkmx.KSKC_PC_PKEY and pc.JGID=rkmx.JGID left join HIS_YFYK_RKD rkd on rkmx.djh=rkd.djh and rkmx.JGID=rkd.JGID where a.JGID=? #ypbm# and c.PJLX='ZS' and sfx.GLLX='Y' and c.SFRQ > ? and c.SFRQ <= ? and c.pjzt=1 and tymxb.stsl > 0
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
]]></sql>
|
|
<fields>
|
|
<f name="type" type="12" />
|
|
<f name="PKEY" type="12" />
|
|
<f name="YZMX" type="12" />
|
|
<f name="YZXPKEY" type="12" />
|
|
<f name="YZMC" type="12" />
|
|
<f name="GG" type="12" />
|
|
<f name="YZSL" type="12" />
|
|
<f name="TYSL" type="12" />
|
|
<f name="ZHXS" type="8" />
|
|
<f name="JBDW" type="12" />
|
|
<f name="RKDW" type="12" />
|
|
<f name="JJYS" type="12" />
|
|
<f name="JJKS" type="12" />
|
|
<f name="FYZL" type="12" />
|
|
<f name="JBDJ" type="8" />
|
|
<f name="YPYZJBJG" type="12" />
|
|
<f name="DWVIEW" type="12" />
|
|
<f name="YXQ" type="93" />
|
|
<f name="PH" type="12" />
|
|
<f name="ZCZH" type="12" />
|
|
<f name="CSXX" type="12" />
|
|
<f name="GYS" type="12" />
|
|
<f name="FYRQ" type="93" />
|
|
<f name="SFSL" type="12" />
|
|
<f name="FYDW" type="12" />
|
|
<f name="FYJE" type="8" />
|
|
<f name="TYJE" type="8" />
|
|
<f name="STSL" type="12" />
|
|
<f name="FYJJJE" type="8" />
|
|
<f name="TYJJJE" type="8" />
|
|
<f name="RQ" type="93" />
|
|
<f name="YPYZBZJG" type="12" />
|
|
<f name="PCSJ" type="8" />
|
|
<f name="PCJBSJ" type="8" />
|
|
<f name="SFBZDWFY" type="12" />
|
|
<f name="YPYZZHXS" type="12" />
|
|
<f name="PCDJ" type="8" />
|
|
<f name="PCJBDJ" type="8" />
|
|
<f name="YPFYSJMS" type="12" />
|
|
</fields>
|
|
<parameter>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
<p>12</p>
|
|
<p>93</p>
|
|
<p>93</p>
|
|
</parameter>
|
|
</dao>
|
|
|
|
<dao id="mzjbypsytjbdao" log="true" type="1">
|
|
<sql>
|
|
SELECT
|
|
a.YZXZYS 医生,
|
|
a.YZLB,
|
|
a.YZXPKEY,
|
|
b.MC 药品名称,
|
|
d.GG 规格,
|
|
sum( a.YZSL ) 发药数量,
|
|
sum( YZJE ) AS 总金额,
|
|
c.JZLX
|
|
FROM
|
|
his_yz_mxb a
|
|
LEFT JOIN HIS_YZX b ON b.JGID = a.JGID
|
|
AND b.BM = a.YZXPKEY
|
|
LEFT JOIN HIS_JZ_BASEINFO c ON c.hzpkey = a.hzpkey
|
|
LEFT JOIN HIS_YPXX d ON b.bm = d.BM
|
|
WHERE
|
|
YZXZYS IS NOT NULL
|
|
AND ( a.YZLB = '01' OR a.YZLB = '02' OR a.YZLB = '03' )
|
|
AND YZSHZT = '1'
|
|
GROUP BY
|
|
a.YZXZYS,
|
|
a.YZLB,
|
|
a.YZXPKEY,
|
|
b.MC,d.GG,
|
|
c.JZLX
|
|
ORDER BY
|
|
YZXZYS DESC
|
|
</sql>
|
|
//医生,YZLB,YZXPKEY,药品名称,规格,发药数量,总金额,JZLX
|
|
<fields>
|
|
<f name="医生" type="12" />
|
|
<f name="YZLB" type="12" />
|
|
<f name="YZXPKEY" type="12" />
|
|
<f name="药品名称" type="12" />
|
|
<f name="规格" type="12" />
|
|
<f name="发药数量" type="4" />
|
|
<f name="总金额" type="4" />
|
|
<f name="JZLX" type="12" />
|
|
</fields>
|
|
</dao>
|
|
|
|
</datasource> |