create table awip(
                ID  int,
                allowip  varchar(50),
                allow    varchar(50)
);
                
create table bfgl(
                ID        int,
                bfbs      varchar(50),
                djsj      varchar(50),
                bfsj      varchar(50),
                bfsl      float,
                wpbs      varchar(50),
                bflx      varchar(50),
                bfyy      varchar(500),
                wpfl      varchar(50),
                bfqdr     varchar(50),               
                bfhzr     varchar(50),
                bfsjclr   varchar(50),
                bfhzdw    varchar(50),
                bfwpclff  varchar(500),
                sqr       varchar(50),
                fsje      varchar(50),
                jfly      varchar(50),
                wpmc      varchar(50),
        	jldw      varchar(50),
                dj        float
);
                  
create table bjlog(
                 jhbs     varchar(50),
                 sj       varchar(100),
                 bj       varchar(50),
                 zzcg     varchar(50),
                 tycgr    varchar(200),
                 sjdz     varchar(100),
                 lxdh     varchar(50),
                 lxr      varchar(50),
                 cpms     varchar(500),
                 wsid     varchar(50),
                 picn     varchar(50),
                 pdfn     varchar(50)
);

create table bjxmb(
                xmbs     varchar(50),
                xmmc     varchar(50),
                xmgg     varchar(200),
                cgsl     varchar(50),
                jldw     varchar(50),
                xmlxr    varchar(50),
                xmlxdh   varchar(50),
                xmlxmail varchar(50),
                bz       varchar(500),
                ztbs     varchar(200),
                bjqx     varchar(50),
                xmfbr    varchar(50),
                fbtime   varchar(50)
);

create table cgjclog(
                  jhbs     varchar(50),
                  djsj     varchar(50),
                  jczt     varchar(50),
                  fsje     varchar(50),
                  bz       varchar(500)
);

create table cgjh(
                ID       int,
                jhbs     varchar(50),
                jhdw     varchar(50),
                djsj     varchar(50),
                cgwp     varchar(50),
                cgsl     float,
                sldw     varchar(50),
                jhje     float,
                cgqx     varchar(50),
                gqbz     int,
                sbr      varchar(50),
                fzr      varchar(50),
                spr      varchar(200),
                sgsy     varchar(200),
                jfly     varchar(50),
                xhgg     varchar(200),
                bjcg     varchar(50),
                shrlb    varchar(200),
                cgsj     varchar(500),
                sjdz     varchar(100),
                lxdh     varchar(50),
                lxr      varchar(50),
                jczt     varchar(50),
                cglx     varchar(50),
                wsbj     varchar(50),
                yfkdy    varchar(50),
                yfkdyr   varchar(50),
                yfkdytime varchar(50),
                yfkje     float,
                fkdyr     varchar(50),
                fkdytime  varchar(50),
                fkje      float,
                yfkr      varchar(50),
                fkr       varchar(50),
                yfkfs     varchar(50),
                fkfs      varchar(50),
                skyh      varchar(100),
                yhzh      varchar(50),
                smstj     varchar(50),
                smstime   varchar(50),
                bgr       varchar(50),
                psr       varchar(50),
                psyj      varchar(100),
		xmcg      varchar(50),
		jysz      varchar(50),
		jyy       varchar(50),
		jydw      varchar(50),
                jybs      varchar(50),
                jyqk      varchar(200),
		jysj      varchar(50),
		xgzlpic   varchar(50),
                psms      int,
                psgd      varchar(2000),
                gcmc      varchar(50),
                yycl      varchar(200)      
);

create table yszjsqgl(
               yszjsqbh   varchar(50),
               yszjsqr    varchar(50),
               yszjsqsj   varchar(50),
	       yszjsqbm   varchar(50),
               jhbs       varchar(50),
               jhje       float,
               jhspr      varchar(200),
               yszjsqje   float,
               yszjsqyy   varchar(200),
               yszjsqpic  varchar(50),
               yszjsqpzr  varchar(50),
               yszjsqpzje float,
               yszjsqclr  varchar(50),
               sqzt       varchar(50)
);
               
create table cjzl(
               ID       int,
               cjbs     varchar(50),
               cjmc     varchar(100),
               cjdz     varchar(100),
               yzbm     varchar(50),
               lxdh     varchar(50),
               lxr      varchar(50),
               web      varchar(50),
               mail     varchar(50),
               khyh     varchar(100),
               yhzh     varchar(50),
               bz       varchar(200),
               xgzl     varchar(50)
);

insert into cjzl(id,cjbs,cjmc) values(0,'cj0000001','计算机维修部'); 

CREATE TABLE cwgl(
	xmbs varchar(50),
	xmmc varchar(50),
	jfze real,
	bz varchar(200),
	ssbm varchar(200),
	cwbh varchar(50),
	jfzrr varchar(50),
	tqyh varchar(100),
	djr  varchar(50),
        jflb varchar(50),
        zhxgr varchar(50),
        usecount int,
        yyse  float,
        ysye  float
);

create table jfsqgl(
               jfsqbh   varchar(50),
               jfsqr    varchar(50),
               jfsqsj   varchar(50),
               xmbs     varchar(50),
               xmmc     varchar(50),
               jfze     float,
               syje     float,
               jfsqje   float,
               jfsqyy   varchar(200),
               jfsqpic  varchar(50),
               jfsqpzr  varchar(50),
               jfsqpzje float,
               jfsqclr  varchar(50),
               sqzt     varchar(50)
);

create table cywp(
               ID       int,
               cywp     varchar(50)
);

create table dzgg(
                fqr     varchar(50),
                rdr     varchar(200),
                fqsj    varchar(50),
                fqzt    varchar(100),
                fqtext  varchar(200),
                xgzlpic varchar(50)
);

