- 浏览: 1208588 次
- 性别:
- 来自: 上海
-
文章分类
- 全部博客 (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 1935BSP电子客票出票流程 -
保理培训
2010-06-23 00:37 0保理培训 -
测试场景
2010-06-22 23:53 1347验票接口验收测试 1 数据完整性 1.1 ... -
帐期列表
2010-06-22 23:39 1447补充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 2164-- update records -
内存溢出
2009-12-08 10:51 1132见附件 -
小 trace 代码(未完成)
2009-09-07 10:41 1150小 trace 代码(未完成) -
atf通过机票提交时间分析系统使用情况
2009-09-03 11:55 1199select to_char(t.entry_time,'yy ... -
atf项目-用oracle存储过程修复 六月份的数据
2009-07-17 16:26 1427atf项目-用oracle存储过程修复 六月份的数据 一共近两 ... -
测试数据生成1万条ticket的sql
2009-06-14 13:04 1316declare i integer;begin for ... -
atf 登入报“加载数据字典错误”的原因, 部署mas机器上的时间与部署atf机器上的系统时间不一致
2009-04-10 19:44 16591. Atf部署在 192.168.6.2 ... -
民航订位基础知识
2009-04-09 09:17 2421四.旅客订座记录:(一) 什么是PNR——PNR是旅客订 ... -
航空公司缩写的由来
2009-04-09 09:08 3059航空公司的二字代码是向国际航协(IATA)申请的,因为是全世界 ... -
航空票务中的月份和星期缩写
2009-04-09 09:06 2904航空票务中的月份和星期缩写JAN 一月 FEB 二月 MAR ... -
有关航班号的问题
2009-03-31 21:05 3726中国国际航班的航班号是由执行该航班任务的航空公司的二字代码和三 ... -
航信BSP电子客票相关知识-图解
2009-03-12 16:43 12305电子客票分为单程和多程。 1.先上 ...
相关推荐
3. 结算功能:用户可以查看待结算账单,并进行在线支付,支持多种支付方式,如支付宝、微信支付等。 4. 管理员模块:管理员可以查看所有用户的账单,进行数据分析,处理缴费异常情况,如设置逾期提醒,处理退款请求...
5. 审核与审批:管理员可以查看并审批学生的报账单,这可能需要增加状态字段来追踪报账单的状态(如待审批、已批准、已拒绝)。审批流程可以通过信号与槽实现,当状态改变时触发相应的通知或操作。 6. 报表统计:...
例如,可以在客房预订界面中使用DataGrid来显示可预订的房间列表,也可以在账单管理界面中使用它来显示待支付的账单信息。同时,VB的窗体设计功能强大,可以轻松设计出符合酒店风格的用户界面。 在数据库方面,...
6. 报表统计:生成各种统计报表,如租金收入、房源空置率、租户满意度等,帮助管理者分析业务状况。 此外,项目还提供了SQLServer数据库文件,这可能包含了预设的数据表结构、初始化数据以及可能的存储过程或触发器...
3. 订单管理:记录顾客点餐,处理订单状态(如待处理、烹饪中、已上菜、已完成)。 4. 库存管理:监控食材库存,及时补充,避免缺货。 5. 收银功能:计算账单,支持多种支付方式。 6. 报表统计:生成销售报告,帮助...
【北大青鸟二单元项目】是一个面向初学者的IT实践项目,主要涵盖了超市账单管理的实现。这个项目旨在帮助学员巩固和应用他们在北大青鸟学习的基础IT知识,特别是Java Web开发技能。通过参与这个项目,学员能够了解并...
例如,可以使用SQL语句来添加新的销售记录、查询特定时间段的销售报告、统计产品销售额或追踪客户购买历史。SQL的高效性能和强大的数据处理能力使得它成为构建销售管理系统的理想选择。 销售管理系统通常包含以下几...
6. **报表与统计**:提供各种统计报表,如入住率、收入分析等,以辅助酒店管理层做决策。 7. **安全机制**:为了保护数据安全,系统应具有用户权限管理,不同角色(如前台、经理)有不同的操作权限。 【关键技术与...
3. **订单表**:记录每个订单的基本信息,如订单号、顾客ID、下单时间、状态(待支付、已支付、已发货、已完成等)。订单表也可能包含订单总额和配送信息。 4. **订单详情表**:保存每个订单中的具体商品信息,包括...
对于咖啡店,数据流程可能包括顾客下单(输入订单信息)、订单处理(计算总价、生成账单)、库存扣减(根据订单消耗原料)、支付处理(记录支付状态)、报表生成(统计每日销售、利润)等步骤。 2.3 数据字典 数据...