select sum(n_oil_fee) from t_car_use u where u.c_lcn_no = '苏A3AE92'
14691
select * from t_car_use u where u.c_lcn_no = '苏A3AE92'
--提取卡信息---------------------------------------------------------------------------
select car.c_lcn_no 车辆车牌号,
'''' || card.c_card_no 加油卡卡号,
decode(card.c_card_type, 'O', '加油卡', 'E', '速通卡') 加油卡类型,
decode(card.c_card_attr, 'M', '主卡', 'A', '副卡') 加油卡性质,
'''' || card.c_main_card_no 关联主卡号,
card.t_adb_tm 有效止期,
(select de.dept_name
from t_dept_info de
where de.deptno = card.c_dpt_cde) 使用部门,
car.c_brand 车型,
car.n_seat 座位数,
(select sum(n_trvl_mils)
from t_car_use u
where u.c_lcn_no = car.c_lcn_no
and u.t_undr_tm2 is not null
and u.t_out_tm is not null
and u.t_out_tm >
to_date('2011-12-31 23:59:59', 'yyyy-mm-dd hh24:mi:ss')
and u.t_out_tm <
to_date('2012-06-30 23:59:59', 'yyyy-mm-dd hh24:mi:ss')) 累计行驶里程,
(select sum(n_oil_fee)
from t_car_use u
where u.c_lcn_no = car.c_lcn_no
and u.t_undr_tm2 is not null
and u.t_out_tm is not null
and u.t_out_tm >
to_date('2011-12-31 23:59:59', 'yyyy-mm-dd hh24:mi:ss')
and u.t_out_tm <
to_date('2012-06-30 23:59:59', 'yyyy-mm-dd hh24:mi:ss')) 累计燃油费
from t_card_base card, t_car_base car
where card.c_lcn_no = car.c_lcn_no
and car.c_com_cde in
(select dept.deptno
from t_dept_info dept
where dept.up_dept_id in ('11001631', '11001707', '11001632'));
--提取车辆使用信息--------------------------------------------------------------------------
select car.c_lcn_no 车辆车牌号,
(select de.dept_name
from t_dept_info de
where de.deptno = car.c_com_cde) 使用部门,
u.c_use_reson 出车事由,
u.c_pass_add 途经地点,
u.c_aim_addr 目的地,
u.t_out_tm 出车时间,
u.t_back_tm 回程时间,
round((u.t_back_tm- u.t_out_tm)*24 ,2) 累计出车小时数,
n_trvl_mils 行驶公里数
from t_car_use u, t_car_base car
where u.c_lcn_no = car.c_lcn_no
and car.c_com_cde in
(select dept.deptno
from t_dept_info dept
where dept.up_dept_id in ('11001631', '11001707', '11001632'))
and u.t_undr_tm2 is not null
and u.t_out_tm is not null
and u.t_out_tm > to_date('2011-12-31 23:59:59','yyyy-mm-dd hh24:mi:ss')
and u.t_out_tm < to_date('2012-06-30 23:59:59','yyyy-mm-dd hh24:mi:ss')
----------------------------------------------
select * from t_card_recharge
select * from t_car_use