create table eslog(
                un    varchar(50),
                ut    varchar(50),
                ud    varchar(100)
);

create table euser(
                  ID        int,
                  euser     varchar(50),
                  pwd       varchar(200),
                  pre       varchar(50),
                  sxnode    varchar(200),
                  gnqx      varchar(500),
                  eonline   varchar(5),
                  sxdl      varchar(200),
                  spje      varchar(50),
                  bz        varchar(100),
                  sxnode1   varchar(200),
                  sxnode2   varchar(200),
                  sxnode3   varchar(200),
                  sxnode4   varchar(200),
                  sxnode5   varchar(200),
                  sxnode6   varchar(200),
                  sxnode7   varchar(200),
                  sxnode8   varchar(200),
                  sxnode9   varchar(200),
                  smstel    varchar(50),
                  smsjhqx   varchar(50),
                  smsjfly   varchar(50),
                  smsjhbm   varchar(50),
                  smsqzqx   varchar(50),
                  smsqzbm   varchar(200),
                  smsspqx   varchar(50),
                  smsspbm   varchar(200),
                  sxnode10  varchar(200),
                  sxnode11  varchar(200),
                  sxnode12  varchar(200),
                  sxnode13  varchar(200),
                  sxnode14  varchar(200),
                  sxnode15  varchar(200),
                  sxnode16  varchar(200),
                  sxnode17  varchar(200),
                  sxnode18  varchar(200),
                  sxnode19  varchar(200),
                  sxdl1     varchar(200),
                  sxdl2     varchar(200),
                  sxdl3     varchar(200),
                  sxdl4     varchar(200),
                  sxdl5     varchar(200),
                  sxdl6     varchar(200),
                  sxdl7     varchar(200),
                  sxdl8     varchar(200),
                  sxdl9     varchar(200),
                  setcoljh  varchar(500),
                  setcolwp  varchar(500),
                  setcolly  varchar(500),
                  setcolwx  varchar(500),
                  setcolbf  varchar(500),
                  setcolcw  varchar(500),
                  lypwd     varchar(200),
		  dltime    integer,
		  sxzl      varchar(200),
                  sxzl1     varchar(200),
                  sxzl2     varchar(200),
                  sxzl3     varchar(200),
                  sxzl4     varchar(200)
);

insert into euser(ID,euser,pwd,pre,eonline,lypwd) 
            values(1,'root','@0|62#1-52@0|52#1-42','abcdefgh','0','@0|62#1-52@0|52#1-42');

create table fplb(
               lbbh     varchar(50),
               lbmc     varchar(50)
);

create table fkdy(
               sj        varchar(100),
               yfkje     float,
               yfkdytime varchar(50),
               yfkdyr    varchar(50),
               jhbs      varchar(50),
               skyh      varchar(100),
               yhzh      varchar(50),
               fkdy      int,
               jfly      varchar(50),
               spr       varchar(100),
               fkfs      varchar(50)               
);

create table gccs(
               gcmc     varchar(100),
               zfzr     varchar(50),
               kgsj     varchar(50),
               jgsj     varchar(50),
               zyse     varchar(50),
               zyjf     varchar(50),
               bz       varchar(200)
);

create table clcs(
               pzbm     varchar(50),
               jsy      varchar(50),
               clzt     varchar(50),
               bz       varchar(200)
);

create table htlb(
               lbbh     varchar(50),
               lbmc     varchar(50)
);

create table htmb(
              lbbh    varchar(50),
              mbmc    varchar(200),
              mbn     varchar(50)
);

create table jflog(
                xmbs      varchar(50),
                djjf      real,
                djsj      varchar(50),
                bz        varchar(200),
                djr       varchar(50),
                jfsqbh    varchar(50)
);

create table kcjl(
                ID        int,
                wpbs      varchar(50),
                zl        float,
                kyl       float,
                syl       float,
                wxl       float,
                bfl       float,
                wpmc      varchar(50),
                xhgg      varchar(200),
                jldw      varchar(50),
                dj        float
);

create table lysqgl(
                sqbh      varchar(50),
                sqbm      varchar(50),
                sqsj      varchar(50),
                sqr       varchar(50),
                pzr       varchar(50),
                pzsj      varchar(50),
                sqzt      varchar(50),
                slsy      varchar(200),
                xgzlpic   varchar(50)
);

create table lysqxq(
                sqbh      varchar(50),
                wpbs      varchar(50),
                wpmc      varchar(50),
                xhgg      varchar(200),
                dj        varchar(50),
                slsl      varchar(50),
                slje      varchar(50),
                ylsl      varchar(50)
);

create table lyff(
                ID     int,
                lybs   varchar(50),
                lysj   varchar(50),
                lyr    varchar(50),
                lybm   varchar(50),
                wpbs   varchar(50),
                lysl   float,
                jldw   varchar(50),
                qx     varchar(50),
                ghbz   int,
                lyjybz int,
                bz     varchar(200),
                lybq   varchar(50),
                ffr    varchar(50),
                fzwz   varchar(50),
                lzbz   varchar(50),
                gcmc   varchar(50),
                wpmc   varchar(50),
                lysqbh varchar(50),
                dj     float
);

create table lyghlog(
                lybs      varchar(50),
                ghl       float,
                djr       varchar(50),
                djsj      varchar(50),
                bcslyl    varchar(50)
);

create table lysxlog(
                wxbs      varchar(50),
                lybs      varchar(50),
                sxsl      float,
                xhsl      float,
                bfsl      float
);

create table param(
                ID    int,
                param varchar(200),
                key1  int,
                val   varchar(500)
);

