提取报表

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值