select count(*) num,sum(fylbje) fylbje,sum(zfje) zfje from (select (select sum(FYLBJE) FYLBJE from HIS_MZJS_MZFPSFLBB where MZFPPKEY=a.pkey and JGID=a.JGID) FYLBJE,(select sum(ZFJE) ZFJE from HIS_MZJS_MZFPZFFSB where MZFPPKEY=a.pkey and JGID=a.JGID) ZFJE,a.LOCKFLAG from HIS_MZJS_MZFPZB a left join HIS_SFZD_ZB b on a.GLZDBPKEY=b.pkey and a.JGID=b.JGID left join HIS_JZ_BASEINFO c on b.jzpkey=c.pkey and b.JGID=c.JGID left join HIS_HZINFO d on b.hzpkey=d.pkey and b.JGID=d.JGID where a.JGID=? and a.JZZT=0 and a.SFZT != '0' and a.SFRY=? and a.PJLX=? and a.SFRQ > ? and a.SFRQ <=? order by a.SFRQ )
select FPHM,PJLX,SFRY,SFRQ,SFZT,FPLX,FPDRYY,SFDZP,SFJZDY,SFJE from HIS_PJUSE_MX where JGID=? and PJLX=? and SFRY=? and SFRQ > ? and SFRQ <=? order by CJRQ
left join HIS_MZJS_MZFPZB b on a.MZFPPKEY=b.pkey and b.JGID=a.JGID
left join HIS_YB_JSB c on c.ZDZBPKEY=b.GLZDBPKEY
where a.JGID=? and b.JZZT=? and b.SFZT != '0' and a.ZFJE >= 0 and b.SFRY=? and b.PJLX=? and b.SFRQ > ? and b.SFRQ <=? and b.pjzt='1' and (c.cxzt=0 or (c.cxzt='1' and c.OLD_SETL_ID is null) or c.cxzt is null)) group by ZFLX,INSUTYPE order by zflx
where a.JGID=? and b.JZZT=? and b.SFZT != '0' and a.ZFJE >= 0 and b.SFRY=? and b.PJLX=? and b.SFRQ > ? and b.SFRQ <=? and b.pjzt='1' and (c.cxzt=0 or (c.cxzt='1' and c.OLD_SETL_ID is null) or c.cxzt is null) order by zflx
where a.JGID=? and b.JZZT=? and b.SFZT != '0' and a.ZFJE < 0andb.SFRY=?andb.PJLX=?andb.SFRQ> ? and b.SFRQ <=? and b.pjzt='1' and (c.cxzt=0 or (c.cxzt='1' and c.OLD_SETL_ID is null) or c.cxzt is null) order by zflx
where a.JGID=? and b.JZZT=? and b.SFZT != '0' and a.ZFJE < 0andb.SFRY=?andb.PJLX=?andb.SFRQ> ? and b.SFRQ <=? and b.PJZT = '2' and ((c.cxzt='1' and c.OLD_SETL_ID is not null) or c.cxzt is null)) group by zflx,INSUTYPE order by zflx
select zflx,sum(zfje)zfje,insutype from(select distinct a.pkey,b.pkey mzfppkey,a.ZFLX,a.ZFJE,nvl(c.INSUTYPE,'') INSUTYPE from HIS_MZJS_MZFPZFFSB a left join HIS_MZJS_MZFPZB b on a.MZFPPKEY=b.pkey and b.JGID=a.JGID left join HIS_YB_JSB c on c.ZDZBPKEY=b.GLZDBPKEY where a.JGID=? and b.JZZT=? and b.SFZT != '0' and a.ZFJE >= 0 and b.SFRY=? and b.PJLX=? and b.CLOSEPKEY=? and b.pjzt='1' and (c.cxzt=0 or (c.cxzt='1' and c.OLD_SETL_ID is null) or c.cxzt is null) order by a.zflx ) group by ZFLX,INSUTYPE order by zflx
left join HIS_MZJS_MZFPZB b on a.MZFPPKEY=b.pkey and b.JGID=a.JGID
left join HIS_YB_JSB c on c.ZDZBPKEY=b.GLZDBPKEY and c.GJ_FLAG !='1'
where a.JGID=? and b.JZZT=? and b.SFZT != '0' and a.ZFJE >= 0 and b.SFRY=? and b.PJLX=? and b.CLOSEPKEY=? and b.pjzt='1' and (c.cxzt=0 or (c.cxzt='1' and c.OLD_SETL_ID is null) or c.cxzt is null) order by zflx
select distinct a.pkey,b.pkey mzfppkey,a.ZFLX,a.ZFJE,nvl(c.INSUTYPE,'') INSUTYPE,c.cxzt,c.SETL_ID from HIS_MZJS_MZFPZFFSB a
left join HIS_MZJS_MZFPZB b on a.MZFPPKEY=b.pkey and b.JGID=a.JGID
left join HIS_YB_JSB c on c.ZDZBPKEY=b.GLZDBPKEY and c.GJ_FLAG !='1'
where a.JGID=? and b.JZZT=? and b.SFZT != '0' and a.ZFJE < 0andb.SFRY=?andb.PJLX=?andb.CLOSEPKEY=?andb.pjzt='1'and(c.cxzt=0or(c.cxzt='1'andc.OLD_SETL_IDisnull)orc.cxztisnull)orderbyzflx
select zflx,sum(zfje)zfje,insutype from( select distinct b.pkey,a.ZFLX,a.ZFJE,c.INSUTYPE from HIS_MZJS_MZFPZFFSB a
left join HIS_MZJS_MZFPZB b on a.MZFPPKEY=b.pkey and b.JGID=a.JGID
left join HIS_MZJS_MZFPZB e on b.CHPKEY=e.pkey and b.JGID=e.JGID
left join HIS_YB_JSB c on c.ZDZBPKEY=e.GLZDBPKEY and c.GJ_FLAG !='1'
where a.JGID=? and b.JZZT=? and b.SFZT != '0' and a.ZFJE < 0andb.SFRY=?andb.PJLX=?andb.CLOSEPKEY =?andb.PJZT ='2'and((c.cxzt='1'andc.OLD_SETL_IDisnotnull)orc.cxztisnull)orderbya.zflx)groupbyzflx,INSUTYPEorderbyzflx
select a.FYLBBM,sum(a.FYLBJE) FYLBJE from HIS_MZJS_MZFPSFLBB a left join HIS_MZJS_MZFPZB b on a.MZFPPKEY=b.pkey and b.JGID=a.JGID where a.JGID=? and b.JZZT=? and b.SFZT != '0' and b.SFRY=? and b.PJLX=? and b.SFRQ > ? and b.SFRQ <=? group by a.FYLBBM order by a.FYLBBM
<sql><![CDATA[select PKEY,JZLX,JZTIME,JZKSSJ,JZJSSJ,JZRY,JZBM,JZZJE,JZYBJE,CJR,CJRQ,JGID from HIS_JS_JZZB where JGID=? and JZRY=? and JZLX=? and JZTIME >=? and JZTIME <= ?]]></sql>
select fphm,PKEY,CHPKEY,SFZT from HIS_MZJS_MZFPZB a where a.JGID=? and a.JZZT=0 and a.SFZT != '0' and a.SFRY=? and a.PJLX=? and a.SFRQ > ? and a.SFRQ <=? order by a.SFRQ
select fphm,PKEY,CHPKEY,SFZT from HIS_MZJS_MZFPZB a where JGID=? and a.JZZT=1 and a.SFZT != '0' and a.SFRY=? and a.PJLX=? and a.SFRQ > ? and a.SFRQ <=? order by SFRQ
select '' 费用类别1,'' 费用金额1,'' 费用类别2,'' 费用金额2,'' 费用类别3,'' 费用金额3 from dual where 1=2
</sql>
<fields>
<fname="费用类别1"type="1"/>
<fname="费用金额1"type="1"/>
<fname="费用类别2"type="1"/>
<fname="费用金额2"type="1"/>
<fname="费用类别3"type="1"/>
<fname="费用金额3"type="1"/>
</fields>
</dao>
<daoid="hzSumCardCostdao"type="1">
<sql><![CDATA[
SELECT count(*) rc,sum(B.KF) kf FROM HIS_HZINFO A left join HIS_CARD_MANAGE B on A.PKEY=B.HZPKEY AND A.JGID=B.JGID WHERE A.JGID=? and A.CJR=? and A.CJRQ > ? and A.CJRQ < ?
select count(*) cs,sum(b.YJJE) yjje,b.ZFFS from HIS_ZY_YJMANAGE a inner join HIS_ZY_YJMX b on a.JZPKEY=b.JZPKEY and a.hzpkey=b.hzpkey and a.YJTYPE=b.YJTYPE AND a.JGID=b.JGID left join HIS_HZINFO c on a.hzpkey=c.pkey and a.JGID=c.JGID where a.JGID=? and b.SKR=? and b.YJSTATE=? and b.SKRQ > ? and b.SKRQ <=? group by b.zffs order by b.zffs
select b.sjh from HIS_ZY_YJMANAGE a inner join HIS_ZY_YJMX b on a.JZPKEY=b.JZPKEY and a.hzpkey=b.hzpkey and a.YJTYPE=b.YJTYPE AND a.JGID=b.JGID left join HIS_HZINFO c on a.hzpkey=c.pkey and a.JGID=c.JGID where a.JGID=? and b.SKR=? and b.YJSTATE='02' and b.SKRQ > ? and b.SKRQ <=? order by b.SKRQ
select b.sjh from HIS_ZY_YJMANAGE a inner join HIS_ZY_YJMX b on a.JZPKEY=b.JZPKEY and a.hzpkey=b.hzpkey and a.YJTYPE=b.YJTYPE AND a.JGID=b.JGID left join HIS_HZINFO c on a.hzpkey=c.pkey and a.JGID=c.JGID where a.JGID=? and b.SKR=? and (b.YJSTATE='02' or b.YJSTATE='01') and b.SKRQ > ? and b.SKRQ <=? order by b.SKRQ