insert into param(ID,param,key1,val) values(0,'',1,'2');
insert into param(ID,param,key1,val) values(0,'',2,'huiruan.cc');
insert into param(ID,param,key1,val) values(0,'',3,'7.0');
insert into param(ID,param,key1,val) values(0,'',4,'0');
insert into param(ID,param,key1,val) values(0,'',5,'0');
insert into param(ID,param,key1,val) values(0,'',6,'0');
insert into param(ID,param,key1,val) values(0,'',7,'');
insert into param(ID,param,key1,val) values(0,'all',8,'1');
insert into param(ID,param,key1,val) values(0,'',9,'0');
insert into param(ID,param,key1,val) values(0,'',10,'');
insert into param(ID,param,key1,val) values(0,'gserip',11,'127.0.0.1');
insert into param(ID,param,key1,val) values(0,'gserport',12,'7702');
insert into param(ID,param,key1,val) values(0,'',13,'');
insert into param(ID,param,key1,val) values(0,'',14,'http://127.0.0.1/update/');
insert into param(ID,param,key1,val) values(0,'',15,'');
insert into param(ID,param,key1,val) values(0,'',16,'');
insert into param(ID,param,key1,val) values(0,'',17,'1');
insert into param(ID,param,key1,val) values(0,'',18,'115200');
insert into param(ID,param,key1,val) values(0,'',19,'+8613800270500');
insert into param(ID,param,key1,val) values(0,'',20,'0000000');
insert into param(ID,param,key1,val) values(0,'',21,'http://127.0.0.1');
insert into param(ID,param,key1,val) values(0,'',22,'127;21;u;p;');
insert into param(ID,param,key1,val) values(0,'',23,'0000000');
insert into param(ID,param,key1,val) values(0,'',24,'');
insert into param(ID,param,key1,val) values(0,'',25,'http://127.0.0.1/help/');
insert into param(ID,param,key1,val) values(0,'',26,'￥');
insert into param(ID,param,key1,val) values(0,'',27,'');
insert into param(ID,param,key1,val) values(0,'',28,'');
insert into param(ID,param,key1,val) values(0,'databasename(dm,mysql,sqlserver,oracle)',29,'FFFFFF');
insert into param(ID,param,key1,val) values(0,'',30,'0');
insert into param(ID,param,key1,val) values(0,'',31,'0');
insert into param(ID,param,key1,val) values(0,'',32,'0');
insert into param(ID,param,key1,val) values(0,'',33,'0');
insert into param(ID,param,key1,val) values(0,'',34,'jh');
insert into param(ID,param,key1,val) values(0,'',35,'wp');
insert into param(ID,param,key1,val) values(0,'',36,'ly');
insert into param(ID,param,key1,val) values(0,'',37,'wx');
insert into param(ID,param,key1,val) values(0,'',38,'bf');
insert into param(ID,param,key1,val) values(0,'',39,'cw');
insert into param(ID,param,key1,val) values(0,'',40,'sj');
insert into param(ID,param,key1,val) values(0,'',41,'0');
insert into param(ID,param,key1,val) values(0,'',42,'1');
insert into param(ID,param,key1,val) values(0,'',43,'0');
insert into param(ID,param,key1,val) values(0,'',44,'0');
insert into param(ID,param,key1,val) values(0,'',45,'0');
insert into param(ID,param,key1,val) values(0,'',46,'0');
insert into param(ID,param,key1,val) values(0,'',47,'0');
insert into param(ID,param,key1,val) values(0,'',48,'0');
insert into param(ID,param,key1,val) values(0,'',49,'0');
insert into param(ID,param,key1,val) values(0,'',50,'0');
insert into param(ID,param,key1,val) values(0,'',51,'1');
insert into param(ID,param,key1,val) values(0,'',52,'3');
insert into param(ID,param,key1,val) values(0,'',53,'0');
insert into param(ID,param,key1,val) values(0,'',54,'0');
insert into param(ID,param,key1,val) values(0,'',55,'0');
insert into param(ID,param,key1,val) values(0,'',56,'700');
insert into param(ID,param,key1,val) values(0,'',57,'2');
insert into param(ID,param,key1,val) values(0,'',58,'1');
insert into param(ID,param,key1,val) values(0,'',59,'管理员：  联系电话：  电子邮件：');
insert into param(ID,param,key1,val) values(0,'',60,'0');
insert into param(ID,param,key1,val) values(0,'',61,'0');
insert into param(ID,param,key1,val) values(0,'',62,'0');
insert into param(ID,param,key1,val) values(0,'',63,'');
insert into param(ID,param,key1,val) values(0,'',64,'');
insert into param(ID,param,key1,val) values(0,'',65,'');
insert into param(ID,param,key1,val) values(0,'',66,'');
insert into param(ID,param,key1,val) values(0,'',67,'');
insert into param(ID,param,key1,val) values(0,'',68,'');
insert into param(ID,param,key1,val) values(0,'',69,'');
insert into param(ID,param,key1,val) values(0,'lysqbh',70,'0');
insert into param(ID,param,key1,val) values(0,'yssqbh',71,'0');
insert into param(ID,param,key1,val) values(0,'jfsqbh',72,'0');
insert into param(ID,param,key1,val) values(0,'',73,'');
insert into param(ID,param,key1,val) values(0,'',74,'');
insert into param(ID,param,key1,val) values(0,'',75,'');
insert into param(ID,param,key1,val) values(0,'',76,'');
insert into param(ID,param,key1,val) values(0,'',77,'');
insert into param(ID,param,key1,val) values(0,'',78,'');
insert into param(ID,param,key1,val) values(0,'',79,'');
insert into param(ID,param,key1,val) values(0,'',80,'');

create table sjbj(
               id       varchar(50),
               xmbs     varchar(50),
               usrname  varchar(50),
               cpmc     varchar(50),
               xhgg     varchar(200),
               cpdj     varchar(50),
               gysl     varchar(50),
               lxr      varchar(50),
               lxdh     varchar(50),
               lxmail   varchar(50),
               bz       varchar(200),
               shbs     varchar(200),
               tjtime   varchar(50),
               shr      varchar(50),
               picn     varchar(50),
               pdfn     varchar(50)
);

