プロジェクト

全般

プロフィール

リビジョン 342

堀内6年以上前に追加

工事詳細台帳経費データ追加
案件新著億データ:キー項目変更・インデックス追加
部署経費マスタ:経費名称追加
担当者給与マスタ:インデックス追加

差分を表示:

branches/ddl/20180406_SQL.txt
1
-- ???????o?[?f?[?^
2
drop table if exists DepartmentCostData cascade; 
3

  
4
CREATE TABLE DepartmentCostData( 
5
  DepartmentCode DECIMAL (5, 0) UNSIGNED NOT NULL COMMENT '?????R?[?h'
6
  , DataYear SMALLINT (5) UNSIGNED NOT NULL COMMENT '?H???????E?H???N??'
7
  , DataCount DECIMAL (5, 0) UNSIGNED NOT NULL COMMENT '?f?[?^???'
8
  , EntryPersonCode DECIMAL (8, 0) UNSIGNED NOT NULL COMMENT '????S????R?[?h'
9
  , SuppliersCode DECIMAL (5, 0) UNSIGNED NOT NULL COMMENT '?x????R?[?h'
10
  , SuppliersName VARCHAR (120) COMMENT '?x??????'
11
  , PaymentContent VARCHAR (60) COMMENT '?x?????e'
12
  , DateOfBilling DATE NOT NULL COMMENT '??????'
13
  , DateOfPayment DATE NOT NULL COMMENT '?x????'
14
  , EntryPrice DECIMAL (12, 0) NOT NULL COMMENT '???z?i????j'
15
  , EntryPriceInTax DECIMAL (12, 0) NOT NULL COMMENT '???z?i????j'
16
  , SlipNumber VARCHAR (12) COMMENT '?`?[???'
17
  , ComplateFlg DECIMAL (1, 0) NOT NULL COMMENT '???????t???O'
18
  , ApprovalFlg DECIMAL (1, 0) NOT NULL COMMENT '???F?t???O'
19
  , EntryDate DATETIME NOT NULL COMMENT '?o?^???t'
20
  , UpdateDate DATETIME NOT NULL COMMENT '?X?V???t'
21
  , CONSTRAINT DepartmentCostData_PKC PRIMARY KEY (DepartmentCode, DataYear, DataCount)
22
) COMMENT '???????o?[?f?[?^'; 
23

  
24

  
branches/ddl/20180411_SQL.txt
1
-- ????i?????t?f?[?^
2
DROP TABLE IF EXISTS constructionprogressdate_OLD; 
3

  
4
CREATE TABLE constructionprogressdate_OLD As 
5
Select
6
  * 
7
from
8
  constructionprogressdate; 
9

  
10
drop table if exists constructionprogressdate cascade; 
11

  
12
create table constructionprogressdate( 
13
  ConstructionCode decimal (10, 0) not null comment '?H?????'
14
  , ConstructionStatusFlg decimal (2, 0) not null comment '???H?????'
15
  , PreviousStatusFlg decimal (2, 0) comment '??X?O???'
16
  , ChangeDate datetime not null comment '?????t'
17
  , ChangePersonCode decimal (8, 0) not null comment '???S????'
18
  , EntryDate datetime not null comment '?o?^???t'
19
  , UpdateDate datetime not null comment '?X?V???t'
20
  , constraint constructionprogressdate_PKC primary key (ConstructionCode, ChangeDate)
21
) comment '????i?????t?f?[?^'; 
22

  
23
create index ConstrProg_Index1 
24
  on constructionprogressdate(ConstructionCode); 
25

  
26
create index ConstrProg_Index2 
27
  on constructionprogressdate(ConstructionStatusFlg); 
28

  
29
create index ConstrProg_Index3 
30
  on constructionprogressdate(ChangeDate); 
31

  
32
Insert 
33
INTO constructionprogressdate 
34
Select
35
  * 
36
from
37
  constructionprogressdate_OLD; 
38

  
39
-- ?H???????o??f?[?^
40
drop table if exists ConstrLedgerExpenses cascade;
41

  
42
create table ConstrLedgerExpenses (
43
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
44
  , SeqNo decimal(5,0) not null comment '?}??'
45
  , NameCode decimal(5,0) unsigned not null comment '?o??R?[?h'
46
  , ExpensesRaito decimal(4,2) not null comment '?o??'
47
  , ExpensesValue decimal(10,0) not null comment '?o????z'
48
  , EntryDate datetime not null comment '?o?^???t'
49
  , UpdateDate datetime not null comment '?X?V???t'
50
  , constraint ConstrLedgerExpenses_PKC primary key (ConstructionCode, SeqNo, NameCode)
51
) comment '?H???????o??f?[?^' ;
52

  
53
create index ConstrLedgerExpenses_Index1
54
  on ConstrLedgerExpenses(ConstructionCode);
55

  
56
create index ConstrLedgerExpenses_Index2
57
  on ConstrLedgerExpenses(SeqNo);
58

  
59
create index ConstrLedgerExpenses_Index3
60
  on ConstrLedgerExpenses(NameCode);
61

  
62
Insert 
63
INTO constrledgerexpenses 
64
select
65
  A.ConstructionCode
66
  , 1
67
  , A.ComponentCode
68
  , A.AmountConfigRate
69
  , A.ExecutionAmount 
70
  , A.EntryDate
71
  , A.UpdateDate
72
from
73
  constructionledgerdetail As A 
74
where
75
  A.GroupCount = 1 
76
  And A.ComponentCode = 3; 
77

  
78
Insert 
79
INTO constrledgerexpenses 
80
select
81
  A.ConstructionCode
82
  , 2
83
  , A.ComponentCode
84
  , A.AmountConfigRate
85
  , A.ExecutionAmount 
86
  , A.EntryDate
87
  , A.UpdateDate
88
from
89
  constructionledgerdetail As A 
90
where
91
  A.GroupCount = 1 
92
  And A.ComponentCode = 1; 
93

  
94
Insert 
95
INTO constrledgerexpenses 
96
select
97
  A.ConstructionCode
98
  , 3
99
  , A.ComponentCode
100
  , A.AmountConfigRate
101
  , A.ExecutionAmount 
102
  , A.EntryDate
103
  , A.UpdateDate
104
from
105
  constructionledgerdetail As A 
106
where
107
  A.GroupCount = 1 
108
  And A.ComponentCode = 2; 
109

  
110

  
111
-- ?????o???}?X?^
112
DROP TABLE IF EXISTS departmentexpensesmaster_OLD; 
113

  
114
CREATE TABLE departmentexpensesmaster_OLD As 
115
Select
116
  * 
117
from
118
  departmentexpensesmaster; 
119

  
120
drop table if exists departmentexpensesmaster cascade;
121

  
122
create table departmentexpensesmaster (
123
  DepartmentCode decimal(5,0) unsigned not null comment '?????R?[?h'
124
  , ExpensesPeriod smallint(6) not null comment '?????'
125
  , NameCode decimal(5,0) unsigned not null comment '?o??R?[?h'
126
  , NameString varchar(100) not null comment '????'
127
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
128
  , ExpensesRaito decimal(4,2) not null comment '?o??'
129
  , DeleteFlg decimal(1,0) not null comment '???t???O'
130
  , EntryDate datetime not null comment '?o?^???t'
131
  , UpdateDate datetime not null comment '?X?V???t'
132
  , constraint departmentexpensesmaster_PKC primary key (DepartmentCode,ExpensesPeriod,NameCode)
133
) comment '?????o???}?X?^' ;
134

  
135
Insert 
136
INTO departmentexpensesmaster 
137
select
138
  A.DepartmentCode
139
  , A.ExpensesPeriod
140
  , A.NameCode
141
  , B.NameString
142
  , A.DisplayOrder
143
  , A.ExpensesRaito
144
  , A.DeleteFlg
145
  , A.EntryDate
146
  , A.UpdateDate 
147
from
148
  departmentexpensesmaster_OLD As A 
149
  LEFT JOIN divisionmaster AS B 
150
    ON B.DivisionCode = 3 
151
    And B.NameCode = A.NameCode; 
152

  
153
commit;
branches/ddl/ProcessManagement.sql
1 1
-- Project Name : noname
2
-- Date/Time    : 2018/04/06 11:54:53
2
-- Date/Time    : 2018/04/12 9:06:32
3 3
-- Author       : Horiuchi
4 4
-- RDBMS Type   : MySQL
5 5
-- Application  : A5:SQL Mk-2
......
462 462
  , constraint constrchgcharge_PKC primary key (ConstructionCode,Division,SeqNo)
463 463
) comment '?H???S???????f?[?^' ;
464 464

  
465
-- ?H???????o??f?[?^
466
drop table if exists constrledgerexpenses cascade;
467

  
468
create table constrledgerexpenses (
469
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
470
  , SeqNo decimal(5,0) not null comment '?}??'
471
  , NameCode decimal(5,0) unsigned not null comment '?o??R?[?h'
472
  , ExpensesRaito decimal(4,2) not null comment '?o??'
473
  , ExpensesValue decimal(10,0) not null comment '?o????z'
474
  , EntryDate datetime not null comment '?o?^???t'
475
  , UpdateDate datetime not null comment '?X?V???t'
476
  , constraint constrledgerexpenses_PKC primary key (ConstructionCode,SeqNo,NameCode)
477
) comment '?H???????o??f?[?^' ;
478

  
479
create index ConstrLedgerExpenses_Index1
480
  on constrledgerexpenses(ConstructionCode);
481

  
482
create index ConstrLedgerExpenses_Index2
483
  on constrledgerexpenses(SeqNo);
484

  
485
create index ConstrLedgerExpenses_Index3
486
  on constrledgerexpenses(NameCode);
487

  
465 488
-- ?H????{???
466 489
drop table if exists constructionbaseinfo cascade;
467 490

  
......
788 811
  , ChangePersonCode decimal(8,0) not null comment '???S????'
789 812
  , EntryDate datetime not null comment '?o?^???t'
790 813
  , UpdateDate datetime not null comment '?X?V???t'
791
  , constraint constructionprogressdate_PKC primary key (ConstructionCode,ConstructionStatusFlg)
814
  , constraint constructionprogressdate_PKC primary key (ConstructionCode,ChangeDate)
792 815
) comment '????i?????t?f?[?^' ;
793 816

  
817
create index ConstrProg_Index1
818
  on constructionprogressdate(ConstructionCode);
819

  
820
create index ConstrProg_Index2
821
  on constructionprogressdate(ConstructionStatusFlg);
822

  
823
create index ConstrProg_Index3
824
  on constructionprogressdate(ChangeDate);
825

  
794 826
-- ???}?X?^
795 827
drop table if exists constructionspecmaster cascade;
796 828

  
......
1068 1100
create table departmentexpensesmaster (
1069 1101
  DepartmentCode decimal(5,0) unsigned not null comment '?????R?[?h'
1070 1102
  , ExpensesPeriod smallint(6) not null comment '?????'
1071
  , NameCode decimal(5,0) unsigned not null comment '?o????R?[?h'
1103
  , NameCode decimal(5,0) unsigned not null comment '?o??R?[?h'
1104
  , NameString varchar(100) not null comment '????'
1072 1105
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
1073 1106
  , ExpensesRaito decimal(4,2) not null comment '?o??'
1074 1107
  , DeleteFlg decimal(1,0) not null comment '???t???O'
......
1713 1746
create index PersonSalaryMaster_Index2
1714 1747
  on personsalarymaster(StartDate);
1715 1748

  
1749
create index PersonSalaryMaster_Index3
1750
  on personsalarymaster(MonthlySalary);
1751

  
1716 1752
-- ?w???????f?[?^
1717 1753
drop table if exists pointingoutcomment cascade;
1718 1754

  

他の形式にエクスポート: Unified diff