欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

公司日常加班费用报销系统

程序员文章站 2022-05-28 16:53:47
...

雏形如下:

初步脚本:
		-- 做个系统:个人工资条的查询、日常报销费用的记录查询
	   --日常报销记录功能: 管理员进来可以查看所有人的报销情况:查询条件:报销类别(下拉框):吃饭、打车、出差; 报销状态(下拉框):已报销、未报销;
	   -- 个人工资条查询功能

-- 日常加班餐费、打车费报销记录表  
   -- 消费  consumption  kənˈsʌmpʃn    费用报销;报销;偿付;补偿;赛季报销   consumption  美 [ˌriːɪmˈbɜːrsmənt] ;  
  
   select a.*,a.rowid from t_pc_personal_consumption a where  1=1 
   and consumption_Status=0
   --and consumption_type_code=1
  -- and to_char(consumption_Create_Time,'yyyy/MM')='2019/11'
   order by id desc;
   
   -- 总计 sum(a.consumption_momey) as total
   select b.consumption_people, b.consumption_type,to_char(consumption_Create_Time,'yyyy/MM')as time,sum(b.consumption_momey) as total 
   from t_pc_personal_consumption b
   group by  b.consumption_people,b.consumption_type,to_char(consumption_Create_Time,'yyyy/MM')
   
   
   -- 吃饭
   insert into t_pc_personal_consumption values(seq_personal_consumption.nextval,'朱元璋','home',20,'吃饭',1,0,sysdate,'');
   insert into t_pc_personal_consumption values(seq_personal_consumption.nextval,'朱元璋','home',20,'吃饭',1,0,to_date('2019/11/21','yyyy/MM/dd'),'');
   -- 打车
   insert into t_pc_personal_consumption values(seq_personal_consumption.nextval,'朱元璋','home',25,'打车',2,0,to_date('2019/09/03','yyyy/MM/dd'),'');
   insert into t_pc_personal_consumption values(seq_personal_consumption.nextval,'朱元璋','home',25,'打车',2,0,to_date('2019/09/03','yyyy/MM/dd'),'');

   -- 创建序列
      drop sequence seq_personal_consumption;
      create sequence seq_personal_consumption increment by 1 start with 1 nomaxvalue nocycle cache 10;

comment on table t_pc_personal_consumption is '个人消费报销记录表';
comment on column t_pc_personal_consumption.consumption_people is '消费的人';
comment on column t_pc_personal_consumption.consumption_Place is '消费的地点';
comment on column t_pc_personal_consumption.consumption_Momey is '消费的金额';
comment on column t_pc_personal_consumption.consumption_Create_Time is '消费的时间';
comment on column t_pc_personal_consumption.consumption_Status is '报销的状态:0 未报销,1 已报销';
comment on column t_pc_personal_consumption.consumption_type is '消费类型:吃饭、打车、出差....';
comment on column t_pc_personal_consumption.consumption_type_code is '消费类型编码:1吃饭、2打车、3出差....';
comment on column t_pc_personal_consumption.consumption_Remark is '消费备注';

--drop table t_pc_personal_consumption; 

create table t_pc_personal_consumption(
       id  number(10),
       consumption_people varchar2(100),
       consumption_place varchar2(100),
       consumption_momey number(10),
       consumption_type varchar2(10),
       consumption_type_code number(10),
       consumption_status number(10),
       consumption_create_time date,
       consumption_remark varchar2(200) 
);