create table sjgl(
               sjbs       varchar(50),
               sjmc       varchar(100),
               sjdz       varchar(100),
               sjlxr      varchar(50),
               sjlxdh     varchar(50),
               sjfax      varchar(50),
               sjemail    varchar(50),
               sjweb      varchar(100),
               bz         varchar(200),
               sjlb       varchar(50),
               tjr        varchar(50),
               khyh       varchar(50),
               yhzh       varchar(50),
	       xgzl       varchar(50)
);

CREATE TABLE sjreg (
	usrname varchar(50),
	usrpwd varchar(50),
	usrqx varchar(50),
	sjname varchar(100),
	sjdz varchar(100),
	sjlxr varchar(50),
	sjlxdh varchar(50),
	sjfax varchar(50),
	sjmail varchar(50),
	sjweb varchar(100),
	bz varchar(200),
	yzbs varchar(50),
	zctime varchar(50),
        khyh   varchar(100),
        yhzh   varchar(50)
);

CREATE TABLE sldw(
	ID int,
	sldw varchar(50) 
);

insert into sldw(ID,sldw) values(0,'台');
insert into sldw(ID,sldw) values(0,'张');
insert into sldw(ID,sldw) values(0,'个');
insert into sldw(ID,sldw) values(0,'包');
insert into sldw(ID,sldw) values(0,'箱');
insert into sldw(ID,sldw) values(0,'项');
insert into sldw(ID,sldw) values(0,'支');
insert into sldw(ID,sldw) values(0,'打');
insert into sldw(ID,sldw) values(0,'米');
insert into sldw(ID,sldw) values(0,'厘米');
insert into sldw(ID,sldw) values(0,'毫米');
insert into sldw(ID,sldw) values(0,'分');
insert into sldw(ID,sldw) values(0,'份');
insert into sldw(ID,sldw) values(0,'克');
insert into sldw(ID,sldw) values(0,'千克');

CREATE TABLE smsdl(
	smsjhbs varchar(50),
	smstel varchar(50),
	smstime varchar(50),
	smsqzzt varchar(50),
	smsspzt varchar(50),
	smswpmc varchar(200),
	smssl varchar(50),
	smsjldw varchar(50),
	smsje varchar(50),
	smssgsy varchar(200),
	smsqztel varchar(50),
	smssptel varchar(50)
);

CREATE TABLE smslog(
	smstime varchar(50),
	smshm varchar(50),
	smslog varchar(200),
	sim varchar(50)
);

CREATE TABLE smssend(
	tjtime varchar(50),
	tel varchar(50),
	xxnr varchar(200),
	tjr varchar(50)
);

create table ssel(
             etp   varchar(50),
             eval  varchar(50)
);

create table statpar(
               ID           int,
               tjcs         varchar(50),
               sql1         varchar(100),
               nodelab      varchar(50)
);

insert into statpar(ID,tjcs,sql1,nodelab) values(2,'临近计划数','','a');
insert into statpar(ID,tjcs,sql1,nodelab) values(9,'入库记录总条数','','b');
insert into statpar(ID,tjcs,sql1,nodelab) values(11,'入库物资总价值','','b');
insert into statpar(ID,tjcs,sql1,nodelab) values(12,'领用记录总条数','','c');
insert into statpar(ID,tjcs,sql1,nodelab) values(14,'领用物资总价值','','c');
insert into statpar(ID,tjcs,sql1,nodelab) values(15,'未归还记录数','','c');
insert into statpar(ID,tjcs,sql1,nodelab) values(16,'已归还记录数','','c');
insert into statpar(ID,tjcs,sql1,nodelab) values(17,'维修记录总条数','','d');
insert into statpar(ID,tjcs,sql1,nodelab) values(18,'已返还记录数','','d');
insert into statpar(ID,tjcs,sql1,nodelab) values(19,'未返回记录数','','d');
insert into statpar(ID,tjcs,sql1,nodelab) values(22,'维修总费用','','d');
insert into statpar(ID,tjcs,sql1,nodelab) values(23,'报废记录总条数','','e');
insert into statpar(ID,tjcs,sql1,nodelab) values(24,'报废物资总价值','','e');
insert into statpar(ID,tjcs,sql1,nodelab) values(25,'维修后报废记录数','','e');
insert into statpar(ID,tjcs,sql1,nodelab) values(26,'使用中报废记录数','','e');
insert into statpar(ID,tjcs,sql1,nodelab) values(27,'库存中报废记录数','','e');
insert into statpar(ID,tjcs,sql1,nodelab) values(1,'计划总数','select count(*) from cgjh','a');
insert into statpar(ID,tjcs,sql1,nodelab) values(3,'过期计划数','','a');
insert into statpar(ID,tjcs,sql1,nodelab) values(4,'已采购计划数','','a');
insert into statpar(ID,tjcs,sql1,nodelab) values(5,'计划总金额','','a');
insert into statpar(ID,tjcs,sql1,nodelab) values(28,'有计划采购记录数','','b');
insert into statpar(ID,tjcs,sql1,nodelab) values(29,'无计划采购记录数','','b');
insert into statpar(ID,tjcs,sql1,nodelab) values(30,'采购计划统计分析表','双击可在下面视图中显示表格,在表格中单击右键可进行图表评比分析','f');
insert into statpar(ID,tjcs,sql1,nodelab) values(31,'物品资源统计分析表','双击可在下面视图中显示表格,在表格中单击右键可进行图表评比分析','f');
insert into statpar(ID,tjcs,sql1,nodelab) values(32,'领用发放情况统计表','双击可在下面视图中显示表格,在表格中单击右键可进行图表评比分析','f');
insert into statpar(ID,tjcs,sql1,nodelab) values(33,'物资维修情况统计表','双击可在下面视图中显示表格,在表格中单击右键可进行图表评比分析','f');
insert into statpar(ID,tjcs,sql1,nodelab) values(34,'物资报废情况统计表','双击可在下面视图中显示表格,在表格中单击右键可进行图表评比分析','f');
insert into statpar(ID,tjcs,sql1,nodelab) values(35,'物资库存情况分析表','双击可在下面视图中显示表格,在表格中单击右键可进行图表评比分析','f');
insert into statpar(ID,tjcs,sql1,nodelab) values(36,'物资库存告警分析表','双击可在下面视图中显示表格,在表格中单击右键可进行图表评比分析','f');
insert into statpar(ID,tjcs,sql1,nodelab) values(37,'经费项目总条数','','g');
insert into statpar(ID,tjcs,sql1,nodelab) values(38,'经费总金额','','g');
insert into statpar(ID,tjcs,sql1,nodelab) values(39,'经费项目核算分析表','双击可在下面视图中显示表格,在表格中单击右键可进行图表评比分析','f');
insert into statpar(ID,tjcs,sql1,nodelab) values(40,'入库物资总量','','b');
insert into statpar(ID,tjcs,sql1,nodelab) values(41,'领用物资总量','','c');
insert into statpar(ID,tjcs,sql1,nodelab) values(41,'维修物资总量','','d');
insert into statpar(ID,tjcs,sql1,nodelab) values(42,'报废物资总量','','e');
insert into statpar(ID,tjcs,sql1,nodelab) values(43,'员工消耗成本分析表','双击可在下面视图中显示表格,在表格中单击右键可进行图表评比分析','f');
insert into statpar(ID,tjcs,sql1,nodelab) values(44,'工程项目统筹分析表','双击可在下面视图中显示表格,在表格中单击右键可进行图表评比分析','f');
insert into statpar(ID,tjcs,sql1,nodelab) values(45,'维修厂家资料汇总表','双击可在下面视图中显示表格,在表格中单击右键可进行图表评比分析','f');
insert into statpar(ID,tjcs,sql1,nodelab) values(46,'供货商采购情况报表','双击可在下面视图中显示表格,在表格中单击右键可进行图表评比分析','f');

