プロジェクト

全般

プロフィール

統計
| リビジョン:

h-you / branches / ddl / ProcessManagement.sql @ 368

履歴 | 表示 | アノテート | ダウンロード (115 KB)

1
-- Project Name : noname
2
-- Date/Time    : 2018/07/24 8:34:39
3
-- Author       : Horiuchi
4
-- RDBMS Type   : MySQL
5
-- Application  : A5:SQL Mk-2
6

    
7
-- ?S????s???\??f?[?^
8
drop table if exists actionscheduledata cascade;
9

    
10
create table actionscheduledata (
11
  TargetDate date not null comment '????'
12
  , PersonCode decimal(8,0) not null comment '?S????R?[?h'
13
  , ActionSchedule varchar(30) comment '?s???\??'
14
  , TargetYear year(4) not null comment '?Y???N'
15
  , TargetMonth year(4) not null comment '?Y????'
16
  , TargetDay year(4) not null comment '?Y????'
17
  , EntryDate datetime not null comment '?o?^???t'
18
  , UpdateDate datetime not null comment '?X?V???t'
19
  , constraint actionscheduledata_PKC primary key (TargetDate,PersonCode)
20
) comment '?S????s???\??f?[?^' ;
21

    
22
create index ActionScheduleData_Index1
23
  on actionscheduledata(TargetYear);
24

    
25
create index ActionScheduleData_Index2
26
  on actionscheduledata(TargetMonth);
27

    
28
create index ActionScheduleData_Index3
29
  on actionscheduledata(TargetDay);
30

    
31
-- ???F?o?H?}?X?^
32
drop table if exists approvalmaster cascade;
33

    
34
create table approvalmaster (
35
  ApprovalCode decimal(3,0) unsigned not null comment '???F?@?\???'
36
  , DepartmentCode decimal(5,0) unsigned not null comment '?????R?[?h'
37
  , SeqNo decimal(2,0) not null comment '?}??'
38
  , DisplayOrder decimal(2,0) not null comment '?\????'
39
  , ApprovalPerson decimal(8,0) unsigned not null comment '???F??R?[?h'
40
  , ApprovalAuthority decimal(1,0) not null comment '???F??????'
41
  , EntryDate datetime not null comment '?o?^???t'
42
  , UpdateDate datetime not null comment '?X?V???t'
43
  , constraint approvalmaster_PKC primary key (ApprovalCode,DepartmentCode,SeqNo)
44
) comment '???F?o?H?}?X?^' ;
45

    
46
-- ?o?????f?[?^
47
drop table if exists attendancedailydata cascade;
48

    
49
create table attendancedailydata (
50
  PersonCode decimal(8,0) unsigned not null comment '????R?[?h'
51
  , AttendanceDate date not null comment '???????'
52
  , SeqNo decimal(3,0) unsigned not null comment '????s???'
53
  , ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
54
  , ActionResult varchar(30) not null comment '?s??????'
55
  , StartTime datetime comment '?J?n????'
56
  , CompTime datetime comment '?I??????'
57
  , DayTimes decimal(4,1) not null comment '????????v????'
58
  , WorkingComment varchar(120) comment '?R?????g'
59
  , WorkKindFlg decimal(1,0) not null comment '?????t???O'
60
  , EntryDate datetime not null comment '?o?^???t'
61
  , UpdateDate datetime not null comment '?X?V???t'
62
  , constraint attendancedailydata_PKC primary key (PersonCode,AttendanceDate,SeqNo)
63
) comment '?o?????f?[?^' ;
64

    
65
create index AttendDaily_Index1
66
  on attendancedailydata(ConstructionCode);
67

    
68
create index AttendDaily_Index2
69
  on attendancedailydata(AttendanceDate);
70

    
71
-- ?o?????f?[?^
72
drop table if exists attendancedata cascade;
73

    
74
create table attendancedata (
75
  PersonCode decimal(8,0) unsigned not null comment '????R?[?h'
76
  , AttendanceMonth date not null comment '?o?????N??'
77
  , LastDays decimal(2,0) unsigned not null comment '??????I??'
78
  , AttendDayCount decimal(2,0) unsigned not null comment '?o?????'
79
  , TotalOverTimes decimal(4,1) not null comment '?c??????'
80
  , OrderDate date not null comment '?\????'
81
  , OrderNo decimal(2,0) unsigned not null comment '?\????t???'
82
  , EntryDate datetime not null comment '?o?^???t'
83
  , UpdateDate datetime not null comment '?X?V???t'
84
  , constraint attendancedata_PKC primary key (PersonCode,AttendanceMonth)
85
) comment '?o?????f?[?^' ;
86

    
87
-- ??s?c????}?X?^
88
drop table if exists bankbusinessdaymaster cascade;
89

    
90
create table bankbusinessdaymaster (
91
  YEARMONTH decimal(6,0) default '0' not null comment '?N??'
92
  , BANKBUSINESSDAY decimal(2,0) default '0' not null comment '??s?c???'
93
  , NOTE varchar(120) comment '???l'
94
  , DELETEFLG decimal(1,0) comment '???t???O'
95
  , ENTRYDATE datetime comment '?o?^?N????'
96
  , UPDATEDATE datetime comment '?X?V?N????'
97
  , constraint bankbusinessdaymaster_PKC primary key (YEARMONTH,BANKBUSINESSDAY)
98
) comment '??s?c????}?X?^' ;
99

    
100
-- ???????f?[?^
101
drop table if exists billingdata cascade;
102

    
103
create table billingdata (
104
  COMPANYCODE decimal(8,0) default '0' not null comment '??????R?[?h'
105
  , TARGETDATE decimal(6,0) default '0' not null comment '???N??'
106
  , SEQNO decimal(3,0) default '0' not null comment '?A??'
107
  , BILLPRICE decimal(10,0) comment '???????z'
108
  , ENTRYDATE datetime comment '?o?^?N????'
109
  , UPDATEDATE datetime comment '?X?V?N????'
110
  , constraint billingdata_PKC primary key (COMPANYCODE,TARGETDATE,SEQNO)
111
) comment '???????f?[?^' ;
112

    
113
-- ??????????f?[?^
114
drop table if exists billingdatadetail cascade;
115

    
116
create table billingdatadetail (
117
  COMPANYCODE decimal(8,0) default '0' not null comment '??????R?[?h'
118
  , TARGETDATE decimal(6,0) default '0' not null comment '???N??'
119
  , SEQNO decimal(3,0) default '0' not null comment '?A??'
120
  , LINECOUNT decimal(3,0) default '0' not null comment '?s???'
121
  , CONSTRUCTIONCODE decimal(10,0) comment '?H?????'
122
  , CONSTRUCTIONROWCNT decimal(3,0) default '0' not null comment '?s???'
123
  , CONSTRUCTIONCOLCNT decimal(3,0) default '0' not null comment '????'
124
  , FIELDNAME varchar(120) comment '????'
125
  , BILLPRICE decimal(10,0) comment '???????z'
126
  , HIGHWPRICE decimal(10,0) comment '??????'
127
  , HARDWPRICE decimal(10,0) comment '??????'
128
  , INDSWASTETAX decimal(10,0) comment '?Y?p??'
129
  , NOTE varchar(120) comment '???l'
130
  , ENTRYDATE datetime comment '?o?^?N????'
131
  , UPDATEDATE datetime comment '?X?V?N????'
132
  , constraint billingdatadetail_PKC primary key (COMPANYCODE,TARGETDATE,SEQNO,LINECOUNT)
133
) comment '??????????f?[?^' ;
134

    
135
-- ???????x???T?}???[?f?[?^
136
drop table if exists billingpaymentsummary cascade;
137

    
138
create table billingpaymentsummary (
139
  COMPANYCODE decimal(8,0) default '0' not null comment '??????R?[?h'
140
  , TARGETDATE decimal(6,0) default '0' not null comment '???N??'
141
  , CHARGEPAYMENTKIND decimal(1,0) default '0' not null comment '?????x????'
142
  , PAYDAY date comment '?x????'
143
  , BILLPRICESTOTAL decimal(10,0) comment '???????z???v'
144
  , CONSUMPTIONTAXRATE decimal(6,3) comment '??????'
145
  , CONSUMPTIONTAXPRICE decimal(10,0) comment '?????z'
146
  , HIGHWPRICESTOTAL decimal(10,0) comment '???????v'
147
  , HARDWPRICESTOTAL decimal(10,0) comment '???????v'
148
  , INDSWASTETAXSTOTAL decimal(10,0) comment '?Y?p????v'
149
  , CNSTRPRICERATE decimal(6,3) comment '???????'
150
  , CNSTRPRICESTOTAL decimal(10,0) comment '????????v'
151
  , BILLINGPRICETOTAL decimal(10,0) comment '???????z???v'
152
  , ENTRYDATE datetime comment '?o?^?N????'
153
  , UPDATEDATE datetime comment '?X?V?N????'
154
  , constraint billingpaymentsummary_PKC primary key (COMPANYCODE,TARGETDATE,CHARGEPAYMENTKIND)
155
) comment '???????x???T?}???[?f?[?^' ;
156

    
157
-- ?^?c?????????
158
drop table if exists bizperiodhistory cascade;
159

    
160
create table bizperiodhistory (
161
  PeriodYear smallint(6) not null comment '?c??????E?H???N?x'
162
  , PeriodFlag smallint(1) not null comment '?c??????E?H???N?x?t???O'
163
  , BeginDate datetime not null comment '?????'
164
  , CompleteDate datetime not null comment '??????'
165
  , EntryDate datetime not null comment '?o?^???t'
166
  , UpdateDate datetime not null comment '?X?V???t'
167
  , constraint bizperiodhistory_PKC primary key (PeriodYear,PeriodFlag)
168
) comment '?^?c?????????' ;
169

    
170
-- ?H???????f?[?^?y???p?z
171
drop table if exists bk_constructionledger cascade;
172

    
173
create table bk_constructionledger (
174
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
175
  , ConstructionPeriod decimal(4,0) unsigned not null comment '?????'
176
  , CreatorCode decimal(8,0) comment '????R?[?h'
177
  , CreatorName varchar(60) comment '?????'
178
  , CreateDate date not null comment '????'
179
  , ConstructionTimes decimal(5,2) not null comment '?H???i?P??E???j'
180
  , ConstructionStart date not null comment '?_??H???J?n'
181
  , ConstructionEnd date not null comment '?_??H??????'
182
  , OrdersDecisionPrice decimal(14,0) not null comment '??????????z'
183
  , CompanyExpenses decimal(10,0) not null comment '???o???v'
184
  , DepartmentExpenses decimal(10,0) not null comment '?????o???v'
185
  , SalesExpenses decimal(10,0) not null comment '?c??o???v'
186
  , TotalPayment decimal(10,0) not null comment '???x???z'
187
  , GrossProfit decimal(10,0) not null comment '?e??'
188
  , Allowance decimal(10,0) not null comment '???^'
189
  , NetProfit decimal(10,0) not null comment '?????v'
190
  , ComplateFlg decimal(1,0) not null comment '????????t???O'
191
  , IntegrationFlg decimal(1,0) not null comment '????z??Z?t???O'
192
  , EntryDate datetime not null comment '?o?^???t'
193
  , UpdateDate datetime not null comment '?X?V???t'
194
  , constraint bk_constructionledger_PKC primary key (ConstructionCode)
195
) comment '?H???????f?[?^?y???p?z' ;
196

    
197
-- ?H??????????f?[?^?y???p?z
198
drop table if exists bk_constructionledgerdetail cascade;
199

    
200
create table bk_constructionledgerdetail (
201
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
202
  , GroupCount decimal(2,0) unsigned not null comment '?O???[?v???'
203
  , LineCount decimal(5,0) unsigned not null comment '?s???'
204
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
205
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
206
  , FirstString varchar(120) comment '???????'
207
  , SecondString varchar(120) comment '?H?????e'
208
  , CompanyType decimal(1,0) not null comment '??????R?[?h?^?C?v'
209
  , CompanyCode decimal(8,0) not null comment '??????R?[?h'
210
  , CompanyName varchar(120) comment '?????????'
211
  , EstimatePrice decimal(12,0) not null comment '?\?Z?i????j???z'
212
  , ExecutionAmount decimal(12,0) not null comment '???s???z'
213
  , AmountConfigRate decimal(5,2) not null comment '???z?\????'
214
  , PaymentBurden decimal(12,0) not null comment '?x????U?z'
215
  , FixDataFlg decimal(1,0) not null comment '???f?[?^?t???O'
216
  , IndependentFlg decimal(1,0) not null comment '????f?[?^?t???O'
217
  , FluctuationFlg decimal(1,0) not null comment '?????f?[?^?t???O'
218
  , SalaryFlg decimal(1,0) not null comment '???^?U????'
219
  , SalaryDays decimal(4,0) not null comment '???^?U??????'
220
  , OperatingFlg decimal(1,0) not null comment '?S?????t???O'
221
  , SourceCode decimal(10,0) unsigned not null comment '???H?????'
222
  , JoinTitleFlg decimal(1,0) not null comment '?H??????^?C?g??'
223
  , SalaryOnRegist decimal(12,0) not null comment '?o?^?????z???^'
224
  , PurchaseOrderFlg decimal(2,0) not null comment '?????????s?t???O'
225
  , EntryDate datetime not null comment '?o?^???t'
226
  , UpdateDate datetime not null comment '?X?V???t'
227
  , constraint bk_constructionledgerdetail_PKC primary key (ConstructionCode,GroupCount,LineCount)
228
) comment '?H??????????f?[?^?y???p?z' ;
229

    
230
-- ?H?????????s?f?[?^?y???p?z
231
drop table if exists bk_constructionledgerexcute cascade;
232

    
233
create table bk_constructionledgerexcute (
234
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
235
  , GroupCount decimal(2,0) unsigned not null comment '?O???[?v???'
236
  , LineCount decimal(5,0) unsigned not null comment '?s???'
237
  , ColumnCount decimal(3,0) not null comment '????'
238
  , PaymentAmount decimal(12,0) not null comment '?x?????z'
239
  , TargetMonth date not null comment '???N??'
240
  , EntryDate datetime not null comment '?o?^???t'
241
  , UpdateDate datetime not null comment '?X?V???t'
242
  , constraint bk_constructionledgerexcute_PKC primary key (ConstructionCode,GroupCount,LineCount,ColumnCount)
243
) comment '?H?????????s?f?[?^?y???p?z' ;
244

    
245
-- ??Z????f?[?^?y???p?z
246
drop table if exists bk_estimatedata cascade;
247

    
248
create table bk_estimatedata (
249
  SaveDate datetime not null comment '?????t'
250
  , ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
251
  , LineCount decimal(3,0) unsigned not null comment '?s???'
252
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
253
  , FixedItemCode varchar(1) comment '?????L?['
254
  , ItemName varchar(120) comment '??????'
255
  , SpecName varchar(120) comment '???^?i???E?`??E???@'
256
  , PriceValue decimal(14,0) not null comment '???z'
257
  , note varchar(60) comment '???l'
258
  , MyExpensesFlg decimal(1,0) not null comment '????o??t???O'
259
  , InputFlg decimal(1,0) not null comment '????t???O'
260
  , EntryDate datetime not null comment '?o?^???t'
261
  , UpdateDate datetime not null comment '?X?V???t'
262
  , constraint bk_estimatedata_PKC primary key (SaveDate,ConstructionCode,LineCount)
263
) comment '??Z????f?[?^?y???p?z' ;
264

    
265
-- ??Z????y?[?W?f?[?^?y???p?z
266
drop table if exists bk_estimatedatabody cascade;
267

    
268
create table bk_estimatedatabody (
269
  SaveDate datetime not null comment '?????t'
270
  , ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
271
  , PageCount decimal(4,0) unsigned not null comment '?y?[?W???'
272
  , Category decimal(1,0) not null comment '?y?[?W??'
273
  , UnionComponentCode decimal(5,0) unsigned not null comment '?????\???L?['
274
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
275
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
276
  , SelectComponent decimal(5,0) unsigned not null comment '?I???\???L?['
277
  , PageTitle varchar(120) not null comment '?y?[?W?\????'
278
  , DetailLineCount decimal(3,0) unsigned not null comment '????s???'
279
  , EntryDate datetime not null comment '?o?^???t'
280
  , UpdateDate datetime not null comment '?X?V???t'
281
  , constraint bk_estimatedatabody_PKC primary key (SaveDate,ConstructionCode,PageCount)
282
) comment '??Z????y?[?W?f?[?^?y???p?z' ;
283

    
284
-- ??Z????f?[?^????y???p?z
285
drop table if exists bk_estimatedatadetail cascade;
286

    
287
create table bk_estimatedatadetail (
288
  SaveDate datetime not null comment '?????t'
289
  , ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
290
  , PageCount decimal(4,0) unsigned not null comment '?y?[?W???'
291
  , LineCount decimal(3,0) unsigned not null comment '?s???'
292
  , DataType decimal(1,0) not null comment '?f?[?^???'
293
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
294
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
295
  , SpecCode decimal(5,0) unsigned not null comment '???L?['
296
  , ItemName varchar(120) comment '??????'
297
  , SpecName varchar(120) comment '???^?i???E?`??E???@'
298
  , Unitcount decimal(8,2) not null comment '????'
299
  , UnitName varchar(30) comment '?P?????'
300
  , UnitPrice decimal(9,2) not null comment '?P??'
301
  , LineTotal decimal(12,0) not null comment '???z'
302
  , note varchar(60) comment '???l'
303
  , CompanyCode decimal(8,0) not null comment '??????R?[?h'
304
  , MyExpensesFlg decimal(1,0) not null comment '????o??t???O'
305
  , InputFlg decimal(1,0) comment '????t???O'
306
  , EntryDate datetime not null comment '?o?^???t'
307
  , UpdateDate datetime not null comment '?X?V???t'
308
  , constraint bk_estimatedatadetail_PKC primary key (SaveDate,ConstructionCode,PageCount,LineCount)
309
) comment '??Z????f?[?^????y???p?z' ;
310

    
311
-- ?\?Z???W?v?R?[?h?}?X?^
312
drop table if exists budgetsumcode cascade;
313

    
314
create table budgetsumcode (
315
  BlockCode decimal(2,0) unsigned not null comment '?u???b?N???'
316
  , GroupCode decimal(2,0) unsigned not null comment '?O???[?v???'
317
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
318
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
319
  , ElementsName varchar(100) not null comment '?v?f????'
320
  , EntryDate datetime not null comment '?o?^???t'
321
  , UpdateDate datetime not null comment '?X?V???t'
322
  , constraint budgetsumcode_PKC primary key (BlockCode,GroupCode,ComponentCode,ItemCode)
323
) comment '?\?Z???W?v?R?[?h?}?X?^' ;
324

    
325
-- ?@?l?i?}?X?^
326
drop table if exists businesstypemaster cascade;
327

    
328
create table businesstypemaster (
329
  BusinessTypeCode decimal(5,0) unsigned not null comment '?@?l?i?R?[?h'
330
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
331
  , BusinessTypeName varchar(100) not null comment '???'
332
  , EntryDate datetime not null comment '?o?^???t'
333
  , UpdateDate datetime not null comment '?X?V???t'
334
  , constraint businesstypemaster_PKC primary key (BusinessTypeCode)
335
) comment '?@?l?i?}?X?^' ;
336

    
337
create index BusinessTypeMaster_Index1
338
  on businesstypemaster(DisplayOrder);
339

    
340
-- ?S????????????f?[?^
341
drop table if exists chgchargedep cascade;
342

    
343
create table chgchargedep (
344
  PersonCode decimal(8,0) not null comment '?S????R?[?h'
345
  , StartDate date not null comment '?J?n?N????'
346
  , CompDate date not null comment '?I???N????'
347
  , DepartmentCode decimal(5,0) unsigned not null comment '?????R?[?h'
348
  , DepartmentName varchar(60) comment '??????'
349
  , EntryDate datetime not null comment '?o?^???t'
350
  , UpdateDate datetime not null comment '?X?V???t'
351
  , constraint chgchargedep_PKC primary key (PersonCode,StartDate)
352
) comment '?S????????????f?[?^' ;
353

    
354
-- ?H???S????X?????f?[?^
355
drop table if exists chgconstrcharge cascade;
356

    
357
create table chgconstrcharge (
358
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
359
  , Division decimal(1,0) not null comment '????'
360
  , SeqNo smallint(5) unsigned not null comment '?A??'
361
  , DepartmentCode decimal(5,0) unsigned not null comment '?????R?[?h'
362
  , PersonCode decimal(8,0) not null comment '?S????R?[?h'
363
  , StartDate date comment '?S???J?n?N????'
364
  , CompDate date comment '?S???I???N????'
365
  , SourceCode decimal(10,0) unsigned not null comment '???H???R?[?h'
366
  , DeleteFlg decimal(1,0) not null comment '???t???O'
367
  , EntryDate datetime not null comment '?o?^???t'
368
  , UpdateDate datetime not null comment '?X?V???t'
369
  , constraint chgconstrcharge_PKC primary key (ConstructionCode,Division,SeqNo)
370
) comment '?H???S????X?????f?[?^' ;
371

    
372
-- ????????}?X?^
373
drop table if exists commoncostlarge cascade;
374

    
375
create table commoncostlarge (
376
  LargeCode decimal(5,0) unsigned not null comment '????L?['
377
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
378
  , LargeName varchar(50) not null comment '???????'
379
  , CommentText varchar(120) comment '????????'
380
  , DeleteFlg decimal(1,0) not null comment '???t???O'
381
  , EntryDate datetime not null comment '?o?^???t'
382
  , UpdateDate datetime not null comment '?X?V???t'
383
  , constraint commoncostlarge_PKC primary key (LargeCode)
384
) comment '????????}?X?^' ;
385

    
386
-- ?????H???A?}?X?^
387
drop table if exists commoncostlinkms cascade;
388

    
389
create table commoncostlinkms (
390
  LargeCode decimal(5,0) unsigned not null comment '????L?['
391
  , MiddleCode decimal(5,0) unsigned not null comment '??????L?['
392
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
393
  , EntryDate datetime comment '?o?^???t'
394
  , UpdateDate datetime comment '?X?V???t'
395
  , constraint commoncostlinkms_PKC primary key (LargeCode,MiddleCode,ItemCode)
396
) comment '?????H???A?}?X?^' ;
397

    
398
-- ?????????}?X?^
399
drop table if exists commoncostmiddle cascade;
400

    
401
create table commoncostmiddle (
402
  LargeCode decimal(5,0) unsigned not null comment '????L?['
403
  , MiddleCode decimal(5,0) unsigned not null comment '??????L?['
404
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
405
  , MiddleName varchar(50) not null comment '?????????'
406
  , CommentText varchar(120) comment '????????'
407
  , DeleteFlg decimal(1,0) not null comment '???t???O'
408
  , EntryDate datetime not null comment '?o?^???t'
409
  , UpdateDate datetime not null comment '?X?V???t'
410
  , constraint commoncostmiddle_PKC primary key (LargeCode,MiddleCode)
411
) comment '?????????}?X?^' ;
412

    
413
-- ?????????L?[?}?X?^
414
drop table if exists commoncostmiddlesearchword cascade;
415

    
416
create table commoncostmiddlesearchword (
417
  LargeCode decimal(5,0) unsigned not null comment '????L?['
418
  , MiddleCode decimal(5,0) unsigned not null comment '??????L?['
419
  , SeqNo decimal(5,0) unsigned not null comment '????'
420
  , SearchWord varchar(50) not null comment '????????'
421
  , EntryDate datetime not null comment '?o?^???t'
422
  , UpdateDate datetime not null comment '?X?V???t'
423
  , constraint commoncostmiddlesearchword_PKC primary key (LargeCode,MiddleCode,SeqNo)
424
) comment '?????????L?[?}?X?^' ;
425

    
426
-- ?\???H???A?}?X?^
427
drop table if exists componentlinkmaster cascade;
428

    
429
create table componentlinkmaster (
430
  ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
431
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
432
  , DisplayOrder decimal(5,0) unsigned comment '?\????'
433
  , EntryDate datetime not null comment '?o?^???t'
434
  , UpdateDate datetime not null comment '?X?V???t'
435
  , constraint componentlinkmaster_PKC primary key (ComponentCode,ItemCode)
436
) comment '?\???H???A?}?X?^' ;
437

    
438
create index ComponentLinkMaster_Index1
439
  on componentlinkmaster(ComponentCode);
440

    
441
create index ComponentLinkMaster_Index2
442
  on componentlinkmaster(ItemCode);
443

    
444
-- ?\???}?X?^
445
drop table if exists componentmaster cascade;
446

    
447
create table componentmaster (
448
  ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
449
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
450
  , ComponentName varchar(120) not null comment '?\??????'
451
  , SubItemsFlg decimal(1,0) comment '???????t???O'
452
  , DirectInputFlg decimal(1,0) comment '???????t???O'
453
  , MyExpensesFlg decimal(1,0) comment '????o??t???O'
454
  , DeleteFlg decimal(1,0) not null comment '???t???O'
455
  , EntryDate datetime not null comment '?o?^???t'
456
  , UpdateDate datetime not null comment '?X?V???t'
457
  , constraint componentmaster_PKC primary key (ComponentCode)
458
) comment '?\???}?X?^' ;
459

    
460
create index ComponentMaster_Index1
461
  on componentmaster(DisplayOrder);
462

    
463
-- ?\???H??????A?}?X?^
464
drop table if exists componenttotypemaster cascade;
465

    
466
create table componenttotypemaster (
467
  ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
468
  , TypeCode decimal(5,0) unsigned not null comment '?H?????R?[?h'
469
  , Dummy decimal(1,0) not null comment '?_?~?[????'
470
  , EntryDate datetime not null comment '?o?^???t'
471
  , UpdateDate datetime not null comment '?X?V???t'
472
  , constraint componenttotypemaster_PKC primary key (ComponentCode,TypeCode)
473
) comment '?\???H??????A?}?X?^' ;
474

    
475
create index ComponentToTypeMaster_Index1
476
  on componenttotypemaster(ComponentCode);
477

    
478
create index ComponentToTypeMaster_Index2
479
  on componenttotypemaster(TypeCode);
480

    
481
-- ?H???????o??f?[?^
482
drop table if exists constrledgerexpenses cascade;
483

    
484
create table constrledgerexpenses (
485
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
486
  , SeqNo decimal(5,0) not null comment '?}??'
487
  , NameCode decimal(5,0) unsigned not null comment '?o??R?[?h'
488
  , ExpensesRaito decimal(4,2) not null comment '?o??'
489
  , ExpensesValue decimal(10,0) not null comment '?o????z'
490
  , EntryDate datetime not null comment '?o?^???t'
491
  , UpdateDate datetime not null comment '?X?V???t'
492
  , constraint constrledgerexpenses_PKC primary key (ConstructionCode,SeqNo,NameCode)
493
) comment '?H???????o??f?[?^' ;
494

    
495
create index ConstrLedgerExpenses_Index1
496
  on constrledgerexpenses(ConstructionCode);
497

    
498
create index ConstrLedgerExpenses_Index2
499
  on constrledgerexpenses(SeqNo);
500

    
501
create index ConstrLedgerExpenses_Index3
502
  on constrledgerexpenses(NameCode);
503

    
504
-- ?H????{???
505
drop table if exists constructionbaseinfo cascade;
506

    
507
create table constructionbaseinfo (
508
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
509
  , TyingFlg decimal(1,0) not null comment '?R?t?f?[?^?t???O'
510
  , JoinFlg decimal(1,0) not null comment '?????_??H???t???O'
511
  , ConstructionYear smallint(5) unsigned not null comment '?H???N?x'
512
  , ConstructionPeriod smallint(5) unsigned not null comment '?H??????'
513
  , RequestedDate date comment '??????'
514
  , EstimatesSubmitDeadline date comment '?????o????'
515
  , EstimatesSubmittedDate date comment '?????o??'
516
  , ProvisionalOrderDate date comment '?????'
517
  , OrderDate date comment '???'
518
  , OrderStartingDate date comment '?J?n?\???'
519
  , OrderCompletionDate date comment '?????\???'
520
  , PreparationStartDate date comment '?{?H?????J?n??'
521
  , ConstructionStartingDate date comment '?{?H?J?n??'
522
  , ConstructionCompletionDate date comment '?{?H??????'
523
  , NonOrderDate date comment '????'
524
  , OrdersDecisionPrice decimal(12,0) not null comment '??????????z'
525
  , OrdersDecisionPriceInTax decimal(12,0) not null comment '??????????z'
526
  , SalesDepCode decimal(5,0) unsigned not null comment '?c??S????????R?[?h'
527
  , SalesPersonCode decimal(8,0) unsigned not null comment '?c??S????R?[?h'
528
  , SalesSubDepCode decimal(5,0) unsigned not null comment '?c????S????????R?[?h'
529
  , SalesSubPersonCode decimal(8,0) unsigned not null comment '?c????S????R?[?h'
530
  , ConstrDepCode decimal(5,0) unsigned not null comment '?H???S????????R?[?h'
531
  , ConstructionPersonCode decimal(8,0) not null comment '?H???S????R?[?h'
532
  , ConstrSubDepCode decimal(5,0) unsigned not null comment '?H?????S????????R?[?h'
533
  , ConstrSubPersonCode decimal(8,0) not null comment '?H?????S????R?[?h'
534
  , ConstrInstrDepCode decimal(5,0) unsigned not null comment '?H???w?????????R?[?h'
535
  , ConstructionInstructor decimal(8,0) not null comment '?H???w?????R?[?h'
536
  , TransferConstruction decimal(8,0) not null comment '?H??????R?[?h'
537
  , TransferConstructionDate date comment '?H??????'
538
  , OrderersDivision decimal(5,0) not null comment '????????R?[?h'
539
  , OrderersCode decimal(5,0) unsigned not null comment '??????R?[?h'
540
  , EstimatesExpirationDate date comment '????L??????'
541
  , ConstructionPeriodStart date comment '?_??H???J?n??'
542
  , ConstructionPeriodEnd date comment '?_??H??????'
543
  , ConstructionPeriodStart2 date comment '?_??H???J?n?i???????j'
544
  , ConstructionPeriodEnd2 date comment '?_??H???????i???????j'
545
  , StartDate date comment '?H???J?n??'
546
  , EndDate date comment '?H???I????'
547
  , PurchaseOrderMailingDate date comment '???????X????'
548
  , PurchaseOrderReturnDate date comment '???????????'
549
  , PurchaseOrderReturnCheckDate date comment '??????????m?F??'
550
  , ConsumptionTaxFlg decimal(1,0) not null comment '?????t???O'
551
  , PrimeContractorFlg decimal(1,0) not null comment '?????t???O'
552
  , SalesCostFlg decimal(1,0) not null comment '?c??o?????t???O'
553
  , ConstructionStatusFlg decimal(2,0) not null comment '?H?????t???O'
554
  , ConstructionType decimal(5,0) not null comment '?H?????R?[?h'
555
  , EstimateType decimal(1,0) not null comment '??????'
556
  , BillingStartDate date not null comment '?????????J?n??'
557
  , BillingDate date not null comment '??????'
558
  , BillingSplitFlg decimal(1,0) not null comment '??????t???O'
559
  , BillingSendDate date comment '???????X??/??n????'
560
  , LedgerComplateDate date not null comment '?H????????????????t'
561
  , InspectPlanningDate date not null comment '?????\???'
562
  , InspectExecuteDate date not null comment '???????s??'
563
  , RevCompleteDate date not null comment '??????????????'
564
  , EntryDate datetime not null comment '?o?^???t'
565
  , UpdateDate datetime not null comment '?X?V???t'
566
  , constraint constructionbaseinfo_PKC primary key (ConstructionCode)
567
) comment '?H????{???' ;
568

    
569
create index BaseInfo_Index1
570
  on constructionbaseinfo(ConstructionStatusFlg);
571

    
572
create index BaseInfo_Index2
573
  on constructionbaseinfo(EstimateType);
574

    
575
create index BaseInfo_Index3
576
  on constructionbaseinfo(SalesPersonCode);
577

    
578
create index BaseInfo_Index4
579
  on constructionbaseinfo(ConstructionPersonCode);
580

    
581
create index BaseInfo_Index5
582
  on constructionbaseinfo(ConstructionInstructor);
583

    
584
create index BaseInfo_Index6
585
  on constructionbaseinfo(ConstructionPeriod);
586

    
587
-- ?H????{????
588
drop table if exists constructionbaseinfodetail cascade;
589

    
590
create table constructionbaseinfodetail (
591
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
592
  , DetailNo decimal(3,0) not null comment '??????'
593
  , DetailString varchar(300) comment '??????e'
594
  , EntryDate datetime not null comment '?o?^???t'
595
  , UpdateDate datetime not null comment '?X?V???t'
596
  , constraint constructionbaseinfodetail_PKC primary key (ConstructionCode,DetailNo)
597
) comment '?H????{????' ;
598

    
599
create index BaseInfoDetail_Idx1
600
  on constructionbaseinfodetail(ConstructionCode);
601

    
602
create index BaseInfoDetail_Idx2
603
  on constructionbaseinfodetail(DetailNo);
604

    
605
-- ?H???{?H?\?Z?f?[?^
606
drop table if exists constructionbudget cascade;
607

    
608
create table constructionbudget (
609
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
610
  , CreatorCode decimal(8,0) not null comment '????R?[?h'
611
  , CreatorName varchar(60) comment '?????'
612
  , CreatorCosts decimal(11,0) not null comment '??????^'
613
  , AssistantCode decimal(8,0) not null comment '???S????R?[?h'
614
  , AssistantName varchar(60) comment '???S?????'
615
  , AssistantCosts decimal(11,0) not null comment '???S??????^'
616
  , InstructorCode decimal(8,0) not null comment '?H???w?????R?[?h'
617
  , InstructorName varchar(60) comment '?H???w??????'
618
  , InstructorCosts decimal(11,0) not null comment '?H???w???????^'
619
  , CreateDate date not null comment '????'
620
  , ConstructionTimes decimal(5,2) not null comment '?H???i?P??E???j'
621
  , ConstructionStart date not null comment '?_??H???J?n'
622
  , ConstructionEnd date not null comment '?_??H??????'
623
  , InstructorTimes decimal(5,2) not null comment '?w???????????'
624
  , SalaryFlg decimal(1,0) not null comment '???^?U????'
625
  , SalaryDays decimal(4,0) not null comment '?U??????'
626
  , A_SalaryFlg decimal(1,0) not null comment '???S??????^?U????'
627
  , A_SalaryDays decimal(4,0) not null comment '???S????U??????'
628
  , I_SalaryFlg decimal(1,0) not null comment '?w???????^?U????'
629
  , I_SalaryDays decimal(4,0) not null comment '?w?????U??????'
630
  , OrdersDecisionPrice decimal(12,0) not null comment '??????????z'
631
  , EntryDate datetime not null comment '?o?^???t'
632
  , UpdateDate datetime not null comment '?X?V???t'
633
  , constraint constructionbudget_PKC primary key (ConstructionCode)
634
) comment '?H???{?H?\?Z?f?[?^' ;
635

    
636
-- ?H???{?H?\?Z?f?[?^????
637
drop table if exists constructionbudgetdetail cascade;
638

    
639
create table constructionbudgetdetail (
640
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
641
  , GroupCount decimal(2,0) unsigned not null comment '?O???[?v???'
642
  , LineCount decimal(3,0) unsigned not null comment '?s???'
643
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
644
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
645
  , FirstString varchar(120) comment '???????'
646
  , SecondString varchar(120) comment '?H?????e'
647
  , CompanyType decimal(1,0) not null comment '??????R?[?h?^?C?v'
648
  , CompanyCode decimal(8,0) not null comment '??????R?[?h'
649
  , CompanyName varchar(120) comment '?????????'
650
  , EstimatePrice decimal(12,0) not null comment '??Z????????z'
651
  , NegotiationPrice decimal(12,0) not null comment '??Z????????z'
652
  , OrderDesiredAmount decimal(12,0) not null comment '??????]???z'
653
  , ExecutionAmount decimal(12,0) not null comment '???s???z'
654
  , AmountConfigRate decimal(5,2) not null comment '???z?\????'
655
  , NegotiateFlg decimal(1,0) not null comment '?????????t???O'
656
  , EntryDate datetime not null comment '?o?^???t'
657
  , UpdateDate datetime not null comment '?X?V???t'
658
  , constraint constructionbudgetdetail_PKC primary key (ConstructionCode,GroupCount,LineCount)
659
) comment '?H???{?H?\?Z?f?[?^????' ;
660

    
661
-- ?H??}?X?^
662
drop table if exists constructionitemmaster cascade;
663

    
664
create table constructionitemmaster (
665
  ItemCode decimal(5,0) unsigned not null comment '?H??L?['
666
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
667
  , ItemName varchar(120) not null comment '?H????'
668
  , SubItemsFlg decimal(1,0) comment '???????t???O'
669
  , MyExpensesFlg decimal(1,0) not null comment '????o??t???O'
670
  , DeleteFlg decimal(1,0) not null comment '???t???O'
671
  , EntryDate datetime not null comment '?o?^???t'
672
  , UpdateDate datetime not null comment '?X?V???t'
673
  , constraint constructionitemmaster_PKC primary key (ItemCode)
674
) comment '?H??}?X?^' ;
675

    
676
-- ?H???????f?[?^
677
drop table if exists constructionledger cascade;
678

    
679
create table constructionledger (
680
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
681
  , ConstructionPeriod decimal(4,0) unsigned not null comment '?????'
682
  , CreatorCode decimal(8,0) comment '????R?[?h'
683
  , CreatorName varchar(60) comment '?????'
684
  , CreateDate date not null comment '????'
685
  , ConstructionTimes decimal(5,2) not null comment '?H???i?P??E???j'
686
  , ConstructionStart date not null comment '?_??H???J?n'
687
  , ConstructionEnd date not null comment '?_??H??????'
688
  , OrdersDecisionPrice decimal(14,0) not null comment '??????????z'
689
  , CompanyExpenses decimal(10,0) not null comment '???o???v'
690
  , DepartmentExpenses decimal(10,0) not null comment '?????o???v'
691
  , SalesExpenses decimal(10,0) not null comment '?c??o???v'
692
  , TotalPayment decimal(10,0) not null comment '???x???z'
693
  , GrossProfit decimal(10,0) not null comment '?e??'
694
  , Allowance decimal(10,0) not null comment '???^'
695
  , NetProfit decimal(10,0) not null comment '?????v'
696
  , ComplateFlg decimal(1,0) not null comment '????????t???O'
697
  , IntegrationFlg decimal(1,0) not null comment '????z??Z?t???O'
698
  , EntryDate datetime not null comment '?o?^???t'
699
  , UpdateDate datetime not null comment '?X?V???t'
700
  , constraint constructionledger_PKC primary key (ConstructionCode)
701
) comment '?H???????f?[?^' ;
702

    
703
create index constructionledger_Index1
704
  on constructionledger(ConstructionStart);
705

    
706
create index constructionledger_Index2
707
  on constructionledger(ConstructionEnd);
708

    
709
-- ?H??????????f?[?^
710
drop table if exists constructionledgerdetail cascade;
711

    
712
create table constructionledgerdetail (
713
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
714
  , GroupCount decimal(2,0) unsigned not null comment '?O???[?v???'
715
  , LineCount decimal(4,0) unsigned not null comment '?s???'
716
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
717
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
718
  , FirstString varchar(120) comment '???????'
719
  , SecondString varchar(120) comment '?H?????e'
720
  , CompanyType decimal(1,0) not null comment '??????R?[?h?^?C?v'
721
  , CompanyCode decimal(8,0) not null comment '??????R?[?h'
722
  , CompanyName varchar(120) comment '?????????'
723
  , EstimatePrice decimal(12,0) not null comment '?\?Z?i????j???z'
724
  , ExecutionAmount decimal(12,0) not null comment '???s???z'
725
  , AmountConfigRate decimal(5,2) not null comment '???z?\????'
726
  , PaymentBurden decimal(12,0) not null comment '?x????U?z'
727
  , FixDataFlg decimal(1,0) not null comment '???f?[?^?t???O'
728
  , IndependentFlg decimal(1,0) not null comment '????f?[?^?t???O'
729
  , FluctuationFlg decimal(1,0) not null comment '?????f?[?^?t???O'
730
  , SalaryFlg decimal(1,0) not null comment '???^?U????'
731
  , SalaryDays decimal(4,0) not null comment '???^?U??????'
732
  , OperatingFlg decimal(1,0) not null comment '?S?????t???O'
733
  , SourceCode decimal(10,0) unsigned not null comment '???H?????'
734
  , JoinTitleFlg decimal(1,0) not null comment '?H??????^?C?g??'
735
  , SalaryOnRegist decimal(12,0) not null comment '?o?^?????z???^'
736
  , PurchaseOrderFlg decimal(2,0) not null comment '?????????s?t???O'
737
  , DetailCount decimal(4,0) unsigned not null comment '??????'
738
  , EntryDate datetime not null comment '?o?^???t'
739
  , UpdateDate datetime not null comment '?X?V???t'
740
  , constraint constructionledgerdetail_PKC primary key (ConstructionCode,GroupCount,LineCount)
741
) comment '?H??????????f?[?^' ;
742

    
743
create index LedgerDetail_Index01
744
  on constructionledgerdetail(ConstructionCode);
745

    
746
create index LedgerDetail_Index02
747
  on constructionledgerdetail(GroupCount);
748

    
749
create index LedgerDetail_Index03
750
  on constructionledgerdetail(LineCount);
751

    
752
create index LedgerDetail_Index04
753
  on constructionledgerdetail(SourceCode);
754

    
755
create index LedgerDetail_Index05
756
  on constructionledgerdetail(DetailCount);
757

    
758
create index LedgerDetail_Index06
759
  on constructionledgerdetail(SalaryFlg);
760

    
761
create index LedgerDetail_Index07
762
  on constructionledgerdetail(CompanyCode);
763

    
764
-- ?H?????????s?f?[?^
765
drop table if exists constructionledgerexcute cascade;
766

    
767
create table constructionledgerexcute (
768
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
769
  , GroupCount decimal(2,0) unsigned not null comment '?O???[?v???'
770
  , LineCount decimal(4,0) unsigned not null comment '?s???'
771
  , ColumnCount decimal(3,0) not null comment '????'
772
  , PaymentAmount decimal(12,0) not null comment '?x?????z'
773
  , TargetMonth date not null comment '???N??'
774
  , EntryDate datetime not null comment '?o?^???t'
775
  , UpdateDate datetime not null comment '?X?V???t'
776
  , constraint constructionledgerexcute_PKC primary key (ConstructionCode,GroupCount,LineCount,ColumnCount)
777
) comment '?H?????????s?f?[?^' ;
778

    
779
create index LedgerExcute_Index1
780
  on constructionledgerexcute(ConstructionCode,TargetMonth,GroupCount,LineCount);
781

    
782
-- ?H???????N???
783
drop table if exists constructionlink cascade;
784

    
785
create table constructionlink (
786
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
787
  , FluctuationCode decimal(10,0) not null comment '?q?H?????'
788
  , LinkType decimal(1,0) not null comment '?????N???'
789
  , EntryDate datetime not null comment '?o?^???t'
790
  , UpdateDate datetime not null comment '?X?V???t'
791
  , constraint constructionlink_PKC primary key (ConstructionCode,FluctuationCode)
792
) comment '?H???????N???' ;
793

    
794
create index ConstructionLink_Index1
795
  on constructionlink(ConstructionCode);
796

    
797
create index ConstructionLink_Index2
798
  on constructionlink(FluctuationCode);
799

    
800
create index ConstructionLink_Index3
801
  on constructionlink(LinkType);
802

    
803
-- ?H????????
804
drop table if exists constructionmaterialinfo cascade;
805

    
806
create table constructionmaterialinfo (
807
  CONSTRUCTIONCODE int(10) unsigned default 0 not null comment '?H?????'
808
  , MATERIALITEMCODE smallint(5) unsigned default 0 not null comment '????i??R?[?h'
809
  , PROCESSDATE datetime default '0000-00-00 00:00:00' not null comment '?????N????'
810
  , RENTCOUNT smallint(5) unsigned comment '??o??'
811
  , REPAYCOUNT smallint(5) unsigned comment '??p??'
812
  , JUNKCOUNT smallint(5) unsigned comment '?j????'
813
  , COMPLETEFLG tinyint(3) unsigned comment '?????t???O'
814
  , ENTRYDATE datetime comment '?o?^???t'
815
  , UPDATEDATE datetime comment '?X?V???t'
816
  , constraint constructionmaterialinfo_PKC primary key (CONSTRUCTIONCODE,MATERIALITEMCODE,PROCESSDATE)
817
) comment '?H????????' ;
818

    
819
-- ????i?????t?f?[?^
820
drop table if exists constructionprogressdate cascade;
821

    
822
create table constructionprogressdate (
823
  ConstructionCode decimal(10,0) not null comment '?H?????'
824
  , ConstructionStatusFlg decimal(2,0) not null comment '???H?????'
825
  , PreviousStatusFlg decimal(2,0) comment '??X?O???'
826
  , ChangeDate datetime not null comment '?????t'
827
  , ChangePersonCode decimal(8,0) not null comment '???S????'
828
  , EntryDate datetime not null comment '?o?^???t'
829
  , UpdateDate datetime not null comment '?X?V???t'
830
  , constraint constructionprogressdate_PKC primary key (ConstructionCode,ChangeDate)
831
) comment '????i?????t?f?[?^' ;
832

    
833
create index ConstrProg_Index1
834
  on constructionprogressdate(ConstructionCode);
835

    
836
create index ConstrProg_Index2
837
  on constructionprogressdate(ConstructionStatusFlg);
838

    
839
create index ConstrProg_Index3
840
  on constructionprogressdate(ChangeDate);
841

    
842
-- ???}?X?^
843
drop table if exists constructionspecmaster cascade;
844

    
845
create table constructionspecmaster (
846
  ItemCode decimal(5,0) unsigned not null comment '?H??L?['
847
  , SpecCode decimal(5,0) unsigned not null comment '???L?['
848
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
849
  , ItemName varchar(120) comment '??????'
850
  , SpecName varchar(120) comment '??????'
851
  , UnitName varchar(30) comment '?P?????'
852
  , UnitPrice decimal(9,2) not null comment '?P??'
853
  , DeleteFlg decimal(1,0) not null comment '???t???O'
854
  , EntryDate datetime not null comment '?o?^???t'
855
  , UpdateDate datetime not null comment '?X?V???t'
856
  , constraint constructionspecmaster_PKC primary key (ItemCode,SpecCode)
857
) comment '???}?X?^' ;
858

    
859
create index ConstructionSpecMaster_Index1
860
  on constructionspecmaster(DisplayOrder);
861

    
862
-- ???P???}?X?^
863
drop table if exists constructionspecunitprice cascade;
864

    
865
create table constructionspecunitprice (
866
  ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
867
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
868
  , SpecCode decimal(5,0) unsigned not null comment '???L?['
869
  , ConstructionTypeCode mediumint(8) unsigned not null comment '?H?????R?[?h'
870
  , UnitPrice decimal(9,2) not null comment '?P??'
871
  , EntryDate datetime not null comment '?o?^???t'
872
  , UpdateDate datetime not null comment '?X?V???t'
873
  , constraint constructionspecunitprice_PKC primary key (ComponentCode,ItemCode,SpecCode,ConstructionTypeCode)
874
) comment '???P???}?X?^' ;
875

    
876
-- ?H?????}?X?^
877
drop table if exists constructiontypemaster cascade;
878

    
879
create table constructiontypemaster (
880
  TypeCode decimal(5,0) unsigned not null comment '?H?????R?[?h'
881
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
882
  , NameString varchar(100) not null comment '????'
883
  , PublicFlg decimal(1,0) not null comment '?????t???O'
884
  , RepairFlg decimal(1,0) not null comment '?V?z?E???C?t???O'
885
  , SecRank decimal(1,0) not null comment '?????????N'
886
  , ExpensesLink decimal(1,0) not null comment '?o??g?p??'
887
  , DeleteFlg decimal(1,0) not null comment '???t???O'
888
  , EntryDate datetime not null comment '?o?^???t'
889
  , UpdateDate datetime not null comment '?X?V???t'
890
  , constraint constructiontypemaster_PKC primary key (TypeCode)
891
) comment '?H?????}?X?^' ;
892

    
893
-- ?????o?[?f?[?^
894
drop table if exists costdataofdepartment cascade;
895

    
896
create table costdataofdepartment (
897
  DepartmentCode decimal(5,0) unsigned not null comment '?????R?[?h'
898
  , ConstrYear smallint(5) unsigned not null comment '?H???????E?N??'
899
  , SeqNo decimal(5,0) unsigned not null comment '?f?[?^???'
900
  , CostDate date not null comment '?????t'
901
  , DepartmentName varchar(100) not null comment '??????'
902
  , SuppliersCode decimal(8,0) unsigned not null comment '?o?[??R?[?h'
903
  , SuppliersName varchar(120) comment '?o?[??'
904
  , PaymentContent varchar(100) comment '?o?[???e'
905
  , SendReceiveFlg decimal(1,0) not null comment '?o?[?t???O'
906
  , EntryPrice decimal(12,0) not null comment '???z?i????j'
907
  , EntryTax decimal(12,0) not null comment '???z?i????j'
908
  , Coment varchar(100) comment '???l'
909
  , EntryDate datetime not null comment '?o?^???t'
910
  , UpdateDate datetime not null comment '?X?V???t'
911
  , constraint costdataofdepartment_PKC primary key (DepartmentCode,ConstrYear,SeqNo)
912
) comment '?????o?[?f?[?^' ;
913

    
914
-- ?S??????o??f?[?^
915
drop table if exists costdataofperson cascade;
916

    
917
create table costdataofperson (
918
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
919
  , ActionDate date not null comment '?????t'
920
  , DataType decimal(1,0) not null comment '?f?[?^??'
921
  , DataAddCount decimal(5,0) unsigned not null comment '?f?[?^??????'
922
  , TargetMonth varchar(7) not null comment '???N??'
923
  , ConstructionCode decimal(10,0) unsigned comment '?H???R?[?h'
924
  , SuppliersCode decimal(5,0) unsigned not null comment '?x????R?[?h'
925
  , SuppliersName varchar(120) comment '?x??????'
926
  , PaymentContent varchar(60) comment '?x?????e'
927
  , PaymentType decimal(1,0) not null comment '?x?????@?t???O'
928
  , EntryPrice decimal(12,0) not null comment '???z?i????j'
929
  , EntryPriceInTax decimal(12,0) not null comment '???z?i????j'
930
  , SlipNumber varchar(12) comment '?`?[???'
931
  , ComplateFlg decimal(1,0) not null comment '???????t???O'
932
  , ApprovalFlg decimal(1,0) not null comment '???F?t???O'
933
  , EntryDate datetime not null comment '?o?^???t'
934
  , UpdateDate datetime not null comment '?X?V???t'
935
  , constraint costdataofperson_PKC primary key (PersonCode,ActionDate,DataType,DataAddCount)
936
) comment '?S??????o??f?[?^' ;
937

    
938
create index CostDataOfPerson_Index1
939
  on costdataofperson(TargetMonth);
940

    
941
create index CostDataOfPerson_Index2
942
  on costdataofperson(ConstructionCode);
943

    
944
-- ??????o?^?\???f?[?^
945
drop table if exists costomerregist cascade;
946

    
947
create table costomerregist (
948
  CreatePersonCode decimal(8,0) unsigned not null comment '?\??????'
949
  , CreateDate date not null comment '????'
950
  , SeqNo decimal(2,0) not null comment '?L?[?A??'
951
  , DataMode decimal(1,0) not null comment '?f?[?^??'
952
  , SourceCotegory decimal(5,0) unsigned not null comment '???????'
953
  , SourceCode decimal(5,0) unsigned not null comment '??????R?[?h'
954
  , PetitionPeriod decimal(4,0) unsigned not null comment '?????'
955
  , OrderFlg decimal(1,0) not null comment '?@?l?c??E??l?t???O'
956
  , CorporateStatusName varchar(100) comment '?@?l?i????'
957
  , CorporateStatusPoint decimal(1,0) comment '?@?l?i?????u'
958
  , OrderersName1 varchar(60) not null comment '???????1'
959
  , OrderersName2 varchar(60) comment '????????Q'
960
  , DepartmentName varchar(60) comment '??????'
961
  , PersonName varchar(60) comment '?S?????'
962
  , ZipCode varchar(8) comment '?X????'
963
  , Address1 varchar(60) comment '?Z???P'
964
  , Address2 varchar(60) comment '?Z??2'
965
  , Address3 varchar(60) comment '?Z??3'
966
  , PhoneNumber varchar(13) comment '?d?b???'
967
  , FaxNumber varchar(13) comment 'FAX???'
968
  , MailAddress varchar(257) comment '???[???A?h???X'
969
  , Note varchar(300) comment '???l'
970
  , OrderCotegory decimal(5,0) unsigned not null comment '???????'
971
  , OrderDate date not null comment '?\????'
972
  , OrderNo decimal(2,0) unsigned not null comment '?\????t???'
973
  , CreateDepartmentCode decimal(5,0) unsigned not null comment '?\???????R?[?h'
974
  , CreateDepartmentName varchar(60) comment '?\????????'
975
  , EntryDate datetime not null comment '?o?^???t'
976
  , UpdateDate datetime not null comment '?X?V???t'
977
  , constraint costomerregist_PKC primary key (CreatePersonCode,CreateDate,SeqNo)
978
) comment '??????o?^?\???f?[?^' ;
979

    
980
create index CostomerRegist_Index1
981
  on costomerregist(PetitionPeriod);
982

    
983
create index CostomerRegist_Index2
984
  on costomerregist(CreatePersonCode);
985

    
986
create index CostomerRegist_Index3
987
  on costomerregist(CreateDepartmentCode);
988

    
989
-- ????f?[?^
990
drop table if exists dailydataconstruction cascade;
991

    
992
create table dailydataconstruction (
993
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
994
  , DailyDataDate date not null comment '???????'
995
  , ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
996
  , Weather varchar(60) comment '?V?C'
997
  , EntryDate datetime not null comment '?o?^???t'
998
  , UpdateDate datetime not null comment '?X?V???t'
999
  , constraint dailydataconstruction_PKC primary key (PersonCode,DailyDataDate,ConstructionCode)
1000
) comment '????f?[?^' ;
1001

    
1002
create index DailyDataConstruction_Index1
1003
  on dailydataconstruction(PersonCode);
1004

    
1005
create index DailyDataConstruction_Index2
1006
  on dailydataconstruction(DailyDataDate);
1007

    
1008
create index DailyDataConstruction_Index3
1009
  on dailydataconstruction(ConstructionCode);
1010

    
1011
-- ????f?[?^ (????)
1012
drop table if exists dailydatadetail cascade;
1013

    
1014
create table dailydatadetail (
1015
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
1016
  , DailyDataDate date not null comment '???????'
1017
  , ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1018
  , SeqNo decimal(3,0) unsigned not null comment '????s???'
1019
  , JobCategoryCode decimal(5,0) not null comment '?E??L?['
1020
  , CompanyCode decimal(8,0) not null comment '??????R?[?h'
1021
  , TodayHeadCount decimal(4,1) not null comment '?????l????'
1022
  , TotalHeadCount decimal(5,1) not null comment '??v?l????'
1023
  , TodayWork varchar(100) comment '?????????e'
1024
  , NextdayWork varchar(100) comment '?????????e'
1025
  , NextdayHeadCount decimal(4,1) not null comment '?????l????'
1026
  , EntryDate datetime not null comment '?o?^???t'
1027
  , UpdateDate datetime not null comment '?X?V???t'
1028
  , constraint dailydatadetail_PKC primary key (PersonCode,DailyDataDate,ConstructionCode,SeqNo)
1029
) comment '????f?[?^ (????)' ;
1030

    
1031
create index DailyDataDetail_Index
1032
  on dailydatadetail(PersonCode,DailyDataDate,ConstructionCode);
1033

    
1034
-- ????f?[?^ (??????)
1035
drop table if exists dailydatafield cascade;
1036

    
1037
create table dailydatafield (
1038
  PersonCode decimal(8,0) unsigned not null comment '????R?[?h'
1039
  , DailyDataDate date not null comment '???????'
1040
  , ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1041
  , SeqNo decimal(3,0) unsigned not null comment '????s???'
1042
  , PatrolTime datetime not null comment '?????'
1043
  , ContentsText varchar(200) comment '???e'
1044
  , EntryDate datetime not null comment '?o?^???t'
1045
  , UpdateDate datetime not null comment '?X?V???t'
1046
  , constraint dailydatafield_PKC primary key (PersonCode,DailyDataDate,ConstructionCode,SeqNo)
1047
) comment '????f?[?^ (??????)' ;
1048

    
1049
create index DailyDataField_Index
1050
  on dailydatafield(PersonCode,DailyDataDate,ConstructionCode);
1051

    
1052
-- ????f?[?^ (????)
1053
drop table if exists dailydatamaterials cascade;
1054

    
1055
create table dailydatamaterials (
1056
  PersonCode decimal(8,0) unsigned not null comment '????R?[?h'
1057
  , DailyDataDate date not null comment '???????'
1058
  , ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1059
  , SeqNo decimal(3,0) unsigned not null comment '????s???'
1060
  , Materials varchar(100) comment '?????'
1061
  , Quantity varchar(100) comment '????'
1062
  , Production varchar(100) comment '??????'
1063
  , Delivery varchar(100) comment '?[?????'
1064
  , QualityControl varchar(100) comment '?i?????????'
1065
  , EntryDate datetime not null comment '?o?^???t'
1066
  , UpdateDate datetime not null comment '?X?V???t'
1067
  , constraint dailydatamaterials_PKC primary key (PersonCode,DailyDataDate,ConstructionCode,SeqNo)
1068
) comment '????f?[?^ (????)' ;
1069

    
1070
create index DailyDataMaterials_Index
1071
  on dailydatamaterials(PersonCode,DailyDataDate,ConstructionCode);
1072

    
1073
-- ????f?[?^ (??????w??)
1074
drop table if exists dailydatasubcontractors cascade;
1075

    
1076
create table dailydatasubcontractors (
1077
  PersonCode decimal(8,0) unsigned not null comment '????R?[?h'
1078
  , DailyDataDate date not null comment '???????'
1079
  , ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1080
  , SeqNo decimal(3,0) unsigned not null comment '????s???'
1081
  , Attendee varchar(100) comment '?o???'
1082
  , ContentsText varchar(200) comment '???e'
1083
  , EntryDate datetime not null comment '?o?^???t'
1084
  , UpdateDate datetime not null comment '?X?V???t'
1085
  , constraint dailydatasubcontractors_PKC primary key (PersonCode,DailyDataDate,ConstructionCode,SeqNo)
1086
) comment '????f?[?^ (??????w??)' ;
1087

    
1088
create index DailyDataSubcontractors_Index
1089
  on dailydatasubcontractors(PersonCode,DailyDataDate,ConstructionCode);
1090

    
1091
-- ????f?[?^ (???)
1092
drop table if exists dailydatavehicles cascade;
1093

    
1094
create table dailydatavehicles (
1095
  PersonCode decimal(8,0) unsigned not null comment '????R?[?h'
1096
  , DailyDataDate date not null comment '???????'
1097
  , ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1098
  , SeqNo decimal(3,0) unsigned not null comment '????s???'
1099
  , Model varchar(100) comment '?@??'
1100
  , Performance varchar(100) comment '???\'
1101
  , Owner varchar(100) comment '???L???'
1102
  , Driver varchar(100) comment '?????^?]??'
1103
  , StartWorkingTime datetime not null comment '??????J?n'
1104
  , EndWorkingTime datetime not null comment '??????I??'
1105
  , EntryDate datetime not null comment '?o?^???t'
1106
  , UpdateDate datetime not null comment '?X?V???t'
1107
  , constraint dailydatavehicles_PKC primary key (PersonCode,DailyDataDate,ConstructionCode,SeqNo)
1108
) comment '????f?[?^ (???)' ;
1109

1110
create index DailyDataVehicles_Index
1111
  on dailydatavehicles(PersonCode,DailyDataDate,ConstructionCode);
1112

1113
-- ???}?X?^
1114
drop table if exists daymaster cascade;
1115

1116
create table daymaster (
1117
  days smallint(6) not null comment '??'
1118
  , constraint daymaster_PKC primary key (days)
1119
) comment '???}?X?^' ;
1120

1121
-- ?????}?X?^
1122
drop table if exists deadlinemaster cascade;
1123

1124
create table deadlinemaster (
1125
  LABOURKIND decimal(1,0) default '0' not null comment '??????'
1126
  , DEADLINE decimal(2,0) comment '????'
1127
  , PAYDAY decimal(2,0) comment '?x????'
1128
  , NOTE varchar(120) comment '???l'
1129
  , DELETEFLG decimal(1,0) comment '???t???O'
1130
  , ENTRYDATE datetime comment '?o?^???t'
1131
  , UPDATEDATE datetime comment '?X?V???t'
1132
  , constraint deadlinemaster_PKC primary key (LABOURKIND)
1133
) comment '?????}?X?^' ;
1134

1135
-- ?????o???}?X?^
1136
drop table if exists departmentexpensesmaster cascade;
1137

1138
create table departmentexpensesmaster (
1139
  DepartmentCode decimal(5,0) unsigned not null comment '?????R?[?h'
1140
  , ExpensesPeriod smallint(6) not null comment '?????'
1141
  , NameCode decimal(5,0) unsigned not null comment '?o??R?[?h'
1142
  , NameString varchar(100) not null comment '????'
1143
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
1144
  , ExpensesRaito decimal(4,2) not null comment '?o??'
1145
  , DeleteFlg decimal(1,0) not null comment '???t???O'
1146
  , EntryDate datetime not null comment '?o?^???t'
1147
  , UpdateDate datetime not null comment '?X?V???t'
1148
  , constraint departmentexpensesmaster_PKC primary key (DepartmentCode,ExpensesPeriod,NameCode)
1149
) comment '?????o???}?X?^' ;
1150

1151
-- ?????}?X?^
1152
drop table if exists departmentmaster cascade;
1153

1154
create table departmentmaster (
1155
  DepartmentCode decimal(5,0) unsigned not null comment '?????R?[?h'
1156
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
1157
  , DepartmentString varchar(100) not null comment '??????'
1158
  , ActionScheduleFlg decimal(1,0) not null comment '?s???\??\???t???O'
1159
  , StaffAssignFlg decimal(1,0) not null comment '?l???z?u?\???t???O'
1160
  , StartDate datetime not null comment '?J?n???t'
1161
  , CompDate datetime not null comment '?I?????t'
1162
  , DeleteFlg decimal(1,0) not null comment '???t???O'
1163
  , EntryDate datetime not null comment '?o?^???t'
1164
  , UpdateDate datetime not null comment '?X?V???t'
1165
  , constraint departmentmaster_PKC primary key (DepartmentCode)
1166
) comment '?????}?X?^' ;
1167

1168
create index DepartmentMaster_index1
1169
  on departmentmaster(DisplayOrder);
1170

1171
-- ?????m?F???F?f?[?^
1172
drop table if exists depositapprovalinfo cascade;
1173

1174
create table depositapprovalinfo (
1175
  ORDERERSDIVISION decimal(5,0) not null comment '???????'
1176
  , ORDERERSCODE decimal(5,0) not null comment '??????R?[?h'
1177
  , TARGETDATE decimal(6,0) not null comment '???N??'
1178
  , SEQNO decimal(3,0) not null comment '?A??'
1179
  , LINECOUNT decimal(3,0) not null comment '?s???'
1180
  , APPROVALNO decimal(3,0) not null comment '???F????'
1181
  , APPROVALPERSON decimal(8,0) comment '???F??R?[?h'
1182
  , APPROVALPERSONNAME varchar(20) comment '???F???'
1183
  , APPROVALAUTHORITY decimal(1,0) comment '???F??????'
1184
  , APPROVALDATE date comment '???F???t'
1185
  , ENTRYDATE datetime comment '?o?^???t'
1186
  , UPDATEDATE datetime comment '?X?V???t'
1187
  , constraint depositapprovalinfo_PKC primary key (ORDERERSDIVISION,ORDERERSCODE,TARGETDATE,SEQNO,LINECOUNT,APPROVALNO)
1188
) comment '?????m?F???F?f?[?^' ;
1189

1190
-- ?????f?[?^
1191
drop table if exists depositdata cascade;
1192

1193
create table depositdata (
1194
  ORDERERSDIVISION decimal(5,0) not null comment '???????'
1195
  , ORDERERSCODE decimal(5,0) not null comment '??????R?[?h'
1196
  , TARGETDATE decimal(6,0) not null comment '???N??'
1197
  , SEQNO decimal(3,0) not null comment '?A??'
1198
  , BUSINESSPERIOD decimal(4,0) comment '?c???'
1199
  , DEPOSITDATE date comment '??????'
1200
  , DEPOSITAMOUNT decimal(12,0) comment '???????z'
1201
  , DEPOSITAMOUNTCASH decimal(10,0) comment '???????z?i?????j'
1202
  , DEPOSITAMOUNTBILL decimal(10,0) comment '???????z?i??`?j'
1203
  , DEPOSITPERSONCODE decimal(8,0) not null comment '?????S????R?[?h'
1204
  , NOTE varchar(120) comment '???l'
1205
  , ENTRYDATE datetime comment '?o?^???t'
1206
  , UPDATEDATE datetime comment '?X?V???t'
1207
  , constraint depositdata_PKC primary key (ORDERERSDIVISION,ORDERERSCODE,TARGETDATE,SEQNO)
1208
) comment '?????f?[?^' ;
1209

1210
-- ????????f?[?^
1211
drop table if exists depositdatadetail cascade;
1212

1213
create table depositdatadetail (
1214
  ORDERERSDIVISION decimal(5,0) not null comment '???????'
1215
  , ORDERERSCODE decimal(5,0) not null comment '??????R?[?h'
1216
  , TARGETDATE decimal(6,0) not null comment '???N??'
1217
  , REQUESTNO decimal(10,0) not null comment '????No'
1218
  , ORDERNO decimal(2,0) comment '??t???'
1219
  , DEPOSITAMOUNT decimal(10,0) comment '???????z'
1220
  , DISCOUNTAMOUNT decimal(10,0) comment '?l???????z'
1221
  , CNSTRPRICE decimal(10,0) comment '?????'
1222
  , FEES decimal(10,0) comment '????'
1223
  , OTHERADJUSTMENTS decimal(10,0) comment '?????'
1224
  , DIFFERENCEAMOUNT decimal(10,0) comment '????'
1225
  , CONFIRMATIONPERSONCODE decimal(8,0) comment '?m?F?S????R?[?h'
1226
  , CONFIRMATIONDATE date comment '?S????m?F???t'
1227
  , CONFIRMATIONENDFLG decimal(1,0) comment '?m?F?????t???O'
1228
  , NOTE varchar(120) comment '???l'
1229
  , ENTRYDATE datetime comment '?o?^???t'
1230
  , UPDATEDATE datetime comment '?X?V???t'
1231
  , constraint depositdatadetail_PKC primary key (ORDERERSDIVISION,ORDERERSCODE,TARGETDATE,REQUESTNO)
1232
) comment '????????f?[?^' ;
1233

1234
-- ???}?X?^
1235
drop table if exists divisionmaster cascade;
1236

1237
create table divisionmaster (
1238
  DivisionCode decimal(5,0) unsigned not null comment '???R?[?h'
1239
  , NameCode decimal(5,0) unsigned not null comment '????R?[?h'
1240
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
1241
  , NameString varchar(100) not null comment '????'
1242
  , DeleteFlg decimal(1,0) not null comment '???t???O'
1243
  , EntryDate datetime not null comment '?o?^???t'
1244
  , UpdateDate datetime not null comment '?X?V???t'
1245
  , constraint divisionmaster_PKC primary key (DivisionCode,NameCode)
1246
) comment '???}?X?^' ;
1247

1248
-- ??Z?\?Z???f?[?^
1249
drop table if exists estimatebudget cascade;
1250

1251
create table estimatebudget (
1252
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1253
  , ConstructionTime decimal(5,2) unsigned not null comment '?H??'
1254
  , IntegratedCode decimal(8,0) not null comment '??Z??'
1255
  , DataCreateDate datetime not null comment '?f?[?^??????'
1256
  , RetValue1 decimal(12,0) not null comment '?\???i'
1257
  , RetValue2 decimal(12,0) not null comment '????H????'
1258
  , RetValue3 decimal(12,0) not null comment '????????????'
1259
  , RetValue4 decimal(12,0) not null comment '????????????'
1260
  , RetPercent decimal(5,2) not null comment '???????'
1261
  , EntryDate datetime not null comment '?o?^???t'
1262
  , UpdateDate datetime not null comment '?X?V???t'
1263
  , constraint estimatebudget_PKC primary key (ConstructionCode)
1264
) comment '??Z?\?Z???f?[?^' ;
1265

1266
-- ??Z?\?Z????f?[?^????
1267
drop table if exists estimatebudgetdetail cascade;
1268

1269
create table estimatebudgetdetail (
1270
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1271
  , GroupCount decimal(2,0) unsigned not null comment '?O???[?v???'
1272
  , LineCount decimal(3,0) unsigned not null comment '?s???'
1273
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
1274
  , ItemCode decimal(5,0) unsigned comment '?H??L?['
1275
  , CompanyCode decimal(8,0) not null comment '??????R?[?h'
1276
  , FirstString varchar(120) comment '???????'
1277
  , SecondString varchar(120) comment '?H????E???????'
1278
  , Content varchar(120) comment '???e'
1279
  , EstimatePrice decimal(12,0) not null comment '????????z'
1280
  , NegotiationPrice decimal(12,0) not null comment '????????z'
1281
  , Notes varchar(120) comment '???????'
1282
  , EntryDate datetime not null comment '?o?^???t'
1283
  , UpdateDate datetime not null comment '?X?V???t'
1284
  , constraint estimatebudgetdetail_PKC primary key (ConstructionCode,GroupCount,LineCount)
1285
) comment '??Z?\?Z????f?[?^????' ;
1286

1287
-- ??Z????f?[?^
1288
drop table if exists estimatedata cascade;
1289

1290
create table estimatedata (
1291
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1292
  , LineCount decimal(3,0) unsigned not null comment '?s???'
1293
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
1294
  , FixedItemCode varchar(1) comment '?????L?['
1295
  , ItemName varchar(120) comment '??????'
1296
  , SpecName varchar(120) comment '???^?i???E?`??E???@'
1297
  , PriceValue decimal(14,0) not null comment '???z'
1298
  , note varchar(60) comment '???l'
1299
  , MyExpensesFlg decimal(1,0) not null comment '????o??t???O'
1300
  , InputFlg decimal(1,0) not null comment '????t???O'
1301
  , EntryDate datetime not null comment '?o?^???t'
1302
  , UpdateDate datetime not null comment '?X?V???t'
1303
  , constraint estimatedata_PKC primary key (ConstructionCode,LineCount)
1304
) comment '??Z????f?[?^' ;
1305

1306
create index EstimateData_Index1
1307
  on estimatedata(ConstructionCode,FixedItemCode);
1308

1309
-- ??Z????y?[?W?f?[?^
1310
drop table if exists estimatedatabody cascade;
1311

1312
create table estimatedatabody (
1313
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1314
  , PageCount decimal(4,0) unsigned not null comment '?y?[?W???'
1315
  , Category decimal(1,0) not null comment '?y?[?W??'
1316
  , UnionComponentCode decimal(5,0) unsigned not null comment '?????\???L?['
1317
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
1318
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
1319
  , SelectComponent decimal(5,0) unsigned not null comment '?I???\???L?['
1320
  , PageTitle varchar(120) not null comment '?y?[?W?\????'
1321
  , DetailLineCount decimal(3,0) unsigned not null comment '????s???'
1322
  , EntryDate datetime not null comment '?o?^???t'
1323
  , UpdateDate datetime not null comment '?X?V???t'
1324
  , constraint estimatedatabody_PKC primary key (ConstructionCode,PageCount)
1325
) comment '??Z????y?[?W?f?[?^' ;
1326

1327
create index EstimateDataBody_Index1
1328
  on estimatedatabody(ConstructionCode,ComponentCode,ItemCode);
1329

1330
-- ??Z????f?[?^????
1331
drop table if exists estimatedatadetail cascade;
1332

1333
create table estimatedatadetail (
1334
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1335
  , PageCount decimal(4,0) unsigned not null comment '?y?[?W???'
1336
  , LineCount decimal(3,0) unsigned not null comment '?s???'
1337
  , DataType decimal(1,0) not null comment '?f?[?^???'
1338
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
1339
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
1340
  , SpecCode decimal(5,0) unsigned not null comment '???L?['
1341
  , ItemName varchar(120) comment '??????'
1342
  , SpecName varchar(120) comment '???^?i???E?`??E???@'
1343
  , Unitcount decimal(8,2) not null comment '????'
1344
  , UnitName varchar(30) comment '?P?????'
1345
  , UnitPrice decimal(9,2) not null comment '?P??'
1346
  , LineTotal decimal(12,0) not null comment '???z'
1347
  , note varchar(60) comment '???l'
1348
  , CompanyCode decimal(8,0) not null comment '??????R?[?h'
1349
  , MyExpensesFlg decimal(1,0) not null comment '????o??t???O'
1350
  , InputFlg decimal(1,0) comment '????t???O'
1351
  , EntryDate datetime not null comment '?o?^???t'
1352
  , UpdateDate datetime not null comment '?X?V???t'
1353
  , constraint estimatedatadetail_PKC primary key (ConstructionCode,PageCount,LineCount)
1354
) comment '??Z????f?[?^????' ;
1355

1356
create index EstimateDataDetail_Index1
1357
  on estimatedatadetail(ConstructionCode,PageCount);
1358

1359
-- ?o???}?X?^
1360
drop table if exists expensesmaster cascade;
1361

1362
create table expensesmaster (
1363
  DivisionCode smallint(6) not null comment '?H?????R?[?h'
1364
  , NameCode smallint(6) not null comment '?o????R?[?h'
1365
  , DisplayOrder smallint(6) not null comment '?\????'
1366
  , ExpensesRatio decimal(4,2) not null comment '?o??'
1367
  , DeleteFlg decimal(1,0) not null comment '???t???O'
1368
  , EntryDate datetime not null comment '?o?^???t'
1369
  , UpdateDate datetime not null comment '?X?V???t'
1370
  , constraint expensesmaster_PKC primary key (DivisionCode,NameCode)
1371
) comment '?o???}?X?^' ;
1372

1373
-- ???x???}?X?^
1374
drop table if exists holidaycalendermaster cascade;
1375

1376
create table holidaycalendermaster (
1377
  Holiday date not null comment '?x??'
1378
  , BusinessYear smallint(5) unsigned not null comment '?c??N?x'
1379
  , TargetMonth tinyint(3) unsigned not null comment '?Y????'
1380
  , TargetDay tinyint(3) unsigned not null comment '?Y????'
1381
  , constraint holidaycalendermaster_PKC primary key (Holiday)
1382
) comment '???x???}?X?^' ;
1383

1384
create index HolidayCalender_Index1
1385
  on holidaycalendermaster(BusinessYear);
1386

1387
create index HolidayCalenderMaster_Index2
1388
  on holidaycalendermaster(TargetMonth);
1389

1390
create index HolidayCalenderMaster_Index3
1391
  on holidaycalendermaster(TargetDay);
1392

1393
-- ?????????????
1394
drop table if exists inputsearchlogdata cascade;
1395

1396
create table inputsearchlogdata (
1397
  ConstructionCode decimal(10,0) not null comment '?H???R?[?h'
1398
  , UsedProcessNo decimal(4,0) not null comment '?g?p?@?\???'
1399
  , DisplayOrder decimal(4,0) unsigned not null comment '?\????'
1400
  , DataType decimal(1,0) not null comment '?f?[?^???'
1401
  , InputCode decimal(10,0) comment '????R?[?h'
1402
  , constraint inputsearchlogdata_PKC primary key (ConstructionCode,UsedProcessNo,DisplayOrder)
1403
) comment '?????????????' ;
1404

1405
create index InputSearchLogData_Index1
1406
  on inputsearchlogdata(ConstructionCode,UsedProcessNo,InputCode);
1407

1408
-- ???????f?[?^
1409
drop table if exists invoicedata cascade;
1410

1411
create table invoicedata (
1412
  INVOICENO decimal(9,0) not null comment '??????No'
1413
  , ORDERERSDIVISION decimal(5,0) not null comment '???????'
1414
  , ORDERERSCODE decimal(5,0) not null comment '??????R?[?h'
1415
  , REQUESTMONTH decimal(6,0) not null comment '??????'
1416
  , SEQNO decimal(2,0) not null comment '?A??'
1417
  , CRETATEDATE date not null comment '????'
1418
  , REQUESTDATE date not null comment '??????'
1419
  , REQUESTNAME varchar(120) comment '??????'
1420
  , TOTALAMOUNT decimal(10,0) comment '???????v???z'
1421
  , TAXAMOUNT decimal(10,0) comment '???????z'
1422
  , COMMENT1 varchar(60) comment '?R?????g1'
1423
  , COMMENT2 varchar(60) comment '?R?????g2'
1424
  , COMMENT3 varchar(60) not null comment '?R?????g3'
1425
  , COMMENT4 varchar(60) not null comment '?R?????g4'
1426
  , COMMENT5 varchar(60) not null comment '?R?????g5'
1427
  , COMPLETEFLG decimal(1,0) default '0' not null comment '?????t???O'
1428
  , ENTRYDATE datetime not null comment '?o?^?N????'
1429
  , UPDATEDATE datetime not null comment '?X?V?N????'
1430
  , constraint invoicedata_PKC primary key (INVOICENO)
1431
) comment '???????f?[?^' ;
1432

1433
alter table invoicedata add unique ORDERERSDIVISION (ORDERERSDIVISION,ORDERERSCODE,REQUESTMONTH,SEQNO) ;
1434

1435
-- ??????
1436
drop table if exists materialinfo cascade;
1437

1438
create table materialinfo (
1439
  MATERIALITEMCODE smallint(5) unsigned default 0 not null comment '????i??R?[?h'
1440
  , MATERIALCOUNT smallint(5) unsigned comment '?????'
1441
  , RENTCOUNT smallint(5) unsigned comment '??o??\??'
1442
  , DELETEFLG smallint(5) unsigned comment '???t???O'
1443
  , ENTRYDATE datetime comment '?o?^???t'
1444
  , UPDATEDATE datetime comment '?X?V???t'
1445
  , constraint materialinfo_PKC primary key (MATERIALITEMCODE)
1446
) comment '??????' ;
1447

1448
-- ????i??}?X?^
1449
drop table if exists materialitemmaster cascade;
1450

1451
create table materialitemmaster (
1452
  MATERIALITEMCODE smallint(5) unsigned default 0 not null comment '????i??R?[?h'
1453
  , MATERIALKINDCODE smallint(5) unsigned comment '??????R?[?h'
1454
  , MATERIALITEMNAME varchar(40) comment '????i?????'
1455
  , DISPLAYORDER smallint(5) unsigned comment '?\????'
1456
  , DELETEFLG tinyint(3) unsigned comment '???t???O'
1457
  , ENTRYDATE datetime comment '?o?^???t'
1458
  , UPDATEDATE datetime comment '?X?V???t'
1459
  , VERSIONNO decimal(8,0) default '0' not null comment '?o?[?W???????'
1460
  , constraint materialitemmaster_PKC primary key (MATERIALITEMCODE)
1461
) comment '????i??}?X?^' ;
1462

1463
-- ??????}?X?^
1464
drop table if exists materialkindmaster cascade;
1465

1466
create table materialkindmaster (
1467
  MATERIALKINDCODE smallint(5) unsigned default 0 not null comment '??????R?[?h'
1468
  , MATERIALKINDNAME varchar(40) comment '?????????'
1469
  , DISPLAYORDER smallint(5) unsigned comment '?\????'
1470
  , DELETEFLG tinyint(3) unsigned comment '???t???O'
1471
  , ENTRYDATE datetime comment '?o?^???t'
1472
  , UPDATEDATE datetime comment '?X?V???t'
1473
  , constraint materialkindmaster_PKC primary key (MATERIALKINDCODE)
1474
) comment '??????}?X?^' ;
1475

1476
-- ??????????
1477
drop table if exists materialrecordinfo cascade;
1478

1479
create table materialrecordinfo (
1480
  MATERIALITEMCODE smallint(5) unsigned default 0 not null comment '????i??R?[?h'
1481
  , PROCESSDATE date default '0000-00-00' not null comment '?????N????'
1482
  , SEQNO smallint(5) unsigned default 0 not null comment '?A??'
1483
  , RECKIND tinyint(3) unsigned comment '???R?[?h??'
1484
  , CONSTRUCTIONCODE int(10) unsigned comment '?H?????'
1485
  , PERSONCODE int(10) unsigned comment '?S????R?[?h'
1486
  , MATERIALCOUNT smallint(5) unsigned comment '?????'
1487
  , REPAYPLANDATE date comment '??p?\??N????'
1488
  , COMMENTTEXT varchar(80) comment '?R?????g'
1489
  , ENTRYDATE datetime comment '?o?^???t'
1490
  , UPDATEDATE datetime comment '?X?V???t'
1491
  , constraint materialrecordinfo_PKC primary key (MATERIALITEMCODE,PROCESSDATE,SEQNO)
1492
) comment '??????????' ;
1493

1494
-- ?f??????b?Z?[?W
1495
drop table if exists messageboarddata cascade;
1496

1497
create table messageboarddata (
1498
  RecordNumber decimal(6,0) unsigned not null comment '???R?[?h???'
1499
  , BranchNumber decimal(3,0) unsigned not null comment '???R?[?h?}??'
1500
  , FromCode decimal(8,0) unsigned not null comment '???????R?[?h'
1501
  , FromName varchar(60) not null comment '???????'
1502
  , MessageTitile varchar(100) comment '?`???^?C?g??'
1503
  , MessageContent varchar(1333) not null comment '?`?????e'
1504
  , LinkType decimal(2,0) not null comment '?????N????^?C?v'
1505
  , LinkMessage varchar(200) comment '?????N??????'
1506
  , LinkCode varchar(30) comment '?????N?L?['
1507
  , WritingDate datetime not null comment '?????????'
1508
  , PersonCode decimal(8,0) not null comment '??????S????R?[?h'
1509
  , ShareFlag decimal(2,0) not null comment '???????t???O'
1510
  , MessageColor varchar(8) comment '?????F'
1511
  , BackColor varchar(8) comment '?o?b?N?J???['
1512
  , MessageFlag decimal(1,0) not null comment '???b?Z?[?W?t???O'
1513
  , EntryDate datetime not null comment '?o?^???t'
1514
  , UpdateDate datetime not null comment '?X?V???t'
1515
  , constraint messageboarddata_PKC primary key (RecordNumber,BranchNumber)
1516
) comment '?f??????b?Z?[?W' ;
1517

1518
create index MessageBoardData_Index1
1519
  on messageboarddata(WritingDate);
1520

1521
create index MessageBoardData_Index2
1522
  on messageboarddata(MessageFlag);
1523

1524
-- ?f???????e?[?u??
1525
drop table if exists messageboardterget cascade;
1526

1527
create table messageboardterget (
1528
  RecordNumber decimal(6,0) unsigned not null comment '???R?[?h???'
1529
  , BranchNumber decimal(3,0) unsigned not null comment '???R?[?h?}??'
1530
  , SeqNum decimal(3,0) unsigned not null comment '????'
1531
  , ToCode decimal(8,0) not null comment '????R?[?h'
1532
  , ToName varchar(60) not null comment '????'
1533
  , EntryDate datetime not null comment '?o?^???t'
1534
  , UpdateDate datetime not null comment '?X?V???t'
1535
  , constraint messageboardterget_PKC primary key (RecordNumber,BranchNumber,SeqNum)
1536
) comment '?f???????e?[?u??' ;
1537

1538
create index MessageBoardTerget_Index1
1539
  on messageboardterget(RecordNumber,BranchNumber);
1540

1541
-- ?f??????b?Z?[?W?{??????
1542
drop table if exists messagebrowsinghistory cascade;
1543

1544
create table messagebrowsinghistory (
1545
  RecordNumber decimal(6,0) unsigned not null comment '???R?[?h???'
1546
  , BranchNumber decimal(3,0) unsigned not null comment '???R?[?h?}??'
1547
  , SeqNum decimal(3,0) unsigned not null comment '????'
1548
  , BrowsingCode decimal(8,0) not null comment '?{????R?[?h'
1549
  , BrowsingDate datetime not null comment '?{?????t'
1550
  , EntryDate datetime not null comment '?o?^???t'
1551
  , UpdateDate datetime not null comment '?X?V???t'
1552
  , constraint messagebrowsinghistory_PKC primary key (RecordNumber,BranchNumber,SeqNum)
1553
) comment '?f??????b?Z?[?W?{??????' ;
1554

1555
-- ???}?X?^
1556
drop table if exists monthmaster cascade;
1557

1558
create table monthmaster (
1559
  month smallint(6) not null comment '??'
1560
  , constraint monthmaster_PKC primary key (month)
1561
) comment '???}?X?^' ;
1562

1563
-- ??????}?X?^
1564
drop table if exists orderersmaster cascade;
1565

1566
create table orderersmaster (
1567
  OrderCotegory decimal(5,0) unsigned not null comment '???????'
1568
  , OrderersCode decimal(5,0) unsigned not null comment '??????R?[?h'
1569
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
1570
  , OrderFlg decimal(1,0) not null comment '?@?l?c??E??l?t???O'
1571
  , CorporateStatusName varchar(100) comment '?@?l?i????'
1572
  , CorporateStatusPoint decimal(1,0) comment '?@?l?i?????u'
1573
  , OrderersName1 varchar(60) not null comment '???????1'
1574
  , OrderersName2 varchar(60) comment '????????Q'
1575
  , DepartmentName varchar(60) comment '??????'
1576
  , ChargePersonName varchar(60) comment '?S?????'
1577
  , ZipCode varchar(8) comment '?X????'
1578
  , Address1 varchar(60) comment '?Z???P'
1579
  , Address2 varchar(60) comment '?Z??2'
1580
  , Address3 varchar(60) comment '?Z??3'
1581
  , PhoneNumber varchar(13) comment '?d?b???'
1582
  , FaxNumber varchar(13) comment 'FAX???'
1583
  , MailAddress varchar(257) comment '???[???A?h???X'
1584
  , Note varchar(300) comment '???l'
1585
  , DeleteFlg decimal(1,0) not null comment '???t???O'
1586
  , EntryDate datetime not null comment '?o?^???t'
1587
  , UpdateDate datetime not null comment '?X?V???t'
1588
  , constraint orderersmaster_PKC primary key (OrderCotegory,OrderersCode)
1589
) comment '??????}?X?^' ;
1590

1591
-- ????z?f?[?^
1592
drop table if exists orderspricedata cascade;
1593

1594
create table orderspricedata (
1595
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1596
  , ChangeNo decimal(3,0) unsigned not null comment '??X???'
1597
  , ChangeDate date not null comment '??X??'
1598
  , ChangePersonCode decimal(8,0) unsigned not null comment '??X??R?[?h'
1599
  , ChangePersonName varchar(60) comment '??X???'
1600
  , BeforeValue decimal(14,0) not null comment '??X?O???????z'
1601
  , BeforeValueInTax decimal(14,0) not null comment '??X?O???????z'
1602
  , AfterValue decimal(14,0) not null comment '??X????????z'
1603
  , AfterValueInTax decimal(14,0) not null comment '??X????????z'
1604
  , ChangeComment varchar(200) comment '??X???R'
1605
  , EntryDate datetime not null comment '?o?^???t'
1606
  , UpdateDate datetime not null comment '?X?V???t'
1607
  , constraint orderspricedata_PKC primary key (ConstructionCode,ChangeNo)
1608
) comment '????z?f?[?^' ;
1609

1610
-- ?x?????F???f?[?^
1611
drop table if exists paymentapprovalinfo cascade;
1612

1613
create table paymentapprovalinfo (
1614
  COMPANYCODE decimal(8,0) default '0' not null comment '??????R?[?h'
1615
  , TARGETDATE decimal(6,0) default '0' not null comment '???N??'
1616
  , SEQNO decimal(3,0) default '0' not null comment '?A??'
1617
  , LINECOUNT decimal(3,0) default '0' not null comment '?s???'
1618
  , APPROVALNO decimal(3,0) default '0' not null comment '???F????'
1619
  , APPROVALPERSON decimal(8,0) comment '???F??R?[?h'
1620
  , APPROVALPERSONNAME varchar(20) comment '???F???'
1621
  , APPROVALAUTHORITY decimal(1,0) comment '???F??????'
1622
  , APPROVALDATE date comment '???F???t'
1623
  , ENTRYDATE datetime comment '?o?^???t'
1624
  , UPDATEDATE datetime comment '?X?V???t'
1625
  , constraint paymentapprovalinfo_PKC primary key (COMPANYCODE,TARGETDATE,SEQNO,LINECOUNT,APPROVALNO)
1626
) comment '?x?????F???f?[?^' ;
1627

1628
-- ?x??????f?[?^
1629
drop table if exists paymentdatadetail cascade;
1630

1631
create table paymentdatadetail (
1632
  COMPANYCODE decimal(8,0) default '0' not null comment '??????R?[?h'
1633
  , TARGETDATE decimal(6,0) default '0' not null comment '???N??'
1634
  , SEQNO decimal(3,0) default '0' not null comment '?A??'
1635
  , LINECOUNT decimal(3,0) default '0' not null comment '?s???'
1636
  , BILLPRICE decimal(10,0) comment '???????z'
1637
  , DISCOUNTPRICE decimal(10,0) comment '?l???????z'
1638
  , OFFSETPRICE decimal(10,0) comment '???E???z'
1639
  , NEXTCOPRICE decimal(10,0) comment '????J?z'
1640
  , HIGHWPRICE decimal(10,0) comment '??????'
1641
  , HARDWPRICE decimal(10,0) comment '??????'
1642
  , INDSWASTETAX decimal(10,0) comment '?Y?p??'
1643
  , CNSTRPRICE decimal(10,0) comment '?????'
1644
  , CNSTRPRICEEXIST decimal(1,0) comment '??????L??'
1645
  , APPROVALPERSONCODE decimal(8,0) comment '???F?S????R?[?h'
1646
  , APPROVALDATE date comment '?S??????F???t'
1647
  , APPROVALENDFLG decimal(1,0) comment '???F?????t???O'
1648
  , ENTRYDATE datetime comment '?o?^???t'
1649
  , UPDATEDATE datetime comment '?X?V???t'
1650
  , constraint paymentdatadetail_PKC primary key (COMPANYCODE,TARGETDATE,SEQNO,LINECOUNT)
1651
) comment '?x??????f?[?^' ;
1652

1653
create index PayDataDetail_Index1
1654
  on paymentdatadetail(TARGETDATE);
1655

1656
create index PayDataDetail_Index2
1657
  on paymentdatadetail(APPROVALPERSONCODE);
1658

1659
-- ?H??????????f?[?^
1660
drop table if exists periodavoidance cascade;
1661

1662
create table periodavoidance (
1663
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1664
  , ConstructionStatusFlg decimal(2,0) not null comment '?H?????t???O'
1665
  , FieldNo decimal(2,0) not null comment '?`?F?b?N???t?B?[???h???'
1666
  , EntryDate datetime not null comment '?o?^???t'
1667
  , UpdateDate datetime not null comment '?X?V???t'
1668
  , constraint periodavoidance_PKC primary key (ConstructionCode,ConstructionStatusFlg,FieldNo)
1669
) comment '?H??????????f?[?^' ;
1670

1671
create index PeriodAvoidance_Index1
1672
  on periodavoidance(ConstructionCode);
1673

1674
create index PeriodAvoidance_Index2
1675
  on periodavoidance(ConstructionStatusFlg);
1676

1677
create index PeriodAvoidance_Index3
1678
  on periodavoidance(FieldNo);
1679

1680
-- ?S??????F?f?[?^
1681
drop table if exists personapproval cascade;
1682

1683
create table personapproval (
1684
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
1685
  , ApprovalCode decimal(3,0) unsigned not null comment '???F?@?\???'
1686
  , OrderDate date not null comment '??t??'
1687
  , OrderNo decimal(2,0) unsigned not null comment '??t???'
1688
  , SeqNo decimal(2,0) not null comment '?}??'
1689
  , PersonCodeApproval decimal(8,0) unsigned not null comment '?\???E???F??R?[?h'
1690
  , PetitionApprovalDate datetime not null comment '?\???E???F???t'
1691
  , ApprovalLimitDates datetime not null comment '???F??]??'
1692
  , ApprovalStatus decimal(1,0) not null comment '???F???'
1693
  , InputComment varchar(300) comment '?R?????g'
1694
  , EntryDate datetime not null comment '?o?^???t'
1695
  , UpdateDate datetime not null comment '?X?V???t'
1696
  , constraint personapproval_PKC primary key (PersonCode,ApprovalCode,OrderDate,OrderNo,SeqNo)
1697
) comment '?S??????F?f?[?^' ;
1698

1699
-- ?S??????F?R?????g?f?[?^
1700
drop table if exists personapprovalcomment cascade;
1701

1702
create table personapprovalcomment (
1703
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
1704
  , ApprovalCode decimal(3,0) unsigned not null comment '???F?@?\???'
1705
  , OrderDate date not null comment '??t??'
1706
  , OrderNo decimal(2,0) unsigned not null comment '??t???'
1707
  , CommentNo decimal(2,0) not null comment '?R?????g???'
1708
  , ParentNo decimal(2,0) not null comment '?e?R?????g???'
1709
  , ApproValComment varchar(300) comment '?w???E?A???R?????g'
1710
  , EntryDate datetime not null comment '?o?^???t'
1711
  , UpdateDate datetime not null comment '?X?V???t'
1712
  , constraint personapprovalcomment_PKC primary key (PersonCode,ApprovalCode,OrderDate,OrderNo,CommentNo)
1713
) comment '?S??????F?R?????g?f?[?^' ;
1714

1715
-- ?S??????????}?X?^
1716
drop table if exists persondepartmentmaster cascade;
1717

1718
create table persondepartmentmaster (
1719
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
1720
  , DepartmentCode decimal(5,0) unsigned not null comment '?????R?[?h'
1721
  , AffiliationFlg decimal(1,0) not null comment '?????t???O'
1722
  , EntryDate datetime not null comment '?o?^???t'
1723
  , UpdateDate datetime not null comment '?X?V???t'
1724
  , constraint persondepartmentmaster_PKC primary key (PersonCode,DepartmentCode)
1725
) comment '?S??????????}?X?^' ;
1726

1727
create index PersonDepartmentMaster_Index1
1728
  on persondepartmentmaster(PersonCode);
1729

1730
create index PersonDepartmentMaster_Index2
1731
  on persondepartmentmaster(DepartmentCode);
1732

1733
-- ?S????}?X?^
1734
drop table if exists personinchargemaster cascade;
1735

1736
create table personinchargemaster (
1737
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
1738
  , DisplayOrder decimal(8,0) unsigned not null comment '?\????'
1739
  , PersonName varchar(60) not null comment '?S?????'
1740
  , StartDate date not null comment '?g?p?J?n?N????'
1741
  , EndDate date comment '?g?p?I???N????'
1742
  , PassWord varchar(16) comment '?p?X???[?h'
1743
  , SecurityManagement decimal(1,0) not null comment '?@????'
1744
  , SecCode decimal(2,0) unsigned not null comment '???????'
1745
  , MsgBackColor varchar(8) comment '???b?Z?[?W?w?i?F'
1746
  , DisplayString varchar(20) comment '?\???E???????'
1747
  , DepartmentCode decimal(5,0) unsigned comment '?????R?[?h'
1748
  , MonthlySalary decimal(11,0) not null comment '???????z'
1749
  , YearSalary decimal(12,0) not null comment '?N????z'
1750
  , Qualification varchar(120) comment '???i?????'
1751
  , SealPrintName varchar(5) comment '???\????'
1752
  , EmployeeClassFlg decimal(1,0) not null comment '?????'
1753
  , LedgerFlg decimal(1,0) not null comment '???v?Z???t???O'
1754
  , CommutingDistance decimal(5,2) not null comment '??????'
1755
  , CommuteCosts decimal(5,0) not null comment '??????'
1756
  , DeleteFlg decimal(1,0) not null comment '???t???O'
1757
  , EntryDate datetime not null comment '?o?^???t'
1758
  , UpdateDate datetime not null comment '?X?V???t'
1759
  , constraint personinchargemaster_PKC primary key (PersonCode)
1760
) comment '?S????}?X?^' ;
1761

1762
create index PersonInChargeMaster_Index1
1763
  on personinchargemaster(StartDate);
1764

1765
create index PersonInChargeMaster_Index2
1766
  on personinchargemaster(DepartmentCode);
1767

1768
-- ?S??????^?}?X?^
1769
drop table if exists personsalarymaster cascade;
1770

1771
create table personsalarymaster (
1772
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
1773
  , StartDate date not null comment '?g?p?J?n?N????'
1774
  , MonthlySalary decimal(11,0) not null comment '???????z'
1775
  , YearSalary decimal(12,0) not null comment '?N????z'
1776
  , EntryDate datetime not null comment '?o?^???t'
1777
  , UpdateDate datetime not null comment '?X?V???t'
1778
  , constraint personsalarymaster_PKC primary key (PersonCode,StartDate)
1779
) comment '?S??????^?}?X?^' ;
1780

1781
create index PersonSalaryMaster_Index1
1782
  on personsalarymaster(PersonCode);
1783

1784
create index PersonSalaryMaster_Index2
1785
  on personsalarymaster(StartDate);
1786

1787
create index PersonSalaryMaster_Index3
1788
  on personsalarymaster(MonthlySalary);
1789

1790
-- ?w???????f?[?^
1791
drop table if exists pointingoutcomment cascade;
1792

1793
create table pointingoutcomment (
1794
  ConstructionCode decimal(10,0) not null comment '?H???R?[?h'
1795
  , ProcessNo smallint(6) not null comment '????????i??????j'
1796
  , SeqNo smallint(6) not null comment '????'
1797
  , PageCount smallint(6) not null comment '?y?[?W???'
1798
  , PersonCode decimal(8,0) not null comment '?L????R?[?h'
1799
  , DrowColor varchar(8) comment '?`??F'
1800
  , CommentMessage varchar(1000) comment '???b?Z?[?W'
1801
  , StartPointX smallint(6) not null comment '?w?E?????u?w'
1802
  , StartPointY smallint(6) not null comment '?w?E?????u?x'
1803
  , CurrentPointX smallint(6) not null comment '??????u?w'
1804
  , CurrentPointY smallint(6) not null comment '??????u?x'
1805
  , CurrentWidth smallint(6) not null comment '?\???T?C?YWidth'
1806
  , CurrentHeight smallint(6) not null comment '?\???T?C?YHeigth'
1807
  , EntryDate datetime not null comment '?o?^???t'
1808
  , UpdateDate datetime not null comment '?X?V???t'
1809
  , constraint pointingoutcomment_PKC primary key (ConstructionCode,ProcessNo,SeqNo)
1810
) comment '?w???????f?[?^' ;
1811

1812
-- ?????????????c???^?f?[?^
1813
drop table if exists proceedingsdata cascade;
1814

1815
create table proceedingsdata (
1816
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1817
  , ProceedingsDataDate date not null comment '?c???^????'
1818
  , StartMeetingTime decimal(4,0) unsigned not null comment '??c????J?n'
1819
  , EndMeetingTime decimal(4,0) unsigned not null comment '??c????I??'
1820
  , CreatorCode decimal(8,0) not null comment '????R?[?h'
1821
  , PalceFlag decimal(1,0) not null comment '???n?t???O'
1822
  , MeetingPalce varchar(120) comment '???????'
1823
  , EntryDate datetime not null comment '?o?^???t'
1824
  , UpdateDate datetime not null comment '?X?V???t'
1825
  , constraint proceedingsdata_PKC primary key (ConstructionCode,ProceedingsDataDate,StartMeetingTime)
1826
) comment '?????????????c???^?f?[?^' ;
1827

1828
-- ?????????????c???^?f?[?^?i?o???j
1829
drop table if exists proceedingsdataattend cascade;
1830

1831
create table proceedingsdataattend (
1832
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1833
  , ProceedingsDataDate date not null comment '?c???^????'
1834
  , StartMeetingTime decimal(4,0) unsigned not null comment '??c????J?n'
1835
  , SeqNo decimal(3,0) unsigned not null comment '????s???'
1836
  , Department varchar(20) comment '?o??????'
1837
  , AttendName varchar(10) comment '?o??????'
1838
  , EntryDate datetime not null comment '?o?^???t'
1839
  , UpdateDate datetime not null comment '?X?V???t'
1840
  , constraint proceedingsdataattend_PKC primary key (ConstructionCode,ProceedingsDataDate,StartMeetingTime,SeqNo)
1841
) comment '?????????????c???^?f?[?^?i?o???j' ;
1842

1843
-- ?????????????c???^?f?[?^?i????j
1844
drop table if exists proceedingsdatadetail cascade;
1845

1846
create table proceedingsdatadetail (
1847
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1848
  , ProceedingsDataDate date not null comment '?c???^????'
1849
  , StartMeetingTime decimal(4,0) unsigned not null comment '??c????J?n'
1850
  , SeqNo decimal(3,0) unsigned not null comment '????s???'
1851
  , TitleNo varchar(5) comment '?c????'
1852
  , Title varchar(20) comment '?c??'
1853
  , ContentsText varchar(50) comment '???e'
1854
  , EntryDate datetime not null comment '?o?^???t'
1855
  , UpdateDate datetime not null comment '?X?V???t'
1856
  , constraint proceedingsdatadetail_PKC primary key (ConstructionCode,ProceedingsDataDate,StartMeetingTime,SeqNo)
1857
) comment '?????????????c???^?f?[?^?i????j' ;
1858

1859
-- ???F?f?[?^
1860
drop table if exists processapproval cascade;
1861

1862
create table processapproval (
1863
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1864
  , ApprovalCode decimal(3,0) unsigned not null comment '???F?@?\???'
1865
  , OrderNo decimal(2,0) unsigned not null comment '??t???'
1866
  , SeqNo decimal(2,0) not null comment '?}??'
1867
  , PersonCode decimal(8,0) unsigned not null comment '?\???E???F??R?[?h'
1868
  , PetitionApprovalDate datetime not null comment '?\???E???F???t'
1869
  , ApprovalLimitDates datetime not null comment '???F??]??'
1870
  , ApprovalStatus decimal(1,0) not null comment '???F???'
1871
  , InputComment varchar(300) comment '?R?????g'
1872
  , EntryDate datetime not null comment '?o?^???t'
1873
  , UpdateDate datetime not null comment '?X?V???t'
1874
  , constraint processapproval_PKC primary key (ConstructionCode,ApprovalCode,OrderNo,SeqNo)
1875
) comment '???F?f?[?^' ;
1876

1877
-- ???F?R?????g?f?[?^
1878
drop table if exists processapprovalcomment cascade;
1879

1880
create table processapprovalcomment (
1881
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1882
  , ApprovalCode decimal(3,0) unsigned not null comment '???F?@?\???'
1883
  , OrderNo decimal(2,0) unsigned not null comment '??t???'
1884
  , CommentNo decimal(2,0) not null comment '?R?????g???'
1885
  , ParentNo decimal(2,0) not null comment '?e?R?????g???'
1886
  , ApproValComment varchar(300) comment '?w???E?A???R?????g'
1887
  , EntryDate datetime not null comment '?o?^???t'
1888
  , UpdateDate datetime not null comment '?X?V???t'
1889
  , constraint processapprovalcomment_PKC primary key (ConstructionCode,ApprovalCode,OrderNo,CommentNo)
1890
) comment '???F?R?????g?f?[?^' ;
1891

1892
-- ???F????f?[?^
1893
drop table if exists processapprovaldetail cascade;
1894

1895
create table processapprovaldetail (
1896
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1897
  , ApprovalCode decimal(3,0) unsigned not null comment '???F?@?\???'
1898
  , OrderNo decimal(2,0) unsigned not null comment '??t???'
1899
  , SerialNo decimal(2,0) unsigned not null comment '?}??'
1900
  , LinkCode decimal(10,0) not null comment '?????N???'
1901
  , EntryDate datetime not null comment '?o?^???t'
1902
  , UpdateDate datetime not null comment '?X?V???t'
1903
  , constraint processapprovaldetail_PKC primary key (ConstructionCode,ApprovalCode,OrderNo,SerialNo)
1904
) comment '???F????f?[?^' ;
1905

1906
-- ?N?????}?X?^
1907
drop table if exists processexcutemaster cascade;
1908

1909
create table processexcutemaster (
1910
  SecCode decimal(2,0) unsigned not null comment '???????'
1911
  , ExecCode decimal(4,0) unsigned not null comment '?N?????????'
1912
  , EditFlg decimal(1,0) not null comment '??W?t???O'
1913
  , EntryDate datetime not null comment '?o?^???t'
1914
  , UpdateDate datetime not null comment '?X?V???t'
1915
  , constraint processexcutemaster_PKC primary key (SecCode,ExecCode)
1916
) comment '?N?????}?X?^' ;
1917

1918
create index ProcessExcuteMaster_Index1
1919
  on processexcutemaster(SecCode);
1920

1921
create index ProcessExcuteMaster_Index2
1922
  on processexcutemaster(ExecCode);
1923

1924
-- ???????f?[?^
1925
drop table if exists purchaseorder cascade;
1926

1927
create table purchaseorder (
1928
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1929
  , SeqNo decimal(3,0) unsigned not null comment '???????}??'
1930
  , CompanyCode decimal(8,0) not null comment '??????R?[?h'
1931
  , CreateDate date comment '?????t'
1932
  , OrderPrice decimal(12,0) not null comment '???????z'
1933
  , LastRowStringDate date not null comment '??I?s?\?????t'
1934
  , OrderSheetType decimal(1,0) not null comment '???E?{???t???O'
1935
  , PaymentTerms decimal(1,0) not null comment '?x????????'
1936
  , CashRatio decimal(4,1) not null comment '?????????i???j'
1937
  , BillPeriod decimal(4,0) not null comment '??`????'
1938
  , PrePayments decimal(1,0) not null comment '?O????'
1939
  , PrePaymentsDays decimal(3,0) not null comment '?O????????'
1940
  , PrePaymentsPrice decimal(12,0) not null comment '?O???????z'
1941
  , PartialPayment decimal(1,0) not null comment '??????'
1942
  , PartialPaymentMounth decimal(2,0) unsigned not null comment '???????????'
1943
  , PartialPaymentDay1 decimal(2,0) unsigned not null comment '???????????'
1944
  , PartialPaymentDay2 decimal(2,0) unsigned not null comment '???????x????'
1945
  , PartialPaymentPrice decimal(12,0) not null comment '?????????z'
1946
  , CompletionPayment decimal(1,0) not null comment '???n??????x??'
1947
  , CompletionPaymentDays decimal(3,0) unsigned not null comment '???n??????x??????'
1948
  , CompletionPaymentPrice decimal(12,0) not null comment '???n??????x?????z'
1949
  , LeadEngineerCode decimal(8,0) comment '??C?Z?p??R?[?h'
1950
  , LeadEngineerName varchar(60) comment '??C?Z?p???'
1951
  , SafetyOfficerCode decimal(8,0) comment '???S?????R?[?h'
1952
  , SafetyOfficerName varchar(60) comment '???S??????'
1953
  , WorkersCount decimal(3,0) unsigned comment '??????'
1954
  , PrintoutDate date not null comment '????N????'
1955
  , EntryDate datetime not null comment '?o?^???t'
1956
  , UpdateDate datetime not null comment '?X?V???t'
1957
  , constraint purchaseorder_PKC primary key (ConstructionCode,SeqNo)
1958
) comment '???????f?[?^' ;
1959

1960
-- ?????????t?f?[?^
1961
drop table if exists purchaseorderdate cascade;
1962

1963
create table purchaseorderdate (
1964
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1965
  , SeqNo decimal(3,0) unsigned not null comment '???????}??'
1966
  , CompanyCode decimal(8,0) not null comment '??????R?[?h'
1967
  , SendDate date not null comment '???????X????'
1968
  , ReturnDate date not null comment '???????????'
1969
  , ReturnCheckDate date not null comment '??????????m?F??'
1970
  , EntryDate datetime not null comment '?o?^???t'
1971
  , UpdateDate datetime not null comment '?X?V???t'
1972
  , constraint purchaseorderdate_PKC primary key (ConstructionCode,SeqNo)
1973
) comment '?????????t?f?[?^' ;
1974

1975
-- ??????????f?[?^
1976
drop table if exists purchaseorderdetail cascade;
1977

1978
create table purchaseorderdetail (
1979
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1980
  , SeqNo decimal(3,0) unsigned not null comment '???????}??'
1981
  , GroupCount decimal(1,0) not null comment '?O???[?v???'
1982
  , LineCount decimal(3,0) unsigned not null comment '?s???'
1983
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
1984
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
1985
  , FirstString varchar(120) comment '?H??E?i??'
1986
  , SecondString varchar(120) comment '???e????'
1987
  , UnitCount decimal(8,2) not null comment '????'
1988
  , UnitName varchar(30) comment '?P??'
1989
  , UnitPrice decimal(10,0) not null comment '?P??'
1990
  , OrdersLinePrice decimal(12,0) comment '???z'
1991
  , SourceCode decimal(10,0) unsigned not null comment '???H?????'
1992
  , SourceDetailCnt decimal(4,0) unsigned not null comment '????????'
1993
  , DataTypeFlag decimal(1,0) unsigned not null comment '?f?[?^?^?C?v?t???O'
1994
  , StatutoryWelfareRate decimal(4,2) not null comment '?@???????'
1995
  , EntryDate datetime not null comment '?o?^???t'
1996
  , UpdateDate datetime not null comment '?X?V???t'
1997
  , constraint purchaseorderdetail_PKC primary key (ConstructionCode,SeqNo,GroupCount,LineCount)
1998
) comment '??????????f?[?^' ;
1999

2000
create index POrderDetail_Index1
2001
  on purchaseorderdetail(SourceCode);
2002

2003
-- ???R?[?h??????
2004
drop table if exists recordkey cascade;
2005

2006
create table recordkey (
2007
  KeyNo decimal(2,0) unsigned not null comment '?L?[?R?[?h'
2008
  , RecordNumber decimal(6,0) unsigned not null comment '???R?[?h???'
2009
  , EntryDate datetime not null comment '?o?^???t'
2010
  , UpdateDate datetime not null comment '?X?V???t'
2011
  , constraint recordkey_PKC primary key (KeyNo,RecordNumber)
2012
) comment '???R?[?h??????' ;
2013

2014
-- ?????f?[?^
2015
drop table if exists requestdata cascade;
2016

2017
create table requestdata (
2018
  REQUESTNO decimal(9,0) not null comment '????No'
2019
  , MAINCONSTRUCTIONCODE decimal(10,0) not null comment '?{?H?????'
2020
  , CONSTRUCTIONNAME varchar(120) not null comment '?H??????'
2021
  , CONTRACTAMOUNT decimal(10,0) not null comment '???????z'
2022
  , PAIDAMOUNT decimal(10,0) not null comment '????????z'
2023
  , REQUESTAMOUNT0 decimal(10,0) not null comment '???????z?O'
2024
  , REQUESTAMOUNT1 decimal(10,0) not null comment '???????z?P'
2025
  , REQUESTAMOUNT2 decimal(10,0) comment '???????z?Q'
2026
  , REQUESTAMOUNT3 decimal(10,0) comment '???????z?R'
2027
  , REQUESTAMOUNT4 decimal(10,0) comment '???????z?S'
2028
  , REQUESTAMOUNT5 decimal(10,0) comment '???????z?T'
2029
  , REQUESTAMOUNT6 decimal(10,0) comment '???????z?U'
2030
  , UNCLAIMEDAMOUNT decimal(10,0) not null comment '?????c???z'
2031
  , UNPAIDAMOUNT decimal(10,0) not null comment '?????????z'
2032
  , TAXAMOUNT decimal(10,0) not null comment '?????'
2033
  , NOTE varchar(120) not null comment '???l'
2034
  , ENTRYDATE datetime not null comment '?o?^?N????'
2035
  , UPDATEDATE datetime not null comment '?X?V?N????'
2036
  , constraint requestdata_PKC primary key (REQUESTNO,MAINCONSTRUCTIONCODE)
2037
) comment '?????f?[?^' ;
2038

2039
-- ?????f?[?^????
2040
drop table if exists requestdatadetail cascade;
2041

2042
create table requestdatadetail (
2043
  REQUESTNO decimal(9,0) not null comment '????No'
2044
  , MAINCONSTRUCTIONCODE decimal(10,0) not null comment '?{?H?????'
2045
  , CONSTRUCTIONCODE decimal(10,0) not null comment '?H?????'
2046
  , CONSTRUCTIONKIND decimal(1,0) not null comment '?H????'
2047
  , REQUESTAMOUNT decimal(10,0) not null comment '???????z'
2048
  , TAXAMOUNT decimal(10,0) not null comment '?????'
2049
  , ENTRYDATE datetime not null comment '?o?^?N????'
2050
  , UPDATEDATE datetime not null comment '?X?V?N????'
2051
  , constraint requestdatadetail_PKC primary key (REQUESTNO,MAINCONSTRUCTIONCODE,CONSTRUCTIONCODE,CONSTRUCTIONKIND)
2052
) comment '?????f?[?^????' ;
2053

2054
-- ?????w?b?_
2055
drop table if exists requesthead cascade;
2056

2057
create table requesthead (
2058
  REQUESTNO decimal(9,0) not null comment '????No'
2059
  , REQCONSTRUCTIONCODE decimal(10,0) not null comment '?????H?????'
2060
  , ORDERNO decimal(2,0) not null comment '??t???'
2061
  , REQUESTMONTH decimal(6,0) not null comment '??????'
2062
  , ORDERERSDIVISION decimal(5,0) not null comment '???????'
2063
  , ORDERERSCODE decimal(5,0) not null comment '??????R?[?h'
2064
  , ORDERERSNAME varchar(120) not null comment '???????'
2065
  , REQCONSTRUCTIONNAME varchar(120) not null comment '?????H??????'
2066
  , REQUESTTOTALAMOUNT decimal(10,0) not null comment '???????z???v'
2067
  , REQUESTAMOUNT decimal(10,0) not null comment '???????z'
2068
  , TAXAMOUNT decimal(10,0) not null comment '?????'
2069
  , UNPAIDAMOUNT decimal(10,0) comment '??????'
2070
  , NOTE varchar(120) comment '???l'
2071
  , ASSIGNEDFLG decimal(1,0) comment '??????t???O'
2072
  , INVOICENO decimal(9,0) not null comment '??????No'
2073
  , ENTRYDATE datetime not null comment '?o?^?N????'
2074
  , UPDATEDATE datetime not null comment '?X?V?N????'
2075
  , constraint requesthead_PKC primary key (REQUESTNO)
2076
) comment '?????w?b?_' ;
2077

2078
alter table requesthead add unique REQCONSTRUCTIONCODE (REQCONSTRUCTIONCODE,ORDERNO) ;
2079

2080
-- ?????????t?f?[?^
2081
drop table if exists requestorderdate cascade;
2082

2083
create table requestorderdate (
2084
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
2085
  , InvoiceNo decimal(9,0) not null comment '??????No'
2086
  , SendDate date not null comment '???????????X????'
2087
  , EntryDate datetime not null comment '?o?^???t'
2088
  , UpdateDate datetime not null comment '?X?V???t'
2089
  , constraint requestorderdate_PKC primary key (ConstructionCode,InvoiceNo)
2090
) comment '?????????t?f?[?^' ;
2091

2092
-- ????O???t?f?[?^
2093
drop table if exists salesgraphdata cascade;
2094

2095
create table salesgraphdata (
2096
  GraphDataCode decimal(8,0) not null comment '?O???t?f?[?^?R?[?h'
2097
  , ConstructionPeriod decimal(4,0) unsigned not null comment '?????'
2098
  , SalesDataDays date not null comment '????N??'
2099
  , DisplayOrder decimal(8,0) unsigned not null comment '?\????'
2100
  , DataName varchar(100) not null comment '?f?[?^?\??????'
2101
  , SalesAmount decimal(10,0) not null comment '????f?[?^'
2102
  , AdministrativeExpense decimal(10,0) not null comment '???E?????o??'
2103
  , GrossProfit decimal(10,0) not null comment '?e???v'
2104
  , NetIncome decimal(10,0) not null comment '?????v(???v)'
2105
  , EntryDate datetime not null comment '?o?^???t'
2106
  , UpdateDate datetime not null comment '?X?V???t'
2107
  , constraint salesgraphdata_PKC primary key (GraphDataCode,ConstructionPeriod,SalesDataDays)
2108
) comment '????O???t?f?[?^' ;
2109

2110
create index SalesGraphData_Idx1
2111
  on salesgraphdata(DisplayOrder);
2112

2113
create index SalesGraphData_idx2
2114
  on salesgraphdata(ConstructionPeriod);
2115

2116
-- ?????}?X?^
2117
drop table if exists securitymaster cascade;
2118

2119
create table securitymaster (
2120
  SecCode decimal(2,0) unsigned not null comment '???????'
2121
  , DisplayOrder decimal(2,0) not null comment '?\????'
2122
  , SecName varchar(60) not null comment '????????'
2123
  , SecRank decimal(1,0) not null comment '?????????N'
2124
  , SecRange decimal(1,0) not null comment '???????'
2125
  , GeneralAffairs decimal(1,0) not null comment '????????t???O'
2126
  , SelectBackColor varchar(8) not null comment '?I??w?i?F'
2127
  , EntryDate datetime not null comment '?o?^???t'
2128
  , UpdateDate datetime not null comment '?X?V???t'
2129
  , constraint securitymaster_PKC primary key (SecCode)
2130
) comment '?????}?X?^' ;
2131

2132
create index SecurityMaster_Index1
2133
  on securitymaster(DisplayOrder);
2134

2135
create index SecurityMaster_Index2
2136
  on securitymaster(SecRank);
2137

2138
create index SecurityMaster_Index3
2139
  on securitymaster(SecRange);
2140

2141
-- ???S?p?g???[???f?[?^
2142
drop table if exists sfpdata cascade;
2143

2144
create table sfpdata (
2145
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
2146
  , DataCount decimal(2,0) unsigned not null comment '?p?g???[????'
2147
  , RequestDate datetime not null comment '?p?g???[???v??????'
2148
  , PersonCode decimal(8,0) unsigned not null comment '?\????R?[?h'
2149
  , StringValue varchar(300) comment '?R?????g'
2150
  , OrderNo decimal(2,0) unsigned not null comment '?\????t???'
2151
  , EntryDate datetime not null comment '?o?^???t'
2152
  , UpdateDate datetime not null comment '?X?V???t'
2153
  , constraint sfpdata_PKC primary key (ConstructionCode,DataCount)
2154
) comment '???S?p?g???[???f?[?^' ;
2155

2156
create index SFPData_Index1
2157
  on sfpdata(RequestDate);
2158

2159
-- ???S?p?g???[??????f?[?^
2160
drop table if exists sfpdatadetail cascade;
2161

2162
create table sfpdatadetail (
2163
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
2164
  , DataCount decimal(2,0) unsigned not null comment '?p?g???[????'
2165
  , SeqNo decimal(2,0) unsigned not null comment '?f?[?^?}??'
2166
  , CompanyCode decimal(8,0) unsigned not null comment '??????R?[?h'
2167
  , EntryDate datetime not null comment '?o?^???t'
2168
  , UpdateDate datetime not null comment '?X?V???t'
2169
  , constraint sfpdatadetail_PKC primary key (ConstructionCode,DataCount,SeqNo)
2170
) comment '???S?p?g???[??????f?[?^' ;
2171

2172
-- ??????{?H?H??o?^?\???f?[?^
2173
drop table if exists subconstrjobitemregist cascade;
2174

2175
create table subconstrjobitemregist (
2176
  PersonCode decimal(8,0) unsigned not null comment '?\??????'
2177
  , CreateDate date not null comment '????'
2178
  , SeqNo decimal(2,0) unsigned not null comment '?\???A??'
2179
  , DisplayOrder decimal(8,0) unsigned not null comment '?\????'
2180
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
2181
  , EntryDate datetime not null comment '?o?^???t'
2182
  , UpdateDate datetime not null comment '?X?V???t'
2183
  , constraint subconstrjobitemregist_PKC primary key (PersonCode,CreateDate,SeqNo,DisplayOrder)
2184
) comment '??????{?H?H??o?^?\???f?[?^' ;
2185

2186
-- ??????E?????N?o?^?\???f?[?^
2187
drop table if exists subconstrjoblinkregist cascade;
2188

2189
create table subconstrjoblinkregist (
2190
  PersonCode decimal(8,0) unsigned not null comment '?\??????'
2191
  , CreateDate date not null comment '????'
2192
  , SeqNo decimal(2,0) unsigned not null comment '?\???A??'
2193
  , DisplayOrder decimal(8,0) unsigned not null comment '?\????'
2194
  , JobCategoryCode decimal(5,0) not null comment '?E??L?['
2195
  , EntryDate datetime not null comment '?o?^???t'
2196
  , UpdateDate datetime not null comment '?X?V???t'
2197
  , constraint subconstrjoblinkregist_PKC primary key (PersonCode,CreateDate,SeqNo,DisplayOrder)
2198
) comment '??????E?????N?o?^?\???f?[?^' ;
2199

2200
-- ??????o?^?\???f?[?^
2201
drop table if exists subconstrregist cascade;
2202

2203
create table subconstrregist (
2204
  PersonCode decimal(8,0) unsigned not null comment '?\??????'
2205
  , CreateDate date not null comment '????'
2206
  , SeqNo decimal(2,0) unsigned not null comment '?\???A??'
2207
  , DataMode decimal(1,0) comment '?f?[?^??'
2208
  , SourceCode decimal(8,0) not null comment '??????R?[?h'
2209
  , PetitionPeriod decimal(4,0) unsigned not null comment '?\???N?x'
2210
  , CorporateStatusName varchar(40) comment '?@?l?i????'
2211
  , CorporateStatusPoint decimal(1,0) not null comment '?@?l?i?????u'
2212
  , CompanyName varchar(100) not null comment '???????'
2213
  , CEOPositionName varchar(60) comment '??\???E??'
2214
  , CEOName varchar(60) comment '??\?????'
2215
  , ContactPersonName varchar(60) comment '?S???????'
2216
  , ZipCode varchar(8) comment '?X????'
2217
  , Address1 varchar(60) comment '?Z???P'
2218
  , Address2 varchar(60) comment '?Z??2'
2219
  , Address3 varchar(60) comment '?Z??3'
2220
  , CellPhoneNumber varchar(13) comment '?g??d?b???'
2221
  , MailAddress varchar(257) comment '???[???A?h???X'
2222
  , PhoneNumber varchar(13) comment '?d?b???'
2223
  , FaxNumber varchar(13) comment 'FAX???'
2224
  , JapaneseSyllabary varchar(2) comment '50?????'
2225
  , StartDate date not null comment '????J?n?N????'
2226
  , Note varchar(300) comment '???l'
2227
  , labourKind decimal(1,0) not null comment '?x???????E????'
2228
  , OrderDate date comment '?\????'
2229
  , OrderNo decimal(2,0) unsigned not null comment '?\????t???'
2230
  , EntryDate datetime not null comment '?o?^???t'
2231
  , UpdateDate datetime not null comment '?X?V???t'
2232
  , constraint subconstrregist_PKC primary key (PersonCode,CreateDate,SeqNo)
2233
) comment '??????o?^?\???f?[?^' ;
2234

2235
-- ??????H??}?X?^
2236
drop table if exists subcontractoritemmaster cascade;
2237

2238
create table subcontractoritemmaster (
2239
  ItemCode decimal(5,0) unsigned not null comment '?H??L?['
2240
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2241
  , ItemName varchar(120) not null comment '?H????'
2242
  , DeleteFlg decimal(1,0) not null comment '???t???O'
2243
  , EntryDate datetime not null comment '?o?^???t'
2244
  , UpdateDate datetime not null comment '?X?V???t'
2245
  , constraint subcontractoritemmaster_PKC primary key (ItemCode)
2246
) comment '??????H??}?X?^' ;
2247

2248
-- ??????E??}?X?^
2249
drop table if exists subcontractorjobcategory cascade;
2250

2251
create table subcontractorjobcategory (
2252
  JobCategoryCode decimal(5,0) not null comment '?E??L?['
2253
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2254
  , JobCategoryName varchar(120) not null comment '?E????'
2255
  , DeleteFlg decimal(1,0) not null comment '???t???O'
2256
  , EntryDate datetime not null comment '?o?^???t'
2257
  , UpdateDate datetime not null comment '?X?V???t'
2258
  , constraint subcontractorjobcategory_PKC primary key (JobCategoryCode)
2259
) comment '??????E??}?X?^' ;
2260

2261
-- ??????{?H?H??f?[?^
2262
drop table if exists subcontractorjobitem cascade;
2263

2264
create table subcontractorjobitem (
2265
  CompanyCode decimal(8,0) not null comment '??????R?[?h'
2266
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
2267
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2268
  , EntryDate datetime not null comment '?o?^???t'
2269
  , UpdateDate datetime not null comment '?X?V???t'
2270
  , constraint subcontractorjobitem_PKC primary key (CompanyCode,ItemCode)
2271
) comment '??????{?H?H??f?[?^' ;
2272

2273
create index SubContractorJobItem_Index1
2274
  on subcontractorjobitem(CompanyCode);
2275

2276
create index SubContractorJobItem_Index2
2277
  on subcontractorjobitem(ItemCode);
2278

2279
-- ??????E?????N?}?X?^
2280
drop table if exists subcontractorjoblink cascade;
2281

2282
create table subcontractorjoblink (
2283
  CompanyCode decimal(8,0) not null comment '??????R?[?h'
2284
  , JobCategoryCode decimal(5,0) not null comment '?E??L?['
2285
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2286
  , EntryDate datetime not null comment '?o?^???t'
2287
  , UpdateDate datetime not null comment '?X?V???t'
2288
  , constraint subcontractorjoblink_PKC primary key (CompanyCode,JobCategoryCode)
2289
) comment '??????E?????N?}?X?^' ;
2290

2291
create index SubContractorJobLink_Index1
2292
  on subcontractorjoblink(CompanyCode);
2293

2294
create index SubContractorJobLink_Index2
2295
  on subcontractorjoblink(JobCategoryCode);
2296

2297
-- ??????}?X?^
2298
drop table if exists subcontractormaster cascade;
2299

2300
create table subcontractormaster (
2301
  CompanyCode decimal(8,0) not null comment '??????R?[?h'
2302
  , DisplayOrder decimal(8,0) unsigned not null comment '?\????'
2303
  , CorporateStatusName varchar(40) comment '?@?l?i????'
2304
  , CorporateStatusPoint decimal(1,0) not null comment '?@?l?i?????u'
2305
  , CompanyName varchar(100) not null comment '???????'
2306
  , CEOPositionName varchar(60) comment '??\???E??'
2307
  , CEOName varchar(60) comment '??\?????'
2308
  , ContactPersonName varchar(60) comment '?S???????'
2309
  , ZipCode varchar(8) comment '?X????'
2310
  , Address1 varchar(60) comment '?Z???P'
2311
  , Address2 varchar(60) comment '?Z??2'
2312
  , Address3 varchar(60) comment '?Z??3'
2313
  , CellPhoneNumber varchar(13) comment '?g??d?b???'
2314
  , MailAddress varchar(257) comment '???[???A?h???X'
2315
  , PhoneNumber varchar(13) comment '?d?b???'
2316
  , FaxNumber varchar(13) comment 'FAX???'
2317
  , JapaneseSyllabary varchar(2) comment '50?????'
2318
  , StartDate date not null comment '????J?n?N????'
2319
  , Note varchar(300) comment '???l'
2320
  , labourKind decimal(1,0) not null comment '?x???????E????'
2321
  , DeleteFlg decimal(1,0) default '0' not null comment '???t???O'
2322
  , EntryDate datetime not null comment '?o?^???t'
2323
  , UpdateDate datetime not null comment '?X?V???t'
2324
  , constraint subcontractormaster_PKC primary key (CompanyCode)
2325
) comment '??????}?X?^' ;
2326

2327
create index SubContractorMaster_Index1
2328
  on subcontractormaster(JapaneseSyllabary);
2329

2330
-- ?d????}?X?^
2331
drop table if exists suppliersmaster cascade;
2332

2333
create table suppliersmaster (
2334
  SuppliersCode decimal(5,0) unsigned not null comment '?d????R?[?h'
2335
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2336
  , SuppliersName1 varchar(60) not null comment '?d????1'
2337
  , SuppliersName2 varchar(60) comment '?d?????Q'
2338
  , ZipCode varchar(8) comment '?X????'
2339
  , Address1 varchar(60) comment '?Z???P'
2340
  , Address2 varchar(60) comment '?Z??2'
2341
  , Address3 varchar(60) comment '?Z??3'
2342
  , PhoneNumber varchar(13) comment '?d?b???'
2343
  , FaxNumber varchar(13) comment 'FAX???'
2344
  , Note varchar(300) comment '???l'
2345
  , DeleteFlg decimal(1,0) not null comment '???t???O'
2346
  , EntryDate datetime not null comment '?o?^???t'
2347
  , UpdateDate datetime not null comment '?X?V???t'
2348
  , constraint suppliersmaster_PKC primary key (SuppliersCode)
2349
) comment '?d????}?X?^' ;
2350

2351
-- ?V?X?e???N???m?F?f?[?^
2352
drop table if exists systemexecute cascade;
2353

2354
create table systemexecute (
2355
  PrimaryCode tinyint(4) not null comment '?L?[????'
2356
  , TargetDate date not null comment '?N?????t'
2357
  , SystemVersion int(11) not null comment '?{??E????o?[?W????'
2358
  , UpDateCopyVersion int(11) not null comment '?R?s?[?o?[?W????'
2359
  , EntryDate datetime not null comment '?o?^???t'
2360
  , UpdateDate datetime not null comment '?X?V???t'
2361
  , constraint systemexecute_PKC primary key (PrimaryCode)
2362
) comment '?V?X?e???N???m?F?f?[?^' ;
2363

2364
-- ????}?X?^
2365
drop table if exists systemmaster cascade;
2366

2367
create table systemmaster (
2368
  SystemCode decimal(3,0) unsigned not null comment '???R?[?h'
2369
  , CompanyName1 varchar(60) not null comment '?????P'
2370
  , CompanyName2 varchar(60) comment '?????Q'
2371
  , CEOName varchar(60) not null comment '??\?????'
2372
  , CEOPositionName varchar(60) comment '??\???E??'
2373
  , ZipCode varchar(8) not null comment '?X????'
2374
  , Address1 varchar(60) not null comment '?Z???P'
2375
  , Address2 varchar(60) comment '?Z??2'
2376
  , Address3 varchar(60) comment '?Z??3'
2377
  , PhoneNumber varchar(13) not null comment '?d?b???'
2378
  , FaxNumber varchar(13) comment 'FAX???'
2379
  , HomePageURL varchar(120) comment '?z?[???y?[?WURL'
2380
  , ConsumptionTax decimal(4,2) not null comment '?????'
2381
  , CooperationRate decimal(4,2) not null comment '???????'
2382
  , StatutoryWelfareRate decimal(4,2) not null comment '?@???????'
2383
  , FuelPrice decimal(5,2) not null comment '?R???L???P??'
2384
  , AreaDistance decimal(5,2) not null comment '????u????????'
2385
  , ExcelSavePath varchar(120) comment 'Excel????p?X'
2386
  , BusinessPeriod smallint(6) not null comment '????c?????'
2387
  , ConstrYear smallint(6) not null comment '????H???N?x'
2388
  , BusinessBeginDate datetime not null comment '?c????????'
2389
  , ConstrBeginDate datetime not null comment '?H???N?x?????'
2390
  , BusinessCompDate datetime not null comment '?c?????????'
2391
  , ConstrCompDate datetime not null comment '?H???N?x??????'
2392
  , ConstructionNoBase decimal(1,0) not null comment '?H????????l'
2393
  , SloganString1 varchar(100) comment '?W??1'
2394
  , SloganString2 varchar(100) comment '?W??2'
2395
  , SloganString3 varchar(100) comment '?W??3'
2396
  , EntryDate datetime not null comment '?o?^???t'
2397
  , UpdateDate datetime not null comment '?X?V???t'
2398
  , constraint systemmaster_PKC primary key (SystemCode)
2399
) comment '????}?X?^' ;
2400

2401
-- ?????}?X?^
2402
drop table if exists termmaster cascade;
2403

2404
create table termmaster (
2405
  ConstructionStatusFlg decimal(2,0) not null comment '?H?????t???O'
2406
  , FieldNo decimal(2,0) not null comment '?`?F?b?N???t?B?[???h???'
2407
  , SeqNo decimal(2,0) not null comment '?}??'
2408
  , DisplayOrder decimal(2,0) not null comment '?\????'
2409
  , CheckSchdule decimal(1,0) not null comment '?`?F?b?N?^?C?~???O'
2410
  , TermDays decimal(3,0) not null comment '?o???'
2411
  , SendTitile varchar(100) comment '?^?C?g??'
2412
  , SendMessage varchar(100) comment '???b?Z?[?W'
2413
  , BackColor varchar(8) comment '?w?i?F'
2414
  , ForeColor varchar(8) comment '?????F'
2415
  , EntryDate datetime not null comment '?o?^???t'
2416
  , UpdateDate datetime not null comment '?X?V???t'
2417
  , constraint termmaster_PKC primary key (ConstructionStatusFlg,FieldNo,SeqNo)
2418
) comment '?????}?X?^' ;
2419

2420
create index TermMaster_Index1
2421
  on termmaster(DisplayOrder);
2422

2423
-- ?o?????f?[?^
2424
drop table if exists tranceportdailydata cascade;
2425

2426
create table tranceportdailydata (
2427
  PersonCode decimal(8,0) unsigned not null comment '????R?[?h'
2428
  , AttendanceDate date not null comment '???????'
2429
  , StartDistance decimal(7,1) not null comment '?????o???L????'
2430
  , ComplateDistance decimal(7,1) not null comment '?????I???L????'
2431
  , TotalDistance decimal(6,1) not null comment '???????v?L????'
2432
  , OfficeGoFlg decimal(1,0) not null comment '???????o??t???O'
2433
  , OfficeOutFlg decimal(1,0) not null comment '???????A??t???O'
2434
  , TrancePayGoFlg decimal(1,0) not null comment '?L?????o??t???O'
2435
  , TrancePayOutFlg decimal(1,0) not null comment '?L?????A??t???O'
2436
  , WareHouseFlg decimal(1,0) not null comment '????u??t???O'
2437
  , EntryDate datetime not null comment '?o?^???t'
2438
  , UpdateDate datetime not null comment '?X?V???t'
2439
  , constraint tranceportdailydata_PKC primary key (PersonCode,AttendanceDate)
2440
) comment '?o?????f?[?^' ;
2441

2442
create index TranceportDailyData_Index1
2443
  on tranceportdailydata(AttendanceDate);
2444

2445
-- ?H?????o???}?X?^
2446
drop table if exists typeexpensesmaster cascade;
2447

2448
create table typeexpensesmaster (
2449
  TypeCode decimal(5,0) unsigned not null comment '?H?????R?[?h'
2450
  , ExpensesPeriod smallint(6) not null comment '?????'
2451
  , NameCode decimal(5,0) unsigned not null comment '?o????R?[?h'
2452
  , ExpensesRaito decimal(4,2) not null comment '?o??'
2453
  , DeleteFlg decimal(1,0) not null comment '???t???O'
2454
  , EntryDate datetime not null comment '?o?^???t'
2455
  , UpdateDate datetime not null comment '?X?V???t'
2456
  , constraint typeexpensesmaster_PKC primary key (TypeCode,ExpensesPeriod,NameCode)
2457
) comment '?H?????o???}?X?^' ;
2458

2459
-- ?P??}?X?^
2460
drop table if exists unitmaster cascade;
2461

2462
create table unitmaster (
2463
  UnitKey decimal(5,0) unsigned not null comment '?P??L?['
2464
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2465
  , UnitName varchar(30) not null comment '?P?????'
2466
  , EntryDate datetime not null comment '?o?^???t'
2467
  , UpdateDate datetime not null comment '?X?V???t'
2468
  , constraint unitmaster_PKC primary key (UnitKey)
2469
) comment '?P??}?X?^' ;
2470

2471
create index UnitMaster_Index1
2472
  on unitmaster(DisplayOrder);
2473

2474
-- ????}?X?^
2475
drop table if exists vehiclemaster cascade;
2476

2477
create table vehiclemaster (
2478
  VehicleCode decimal(5,0) unsigned not null comment '????R?[?h'
2479
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2480
  , VehicleName varchar(100) not null comment '???????'
2481
  , RegistrationNumber varchar(30) comment '?o?^???'
2482
  , IdentificationNumber varchar(30) comment '?????'
2483
  , ModelCode varchar(30) comment '?^??'
2484
  , DepartmentCode decimal(5,0) unsigned not null comment '???????'
2485
  , VehicleScheduleFlg decimal(1,0) not null comment '????\??\???t???O'
2486
  , PurchaseDate date comment '?w????'
2487
  , PurchaseName varchar(30) comment '?w????'
2488
  , PurchaseContactPersons varchar(30) comment '?w????S????'
2489
  , PurchasePhone varchar(13) comment '?w????d?b???'
2490
  , LeaseDate date comment '???[?X?J?n??'
2491
  , LeaseDestination varchar(30) comment '???[?X??'
2492
  , LeaseContactPersons varchar(30) comment '???[?X??S????'
2493
  , LeasePhone varchar(13) comment '???[?X??d?b???'
2494
  , InsuranceCompany varchar(30) comment '?C???????'
2495
  , InsuranceContactPersons varchar(30) comment '?C???????S????'
2496
  , InsurancePhone varchar(13) comment '?C???????d?b???'
2497
  , Note varchar(300) comment '???l'
2498
  , EntryDate datetime comment '?o?^???t'
2499
  , UpdateDate datetime comment '?X?V???t'
2500
  , constraint vehiclemaster_PKC primary key (VehicleCode)
2501
) comment '????}?X?^' ;
2502

2503
-- ????L?^?f?[?^
2504
drop table if exists vehiclerecorddata cascade;
2505

2506
create table vehiclerecorddata (
2507
  VehicleCode decimal(5,0) unsigned not null comment '????R?[?h'
2508
  , DivisionCode decimal(2,0) unsigned not null comment '?f?[?^??'
2509
  , SeqNo decimal(2,0) not null comment '?}??'
2510
  , RecordDate date comment '???n??'
2511
  , Mileage mediumint(9) comment '???s????'
2512
  , Content varchar(100) comment '???e'
2513
  , PaymentCost decimal(10,0) comment '??p'
2514
  , EntryDate datetime not null comment '?o?^???t'
2515
  , UpdateDate datetime not null comment '?X?V???t'
2516
  , constraint vehiclerecorddata_PKC primary key (VehicleCode,DivisionCode,SeqNo)
2517
) comment '????L?^?f?[?^' ;
2518

2519
-- ????\??f?[?^
2520
drop table if exists vehiclescheduledata cascade;
2521

2522
create table vehiclescheduledata (
2523
  TargetDate date not null comment '????'
2524
  , VehicleCode decimal(5,0) unsigned not null comment '????R?[?h'
2525
  , MorningAfternoon decimal(1,0) not null comment '??O?E???'
2526
  , PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
2527
  , TargetYear year(4) not null comment '?Y???N'
2528
  , TargetMonth tinyint(3) unsigned not null comment '?Y????'
2529
  , TargetDay year(4) not null comment '?Y????'
2530
  , EntryDate datetime not null comment '?o?^???t'
2531
  , UpdateDate datetime not null comment '?X?V???t'
2532
  , constraint vehiclescheduledata_PKC primary key (TargetDate,VehicleCode,MorningAfternoon)
2533
) comment '????\??f?[?^' ;
2534

2535
create index VehicleScheduleData_Index1
2536
  on vehiclescheduledata(TargetYear);
2537

2538
create index VehicleScheduleData_Index2
2539
  on vehiclescheduledata(TargetMonth);
2540

2541
create index VehicleScheduleData_Index3
2542
  on vehiclescheduledata(TargetDay);
2543

2544
-- ?N?}?X?^
2545
drop table if exists yearmaster cascade;
2546

2547
create table yearmaster (
2548
  years smallint(6) not null comment '?N'
2549
  , constraint yearmaster_PKC primary key (years)
2550
) comment '?N?}?X?^' ;
2551