- 浏览: 1183104 次
- 性别:
- 来自: 上海
文章分类
- 全部博客 (361)
- java综合 (33)
- 项目管理 (10)
- 工作流 (6)
- spring (11)
- hibenate (17)
- struts (0)
- javascript,html,css,ajax,jquery (11)
- IDE (9)
- 生活 (0)
- 工作 (0)
- 杂记 (1)
- 数据库 (96)
- 服务器 (5)
- 可视编辑 (0)
- freemarker (6)
- 操作系统 windows (13)
- web页面 (6)
- jms (15)
- 调优 (4)
- 测试和bug管理 (2)
- 原理 (1)
- 項目-atf (17)
- 安全 (3)
- xml (4)
- 操作系统 liunx (21)
- 网络 (22)
- office (11)
- 设计 (2)
- 软件 (1)
- 数据库 mysql (6)
- 胖客户端-flex (1)
- 正则 (9)
- oracle- liunx (3)
- sql2000 (2)
- 模式 (1)
- 虚拟机 (2)
- jstl (2)
- 版本控制 打包工具 (0)
- AOP (1)
- demo (1)
- 小软件 (2)
- 感恩 (1)
- iphone 4 (1)
- 反欺诈业务经验整理 (0)
最新评论
-
sea0108:
mark
java内存模型 -
XingShiYiShi:
方便把:testPNR();具体实现发出来吗?谢谢
用正则表达式解析 航信的电子客票和pnr报文 -
wh359126613:
如果js和webservice不在同一个服务器上,有跨域问题如 ...
使用javascript调用webservice示例 -
雨飛雁舞:
...
oracle 动态性能(V$)视图 -
ouyang1224:
好东西
oracle 动态性能(V$)视图
-----------------------------------------------------------------------------------
--------------------------已优化的待开帐语句--------------------------------------------
------------------------------------------------------------------------------------
--优化版本
--把待开帐和已开帐的统计结果都取出,两个结果集 中去除已开帐的统计信息
WITH
waitingBill as
(
select t.inv_seller_cid invSellerCid,t.inv_seller_name invSellerName,t.debtor_cid debtorCid,t.debtor_name debtorName,to_char(t.bill_date,'yyyy-mm-dd') billDate,to_char(t.payoff_date,'yyyy-mm-dd') payoffDate,t.bill_plan billPlan,count(t.id_ticket) count,
--已确认总金额
sum(case
when t.status='C'
then dc.bill_amt
else 0
end
) as confirmedAmt,
----已确认总数
sum(case
when t.status='C'
then 1
else 0
end
) as confirmedCount,
--已确认订票总金额
sum(case
when t.status='C' and t.orig_id_ticket is null
then dc.bill_amt
else 0
end
) as billBookAmt,
--已确认订票总数
sum(case
when t.status='C' and t.orig_id_ticket is null
then 1
else 0
end
) as billBookCount,
--已确认退票总金额
sum(case
when t.status='C' and t.orig_id_ticket is not null
then dc.bill_amt
else 0
end
) as billReturnAmt,
--已确认退票总数
sum(case
when t.status='C' and t.orig_id_ticket is not null
then 1
else 0
end
) as billReturnCount,
--未确认订票总金额
sum(case
when t.status!='C' and t.orig_id_ticket is null
then t.amt
else 0
end
) as unconfirmedBillBookAmt,
--未确认订票总数
sum(case
when t.status!='C' and t.orig_id_ticket is null
then 1
else 0
end
) as unconfirmedBillBookCount,
--未确认退票总金额
sum(case
when t.status!='C' and t.orig_id_ticket is not null
then t.amt
else 0
end
) as unconfirmedBillReturnAmt,
--未确认退票总数
sum(case
when t.status!='C' and t.orig_id_ticket is not null
then 1
else 0
end
) as unconfirmedBillReturnCount,
--未确认总数
sum(case
when t.status!='C'
then 1
else 0
end
) as unconfirmedCount from t_ticket t left join t_debtor_clear_list dc on t.id_ticket=dc.id_ticket
where 1=1 and t.bill_date is not null
--开帐日 在当前月中
and to_char(t.bill_date,'yyyy-mm-dd')>='2009-06-01' and to_char(t.bill_date,'yyyy-mm-dd')<='2009-06-30'
and t.bill_status='0'
group by t.inv_seller_cid,t.inv_seller_name,t.debtor_cid,t.debtor_name, to_char(t.bill_date,'yyyy-mm-dd'),to_char(t.payoff_date,'yyyy-mm-dd'),t.bill_plan
),
billedBill as
(
select a.* from waitingBill a ,t_debtor_bill b
where a.invSellerCid=b.bill_seller_cid and a.invSellerName=b.bill_seller_name and a.debtorCid=b.bill_debtor_cid and a.debtorName=b.bill_debtor_name and a.billDate=to_char(b.bill_date,'yyyy-mm-dd') and a.payoffDate=to_char(b.payoff_date,'yyyy-mm-dd') and a.billPlan=b.bill_plan
)
--SELECT * FROM waitingBill WHERE billDate!=(SELECT billDate from billedBill )
SELECT * FROM waitingBill WHERE (invSellerCid||invSellerName||debtorCid||debtorName||billDate||payoffDate||billPlan)!=(SELECT (invSellerCid||invSellerName||debtorCid||debtorName||billDate||payoffDate||billPlan) from billedBill )
--原始版本
--把待开帐和已开帐的统计结果都取出,用 MINUS 在数据库内存中 去除已开帐的统计信息
select * from (select t.inv_seller_cid invSellerCid,t.inv_seller_name invSellerName,t.debtor_cid debtorCid,t.debtor_name debtorName,to_char(t.bill_date,'yyyy-mm-dd') billDate,to_char(t.payoff_date,'yyyy-mm-dd') payoffDate,t.bill_plan billPlan,count(t.id_ticket) count,
--已确认总金额
sum(case
when t.status='C'
then dc.bill_amt
else 0
end
) as confirmedAmt,
----已确认总数
sum(case
when t.status='C'
then 1
else 0
end
) as confirmedCount,
--已确认订票总金额
sum(case
when t.status='C' and t.orig_id_ticket is null
then dc.bill_amt
else 0
end
) as billBookAmt,
--已确认订票总数
sum(case
when t.status='C' and t.orig_id_ticket is null
then 1
else 0
end
) as billBookCount,
--已确认退票总金额
sum(case
when t.status='C' and t.orig_id_ticket is not null
then dc.bill_amt
else 0
end
) as billReturnAmt,
--已确认退票总数
sum(case
when t.status='C' and t.orig_id_ticket is not null
then 1
else 0
end
) as billReturnCount,
--未确认订票总金额
sum(case
when t.status!='C' and t.orig_id_ticket is null
then t.amt
else 0
end
) as unconfirmedBillBookAmt,
--未确认订票总数
sum(case
when t.status!='C' and t.orig_id_ticket is null
then 1
else 0
end
) as unconfirmedBillBookCount,
--未确认退票总金额
sum(case
when t.status!='C' and t.orig_id_ticket is not null
then t.amt
else 0
end
) as unconfirmedBillReturnAmt,
--未确认退票总数
sum(case
when t.status!='C' and t.orig_id_ticket is not null
then 1
else 0
end
) as unconfirmedBillReturnCount,
--未确认总数
sum(case
when t.status!='C'
then 1
else 0
end
) as unconfirmedCount from t_ticket t left join t_debtor_clear_list dc on t.id_ticket=dc.id_ticket
where 1=1 and t.bill_date is not null
--开帐日 在当前月中
and to_char(t.bill_date,'yyyy-mm-dd')>='2009-06-01' and to_char(t.bill_date,'yyyy-mm-dd')<='2009-06-30'
and t.bill_status='0'
group by t.inv_seller_cid,t.inv_seller_name,t.debtor_cid,t.debtor_name,to_char(t.bill_date,'yyyy-mm-dd'),to_char(t.payoff_date,'yyyy-mm-dd'),t.bill_plan
order by to_char(t.bill_date,'yyyy-mm-dd') asc,t.debtor_name desc)
--去除充分的统计信息
MINUS
select a.* from (select t.inv_seller_cid invSellerCid,t.inv_seller_name invSellerName,t.debtor_cid debtorCid,t.debtor_name debtorName,to_char(t.bill_date,'yyyy-mm-dd') billDate,to_char(t.payoff_date,'yyyy-mm-dd') payoffDate,t.bill_plan billPlan,count(t.id_ticket) count,
--已确认总金额
sum(case
when t.status='C'
then dc.bill_amt
else 0
end
) as confirmedAmt,
----已确认总数
sum(case
when t.status='C'
then 1
else 0
end
) as confirmedCount,
--已确认订票总金额
sum(case
when t.status='C' and t.orig_id_ticket is null
then dc.bill_amt
else 0
end
) as billBookAmt,
--已确认订票总数
sum(case
when t.status='C' and t.orig_id_ticket is null
then 1
else 0
end
) as billBookCount,
--已确认退票总金额
sum(case
when t.status='C' and t.orig_id_ticket is not null
then dc.bill_amt
else 0
end
) as billReturnAmt,
--已确认退票总数
sum(case
when t.status='C' and t.orig_id_ticket is not null
then 1
else 0
end
) as billReturnCount,
--未确认订票总金额
sum(case
when t.status!='C' and t.orig_id_ticket is null
then t.amt
else 0
end
) as unconfirmedBillBookAmt,
--未确认订票总数
sum(case
when t.status!='C' and t.orig_id_ticket is null
then 1
else 0
end
) as unconfirmedBillBookCount,
--未确认退票总金额
sum(case
when t.status!='C' and t.orig_id_ticket is not null
then t.amt
else 0
end
) as unconfirmedBillReturnAmt,
--未确认退票总数
sum(case
when t.status!='C' and t.orig_id_ticket is not null
then 1
else 0
end
) as unconfirmedBillReturnCount,
--未确认总数
sum(case
when t.status!='C'
then 1
else 0
end
) as unconfirmedCount from t_ticket t left join t_debtor_clear_list dc on t.id_ticket=dc.id_ticket
where 1=1 and t.bill_date is not null
--开帐日 在当前月中
and to_char(t.bill_date,'yyyy-mm-dd')>='2009-06-01' and to_char(t.bill_date,'yyyy-mm-dd')<='2009-06-30'
and t.bill_status='0'
group by t.inv_seller_cid,t.inv_seller_name,t.debtor_cid,t.debtor_name,to_char(t.bill_date,'yyyy-mm-dd'),to_char(t.payoff_date,'yyyy-mm-dd'),t.bill_plan
order by to_char(t.bill_date,'yyyy-mm-dd') asc,t.debtor_name desc) a,
(
select db.*
from t_debtor_bill db where db.bill_status=1) b
-- where a.invSellerCid!=b.bill_seller_cid and a.invSellerName!=b.bill_seller_name and a.debtorCid!=b.bill_debtor_cid and a.debtorName!=b.bill_debtor_name and a.billDate!=b.bill_date and a.payoffDate!=b.payoff_date and a.billPlan!=b.bill_plan
where a.invSellerCid=b.bill_seller_cid and a.invSellerName=b.bill_seller_name and a.debtorCid=b.bill_debtor_cid and a.debtorName=b.bill_debtor_name and a.billDate=to_char(b.bill_date,'yyyy-mm-dd') and a.payoffDate=to_char(b.payoff_date,'yyyy-mm-dd') and a.billPlan=b.bill_plan
发表评论
-
BSP电子客票出票流程
2011-04-28 23:58 1832BSP电子客票出票流程 -
保理培训
2010-06-23 00:37 0保理培训 -
测试场景
2010-06-22 23:53 1280验票接口验收测试 1 数据完整性 1.1 ... -
帐期列表
2010-06-22 23:39 1365补充30+10账期: 30+10 ... -
西安凯讯那边收集的测试数据
2010-06-22 20:09 0见附件,响应时间太慢 如:并发50个请求(第3次)时getD ... -
ATF 启动脚本
2010-06-22 16:07 0nohup /opt/jdk1.5.0_14/bin/java ... -
项目文档
2010-06-20 22:20 0项目文档 -
产品系统架构与实现
2010-06-20 16:49 0产品系统架构与实现 -
批量更新历史数据 每10000提交一次
2010-05-24 03:04 2070-- update records -
内存溢出
2009-12-08 10:51 1069见附件 -
小 trace 代码(未完成)
2009-09-07 10:41 1082小 trace 代码(未完成) -
atf通过机票提交时间分析系统使用情况
2009-09-03 11:55 1143select to_char(t.entry_time,'yy ... -
atf项目-用oracle存储过程修复 六月份的数据
2009-07-17 16:26 1362atf项目-用oracle存储过程修复 六月份的数据 一共近两 ... -
测试数据生成1万条ticket的sql
2009-06-14 13:04 1251declare i integer;begin for ... -
atf 登入报“加载数据字典错误”的原因, 部署mas机器上的时间与部署atf机器上的系统时间不一致
2009-04-10 19:44 15711. Atf部署在 192.168.6.2 ... -
民航订位基础知识
2009-04-09 09:17 2338四.旅客订座记录:(一) 什么是PNR——PNR是旅客订 ... -
航空公司缩写的由来
2009-04-09 09:08 2880航空公司的二字代码是向国际航协(IATA)申请的,因为是全世界 ... -
航空票务中的月份和星期缩写
2009-04-09 09:06 2802航空票务中的月份和星期缩写JAN 一月 FEB 二月 MAR ... -
有关航班号的问题
2009-03-31 21:05 3648中国国际航班的航班号是由执行该航班任务的航空公司的二字代码和三 ... -
航信BSP电子客票相关知识-图解
2009-03-12 16:43 12194电子客票分为单程和多程。 1.先上 ...
相关推荐
仿支付宝账单统计日历周报选择
3、账单统计:按天、按月、按年全方位为您解析账单数据,一键导出账单统计数据到excel; 4、资金流动:经常将资金从一处流动到另一处,但又记不清每一笔的去向?别担心,此模块帮您记录。 系统模块: 1、系统设置:...
样式可以看这里:http://blog.csdn.net/the_path/article/details/38851841
北大青鸟_超市账单管理系统(含sql语句在WebRoot下)复制粘贴到plsqldeveloper里直接运行即可。增删改查功能都已实现。
Python 统计年度消费账单 Python源码Python 统计年度消费账单 Python源码Python 统计年度消费账单 Python源码Python 统计年度消费账单 Python源码Python 统计年度消费账单 Python源码Python 统计年度消费账单 Python...
JAVA Swing 作的账单管理系统,往来单位管理,账单管理,下拉框联动技术;按日期进行报表查询,Ireport报表预览和打印,excel报表打印,数据库备份等。
年度消费账单是指个人或家庭在一年内的所有消费记录...统计和分析:通过对消费数据的统计和分析,可以了解整体的消费水平、主要支出项目以及各类别的消费比例。这有助于识别消费习惯、发现潜在节省机会并进行财务规划。
Java语言基于javafx实现的家庭消费账单管理系统,帮助家庭进行账单统计管理。一个简单的javafxGUI界面。
超市账单管理,附带mysql数据库sql文件
该项目为一个简单的账单管理程序,提供了添加账单、显示账单列表、修改账单信息等功能。通过该程序,我们可以轻松地管理和查询自己的消费记录,更好地维护个人财务状况。 该项目的主要功能和实现思路如下: 添加...
超市账单管理系统源码下载超市账单管理系统源码下载 项目概述 1、 业务需求概述 超市账单管理系统主要用于对超市的交易账单进行管理,如账单录入、账单修改、 账单删除,以及和超市商品相关的供应商、用户的管理等。...
Python统计年度消费账单.zip
Python统计年度消费账单.rar
后台框架:springboot2.1.6.RELEASE,projectlombok,shiro 前端页面:easyUI
可以统计账单,即按照日期范围统计账单的所有记录以及日期的账单总和统计。账单金额采用收入为正数,支出为负数的形式进行保存。软件采用E4A编写,需要的可以联系购买源码或者定制化开发。 操作文档教程链接: ...
家庭账单,可以自定义添加,快速录入,查询,管理账务
可以作为本地相册按照时间的顺序进行列表,也可以作为按照日期进行listview列表,例如支付宝账单的形式,资源工程没有进行优化,功能都可以使用
基于javaweb的超市账单管理系统,使用了spring+mybatis+springMVC,后台数据库是mysql
系统包含添加消费信息、删除消费信息、消费信息按类搜索、按照日历查询日账单、月账单与消费年度统计。此系统异常小巧方便,统计也非常齐全,尤其适合现在的年轻人使用。 用户名:admin 登录密码:admin
超市账单管理代码