create table sxbflog(
               ID      int,
               wxbs    varchar(50),
               lybs    varchar(50),
               sxbfsl  float,
               sxbf    int,
               use1    int,
               wpbs    varchar(50)
);

create table tab_sxbfsl(
                   ID      int,
                   lybs    varchar(50),
                   sl      float
);

CREATE TABLE treenode(
	ID int,
	node varchar(50),
	use1 smallint,
	nodelab varchar(50)
);

insert into treenode(id,node,use1,nodelab) values(1,'采购计划',1,'a');
insert into treenode(id,node,use1,nodelab) values(2,'物资管理',1,'b');
insert into treenode(id,node,use1,nodelab) values(3,'领用发放',1,'c');
insert into treenode(id,node,use1,nodelab) values(4,'维修管理',1,'d');
insert into treenode(id,node,use1,nodelab) values(5,'报废管理',1,'e');
insert into treenode(id,node,use1,nodelab) values(6,'财务管理',1,'g');
insert into treenode(id,node,use1,nodelab) values(7,'报表中心',1,'f');

CREATE TABLE treenode1(
	ID int,
	nodestext varchar(50),
	nodesp varchar(50),
	bsf varchar(50),
	dl varchar(50),
	xh varchar(50)
);

insert into treenode1(id,nodestext,nodesp,bsf,dl,xh) values(1,'经理室','a','','','');
insert into treenode1(id,nodestext,nodesp,bsf,dl,xh) values(22,'市场部','a','','','');
insert into treenode1(id,nodestext,nodesp,bsf,dl,xh) values(61,'市场部','c','','','');
insert into treenode1(id,nodestext,nodesp,bsf,dl,xh) values(2,'办公室','a','','','');
insert into treenode1(id,nodestext,nodesp,bsf,dl,xh) values(4,'财务部','a','','','');
insert into treenode1(id,nodestext,nodesp,bsf,dl,xh) values(5,'后勤部','a','','','');
insert into treenode1(id,nodestext,nodesp,bsf,dl,xh) values(6,'车辆类','b','','高值物品','');
insert into treenode1(id,nodestext,nodesp,bsf,dl,xh) values(7,'电脑耗材','b','','低值易耗','');
insert into treenode1(id,nodestext,nodesp,bsf,dl,xh) values(9,'办公桌椅','b','','低值易耗','');
insert into treenode1(id,nodestext,nodesp,bsf,dl,xh) values(12,'经理室','c','','','');
insert into treenode1(id,nodestext,nodesp,bsf,dl,xh) values(13,'办公室','c','','','');
insert into treenode1(id,nodestext,nodesp,bsf,dl,xh) values(15,'财务部','c','','','');
insert into treenode1(id,nodestext,nodesp,bsf,dl,xh) values(16,'后勤部','c','','','');
insert into treenode1(id,nodestext,nodesp,bsf,dl,xh) values(43,'计算机','b','','微型机','');
insert into treenode1(id,nodestext,nodesp,bsf,dl,xh) values(0,'商务礼品','b','','宣传类','');
insert into treenode1(id,nodestext,nodesp,bsf,dl,xh) values(0,'房屋','b','','固定资产','');
insert into treenode1(id,nodestext,nodesp,bsf,dl,xh) values(0,'操作系统','b','','软件类','');
insert into treenode1(id,nodestext,nodesp,bsf,dl,xh) values(0,'数据库','b','','软件类','');
insert into treenode1(id,nodestext,nodesp,bsf,dl,xh) values(0,'应用软件','b','','软件类','');
insert into treenode1(id,nodestext,nodesp,bsf,dl,xh) values(0,'中间件','b','','软件类','');
insert into treenode1(id,nodestext,nodesp,bsf,dl,xh) values(0,'计算机维修部','d','','','');

create table userp(
              num      varchar(50),
              pn       varchar(50),
              pd       varchar(100),
              pk       varchar(50),
              pu       varchar(50)
);

insert into userp(num,pn,pd,pk,pu) values('a02','a','增删改计划部门','a2;','-1');
insert into userp(num,pn,pd,pk,pu) values('a03','a','增删改采购计划','a3;','1');
insert into userp(num,pn,pd,pk,pu) values('a04','a','临近期计划查询','a4;','1');
insert into userp(num,pn,pd,pk,pu) values('a05','a','自定义查询','a5;','1');
insert into userp(num,pn,pd,pk,pu) values('a06','a','负责人签字权','a6;','1');
insert into userp(num,pn,pd,pk,pu) values('a07','a','计划审批权','a7;','1');
insert into userp(num,pn,pd,pk,pu) values('a08','a','查已审批计划','a8;','1');
insert into userp(num,pn,pd,pk,pu) values('a09','a','查未审批计划','a9;','1');
insert into userp(num,pn,pd,pk,pu) values('a10','a','采购进程管理','a10;','1');
insert into userp(num,pn,pd,pk,pu) values('a11','a','供货商资料查看','a11;','1');
insert into userp(num,pn,pd,pk,pu) values('a12','a','增加供货商资料','a12;','1');
insert into userp(num,pn,pd,pk,pu) values('a13','a','删改供货商资料','a13;','1');
insert into userp(num,pn,pd,pk,pu) values('a14','a','只能查看自己所提交的计划','a14;','1');
insert into userp(num,pn,pd,pk,pu) values('a15','a','网上注册商家审核','a15;','0');
insert into userp(num,pn,pd,pk,pu) values('a16','a','网上报价发布','a16;','0');
insert into userp(num,pn,pd,pk,pu) values('a17','a','网上报价审核','a17;','0');
insert into userp(num,pn,pd,pk,pu) values('a18','a','网上报价完成与回退','a18;','0');
insert into userp(num,pn,pd,pk,pu) values('a19','a','预付单打印','a19;','1');
insert into userp(num,pn,pd,pk,pu) values('a20','a','中标结果网上发布','a20;','0');
insert into userp(num,pn,pd,pk,pu) values('a21','a','把关签字权','a21;','1');
insert into userp(num,pn,pd,pk,pu) values('a22','a','项目采购完成设置','a22;','1');
insert into userp(num,pn,pd,pk,pu) values('a23','a','项目采购计划提交权','a23;','1');
insert into userp(num,pn,pd,pk,pu) values('a24','a','检验标志设置权','a24;','1');
insert into userp(num,pn,pd,pk,pu) values('a25','a','工程计划提交权','a25;','1');
insert into userp(num,pn,pd,pk,pu) values('a26','a','增删改预算追加申请仅限于自己提交','a26;','1');
insert into userp(num,pn,pd,pk,pu) values('a27','a','查看权自己提交的预算追加申请','a27;','1');
insert into userp(num,pn,pd,pk,pu) values('a28','a','查看权所属部门提交的预算追加申请','a28;','1');
insert into userp(num,pn,pd,pk,pu) values('a29','a','查看权所有的预算追加申请','a29;','1');
insert into userp(num,pn,pd,pk,pu) values('a30','a','审批所属部门提交的预算追加申请','a30;','1');
insert into userp(num,pn,pd,pk,pu) values('a31','a','审批所有的预算追加申请','a31;','1');
insert into userp(num,pn,pd,pk,pu) values('a32','a','预算追加申请处理权','a32;','1');
insert into userp(num,pn,pd,pk,pu) values('b02','b','增删改物资类别','b2;','-1');
insert into userp(num,pn,pd,pk,pu) values('b03','b','增加物资登记','b3;','1');
insert into userp(num,pn,pd,pk,pu) values('b04','b','物资流向跟踪','b4;','1');
insert into userp(num,pn,pd,pk,pu) values('b05','b','物资库存分析','b5;','1');
insert into userp(num,pn,pd,pk,pu) values('b06','b','自定义查询','b6;','1');
insert into userp(num,pn,pd,pk,pu) values('b07','b','只能查看所属部门能够使用的物资登记','b7;','1');
insert into userp(num,pn,pd,pk,pu) values('b08','b','无计划物资登记权','b8;','1');
insert into userp(num,pn,pd,pk,pu) values('b09','b','只能查看自己提交计划的采购情况','b9;','1');
insert into userp(num,pn,pd,pk,pu) values('b10','b','付款单打印','b10;','1');
insert into userp(num,pn,pd,pk,pu) values('b11','b','领用详情','b11;','1');
insert into userp(num,pn,pd,pk,pu) values('b12','b','维修详情','b12;','1');
insert into userp(num,pn,pd,pk,pu) values('b13','b','报废详情','b13;','1');
insert into userp(num,pn,pd,pk,pu) values('b14','b','增减物资数量','b14;','1');
insert into userp(num,pn,pd,pk,pu) values('b15','b','销售价设置权','b15;','1');
insert into userp(num,pn,pd,pk,pu) values('b16','b','物资图片设置','b16;','1');
insert into userp(num,pn,pd,pk,pu) values('b17','b','项目采购记录查询','b17;','1');
insert into userp(num,pn,pd,pk,pu) values('b18','b','入库物资检验管理','b18;','1');
insert into userp(num,pn,pd,pk,pu) values('b19','b','只能操作具有查看权的物资','b19;','1');
insert into userp(num,pn,pd,pk,pu) values('b20','b','超计划预算物资登记权','b20;','1');
insert into userp(num,pn,pd,pk,pu) values('c02','c','增删改部门','c2;','-1');
insert into userp(num,pn,pd,pk,pu) values('c03','c','增加领用登记','c3;','1');
insert into userp(num,pn,pd,pk,pu) values('c04','c','应归还领用查询','c4;','1');
insert into userp(num,pn,pd,pk,pu) values('c05','c','自定义查询','c5;','1');
insert into userp(num,pn,pd,pk,pu) values('c06','c','只能查看自己的领用情况','c6;','1');
insert into userp(num,pn,pd,pk,pu) values('c07','c','只能查看自己的发放情况','c7;','1');
insert into userp(num,pn,pd,pk,pu) values('c08','c','领用归还单打印','c8;','1');
insert into userp(num,pn,pd,pk,pu) values('c09','c','工程名称设置','c9;','1');
insert into userp(num,pn,pd,pk,pu) values('c10','c','密码签字设置','c10;','1');
insert into userp(num,pn,pd,pk,pu) values('c11','c','工程统筹分析','c11;','1');
insert into userp(num,pn,pd,pk,pu) values('c12','c','领用部分归还','c12;','1');
insert into userp(num,pn,pd,pk,pu) values('c13','c','归还详情查看','c13;','1');
insert into userp(num,pn,pd,pk,pu) values('c14','c','只能操作具有查看权的领用','c14;','1');
insert into userp(num,pn,pd,pk,pu) values('c15','c','领用批量转交','c15;','1');
insert into userp(num,pn,pd,pk,pu) values('c16','c','无申请领用发放权','c16;','1');
insert into userp(num,pn,pd,pk,pu) values('c17','c','查看权自己提交的领用申请','c17;','1');
insert into userp(num,pn,pd,pk,pu) values('c18','c','查看权所属部门提交的领用申请','c18;','1');
insert into userp(num,pn,pd,pk,pu) values('c19','c','查看权所有的领用申请','c19;','1');
insert into userp(num,pn,pd,pk,pu) values('c20','c','增删改领用申请仅限于自己提交','c20;','1');
insert into userp(num,pn,pd,pk,pu) values('c21','c','审批所属部门提交的领用申请','c21;','1');
insert into userp(num,pn,pd,pk,pu) values('c22','c','审批所有的领用申请','c22;','1');
insert into userp(num,pn,pd,pk,pu) values('d02','d','增删改维修厂家','d2;','1');
insert into userp(num,pn,pd,pk,pu) values('d03','d','增加维修登记','d3;','1');
insert into userp(num,pn,pd,pk,pu) values('d04','d','自定义查询','d4;','1');
insert into userp(num,pn,pd,pk,pu) values('d05','d','只能查看自己的送修情况','d5;','1');
insert into userp(num,pn,pd,pk,pu) values('d06','d','验收签字权','d6;','1');
insert into userp(num,pn,pd,pk,pu) values('d07','d','自动授予所有维修厂家的权限','d7;','1');
insert into userp(num,pn,pd,pk,pu) values('d08','d','付款通知单打印','d8;','1');
insert into userp(num,pn,pd,pk,pu) values('e02','e','增加报废记录','e2;','1');
insert into userp(num,pn,pd,pk,pu) values('e03','e','自定义查询','e3;','1');
insert into userp(num,pn,pd,pk,pu) values('e04','e','只能查看自己申请的记录','e4;','1');
insert into userp(num,pn,pd,pk,pu) values('e05','e','报废鉴定权','e5;','1');
insert into userp(num,pn,pd,pk,pu) values('e06','e','报废核准权','e6;','1');
insert into userp(num,pn,pd,pk,pu) values('e07','e','报废数据处理权','e7;','1');
insert into userp(num,pn,pd,pk,pu) values('g02','g','增删改项目记录','g2;','1');
insert into userp(num,pn,pd,pk,pu) values('g03','g','自定义查询','g3;','1');
insert into userp(num,pn,pd,pk,pu) values('g04','g','只能查看所属部门项目','g4;','1');
insert into userp(num,pn,pd,pk,pu) values('g05','g','经费详情查看','g5;','1');
insert into userp(num,pn,pd,pk,pu) values('g06','g','增删改经费申请仅限于自己提交','g6;','1');
insert into userp(num,pn,pd,pk,pu) values('g07','g','经费申请审批权所有申请','g7;','1');
insert into userp(num,pn,pd,pk,pu) values('g08','g','经费申请查看权所有申请','g8;','1');
insert into userp(num,pn,pd,pk,pu) values('t01','t','删除已签字未审批计划','t1;','1');
insert into userp(num,pn,pd,pk,pu) values('t02','t','删改物资登记','t2;','1');
insert into userp(num,pn,pd,pk,pu) values('t03','t','删改领用登记','t3;','1');
insert into userp(num,pn,pd,pk,pu) values('t04','t','修改维修登记','t4;','1');
insert into userp(num,pn,pd,pk,pu) values('t05','t','比价审核完成回退','t5;','1');
insert into userp(num,pn,pd,pk,pu) values('t06','t','签批人修改权','t6;','-1');
insert into userp(num,pn,pd,pk,pu) values('t07','t','经费来源更改','t7;','1');
insert into userp(num,pn,pd,pk,pu) values('t08','t','上报人修改权','t8;','1');
insert into userp(num,pn,pd,pk,pu) values('t09','t','采购人修改权','t9;','1');
insert into userp(num,pn,pd,pk,pu) values('t10','t','签收人修改权','t10;','1');
insert into userp(num,pn,pd,pk,pu) values('t11','t','领用人修改权','t11;','1');
insert into userp(num,pn,pd,pk,pu) values('t12','t','送修人修改权','t12;','1');
insert into userp(num,pn,pd,pk,pu) values('t13','t','删改报废登记','t13;','1');
insert into userp(num,pn,pd,pk,pu) values('t14','t','申请人修改权','t14;','1');
insert into userp(num,pn,pd,pk,pu) values('t15','t','删除维修登记','t15;','1');
insert into userp(num,pn,pd,pk,pu) values('t16','t','审批->上报人','t16;','0');
insert into userp(num,pn,pd,pk,pu) values('t17','t','短信->签批人','t17;','0');
insert into userp(num,pn,pd,pk,pu) values('t18','t','负责->审批人','t18;','0');
insert into userp(num,pn,pd,pk,pu) values('t19','t','计划批示','t19;','1');
insert into userp(num,pn,pd,pk,pu) values('t20','t','云登录','t20;','1');
insert into userp(num,pn,pd,pk,pu) values('t21','t','自定义报表设计','t21;','1');
insert into userp(num,pn,pd,pk,pu) values('t22','t','电子公告图片提交权','t22;','1');

create table usrlog(
                usrname varchar(50),
                dltime  varchar(50),
                dlip    varchar(50)
);

create table wpdl(
              dlbs     varchar(50),
              zlbs     varchar(50),
              dlmc     varchar(50),
              wpzl     varchar(50)
);

insert into wpdl(dlbs,zlbs,dlmc,wpzl) values('低值易耗','b','低值易耗','办公品仓库');				
insert into wpdl(dlbs,zlbs,dlmc,wpzl) values('宣传类','b','宣传类','宣传品仓库');				
insert into wpdl(dlbs,zlbs,dlmc,wpzl) values('固定资产','b','固定资产','资产类仓库');				
insert into wpdl(dlbs,zlbs,dlmc,wpzl) values('微型机','b','微型机','计算机仓库');				
insert into wpdl(dlbs,zlbs,dlmc,wpzl) values('软件类','b','软件类','计算机仓库');				
insert into wpdl(dlbs,zlbs,dlmc,wpzl) values('高值物品','b','高值物品','办公品仓库');				
insert into wpdl(dlbs,zlbs,dlmc,wpzl) values('小型机','b','小型机','计算机仓库');				
insert into wpdl(dlbs,zlbs,dlmc,wpzl) values('服务器','b','服务器','计算机仓库');

CREATE TABLE wpgl(
	ID int ,
	wpbs varchar(50),
	djsj varchar(20),
	jhbs varchar(50),
	wpfl varchar(50),
	wpmc varchar(50),
	xhgg varchar(200),
	jldw varchar(50),
	dj float ,
	rksl float ,
	cgr varchar(50),
	cgbm varchar(50),
	qsr varchar(50),
	sj varchar(50),
	sjdz varchar(100),
	lxdh varchar(50),
	lxr varchar(50),
	bz varchar(200),
	dl varchar(50),
	rjsl float ,
	jfly varchar(50),
	tmbs varchar(50),
	cfwz varchar(50),
	syqx varchar(50),
	sybm varchar(200),
	picn varchar(50),
	htlb varchar(50),
	htbh varchar(200),
	fplb varchar(50),
	fpbh varchar(200),
	salep float ,
	salelp float,
        jhjybs varchar(50),
        jyxq   varchar(500),
        gcmc   varchar(50)
);

create table wplog(
               djr    varchar(50),
               djsj   varchar(50),
               cgr    varchar(50),
               sl     float,
               wpbs   varchar(50),
               htlb   varchar(50),
               htbh   varchar(200),
               fplb   varchar(50),
               fpbh   varchar(200),
               jhbs   varchar(50),
	       dj     float,
               qsr    varchar(50),
               sj     varchar(100),
               fkdy   int
);

create table wpzl(
              zlmc   varchar(50)
);

insert into wpzl(zlmc) values('办公品仓库');
insert into wpzl(zlmc) values('计算机仓库');
insert into wpzl(zlmc) values('宣传品仓库');
insert into wpzl(zlmc) values('资产类仓库');
insert into wpzl(zlmc) values('原材料仓库');
insert into wpzl(zlmc) values('半成品仓库');
insert into wpzl(zlmc) values('全成品仓库');
insert into wpzl(zlmc) values('招待费仓库');
insert into wpzl(zlmc) values('差旅费仓库');
insert into wpzl(zlmc) values('薪资福利库');
insert into wpzl(zlmc) values('会议费仓库');
insert into wpzl(zlmc) values('用车单仓库');

create table wsgb(
               tjtime   varchar(50),
               tjr      varchar(50),
               info     varchar(200),
               gbzt     varchar(50)
);

CREATE TABLE wxgl(
	ID int ,
	wxbs varchar(50),
	djsj varchar(20),
	wpbs varchar(50),
	sxr varchar(50),
	wxcj varchar(50),
	wxr varchar(50),
	fhsj varchar(10),
	sxsl float ,
	xhsl float ,
	bfsl float ,
	wxfy float ,
	bz varchar(200),
	jfly varchar(50),
	sxlx varchar(50),
	lybs varchar(50),
	lybq varchar(50),
	bz1 varchar(200),
	ysr varchar(50),
	bz2 varchar(200),
	qdr varchar(50),
	htlb varchar(50),
	htbh varchar(200),
	fplb varchar(50),
	fpbh varchar(200),
	wpmc varchar(50),
        jldw varchar(50),
        dj   float,
        fkdy varchar(50),
        fkdyr varchar(50),
        fkdysj varchar(50)
);

create table tmp(
        lybs     varchar(50),
        bfl      float
);

create table otherreport(
        tablecaption    varchar(50),
        colsname       varchar(500),
        ssql           varchar(1000),
        use1            varchar(50),
        sjr             varchar(50)
);