プロジェクト

全般

プロフィール

統計
| リビジョン:

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

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

1
-- Project Name : noname
2
-- Date/Time    : 2018/04/12 9:06:32
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
  , NightFlg 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
-- ?@?l?i?}?X?^
312
drop table if exists businesstypemaster cascade;
313

    
314
create table businesstypemaster (
315
  BusinessTypeCode decimal(5,0) unsigned not null comment '?@?l?i?R?[?h'
316
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
317
  , BusinessTypeName varchar(100) not null comment '???'
318
  , EntryDate datetime not null comment '?o?^???t'
319
  , UpdateDate datetime not null comment '?X?V???t'
320
  , constraint businesstypemaster_PKC primary key (BusinessTypeCode)
321
) comment '?@?l?i?}?X?^' ;
322

    
323
create index BusinessTypeMaster_Index1
324
  on businesstypemaster(DisplayOrder);
325

    
326
-- ?S????????????f?[?^
327
drop table if exists chgchargedep cascade;
328

    
329
create table chgchargedep (
330
  PersonCode decimal(8,0) not null comment '?S????R?[?h'
331
  , StartDate date not null comment '?J?n?N????'
332
  , CompDate date not null comment '?I???N????'
333
  , DepartmentCode decimal(5,0) unsigned not null comment '?????R?[?h'
334
  , DepartmentName varchar(60) comment '??????'
335
  , EntryDate datetime not null comment '?o?^???t'
336
  , UpdateDate datetime not null comment '?X?V???t'
337
  , constraint chgchargedep_PKC primary key (PersonCode,StartDate)
338
) comment '?S????????????f?[?^' ;
339

    
340
-- ????????}?X?^
341
drop table if exists commoncostlarge cascade;
342

    
343
create table commoncostlarge (
344
  LargeCode decimal(5,0) unsigned not null comment '????L?['
345
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
346
  , LargeName varchar(50) not null comment '???????'
347
  , CommentText varchar(120) comment '????????'
348
  , DeleteFlg decimal(1,0) not null comment '???t???O'
349
  , EntryDate datetime not null comment '?o?^???t'
350
  , UpdateDate datetime not null comment '?X?V???t'
351
  , constraint commoncostlarge_PKC primary key (LargeCode)
352
) comment '????????}?X?^' ;
353

    
354
-- ?????H???A?}?X?^
355
drop table if exists commoncostlinkms cascade;
356

    
357
create table commoncostlinkms (
358
  LargeCode decimal(5,0) unsigned not null comment '????L?['
359
  , MiddleCode decimal(5,0) unsigned not null comment '??????L?['
360
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
361
  , EntryDate datetime comment '?o?^???t'
362
  , UpdateDate datetime comment '?X?V???t'
363
  , constraint commoncostlinkms_PKC primary key (LargeCode,MiddleCode,ItemCode)
364
) comment '?????H???A?}?X?^' ;
365

    
366
-- ?????????}?X?^
367
drop table if exists commoncostmiddle cascade;
368

    
369
create table commoncostmiddle (
370
  LargeCode decimal(5,0) unsigned not null comment '????L?['
371
  , MiddleCode decimal(5,0) unsigned not null comment '??????L?['
372
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
373
  , MiddleName varchar(50) not null comment '?????????'
374
  , CommentText varchar(120) comment '????????'
375
  , DeleteFlg decimal(1,0) not null comment '???t???O'
376
  , EntryDate datetime not null comment '?o?^???t'
377
  , UpdateDate datetime not null comment '?X?V???t'
378
  , constraint commoncostmiddle_PKC primary key (LargeCode,MiddleCode)
379
) comment '?????????}?X?^' ;
380

    
381
-- ?????????L?[?}?X?^
382
drop table if exists commoncostmiddlesearchword cascade;
383

    
384
create table commoncostmiddlesearchword (
385
  LargeCode decimal(5,0) unsigned not null comment '????L?['
386
  , MiddleCode decimal(5,0) unsigned not null comment '??????L?['
387
  , SeqNo decimal(5,0) unsigned not null comment '????'
388
  , SearchWord varchar(50) not null comment '????????'
389
  , EntryDate datetime not null comment '?o?^???t'
390
  , UpdateDate datetime not null comment '?X?V???t'
391
  , constraint commoncostmiddlesearchword_PKC primary key (LargeCode,MiddleCode,SeqNo)
392
) comment '?????????L?[?}?X?^' ;
393

    
394
-- ?\???H???A?}?X?^
395
drop table if exists componentlinkmaster cascade;
396

    
397
create table componentlinkmaster (
398
  ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
399
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
400
  , DisplayOrder decimal(5,0) unsigned comment '?\????'
401
  , EntryDate datetime not null comment '?o?^???t'
402
  , UpdateDate datetime not null comment '?X?V???t'
403
  , constraint componentlinkmaster_PKC primary key (ComponentCode,ItemCode)
404
) comment '?\???H???A?}?X?^' ;
405

    
406
create index ComponentLinkMaster_Index1
407
  on componentlinkmaster(ComponentCode);
408

    
409
create index ComponentLinkMaster_Index2
410
  on componentlinkmaster(ItemCode);
411

    
412
-- ?\???}?X?^
413
drop table if exists componentmaster cascade;
414

    
415
create table componentmaster (
416
  ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
417
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
418
  , ComponentName varchar(120) not null comment '?\??????'
419
  , SubItemsFlg decimal(1,0) comment '???????t???O'
420
  , DirectInputFlg decimal(1,0) comment '???????t???O'
421
  , MyExpensesFlg decimal(1,0) comment '????o??t???O'
422
  , DeleteFlg decimal(1,0) not null comment '???t???O'
423
  , EntryDate datetime not null comment '?o?^???t'
424
  , UpdateDate datetime not null comment '?X?V???t'
425
  , constraint componentmaster_PKC primary key (ComponentCode)
426
) comment '?\???}?X?^' ;
427

    
428
create index ComponentMaster_Index1
429
  on componentmaster(DisplayOrder);
430

    
431
-- ?\???H??????A?}?X?^
432
drop table if exists componenttotypemaster cascade;
433

    
434
create table componenttotypemaster (
435
  ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
436
  , TypeCode decimal(5,0) unsigned not null comment '?H?????R?[?h'
437
  , Dummy decimal(1,0) not null comment '?_?~?[????'
438
  , EntryDate datetime not null comment '?o?^???t'
439
  , UpdateDate datetime not null comment '?X?V???t'
440
  , constraint componenttotypemaster_PKC primary key (ComponentCode,TypeCode)
441
) comment '?\???H??????A?}?X?^' ;
442

    
443
create index ComponentToTypeMaster_Index1
444
  on componenttotypemaster(ComponentCode);
445

    
446
create index ComponentToTypeMaster_Index2
447
  on componenttotypemaster(TypeCode);
448

    
449
-- ?H???S???????f?[?^
450
drop table if exists constrchgcharge cascade;
451

    
452
create table constrchgcharge (
453
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
454
  , Division decimal(1,0) not null comment '????'
455
  , SeqNo smallint(5) unsigned not null comment '?A??'
456
  , DepartmentCode decimal(5,0) unsigned not null comment '?????R?[?h'
457
  , PersonCode decimal(8,0) not null comment '?S????R?[?h'
458
  , StartDate date comment '?S???J?n?N????'
459
  , CompDate date comment '?S???I???N????'
460
  , EntryDate datetime not null comment '?o?^???t'
461
  , UpdateDate datetime not null comment '?X?V???t'
462
  , constraint constrchgcharge_PKC primary key (ConstructionCode,Division,SeqNo)
463
) comment '?H???S???????f?[?^' ;
464

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

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

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

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

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

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

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

    
553
create index BaseInfo_Index1
554
  on constructionbaseinfo(ConstructionStatusFlg);
555

    
556
create index BaseInfo_Index2
557
  on constructionbaseinfo(EstimateType);
558

    
559
create index BaseInfo_Index3
560
  on constructionbaseinfo(SalesPersonCode);
561

    
562
create index BaseInfo_Index4
563
  on constructionbaseinfo(ConstructionPersonCode);
564

    
565
create index BaseInfo_Index5
566
  on constructionbaseinfo(ConstructionInstructor);
567

    
568
create index BaseInfo_Index6
569
  on constructionbaseinfo(ConstructionPeriod);
570

    
571
-- ?H????{????
572
drop table if exists constructionbaseinfodetail cascade;
573

    
574
create table constructionbaseinfodetail (
575
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
576
  , DetailNo decimal(3,0) not null comment '??????'
577
  , DetailString varchar(300) comment '??????e'
578
  , EntryDate datetime not null comment '?o?^???t'
579
  , UpdateDate datetime not null comment '?X?V???t'
580
  , constraint constructionbaseinfodetail_PKC primary key (ConstructionCode,DetailNo)
581
) comment '?H????{????' ;
582

    
583
create index BaseInfoDetail_Idx1
584
  on constructionbaseinfodetail(ConstructionCode);
585

    
586
create index BaseInfoDetail_Idx2
587
  on constructionbaseinfodetail(DetailNo);
588

    
589
-- ?H???{?H?\?Z?f?[?^
590
drop table if exists constructionbudget cascade;
591

    
592
create table constructionbudget (
593
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
594
  , CreatorCode decimal(8,0) not null comment '????R?[?h'
595
  , CreatorName varchar(60) comment '?????'
596
  , CreatorCosts decimal(11,0) not null comment '??????^'
597
  , AssistantCode decimal(8,0) not null comment '???S????R?[?h'
598
  , AssistantName varchar(60) comment '???S?????'
599
  , AssistantCosts decimal(11,0) not null comment '???S??????^'
600
  , InstructorCode decimal(8,0) not null comment '?H???w?????R?[?h'
601
  , InstructorName varchar(60) comment '?H???w??????'
602
  , InstructorCosts decimal(11,0) not null comment '?H???w???????^'
603
  , CreateDate date not null comment '????'
604
  , ConstructionTimes decimal(5,2) not null comment '?H???i?P??E???j'
605
  , ConstructionStart date not null comment '?_??H???J?n'
606
  , ConstructionEnd date not null comment '?_??H??????'
607
  , InstructorTimes decimal(5,2) not null comment '?w???????????'
608
  , SalaryFlg decimal(1,0) not null comment '???^?U????'
609
  , SalaryDays decimal(4,0) not null comment '?U??????'
610
  , A_SalaryFlg decimal(1,0) not null comment '???S??????^?U????'
611
  , A_SalaryDays decimal(4,0) not null comment '???S????U??????'
612
  , I_SalaryFlg decimal(1,0) not null comment '?w???????^?U????'
613
  , I_SalaryDays decimal(4,0) not null comment '?w?????U??????'
614
  , OrdersDecisionPrice decimal(12,0) not null comment '??????????z'
615
  , EntryDate datetime not null comment '?o?^???t'
616
  , UpdateDate datetime not null comment '?X?V???t'
617
  , constraint constructionbudget_PKC primary key (ConstructionCode)
618
) comment '?H???{?H?\?Z?f?[?^' ;
619

    
620
-- ?H???{?H?\?Z?f?[?^????
621
drop table if exists constructionbudgetdetail cascade;
622

    
623
create table constructionbudgetdetail (
624
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
625
  , GroupCount decimal(2,0) unsigned not null comment '?O???[?v???'
626
  , LineCount decimal(3,0) unsigned not null comment '?s???'
627
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
628
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
629
  , FirstString varchar(120) comment '???????'
630
  , SecondString varchar(120) comment '?H?????e'
631
  , CompanyType decimal(1,0) not null comment '??????R?[?h?^?C?v'
632
  , CompanyCode decimal(8,0) not null comment '??????R?[?h'
633
  , CompanyName varchar(120) comment '?????????'
634
  , EstimatePrice decimal(12,0) not null comment '??Z????????z'
635
  , NegotiationPrice decimal(12,0) not null comment '??Z????????z'
636
  , OrderDesiredAmount decimal(12,0) not null comment '??????]???z'
637
  , ExecutionAmount decimal(12,0) not null comment '???s???z'
638
  , AmountConfigRate decimal(5,2) not null comment '???z?\????'
639
  , NegotiateFlg decimal(1,0) not null comment '?????????t???O'
640
  , EntryDate datetime not null comment '?o?^???t'
641
  , UpdateDate datetime not null comment '?X?V???t'
642
  , constraint constructionbudgetdetail_PKC primary key (ConstructionCode,GroupCount,LineCount)
643
) comment '?H???{?H?\?Z?f?[?^????' ;
644

    
645
-- ?H??}?X?^
646
drop table if exists constructionitemmaster cascade;
647

    
648
create table constructionitemmaster (
649
  ItemCode decimal(5,0) unsigned not null comment '?H??L?['
650
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
651
  , ItemName varchar(120) not null comment '?H????'
652
  , SubItemsFlg decimal(1,0) comment '???????t???O'
653
  , MyExpensesFlg decimal(1,0) not null comment '????o??t???O'
654
  , DeleteFlg decimal(1,0) not null comment '???t???O'
655
  , EntryDate datetime not null comment '?o?^???t'
656
  , UpdateDate datetime not null comment '?X?V???t'
657
  , constraint constructionitemmaster_PKC primary key (ItemCode)
658
) comment '?H??}?X?^' ;
659

    
660
-- ?H???????f?[?^
661
drop table if exists constructionledger cascade;
662

    
663
create table constructionledger (
664
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
665
  , ConstructionPeriod decimal(4,0) unsigned not null comment '?????'
666
  , CreatorCode decimal(8,0) comment '????R?[?h'
667
  , CreatorName varchar(60) comment '?????'
668
  , CreateDate date not null comment '????'
669
  , ConstructionTimes decimal(5,2) not null comment '?H???i?P??E???j'
670
  , ConstructionStart date not null comment '?_??H???J?n'
671
  , ConstructionEnd date not null comment '?_??H??????'
672
  , OrdersDecisionPrice decimal(14,0) not null comment '??????????z'
673
  , CompanyExpenses decimal(10,0) not null comment '???o???v'
674
  , DepartmentExpenses decimal(10,0) not null comment '?????o???v'
675
  , SalesExpenses decimal(10,0) not null comment '?c??o???v'
676
  , TotalPayment decimal(10,0) not null comment '???x???z'
677
  , GrossProfit decimal(10,0) not null comment '?e??'
678
  , Allowance decimal(10,0) not null comment '???^'
679
  , NetProfit decimal(10,0) not null comment '?????v'
680
  , ComplateFlg decimal(1,0) not null comment '????????t???O'
681
  , IntegrationFlg decimal(1,0) not null comment '????z??Z?t???O'
682
  , EntryDate datetime not null comment '?o?^???t'
683
  , UpdateDate datetime not null comment '?X?V???t'
684
  , constraint constructionledger_PKC primary key (ConstructionCode)
685
) comment '?H???????f?[?^' ;
686

    
687
create index constructionledger_Index1
688
  on constructionledger(ConstructionStart);
689

    
690
create index constructionledger_Index2
691
  on constructionledger(ConstructionEnd);
692

    
693
-- ?H??????????f?[?^
694
drop table if exists constructionledgerdetail cascade;
695

    
696
create table constructionledgerdetail (
697
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
698
  , GroupCount decimal(2,0) unsigned not null comment '?O???[?v???'
699
  , LineCount decimal(4,0) unsigned not null comment '?s???'
700
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
701
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
702
  , FirstString varchar(120) comment '???????'
703
  , SecondString varchar(120) comment '?H?????e'
704
  , CompanyType decimal(1,0) not null comment '??????R?[?h?^?C?v'
705
  , CompanyCode decimal(8,0) not null comment '??????R?[?h'
706
  , CompanyName varchar(120) comment '?????????'
707
  , EstimatePrice decimal(12,0) not null comment '?\?Z?i????j???z'
708
  , ExecutionAmount decimal(12,0) not null comment '???s???z'
709
  , AmountConfigRate decimal(5,2) not null comment '???z?\????'
710
  , PaymentBurden decimal(12,0) not null comment '?x????U?z'
711
  , FixDataFlg decimal(1,0) not null comment '???f?[?^?t???O'
712
  , IndependentFlg decimal(1,0) not null comment '????f?[?^?t???O'
713
  , FluctuationFlg decimal(1,0) not null comment '?????f?[?^?t???O'
714
  , SalaryFlg decimal(1,0) not null comment '???^?U????'
715
  , SalaryDays decimal(4,0) not null comment '???^?U??????'
716
  , OperatingFlg decimal(1,0) not null comment '?S?????t???O'
717
  , SourceCode decimal(10,0) unsigned not null comment '???H?????'
718
  , JoinTitleFlg decimal(1,0) not null comment '?H??????^?C?g??'
719
  , SalaryOnRegist decimal(12,0) not null comment '?o?^?????z???^'
720
  , PurchaseOrderFlg decimal(2,0) not null comment '?????????s?t???O'
721
  , DetailCount decimal(4,0) unsigned not null comment '??????'
722
  , EntryDate datetime not null comment '?o?^???t'
723
  , UpdateDate datetime not null comment '?X?V???t'
724
  , constraint constructionledgerdetail_PKC primary key (ConstructionCode,GroupCount,LineCount)
725
) comment '?H??????????f?[?^' ;
726

    
727
create index LedgerDetail_Index01
728
  on constructionledgerdetail(ConstructionCode);
729

    
730
create index LedgerDetail_Index02
731
  on constructionledgerdetail(GroupCount);
732

    
733
create index LedgerDetail_Index03
734
  on constructionledgerdetail(LineCount);
735

    
736
create index LedgerDetail_Index04
737
  on constructionledgerdetail(SourceCode);
738

    
739
create index LedgerDetail_Index05
740
  on constructionledgerdetail(DetailCount);
741

    
742
create index LedgerDetail_Index06
743
  on constructionledgerdetail(SalaryFlg);
744

    
745
create index LedgerDetail_Index07
746
  on constructionledgerdetail(CompanyCode);
747

    
748
-- ?H?????????s?f?[?^
749
drop table if exists constructionledgerexcute cascade;
750

    
751
create table constructionledgerexcute (
752
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
753
  , GroupCount decimal(2,0) unsigned not null comment '?O???[?v???'
754
  , LineCount decimal(4,0) unsigned not null comment '?s???'
755
  , ColumnCount decimal(3,0) not null comment '????'
756
  , PaymentAmount decimal(12,0) not null comment '?x?????z'
757
  , TargetMonth date not null comment '???N??'
758
  , EntryDate datetime not null comment '?o?^???t'
759
  , UpdateDate datetime not null comment '?X?V???t'
760
  , constraint constructionledgerexcute_PKC primary key (ConstructionCode,GroupCount,LineCount,ColumnCount)
761
) comment '?H?????????s?f?[?^' ;
762

    
763
create index LedgerExcute_Index1
764
  on constructionledgerexcute(ConstructionCode,TargetMonth,GroupCount,LineCount);
765

    
766
-- ?H???????N???
767
drop table if exists constructionlink cascade;
768

    
769
create table constructionlink (
770
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
771
  , FluctuationCode decimal(10,0) not null comment '?q?H?????'
772
  , LinkType decimal(1,0) not null comment '?????N???'
773
  , EntryDate datetime not null comment '?o?^???t'
774
  , UpdateDate datetime not null comment '?X?V???t'
775
  , constraint constructionlink_PKC primary key (ConstructionCode,FluctuationCode)
776
) comment '?H???????N???' ;
777

    
778
create index ConstructionLink_Index1
779
  on constructionlink(ConstructionCode);
780

    
781
create index ConstructionLink_Index2
782
  on constructionlink(FluctuationCode);
783

    
784
create index ConstructionLink_Index3
785
  on constructionlink(LinkType);
786

    
787
-- ?H????????
788
drop table if exists constructionmaterialinfo cascade;
789

    
790
create table constructionmaterialinfo (
791
  CONSTRUCTIONCODE int(10) unsigned default 0 not null comment '?H?????'
792
  , MATERIALITEMCODE smallint(5) unsigned default 0 not null comment '????i??R?[?h'
793
  , PROCESSDATE datetime default '0000-00-00 00:00:00' not null comment '?????N????'
794
  , RENTCOUNT smallint(5) unsigned comment '??o??'
795
  , REPAYCOUNT smallint(5) unsigned comment '??p??'
796
  , JUNKCOUNT smallint(5) unsigned comment '?j????'
797
  , COMPLETEFLG tinyint(3) unsigned comment '?????t???O'
798
  , ENTRYDATE datetime comment '?o?^???t'
799
  , UPDATEDATE datetime comment '?X?V???t'
800
  , constraint constructionmaterialinfo_PKC primary key (CONSTRUCTIONCODE,MATERIALITEMCODE,PROCESSDATE)
801
) comment '?H????????' ;
802

    
803
-- ????i?????t?f?[?^
804
drop table if exists constructionprogressdate cascade;
805

    
806
create table constructionprogressdate (
807
  ConstructionCode decimal(10,0) not null comment '?H?????'
808
  , ConstructionStatusFlg decimal(2,0) not null comment '???H?????'
809
  , PreviousStatusFlg decimal(2,0) comment '??X?O???'
810
  , ChangeDate datetime not null comment '?????t'
811
  , ChangePersonCode decimal(8,0) not null comment '???S????'
812
  , EntryDate datetime not null comment '?o?^???t'
813
  , UpdateDate datetime not null comment '?X?V???t'
814
  , constraint constructionprogressdate_PKC primary key (ConstructionCode,ChangeDate)
815
) comment '????i?????t?f?[?^' ;
816

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

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

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

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

    
829
create table constructionspecmaster (
830
  ItemCode decimal(5,0) unsigned not null comment '?H??L?['
831
  , SpecCode decimal(5,0) unsigned not null comment '???L?['
832
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
833
  , ItemName varchar(120) comment '??????'
834
  , SpecName varchar(120) comment '??????'
835
  , UnitName varchar(30) comment '?P?????'
836
  , UnitPrice decimal(9,2) not null comment '?P??'
837
  , DeleteFlg decimal(1,0) not null comment '???t???O'
838
  , EntryDate datetime not null comment '?o?^???t'
839
  , UpdateDate datetime not null comment '?X?V???t'
840
  , constraint constructionspecmaster_PKC primary key (ItemCode,SpecCode)
841
) comment '???}?X?^' ;
842

    
843
create index ConstructionSpecMaster_Index1
844
  on constructionspecmaster(DisplayOrder);
845

    
846
-- ???P???}?X?^
847
drop table if exists constructionspecunitprice cascade;
848

    
849
create table constructionspecunitprice (
850
  ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
851
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
852
  , SpecCode decimal(5,0) unsigned not null comment '???L?['
853
  , ConstructionTypeCode mediumint(8) unsigned not null comment '?H?????R?[?h'
854
  , UnitPrice decimal(9,2) not null comment '?P??'
855
  , EntryDate datetime not null comment '?o?^???t'
856
  , UpdateDate datetime not null comment '?X?V???t'
857
  , constraint constructionspecunitprice_PKC primary key (ComponentCode,ItemCode,SpecCode,ConstructionTypeCode)
858
) comment '???P???}?X?^' ;
859

    
860
-- ?H?????}?X?^
861
drop table if exists constructiontypemaster cascade;
862

    
863
create table constructiontypemaster (
864
  TypeCode decimal(5,0) unsigned not null comment '?H?????R?[?h'
865
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
866
  , NameString varchar(100) not null comment '????'
867
  , PublicFlg decimal(1,0) not null comment '?H?????t???O'
868
  , SecRank decimal(1,0) not null comment '?????????N'
869
  , ExpensesLink decimal(1,0) not null comment '?o??g?p??'
870
  , DeleteFlg decimal(1,0) not null comment '???t???O'
871
  , EntryDate datetime not null comment '?o?^???t'
872
  , UpdateDate datetime not null comment '?X?V???t'
873
  , constraint constructiontypemaster_PKC primary key (TypeCode)
874
) comment '?H?????}?X?^' ;
875

    
876
-- ?S??????o??f?[?^
877
drop table if exists costdataofperson cascade;
878

    
879
create table costdataofperson (
880
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
881
  , ActionDate date not null comment '?????t'
882
  , DataType decimal(1,0) not null comment '?f?[?^??'
883
  , DataAddCount decimal(5,0) unsigned not null comment '?f?[?^??????'
884
  , TargetMonth varchar(7) not null comment '???N??'
885
  , ConstructionCode decimal(10,0) unsigned comment '?H???R?[?h'
886
  , SuppliersCode decimal(5,0) unsigned not null comment '?x????R?[?h'
887
  , SuppliersName varchar(120) comment '?x??????'
888
  , PaymentContent varchar(60) comment '?x?????e'
889
  , PaymentType decimal(1,0) not null comment '?x?????@?t???O'
890
  , EntryPrice decimal(12,0) not null comment '???z?i????j'
891
  , EntryPriceInTax decimal(12,0) not null comment '???z?i????j'
892
  , SlipNumber varchar(12) comment '?`?[???'
893
  , ComplateFlg decimal(1,0) not null comment '???????t???O'
894
  , ApprovalFlg decimal(1,0) not null comment '???F?t???O'
895
  , EntryDate datetime not null comment '?o?^???t'
896
  , UpdateDate datetime not null comment '?X?V???t'
897
  , constraint costdataofperson_PKC primary key (PersonCode,ActionDate,DataType,DataAddCount)
898
) comment '?S??????o??f?[?^' ;
899

    
900
create index CostDataOfPerson_Index1
901
  on costdataofperson(TargetMonth);
902

    
903
create index CostDataOfPerson_Index2
904
  on costdataofperson(ConstructionCode);
905

    
906
-- ??????o?^?\???f?[?^
907
drop table if exists costomerregist cascade;
908

    
909
create table costomerregist (
910
  CreatePersonCode decimal(8,0) unsigned not null comment '?\??????'
911
  , CreateDate date not null comment '????'
912
  , SeqNo decimal(2,0) not null comment '?L?[?A??'
913
  , DataMode decimal(1,0) not null comment '?f?[?^??'
914
  , SourceCotegory decimal(5,0) unsigned not null comment '???????'
915
  , SourceCode decimal(5,0) unsigned not null comment '??????R?[?h'
916
  , PetitionPeriod decimal(4,0) unsigned not null comment '?????'
917
  , OrderFlg decimal(1,0) not null comment '?@?l?c??E??l?t???O'
918
  , CorporateStatusName varchar(100) comment '?@?l?i????'
919
  , CorporateStatusPoint decimal(1,0) comment '?@?l?i?????u'
920
  , OrderersName1 varchar(60) not null comment '???????1'
921
  , OrderersName2 varchar(60) comment '????????Q'
922
  , DepartmentName varchar(60) comment '??????'
923
  , PersonName varchar(60) comment '?S?????'
924
  , ZipCode varchar(8) comment '?X????'
925
  , Address1 varchar(60) comment '?Z???P'
926
  , Address2 varchar(60) comment '?Z??2'
927
  , Address3 varchar(60) comment '?Z??3'
928
  , PhoneNumber varchar(13) comment '?d?b???'
929
  , FaxNumber varchar(13) comment 'FAX???'
930
  , MailAddress varchar(257) comment '???[???A?h???X'
931
  , Note varchar(300) comment '???l'
932
  , OrderCotegory decimal(5,0) unsigned not null comment '???????'
933
  , OrderDate date not null comment '?\????'
934
  , OrderNo decimal(2,0) unsigned not null comment '?\????t???'
935
  , CreateDepartmentCode decimal(5,0) unsigned not null comment '?\???????R?[?h'
936
  , CreateDepartmentName varchar(60) comment '?\????????'
937
  , EntryDate datetime not null comment '?o?^???t'
938
  , UpdateDate datetime not null comment '?X?V???t'
939
  , constraint costomerregist_PKC primary key (CreatePersonCode,CreateDate,SeqNo)
940
) comment '??????o?^?\???f?[?^' ;
941

    
942
create index CostomerRegist_Index1
943
  on costomerregist(PetitionPeriod);
944

    
945
create index CostomerRegist_Index2
946
  on costomerregist(CreatePersonCode);
947

    
948
create index CostomerRegist_Index3
949
  on costomerregist(CreateDepartmentCode);
950

    
951
-- ????f?[?^
952
drop table if exists dailydataconstruction cascade;
953

    
954
create table dailydataconstruction (
955
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
956
  , DailyDataDate date not null comment '???????'
957
  , ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
958
  , Weather varchar(60) comment '?V?C'
959
  , EntryDate datetime not null comment '?o?^???t'
960
  , UpdateDate datetime not null comment '?X?V???t'
961
  , constraint dailydataconstruction_PKC primary key (PersonCode,DailyDataDate,ConstructionCode)
962
) comment '????f?[?^' ;
963

    
964
create index DailyDataConstruction_Index1
965
  on dailydataconstruction(PersonCode);
966

    
967
create index DailyDataConstruction_Index2
968
  on dailydataconstruction(DailyDataDate);
969

    
970
create index DailyDataConstruction_Index3
971
  on dailydataconstruction(ConstructionCode);
972

    
973
-- ????f?[?^ (????)
974
drop table if exists dailydatadetail cascade;
975

    
976
create table dailydatadetail (
977
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
978
  , DailyDataDate date not null comment '???????'
979
  , ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
980
  , SeqNo decimal(3,0) unsigned not null comment '????s???'
981
  , JobCategoryCode decimal(5,0) not null comment '?E??L?['
982
  , CompanyCode decimal(8,0) not null comment '??????R?[?h'
983
  , TodayHeadCount decimal(4,1) not null comment '?????l????'
984
  , TotalHeadCount decimal(5,1) not null comment '??v?l????'
985
  , TodayWork varchar(100) comment '?????????e'
986
  , NextdayWork varchar(100) comment '?????????e'
987
  , NextdayHeadCount decimal(4,1) not null comment '?????l????'
988
  , EntryDate datetime not null comment '?o?^???t'
989
  , UpdateDate datetime not null comment '?X?V???t'
990
  , constraint dailydatadetail_PKC primary key (PersonCode,DailyDataDate,ConstructionCode,SeqNo)
991
) comment '????f?[?^ (????)' ;
992

    
993
create index DailyDataDetail_Index
994
  on dailydatadetail(PersonCode,DailyDataDate,ConstructionCode);
995

    
996
-- ????f?[?^ (??????)
997
drop table if exists dailydatafield cascade;
998

    
999
create table dailydatafield (
1000
  PersonCode decimal(8,0) unsigned not null comment '????R?[?h'
1001
  , DailyDataDate date not null comment '???????'
1002
  , ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1003
  , SeqNo decimal(3,0) unsigned not null comment '????s???'
1004
  , PatrolTime datetime not null comment '?????'
1005
  , ContentsText varchar(200) comment '???e'
1006
  , EntryDate datetime not null comment '?o?^???t'
1007
  , UpdateDate datetime not null comment '?X?V???t'
1008
  , constraint dailydatafield_PKC primary key (PersonCode,DailyDataDate,ConstructionCode,SeqNo)
1009
) comment '????f?[?^ (??????)' ;
1010

    
1011
create index DailyDataField_Index
1012
  on dailydatafield(PersonCode,DailyDataDate,ConstructionCode);
1013

    
1014
-- ????f?[?^ (????)
1015
drop table if exists dailydatamaterials cascade;
1016

    
1017
create table dailydatamaterials (
1018
  PersonCode decimal(8,0) unsigned not null comment '????R?[?h'
1019
  , DailyDataDate date not null comment '???????'
1020
  , ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1021
  , SeqNo decimal(3,0) unsigned not null comment '????s???'
1022
  , Materials varchar(100) comment '?????'
1023
  , Quantity varchar(100) comment '????'
1024
  , Production varchar(100) comment '??????'
1025
  , Delivery varchar(100) comment '?[?????'
1026
  , QualityControl varchar(100) comment '?i?????????'
1027
  , EntryDate datetime not null comment '?o?^???t'
1028
  , UpdateDate datetime not null comment '?X?V???t'
1029
  , constraint dailydatamaterials_PKC primary key (PersonCode,DailyDataDate,ConstructionCode,SeqNo)
1030
) comment '????f?[?^ (????)' ;
1031

    
1032
create index DailyDataMaterials_Index
1033
  on dailydatamaterials(PersonCode,DailyDataDate,ConstructionCode);
1034

    
1035
-- ????f?[?^ (??????w??)
1036
drop table if exists dailydatasubcontractors cascade;
1037

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

    
1050
create index DailyDataSubcontractors_Index
1051
  on dailydatasubcontractors(PersonCode,DailyDataDate,ConstructionCode);
1052

    
1053
-- ????f?[?^ (???)
1054
drop table if exists dailydatavehicles cascade;
1055

    
1056
create table dailydatavehicles (
1057
  PersonCode decimal(8,0) unsigned not null comment '????R?[?h'
1058
  , DailyDataDate date not null comment '???????'
1059
  , ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1060
  , SeqNo decimal(3,0) unsigned not null comment '????s???'
1061
  , Model varchar(100) comment '?@??'
1062
  , Performance varchar(100) comment '???\'
1063
  , Owner varchar(100) comment '???L???'
1064
  , Driver varchar(100) comment '?????^?]??'
1065
  , StartWorkingTime datetime not null comment '??????J?n'
1066
  , EndWorkingTime datetime not null comment '??????I??'
1067
  , EntryDate datetime not null comment '?o?^???t'
1068
  , UpdateDate datetime not null comment '?X?V???t'
1069
  , constraint dailydatavehicles_PKC primary key (PersonCode,DailyDataDate,ConstructionCode,SeqNo)
1070
) comment '????f?[?^ (???)' ;
1071

1072
create index DailyDataVehicles_Index
1073
  on dailydatavehicles(PersonCode,DailyDataDate,ConstructionCode);
1074

1075
-- ???}?X?^
1076
drop table if exists daymaster cascade;
1077

1078
create table daymaster (
1079
  days smallint(6) not null comment '??'
1080
  , constraint daymaster_PKC primary key (days)
1081
) comment '???}?X?^' ;
1082

1083
-- ?????}?X?^
1084
drop table if exists deadlinemaster cascade;
1085

1086
create table deadlinemaster (
1087
  LABOURKIND decimal(1,0) default '0' not null comment '??????'
1088
  , DEADLINE decimal(2,0) comment '????'
1089
  , PAYDAY decimal(2,0) comment '?x????'
1090
  , NOTE varchar(120) comment '???l'
1091
  , DELETEFLG decimal(1,0) comment '???t???O'
1092
  , ENTRYDATE datetime comment '?o?^???t'
1093
  , UPDATEDATE datetime comment '?X?V???t'
1094
  , constraint deadlinemaster_PKC primary key (LABOURKIND)
1095
) comment '?????}?X?^' ;
1096

1097
-- ?????o???}?X?^
1098
drop table if exists departmentexpensesmaster cascade;
1099

1100
create table departmentexpensesmaster (
1101
  DepartmentCode decimal(5,0) unsigned not null comment '?????R?[?h'
1102
  , ExpensesPeriod smallint(6) not null comment '?????'
1103
  , NameCode decimal(5,0) unsigned not null comment '?o??R?[?h'
1104
  , NameString varchar(100) not null comment '????'
1105
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
1106
  , ExpensesRaito decimal(4,2) not null comment '?o??'
1107
  , DeleteFlg decimal(1,0) not null comment '???t???O'
1108
  , EntryDate datetime not null comment '?o?^???t'
1109
  , UpdateDate datetime not null comment '?X?V???t'
1110
  , constraint departmentexpensesmaster_PKC primary key (DepartmentCode,ExpensesPeriod,NameCode)
1111
) comment '?????o???}?X?^' ;
1112

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

1116
create table departmentmaster (
1117
  DepartmentCode decimal(5,0) unsigned not null comment '?????R?[?h'
1118
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
1119
  , DepartmentString varchar(100) not null comment '??????'
1120
  , ActionScheduleFlg decimal(1,0) not null comment '?s???\??\???t???O'
1121
  , StaffAssignFlg decimal(1,0) not null comment '?l???z?u?\???t???O'
1122
  , StartDate datetime not null comment '?J?n???t'
1123
  , CompDate datetime not null comment '?I?????t'
1124
  , DeleteFlg decimal(1,0) not null comment '???t???O'
1125
  , EntryDate datetime not null comment '?o?^???t'
1126
  , UpdateDate datetime not null comment '?X?V???t'
1127
  , constraint departmentmaster_PKC primary key (DepartmentCode)
1128
) comment '?????}?X?^' ;
1129

1130
create index DepartmentMaster_index1
1131
  on departmentmaster(DisplayOrder);
1132

1133
-- ?????m?F???F?f?[?^
1134
drop table if exists depositapprovalinfo cascade;
1135

1136
create table depositapprovalinfo (
1137
  ORDERERSDIVISION decimal(5,0) not null comment '???????'
1138
  , ORDERERSCODE decimal(5,0) not null comment '??????R?[?h'
1139
  , TARGETDATE decimal(6,0) not null comment '???N??'
1140
  , SEQNO decimal(3,0) not null comment '?A??'
1141
  , LINECOUNT decimal(3,0) not null comment '?s???'
1142
  , APPROVALNO decimal(3,0) not null comment '???F????'
1143
  , APPROVALPERSON decimal(8,0) comment '???F??R?[?h'
1144
  , APPROVALPERSONNAME varchar(20) comment '???F???'
1145
  , APPROVALAUTHORITY decimal(1,0) comment '???F??????'
1146
  , APPROVALDATE date comment '???F???t'
1147
  , ENTRYDATE datetime comment '?o?^???t'
1148
  , UPDATEDATE datetime comment '?X?V???t'
1149
  , constraint depositapprovalinfo_PKC primary key (ORDERERSDIVISION,ORDERERSCODE,TARGETDATE,SEQNO,LINECOUNT,APPROVALNO)
1150
) comment '?????m?F???F?f?[?^' ;
1151

1152
-- ?????f?[?^
1153
drop table if exists depositdata cascade;
1154

1155
create table depositdata (
1156
  ORDERERSDIVISION decimal(5,0) not null comment '???????'
1157
  , ORDERERSCODE decimal(5,0) not null comment '??????R?[?h'
1158
  , TARGETDATE decimal(6,0) not null comment '???N??'
1159
  , SEQNO decimal(3,0) not null comment '?A??'
1160
  , BUSINESSPERIOD decimal(4,0) comment '?c???'
1161
  , DEPOSITDATE date comment '??????'
1162
  , DEPOSITAMOUNT decimal(12,0) comment '???????z'
1163
  , DEPOSITAMOUNTCASH decimal(10,0) comment '???????z?i?????j'
1164
  , DEPOSITAMOUNTBILL decimal(10,0) comment '???????z?i??`?j'
1165
  , DEPOSITPERSONCODE decimal(8,0) not null comment '?????S????R?[?h'
1166
  , NOTE varchar(120) comment '???l'
1167
  , ENTRYDATE datetime comment '?o?^???t'
1168
  , UPDATEDATE datetime comment '?X?V???t'
1169
  , constraint depositdata_PKC primary key (ORDERERSDIVISION,ORDERERSCODE,TARGETDATE,SEQNO)
1170
) comment '?????f?[?^' ;
1171

1172
-- ????????f?[?^
1173
drop table if exists depositdatadetail cascade;
1174

1175
create table depositdatadetail (
1176
  ORDERERSDIVISION decimal(5,0) not null comment '???????'
1177
  , ORDERERSCODE decimal(5,0) not null comment '??????R?[?h'
1178
  , TARGETDATE decimal(6,0) not null comment '???N??'
1179
  , REQUESTNO decimal(10,0) not null comment '????No'
1180
  , ORDERNO decimal(2,0) comment '??t???'
1181
  , DEPOSITAMOUNT decimal(10,0) comment '???????z'
1182
  , DISCOUNTAMOUNT decimal(10,0) comment '?l???????z'
1183
  , CNSTRPRICE decimal(10,0) comment '?????'
1184
  , FEES decimal(10,0) comment '????'
1185
  , OTHERADJUSTMENTS decimal(10,0) comment '?????'
1186
  , DIFFERENCEAMOUNT decimal(10,0) comment '????'
1187
  , CONFIRMATIONPERSONCODE decimal(8,0) comment '?m?F?S????R?[?h'
1188
  , CONFIRMATIONDATE date comment '?S????m?F???t'
1189
  , CONFIRMATIONENDFLG decimal(1,0) comment '?m?F?????t???O'
1190
  , NOTE varchar(120) comment '???l'
1191
  , ENTRYDATE datetime comment '?o?^???t'
1192
  , UPDATEDATE datetime comment '?X?V???t'
1193
  , constraint depositdatadetail_PKC primary key (ORDERERSDIVISION,ORDERERSCODE,TARGETDATE,REQUESTNO)
1194
) comment '????????f?[?^' ;
1195

1196
-- ???}?X?^
1197
drop table if exists divisionmaster cascade;
1198

1199
create table divisionmaster (
1200
  DivisionCode decimal(5,0) unsigned not null comment '???R?[?h'
1201
  , NameCode decimal(5,0) unsigned not null comment '????R?[?h'
1202
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
1203
  , NameString varchar(100) not null comment '????'
1204
  , DeleteFlg decimal(1,0) not null comment '???t???O'
1205
  , EntryDate datetime not null comment '?o?^???t'
1206
  , UpdateDate datetime not null comment '?X?V???t'
1207
  , constraint divisionmaster_PKC primary key (DivisionCode,NameCode)
1208
) comment '???}?X?^' ;
1209

1210
-- ??Z?\?Z???f?[?^
1211
drop table if exists estimatebudget cascade;
1212

1213
create table estimatebudget (
1214
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1215
  , ConstructionTime decimal(5,2) unsigned not null comment '?H??'
1216
  , IntegratedCode decimal(8,0) not null comment '??Z??'
1217
  , DataCreateDate datetime not null comment '?f?[?^??????'
1218
  , RetValue1 decimal(12,0) not null comment '?\???i'
1219
  , RetValue2 decimal(12,0) not null comment '????H????'
1220
  , RetValue3 decimal(12,0) not null comment '????????????'
1221
  , RetValue4 decimal(12,0) not null comment '????????????'
1222
  , RetPercent decimal(5,2) not null comment '???????'
1223
  , EntryDate datetime not null comment '?o?^???t'
1224
  , UpdateDate datetime not null comment '?X?V???t'
1225
  , constraint estimatebudget_PKC primary key (ConstructionCode)
1226
) comment '??Z?\?Z???f?[?^' ;
1227

1228
-- ??Z?\?Z????f?[?^????
1229
drop table if exists estimatebudgetdetail cascade;
1230

1231
create table estimatebudgetdetail (
1232
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1233
  , GroupCount decimal(2,0) unsigned not null comment '?O???[?v???'
1234
  , LineCount decimal(3,0) unsigned not null comment '?s???'
1235
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
1236
  , ItemCode decimal(5,0) unsigned comment '?H??L?['
1237
  , CompanyCode decimal(8,0) not null comment '??????R?[?h'
1238
  , FirstString varchar(120) comment '???????'
1239
  , SecondString varchar(120) comment '?H????E???????'
1240
  , Content varchar(120) comment '???e'
1241
  , EstimatePrice decimal(12,0) not null comment '????????z'
1242
  , NegotiationPrice decimal(12,0) not null comment '????????z'
1243
  , Notes varchar(120) comment '???????'
1244
  , EntryDate datetime not null comment '?o?^???t'
1245
  , UpdateDate datetime not null comment '?X?V???t'
1246
  , constraint estimatebudgetdetail_PKC primary key (ConstructionCode,GroupCount,LineCount)
1247
) comment '??Z?\?Z????f?[?^????' ;
1248

1249
-- ??Z????f?[?^
1250
drop table if exists estimatedata cascade;
1251

1252
create table estimatedata (
1253
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1254
  , LineCount decimal(3,0) unsigned not null comment '?s???'
1255
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
1256
  , FixedItemCode varchar(1) comment '?????L?['
1257
  , ItemName varchar(120) comment '??????'
1258
  , SpecName varchar(120) comment '???^?i???E?`??E???@'
1259
  , PriceValue decimal(14,0) not null comment '???z'
1260
  , note varchar(60) comment '???l'
1261
  , MyExpensesFlg decimal(1,0) not null comment '????o??t???O'
1262
  , InputFlg decimal(1,0) not null comment '????t???O'
1263
  , EntryDate datetime not null comment '?o?^???t'
1264
  , UpdateDate datetime not null comment '?X?V???t'
1265
  , constraint estimatedata_PKC primary key (ConstructionCode,LineCount)
1266
) comment '??Z????f?[?^' ;
1267

1268
create index EstimateData_Index1
1269
  on estimatedata(ConstructionCode,FixedItemCode);
1270

1271
-- ??Z????y?[?W?f?[?^
1272
drop table if exists estimatedatabody cascade;
1273

1274
create table estimatedatabody (
1275
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1276
  , PageCount decimal(4,0) unsigned not null comment '?y?[?W???'
1277
  , Category decimal(1,0) not null comment '?y?[?W??'
1278
  , UnionComponentCode decimal(5,0) unsigned not null comment '?????\???L?['
1279
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
1280
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
1281
  , SelectComponent decimal(5,0) unsigned not null comment '?I???\???L?['
1282
  , PageTitle varchar(120) not null comment '?y?[?W?\????'
1283
  , DetailLineCount decimal(3,0) unsigned not null comment '????s???'
1284
  , EntryDate datetime not null comment '?o?^???t'
1285
  , UpdateDate datetime not null comment '?X?V???t'
1286
  , constraint estimatedatabody_PKC primary key (ConstructionCode,PageCount)
1287
) comment '??Z????y?[?W?f?[?^' ;
1288

1289
create index EstimateDataBody_Index1
1290
  on estimatedatabody(ConstructionCode,ComponentCode,ItemCode);
1291

1292
-- ??Z????f?[?^????
1293
drop table if exists estimatedatadetail cascade;
1294

1295
create table estimatedatadetail (
1296
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1297
  , PageCount decimal(4,0) unsigned not null comment '?y?[?W???'
1298
  , LineCount decimal(3,0) unsigned not null comment '?s???'
1299
  , DataType decimal(1,0) not null comment '?f?[?^???'
1300
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
1301
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
1302
  , SpecCode decimal(5,0) unsigned not null comment '???L?['
1303
  , ItemName varchar(120) comment '??????'
1304
  , SpecName varchar(120) comment '???^?i???E?`??E???@'
1305
  , Unitcount decimal(8,2) not null comment '????'
1306
  , UnitName varchar(30) comment '?P?????'
1307
  , UnitPrice decimal(9,2) not null comment '?P??'
1308
  , LineTotal decimal(12,0) not null comment '???z'
1309
  , note varchar(60) comment '???l'
1310
  , CompanyCode decimal(8,0) not null comment '??????R?[?h'
1311
  , MyExpensesFlg decimal(1,0) not null comment '????o??t???O'
1312
  , InputFlg decimal(1,0) comment '????t???O'
1313
  , EntryDate datetime not null comment '?o?^???t'
1314
  , UpdateDate datetime not null comment '?X?V???t'
1315
  , constraint estimatedatadetail_PKC primary key (ConstructionCode,PageCount,LineCount)
1316
) comment '??Z????f?[?^????' ;
1317

1318
create index EstimateDataDetail_Index1
1319
  on estimatedatadetail(ConstructionCode,PageCount);
1320

1321
-- ?o???}?X?^
1322
drop table if exists expensesmaster cascade;
1323

1324
create table expensesmaster (
1325
  DivisionCode smallint(6) not null comment '?H?????R?[?h'
1326
  , NameCode smallint(6) not null comment '?o????R?[?h'
1327
  , DisplayOrder smallint(6) not null comment '?\????'
1328
  , ExpensesRatio decimal(4,2) not null comment '?o??'
1329
  , DeleteFlg decimal(1,0) not null comment '???t???O'
1330
  , EntryDate datetime not null comment '?o?^???t'
1331
  , UpdateDate datetime not null comment '?X?V???t'
1332
  , constraint expensesmaster_PKC primary key (DivisionCode,NameCode)
1333
) comment '?o???}?X?^' ;
1334

1335
-- ???x???}?X?^
1336
drop table if exists holidaycalendermaster cascade;
1337

1338
create table holidaycalendermaster (
1339
  Holiday date not null comment '?x??'
1340
  , BusinessYear smallint(5) unsigned not null comment '?c??N?x'
1341
  , TargetMonth tinyint(3) unsigned not null comment '?Y????'
1342
  , TargetDay tinyint(3) unsigned not null comment '?Y????'
1343
  , constraint holidaycalendermaster_PKC primary key (Holiday)
1344
) comment '???x???}?X?^' ;
1345

1346
create index HolidayCalender_Index1
1347
  on holidaycalendermaster(BusinessYear);
1348

1349
create index HolidayCalenderMaster_Index2
1350
  on holidaycalendermaster(TargetMonth);
1351

1352
create index HolidayCalenderMaster_Index3
1353
  on holidaycalendermaster(TargetDay);
1354

1355
-- ?????????????
1356
drop table if exists inputsearchlogdata cascade;
1357

1358
create table inputsearchlogdata (
1359
  ConstructionCode decimal(10,0) not null comment '?H???R?[?h'
1360
  , UsedProcessNo decimal(4,0) not null comment '?g?p?@?\???'
1361
  , DisplayOrder decimal(4,0) unsigned not null comment '?\????'
1362
  , DataType decimal(1,0) not null comment '?f?[?^???'
1363
  , InputCode decimal(10,0) comment '????R?[?h'
1364
  , constraint inputsearchlogdata_PKC primary key (ConstructionCode,UsedProcessNo,DisplayOrder)
1365
) comment '?????????????' ;
1366

1367
create index InputSearchLogData_Index1
1368
  on inputsearchlogdata(ConstructionCode,UsedProcessNo,InputCode);
1369

1370
-- ???????f?[?^
1371
drop table if exists invoicedata cascade;
1372

1373
create table invoicedata (
1374
  INVOICENO decimal(9,0) not null comment '??????No'
1375
  , ORDERERSDIVISION decimal(5,0) not null comment '???????'
1376
  , ORDERERSCODE decimal(5,0) not null comment '??????R?[?h'
1377
  , REQUESTMONTH decimal(6,0) not null comment '??????'
1378
  , SEQNO decimal(2,0) not null comment '?A??'
1379
  , CRETATEDATE date not null comment '????'
1380
  , REQUESTDATE date not null comment '??????'
1381
  , REQUESTNAME varchar(120) comment '??????'
1382
  , TOTALAMOUNT decimal(10,0) comment '???????v???z'
1383
  , TAXAMOUNT decimal(10,0) comment '???????z'
1384
  , COMMENT1 varchar(60) comment '?R?????g1'
1385
  , COMMENT2 varchar(60) comment '?R?????g2'
1386
  , COMMENT3 varchar(60) not null comment '?R?????g3'
1387
  , COMMENT4 varchar(60) not null comment '?R?????g4'
1388
  , COMMENT5 varchar(60) not null comment '?R?????g5'
1389
  , COMPLETEFLG decimal(1,0) default '0' not null comment '?????t???O'
1390
  , ENTRYDATE datetime not null comment '?o?^?N????'
1391
  , UPDATEDATE datetime not null comment '?X?V?N????'
1392
  , constraint invoicedata_PKC primary key (INVOICENO)
1393
) comment '???????f?[?^' ;
1394

1395
alter table invoicedata add unique ORDERERSDIVISION (ORDERERSDIVISION,ORDERERSCODE,REQUESTMONTH,SEQNO) ;
1396

1397
-- ??????
1398
drop table if exists materialinfo cascade;
1399

1400
create table materialinfo (
1401
  MATERIALITEMCODE smallint(5) unsigned default 0 not null comment '????i??R?[?h'
1402
  , MATERIALCOUNT smallint(5) unsigned comment '?????'
1403
  , RENTCOUNT smallint(5) unsigned comment '??o??\??'
1404
  , DELETEFLG smallint(5) unsigned comment '???t???O'
1405
  , ENTRYDATE datetime comment '?o?^???t'
1406
  , UPDATEDATE datetime comment '?X?V???t'
1407
  , constraint materialinfo_PKC primary key (MATERIALITEMCODE)
1408
) comment '??????' ;
1409

1410
-- ????i??}?X?^
1411
drop table if exists materialitemmaster cascade;
1412

1413
create table materialitemmaster (
1414
  MATERIALITEMCODE smallint(5) unsigned default 0 not null comment '????i??R?[?h'
1415
  , MATERIALKINDCODE smallint(5) unsigned comment '??????R?[?h'
1416
  , MATERIALITEMNAME varchar(40) comment '????i?????'
1417
  , DISPLAYORDER smallint(5) unsigned comment '?\????'
1418
  , DELETEFLG tinyint(3) unsigned comment '???t???O'
1419
  , ENTRYDATE datetime comment '?o?^???t'
1420
  , UPDATEDATE datetime comment '?X?V???t'
1421
  , VERSIONNO decimal(8,0) default '0' not null comment '?o?[?W???????'
1422
  , constraint materialitemmaster_PKC primary key (MATERIALITEMCODE)
1423
) comment '????i??}?X?^' ;
1424

1425
-- ??????}?X?^
1426
drop table if exists materialkindmaster cascade;
1427

1428
create table materialkindmaster (
1429
  MATERIALKINDCODE smallint(5) unsigned default 0 not null comment '??????R?[?h'
1430
  , MATERIALKINDNAME varchar(40) comment '?????????'
1431
  , DISPLAYORDER smallint(5) unsigned comment '?\????'
1432
  , DELETEFLG tinyint(3) unsigned comment '???t???O'
1433
  , ENTRYDATE datetime comment '?o?^???t'
1434
  , UPDATEDATE datetime comment '?X?V???t'
1435
  , constraint materialkindmaster_PKC primary key (MATERIALKINDCODE)
1436
) comment '??????}?X?^' ;
1437

1438
-- ??????????
1439
drop table if exists materialrecordinfo cascade;
1440

1441
create table materialrecordinfo (
1442
  MATERIALITEMCODE smallint(5) unsigned default 0 not null comment '????i??R?[?h'
1443
  , PROCESSDATE date default '0000-00-00' not null comment '?????N????'
1444
  , SEQNO smallint(5) unsigned default 0 not null comment '?A??'
1445
  , RECKIND tinyint(3) unsigned comment '???R?[?h??'
1446
  , CONSTRUCTIONCODE int(10) unsigned comment '?H?????'
1447
  , PERSONCODE int(10) unsigned comment '?S????R?[?h'
1448
  , MATERIALCOUNT smallint(5) unsigned comment '?????'
1449
  , REPAYPLANDATE date comment '??p?\??N????'
1450
  , COMMENTTEXT varchar(80) comment '?R?????g'
1451
  , ENTRYDATE datetime comment '?o?^???t'
1452
  , UPDATEDATE datetime comment '?X?V???t'
1453
  , constraint materialrecordinfo_PKC primary key (MATERIALITEMCODE,PROCESSDATE,SEQNO)
1454
) comment '??????????' ;
1455

1456
-- ?f??????b?Z?[?W
1457
drop table if exists messageboarddata cascade;
1458

1459
create table messageboarddata (
1460
  RecordNumber decimal(6,0) unsigned not null comment '???R?[?h???'
1461
  , BranchNumber decimal(3,0) unsigned not null comment '???R?[?h?}??'
1462
  , FromCode decimal(8,0) unsigned not null comment '???????R?[?h'
1463
  , FromName varchar(60) not null comment '???????'
1464
  , MessageTitile varchar(100) comment '?`???^?C?g??'
1465
  , MessageContent varchar(1333) not null comment '?`?????e'
1466
  , LinkType decimal(2,0) not null comment '?????N????^?C?v'
1467
  , LinkMessage varchar(200) comment '?????N??????'
1468
  , LinkCode varchar(30) comment '?????N?L?['
1469
  , WritingDate datetime not null comment '?????????'
1470
  , PersonCode decimal(8,0) not null comment '??????S????R?[?h'
1471
  , ShareFlag decimal(2,0) not null comment '???????t???O'
1472
  , MessageColor varchar(8) comment '?????F'
1473
  , BackColor varchar(8) comment '?o?b?N?J???['
1474
  , MessageFlag decimal(1,0) not null comment '???b?Z?[?W?t???O'
1475
  , EntryDate datetime not null comment '?o?^???t'
1476
  , UpdateDate datetime not null comment '?X?V???t'
1477
  , constraint messageboarddata_PKC primary key (RecordNumber,BranchNumber)
1478
) comment '?f??????b?Z?[?W' ;
1479

1480
create index MessageBoardData_Index1
1481
  on messageboarddata(WritingDate);
1482

1483
create index MessageBoardData_Index2
1484
  on messageboarddata(MessageFlag);
1485

1486
-- ?f???????e?[?u??
1487
drop table if exists messageboardterget cascade;
1488

1489
create table messageboardterget (
1490
  RecordNumber decimal(6,0) unsigned not null comment '???R?[?h???'
1491
  , BranchNumber decimal(3,0) unsigned not null comment '???R?[?h?}??'
1492
  , SeqNum decimal(3,0) unsigned not null comment '????'
1493
  , ToCode decimal(8,0) not null comment '????R?[?h'
1494
  , ToName varchar(60) not null comment '????'
1495
  , EntryDate datetime not null comment '?o?^???t'
1496
  , UpdateDate datetime not null comment '?X?V???t'
1497
  , constraint messageboardterget_PKC primary key (RecordNumber,BranchNumber,SeqNum)
1498
) comment '?f???????e?[?u??' ;
1499

1500
create index MessageBoardTerget_Index1
1501
  on messageboardterget(RecordNumber,BranchNumber);
1502

1503
-- ?f??????b?Z?[?W?{??????
1504
drop table if exists messagebrowsinghistory cascade;
1505

1506
create table messagebrowsinghistory (
1507
  RecordNumber decimal(6,0) unsigned not null comment '???R?[?h???'
1508
  , BranchNumber decimal(3,0) unsigned not null comment '???R?[?h?}??'
1509
  , SeqNum decimal(3,0) unsigned not null comment '????'
1510
  , BrowsingCode decimal(8,0) not null comment '?{????R?[?h'
1511
  , BrowsingDate datetime not null comment '?{?????t'
1512
  , EntryDate datetime not null comment '?o?^???t'
1513
  , UpdateDate datetime not null comment '?X?V???t'
1514
  , constraint messagebrowsinghistory_PKC primary key (RecordNumber,BranchNumber,SeqNum)
1515
) comment '?f??????b?Z?[?W?{??????' ;
1516

1517
-- ???}?X?^
1518
drop table if exists monthmaster cascade;
1519

1520
create table monthmaster (
1521
  month smallint(6) not null comment '??'
1522
  , constraint monthmaster_PKC primary key (month)
1523
) comment '???}?X?^' ;
1524

1525
-- ??????}?X?^
1526
drop table if exists orderersmaster cascade;
1527

1528
create table orderersmaster (
1529
  OrderCotegory decimal(5,0) unsigned not null comment '???????'
1530
  , OrderersCode decimal(5,0) unsigned not null comment '??????R?[?h'
1531
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
1532
  , OrderFlg decimal(1,0) not null comment '?@?l?c??E??l?t???O'
1533
  , CorporateStatusName varchar(100) comment '?@?l?i????'
1534
  , CorporateStatusPoint decimal(1,0) comment '?@?l?i?????u'
1535
  , OrderersName1 varchar(60) not null comment '???????1'
1536
  , OrderersName2 varchar(60) comment '????????Q'
1537
  , DepartmentName varchar(60) comment '??????'
1538
  , ChargePersonName varchar(60) comment '?S?????'
1539
  , ZipCode varchar(8) comment '?X????'
1540
  , Address1 varchar(60) comment '?Z???P'
1541
  , Address2 varchar(60) comment '?Z??2'
1542
  , Address3 varchar(60) comment '?Z??3'
1543
  , PhoneNumber varchar(13) comment '?d?b???'
1544
  , FaxNumber varchar(13) comment 'FAX???'
1545
  , MailAddress varchar(257) comment '???[???A?h???X'
1546
  , Note varchar(300) comment '???l'
1547
  , DeleteFlg decimal(1,0) not null comment '???t???O'
1548
  , EntryDate datetime not null comment '?o?^???t'
1549
  , UpdateDate datetime not null comment '?X?V???t'
1550
  , constraint orderersmaster_PKC primary key (OrderCotegory,OrderersCode)
1551
) comment '??????}?X?^' ;
1552

1553
-- ????z?f?[?^
1554
drop table if exists orderspricedata cascade;
1555

1556
create table orderspricedata (
1557
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1558
  , ChangeNo decimal(3,0) unsigned not null comment '??X???'
1559
  , ChangeDate date not null comment '??X??'
1560
  , ChangePersonCode decimal(8,0) unsigned not null comment '??X??R?[?h'
1561
  , ChangePersonName varchar(60) comment '??X???'
1562
  , BeforeValue decimal(14,0) not null comment '??X?O???????z'
1563
  , BeforeValueInTax decimal(14,0) not null comment '??X?O???????z'
1564
  , AfterValue decimal(14,0) not null comment '??X????????z'
1565
  , AfterValueInTax decimal(14,0) not null comment '??X????????z'
1566
  , ChangeComment varchar(200) comment '??X???R'
1567
  , EntryDate datetime not null comment '?o?^???t'
1568
  , UpdateDate datetime not null comment '?X?V???t'
1569
  , constraint orderspricedata_PKC primary key (ConstructionCode,ChangeNo)
1570
) comment '????z?f?[?^' ;
1571

1572
-- ?x?????F???f?[?^
1573
drop table if exists paymentapprovalinfo cascade;
1574

1575
create table paymentapprovalinfo (
1576
  COMPANYCODE decimal(8,0) default '0' not null comment '??????R?[?h'
1577
  , TARGETDATE decimal(6,0) default '0' not null comment '???N??'
1578
  , SEQNO decimal(3,0) default '0' not null comment '?A??'
1579
  , LINECOUNT decimal(3,0) default '0' not null comment '?s???'
1580
  , APPROVALNO decimal(3,0) default '0' not null comment '???F????'
1581
  , APPROVALPERSON decimal(8,0) comment '???F??R?[?h'
1582
  , APPROVALPERSONNAME varchar(20) comment '???F???'
1583
  , APPROVALAUTHORITY decimal(1,0) comment '???F??????'
1584
  , APPROVALDATE date comment '???F???t'
1585
  , ENTRYDATE datetime comment '?o?^???t'
1586
  , UPDATEDATE datetime comment '?X?V???t'
1587
  , constraint paymentapprovalinfo_PKC primary key (COMPANYCODE,TARGETDATE,SEQNO,LINECOUNT,APPROVALNO)
1588
) comment '?x?????F???f?[?^' ;
1589

1590
-- ?x??????f?[?^
1591
drop table if exists paymentdatadetail cascade;
1592

1593
create table paymentdatadetail (
1594
  COMPANYCODE decimal(8,0) default '0' not null comment '??????R?[?h'
1595
  , TARGETDATE decimal(6,0) default '0' not null comment '???N??'
1596
  , SEQNO decimal(3,0) default '0' not null comment '?A??'
1597
  , LINECOUNT decimal(3,0) default '0' not null comment '?s???'
1598
  , BILLPRICE decimal(10,0) comment '???????z'
1599
  , DISCOUNTPRICE decimal(10,0) comment '?l???????z'
1600
  , OFFSETPRICE decimal(10,0) comment '???E???z'
1601
  , NEXTCOPRICE decimal(10,0) comment '????J?z'
1602
  , HIGHWPRICE decimal(10,0) comment '??????'
1603
  , HARDWPRICE decimal(10,0) comment '??????'
1604
  , INDSWASTETAX decimal(10,0) comment '?Y?p??'
1605
  , CNSTRPRICE decimal(10,0) comment '?????'
1606
  , CNSTRPRICEEXIST decimal(1,0) comment '??????L??'
1607
  , APPROVALPERSONCODE decimal(8,0) comment '???F?S????R?[?h'
1608
  , APPROVALDATE date comment '?S??????F???t'
1609
  , APPROVALENDFLG decimal(1,0) comment '???F?????t???O'
1610
  , ENTRYDATE datetime comment '?o?^???t'
1611
  , UPDATEDATE datetime comment '?X?V???t'
1612
  , constraint paymentdatadetail_PKC primary key (COMPANYCODE,TARGETDATE,SEQNO,LINECOUNT)
1613
) comment '?x??????f?[?^' ;
1614

1615
create index PayDataDetail_Index1
1616
  on paymentdatadetail(TARGETDATE);
1617

1618
create index PayDataDetail_Index2
1619
  on paymentdatadetail(APPROVALPERSONCODE);
1620

1621
-- ?H??????????f?[?^
1622
drop table if exists periodavoidance cascade;
1623

1624
create table periodavoidance (
1625
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1626
  , ConstructionStatusFlg decimal(2,0) not null comment '?H?????t???O'
1627
  , FieldNo decimal(2,0) not null comment '?`?F?b?N???t?B?[???h???'
1628
  , EntryDate datetime not null comment '?o?^???t'
1629
  , UpdateDate datetime not null comment '?X?V???t'
1630
  , constraint periodavoidance_PKC primary key (ConstructionCode,ConstructionStatusFlg,FieldNo)
1631
) comment '?H??????????f?[?^' ;
1632

1633
create index PeriodAvoidance_Index1
1634
  on periodavoidance(ConstructionCode);
1635

1636
create index PeriodAvoidance_Index2
1637
  on periodavoidance(ConstructionStatusFlg);
1638

1639
create index PeriodAvoidance_Index3
1640
  on periodavoidance(FieldNo);
1641

1642
-- ?S??????F?f?[?^
1643
drop table if exists personapproval cascade;
1644

1645
create table personapproval (
1646
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
1647
  , ApprovalCode decimal(3,0) unsigned not null comment '???F?@?\???'
1648
  , OrderDate date not null comment '??t??'
1649
  , OrderNo decimal(2,0) unsigned not null comment '??t???'
1650
  , SeqNo decimal(2,0) not null comment '?}??'
1651
  , PersonCodeApproval decimal(8,0) unsigned not null comment '?\???E???F??R?[?h'
1652
  , PetitionApprovalDate datetime not null comment '?\???E???F???t'
1653
  , ApprovalLimitDates datetime not null comment '???F??]??'
1654
  , ApprovalStatus decimal(1,0) not null comment '???F???'
1655
  , InputComment varchar(300) comment '?R?????g'
1656
  , EntryDate datetime not null comment '?o?^???t'
1657
  , UpdateDate datetime not null comment '?X?V???t'
1658
  , constraint personapproval_PKC primary key (PersonCode,ApprovalCode,OrderDate,OrderNo,SeqNo)
1659
) comment '?S??????F?f?[?^' ;
1660

1661
-- ?S??????F?R?????g?f?[?^
1662
drop table if exists personapprovalcomment cascade;
1663

1664
create table personapprovalcomment (
1665
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
1666
  , ApprovalCode decimal(3,0) unsigned not null comment '???F?@?\???'
1667
  , OrderDate date not null comment '??t??'
1668
  , OrderNo decimal(2,0) unsigned not null comment '??t???'
1669
  , CommentNo decimal(2,0) not null comment '?R?????g???'
1670
  , ParentNo decimal(2,0) not null comment '?e?R?????g???'
1671
  , ApproValComment varchar(300) comment '?w???E?A???R?????g'
1672
  , EntryDate datetime not null comment '?o?^???t'
1673
  , UpdateDate datetime not null comment '?X?V???t'
1674
  , constraint personapprovalcomment_PKC primary key (PersonCode,ApprovalCode,OrderDate,OrderNo,CommentNo)
1675
) comment '?S??????F?R?????g?f?[?^' ;
1676

1677
-- ?S??????????}?X?^
1678
drop table if exists persondepartmentmaster cascade;
1679

1680
create table persondepartmentmaster (
1681
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
1682
  , DepartmentCode decimal(5,0) unsigned not null comment '?????R?[?h'
1683
  , AffiliationFlg decimal(1,0) not null comment '?????t???O'
1684
  , EntryDate datetime not null comment '?o?^???t'
1685
  , UpdateDate datetime not null comment '?X?V???t'
1686
  , constraint persondepartmentmaster_PKC primary key (PersonCode,DepartmentCode)
1687
) comment '?S??????????}?X?^' ;
1688

1689
create index PersonDepartmentMaster_Index1
1690
  on persondepartmentmaster(PersonCode);
1691

1692
create index PersonDepartmentMaster_Index2
1693
  on persondepartmentmaster(DepartmentCode);
1694

1695
-- ?S????}?X?^
1696
drop table if exists personinchargemaster cascade;
1697

1698
create table personinchargemaster (
1699
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
1700
  , DisplayOrder decimal(8,0) unsigned not null comment '?\????'
1701
  , PersonName varchar(60) not null comment '?S?????'
1702
  , StartDate date not null comment '?g?p?J?n?N????'
1703
  , EndDate date comment '?g?p?I???N????'
1704
  , PassWord varchar(16) comment '?p?X???[?h'
1705
  , SecurityManagement decimal(1,0) not null comment '?@????'
1706
  , SecCode decimal(2,0) unsigned not null comment '???????'
1707
  , MsgBackColor varchar(8) comment '???b?Z?[?W?w?i?F'
1708
  , DisplayString varchar(20) comment '?\???E???????'
1709
  , DepartmentCode decimal(5,0) unsigned comment '?????R?[?h'
1710
  , MonthlySalary decimal(11,0) not null comment '???????z'
1711
  , YearSalary decimal(12,0) not null comment '?N????z'
1712
  , Qualification varchar(120) comment '???i?????'
1713
  , SealPrintName varchar(5) comment '???\????'
1714
  , EmployeeClassFlg decimal(1,0) not null comment '?????'
1715
  , LedgerFlg decimal(1,0) not null comment '???v?Z???t???O'
1716
  , CommutingDistance decimal(5,2) not null comment '??????'
1717
  , CommuteCosts decimal(5,0) not null comment '??????'
1718
  , DeleteFlg decimal(1,0) not null comment '???t???O'
1719
  , EntryDate datetime not null comment '?o?^???t'
1720
  , UpdateDate datetime not null comment '?X?V???t'
1721
  , constraint personinchargemaster_PKC primary key (PersonCode)
1722
) comment '?S????}?X?^' ;
1723

1724
create index PersonInChargeMaster_Index1
1725
  on personinchargemaster(StartDate);
1726

1727
create index PersonInChargeMaster_Index2
1728
  on personinchargemaster(DepartmentCode);
1729

1730
-- ?S??????^?}?X?^
1731
drop table if exists personsalarymaster cascade;
1732

1733
create table personsalarymaster (
1734
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
1735
  , StartDate date not null comment '?g?p?J?n?N????'
1736
  , MonthlySalary decimal(11,0) not null comment '???????z'
1737
  , YearSalary decimal(12,0) not null comment '?N????z'
1738
  , EntryDate datetime not null comment '?o?^???t'
1739
  , UpdateDate datetime not null comment '?X?V???t'
1740
  , constraint personsalarymaster_PKC primary key (PersonCode,StartDate)
1741
) comment '?S??????^?}?X?^' ;
1742

1743
create index PersonSalaryMaster_Index1
1744
  on personsalarymaster(PersonCode);
1745

1746
create index PersonSalaryMaster_Index2
1747
  on personsalarymaster(StartDate);
1748

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

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

1755
create table pointingoutcomment (
1756
  ConstructionCode decimal(10,0) not null comment '?H???R?[?h'
1757
  , ProcessNo smallint(6) not null comment '????????i??????j'
1758
  , SeqNo smallint(6) not null comment '????'
1759
  , PageCount smallint(6) not null comment '?y?[?W???'
1760
  , PersonCode decimal(8,0) not null comment '?L????R?[?h'
1761
  , DrowColor varchar(8) comment '?`??F'
1762
  , CommentMessage varchar(1000) comment '???b?Z?[?W'
1763
  , StartPointX smallint(6) not null comment '?w?E?????u?w'
1764
  , StartPointY smallint(6) not null comment '?w?E?????u?x'
1765
  , CurrentPointX smallint(6) not null comment '??????u?w'
1766
  , CurrentPointY smallint(6) not null comment '??????u?x'
1767
  , CurrentWidth smallint(6) not null comment '?\???T?C?YWidth'
1768
  , CurrentHeight smallint(6) not null comment '?\???T?C?YHeigth'
1769
  , EntryDate datetime not null comment '?o?^???t'
1770
  , UpdateDate datetime not null comment '?X?V???t'
1771
  , constraint pointingoutcomment_PKC primary key (ConstructionCode,ProcessNo,SeqNo)
1772
) comment '?w???????f?[?^' ;
1773

1774
-- ?????????????c???^?f?[?^
1775
drop table if exists proceedingsdata cascade;
1776

1777
create table proceedingsdata (
1778
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1779
  , ProceedingsDataDate date not null comment '?c???^????'
1780
  , StartMeetingTime decimal(4,0) unsigned not null comment '??c????J?n'
1781
  , EndMeetingTime decimal(4,0) unsigned not null comment '??c????I??'
1782
  , CreatorCode decimal(8,0) not null comment '????R?[?h'
1783
  , PalceFlag decimal(1,0) not null comment '???n?t???O'
1784
  , MeetingPalce varchar(120) comment '???????'
1785
  , EntryDate datetime not null comment '?o?^???t'
1786
  , UpdateDate datetime not null comment '?X?V???t'
1787
  , constraint proceedingsdata_PKC primary key (ConstructionCode,ProceedingsDataDate,StartMeetingTime)
1788
) comment '?????????????c???^?f?[?^' ;
1789

1790
-- ?????????????c???^?f?[?^?i?o???j
1791
drop table if exists proceedingsdataattend cascade;
1792

1793
create table proceedingsdataattend (
1794
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1795
  , ProceedingsDataDate date not null comment '?c???^????'
1796
  , StartMeetingTime decimal(4,0) unsigned not null comment '??c????J?n'
1797
  , SeqNo decimal(3,0) unsigned not null comment '????s???'
1798
  , Department varchar(20) comment '?o??????'
1799
  , AttendName varchar(10) comment '?o??????'
1800
  , EntryDate datetime not null comment '?o?^???t'
1801
  , UpdateDate datetime not null comment '?X?V???t'
1802
  , constraint proceedingsdataattend_PKC primary key (ConstructionCode,ProceedingsDataDate,StartMeetingTime,SeqNo)
1803
) comment '?????????????c???^?f?[?^?i?o???j' ;
1804

1805
-- ?????????????c???^?f?[?^?i????j
1806
drop table if exists proceedingsdatadetail cascade;
1807

1808
create table proceedingsdatadetail (
1809
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1810
  , ProceedingsDataDate date not null comment '?c???^????'
1811
  , StartMeetingTime decimal(4,0) unsigned not null comment '??c????J?n'
1812
  , SeqNo decimal(3,0) unsigned not null comment '????s???'
1813
  , TitleNo varchar(5) comment '?c????'
1814
  , Title varchar(20) comment '?c??'
1815
  , ContentsText varchar(50) comment '???e'
1816
  , EntryDate datetime not null comment '?o?^???t'
1817
  , UpdateDate datetime not null comment '?X?V???t'
1818
  , constraint proceedingsdatadetail_PKC primary key (ConstructionCode,ProceedingsDataDate,StartMeetingTime,SeqNo)
1819
) comment '?????????????c???^?f?[?^?i????j' ;
1820

1821
-- ???F?f?[?^
1822
drop table if exists processapproval cascade;
1823

1824
create table processapproval (
1825
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1826
  , ApprovalCode decimal(3,0) unsigned not null comment '???F?@?\???'
1827
  , OrderNo decimal(2,0) unsigned not null comment '??t???'
1828
  , SeqNo decimal(2,0) not null comment '?}??'
1829
  , PersonCode decimal(8,0) unsigned not null comment '?\???E???F??R?[?h'
1830
  , PetitionApprovalDate datetime not null comment '?\???E???F???t'
1831
  , ApprovalLimitDates datetime not null comment '???F??]??'
1832
  , ApprovalStatus decimal(1,0) not null comment '???F???'
1833
  , InputComment varchar(300) comment '?R?????g'
1834
  , EntryDate datetime not null comment '?o?^???t'
1835
  , UpdateDate datetime not null comment '?X?V???t'
1836
  , constraint processapproval_PKC primary key (ConstructionCode,ApprovalCode,OrderNo,SeqNo)
1837
) comment '???F?f?[?^' ;
1838

1839
-- ???F?R?????g?f?[?^
1840
drop table if exists processapprovalcomment cascade;
1841

1842
create table processapprovalcomment (
1843
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1844
  , ApprovalCode decimal(3,0) unsigned not null comment '???F?@?\???'
1845
  , OrderNo decimal(2,0) unsigned not null comment '??t???'
1846
  , CommentNo decimal(2,0) not null comment '?R?????g???'
1847
  , ParentNo decimal(2,0) not null comment '?e?R?????g???'
1848
  , ApproValComment varchar(300) comment '?w???E?A???R?????g'
1849
  , EntryDate datetime not null comment '?o?^???t'
1850
  , UpdateDate datetime not null comment '?X?V???t'
1851
  , constraint processapprovalcomment_PKC primary key (ConstructionCode,ApprovalCode,OrderNo,CommentNo)
1852
) comment '???F?R?????g?f?[?^' ;
1853

1854
-- ???F????f?[?^
1855
drop table if exists processapprovaldetail cascade;
1856

1857
create table processapprovaldetail (
1858
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1859
  , ApprovalCode decimal(3,0) unsigned not null comment '???F?@?\???'
1860
  , OrderNo decimal(2,0) unsigned not null comment '??t???'
1861
  , SerialNo decimal(2,0) unsigned not null comment '?}??'
1862
  , LinkCode decimal(10,0) not null comment '?????N???'
1863
  , EntryDate datetime not null comment '?o?^???t'
1864
  , UpdateDate datetime not null comment '?X?V???t'
1865
  , constraint processapprovaldetail_PKC primary key (ConstructionCode,ApprovalCode,OrderNo,SerialNo)
1866
) comment '???F????f?[?^' ;
1867

1868
-- ?N?????}?X?^
1869
drop table if exists processexcutemaster cascade;
1870

1871
create table processexcutemaster (
1872
  SecCode decimal(2,0) unsigned not null comment '???????'
1873
  , ExecCode decimal(4,0) unsigned not null comment '?N?????????'
1874
  , EditFlg decimal(1,0) not null comment '??W?t???O'
1875
  , EntryDate datetime not null comment '?o?^???t'
1876
  , UpdateDate datetime not null comment '?X?V???t'
1877
  , constraint processexcutemaster_PKC primary key (SecCode,ExecCode)
1878
) comment '?N?????}?X?^' ;
1879

1880
create index ProcessExcuteMaster_Index1
1881
  on processexcutemaster(SecCode);
1882

1883
create index ProcessExcuteMaster_Index2
1884
  on processexcutemaster(ExecCode);
1885

1886
-- ???????f?[?^
1887
drop table if exists purchaseorder cascade;
1888

1889
create table purchaseorder (
1890
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1891
  , SeqNo decimal(3,0) unsigned not null comment '???????}??'
1892
  , CompanyCode decimal(8,0) not null comment '??????R?[?h'
1893
  , CreateDate date comment '?????t'
1894
  , OrderPrice decimal(12,0) not null comment '???????z'
1895
  , LastRowStringDate date not null comment '??I?s?\?????t'
1896
  , OrderSheetType decimal(1,0) not null comment '???E?{???t???O'
1897
  , PaymentTerms decimal(1,0) not null comment '?x????????'
1898
  , CashRatio decimal(4,1) not null comment '?????????i???j'
1899
  , BillPeriod decimal(4,0) not null comment '??`????'
1900
  , PrePayments decimal(1,0) not null comment '?O????'
1901
  , PrePaymentsDays decimal(3,0) not null comment '?O????????'
1902
  , PrePaymentsPrice decimal(12,0) not null comment '?O???????z'
1903
  , PartialPayment decimal(1,0) not null comment '??????'
1904
  , PartialPaymentMounth decimal(2,0) unsigned not null comment '???????????'
1905
  , PartialPaymentDay1 decimal(2,0) unsigned not null comment '???????????'
1906
  , PartialPaymentDay2 decimal(2,0) unsigned not null comment '???????x????'
1907
  , PartialPaymentPrice decimal(12,0) not null comment '?????????z'
1908
  , CompletionPayment decimal(1,0) not null comment '???n??????x??'
1909
  , CompletionPaymentDays decimal(3,0) unsigned not null comment '???n??????x??????'
1910
  , CompletionPaymentPrice decimal(12,0) not null comment '???n??????x?????z'
1911
  , LeadEngineerCode decimal(8,0) comment '??C?Z?p??R?[?h'
1912
  , LeadEngineerName varchar(60) comment '??C?Z?p???'
1913
  , SafetyOfficerCode decimal(8,0) comment '???S?????R?[?h'
1914
  , SafetyOfficerName varchar(60) comment '???S??????'
1915
  , WorkersCount decimal(3,0) unsigned comment '??????'
1916
  , PrintoutDate date not null comment '????N????'
1917
  , EntryDate datetime not null comment '?o?^???t'
1918
  , UpdateDate datetime not null comment '?X?V???t'
1919
  , constraint purchaseorder_PKC primary key (ConstructionCode,SeqNo)
1920
) comment '???????f?[?^' ;
1921

1922
-- ?????????t?f?[?^
1923
drop table if exists purchaseorderdate cascade;
1924

1925
create table purchaseorderdate (
1926
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1927
  , SeqNo decimal(3,0) unsigned not null comment '???????}??'
1928
  , CompanyCode decimal(8,0) not null comment '??????R?[?h'
1929
  , SendDate date not null comment '???????X????'
1930
  , ReturnDate date not null comment '???????????'
1931
  , ReturnCheckDate date not null comment '??????????m?F??'
1932
  , EntryDate datetime not null comment '?o?^???t'
1933
  , UpdateDate datetime not null comment '?X?V???t'
1934
  , constraint purchaseorderdate_PKC primary key (ConstructionCode,SeqNo)
1935
) comment '?????????t?f?[?^' ;
1936

1937
-- ??????????f?[?^
1938
drop table if exists purchaseorderdetail cascade;
1939

1940
create table purchaseorderdetail (
1941
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1942
  , SeqNo decimal(3,0) unsigned not null comment '???????}??'
1943
  , GroupCount decimal(1,0) not null comment '?O???[?v???'
1944
  , LineCount decimal(3,0) unsigned not null comment '?s???'
1945
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
1946
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
1947
  , FirstString varchar(120) comment '?H??E?i??'
1948
  , SecondString varchar(120) comment '???e????'
1949
  , UnitCount decimal(8,2) not null comment '????'
1950
  , UnitName varchar(30) comment '?P??'
1951
  , UnitPrice decimal(10,0) not null comment '?P??'
1952
  , OrdersLinePrice decimal(12,0) comment '???z'
1953
  , SourceCode decimal(10,0) unsigned not null comment '???H?????'
1954
  , SourceDetailCnt decimal(4,0) unsigned not null comment '????????'
1955
  , DataTypeFlag decimal(1,0) unsigned not null comment '?f?[?^?^?C?v?t???O'
1956
  , EntryDate datetime not null comment '?o?^???t'
1957
  , UpdateDate datetime not null comment '?X?V???t'
1958
  , constraint purchaseorderdetail_PKC primary key (ConstructionCode,SeqNo,GroupCount,LineCount)
1959
) comment '??????????f?[?^' ;
1960

1961
create index POrderDetail_Index1
1962
  on purchaseorderdetail(SourceCode);
1963

1964
-- ?????f?[?^
1965
drop table if exists requestdata cascade;
1966

1967
create table requestdata (
1968
  REQUESTNO decimal(9,0) not null comment '????No'
1969
  , MAINCONSTRUCTIONCODE decimal(10,0) not null comment '?{?H?????'
1970
  , CONSTRUCTIONNAME varchar(120) not null comment '?H??????'
1971
  , CONTRACTAMOUNT decimal(10,0) not null comment '???????z'
1972
  , PAIDAMOUNT decimal(10,0) not null comment '????????z'
1973
  , REQUESTAMOUNT0 decimal(10,0) not null comment '???????z?O'
1974
  , REQUESTAMOUNT1 decimal(10,0) not null comment '???????z?P'
1975
  , REQUESTAMOUNT2 decimal(10,0) comment '???????z?Q'
1976
  , REQUESTAMOUNT3 decimal(10,0) comment '???????z?R'
1977
  , REQUESTAMOUNT4 decimal(10,0) comment '???????z?S'
1978
  , REQUESTAMOUNT5 decimal(10,0) comment '???????z?T'
1979
  , REQUESTAMOUNT6 decimal(10,0) comment '???????z?U'
1980
  , UNCLAIMEDAMOUNT decimal(10,0) not null comment '?????c???z'
1981
  , UNPAIDAMOUNT decimal(10,0) not null comment '?????????z'
1982
  , TAXAMOUNT decimal(10,0) not null comment '?????'
1983
  , NOTE varchar(120) not null comment '???l'
1984
  , ENTRYDATE datetime not null comment '?o?^?N????'
1985
  , UPDATEDATE datetime not null comment '?X?V?N????'
1986
  , constraint requestdata_PKC primary key (REQUESTNO,MAINCONSTRUCTIONCODE)
1987
) comment '?????f?[?^' ;
1988

1989
-- ?????f?[?^????
1990
drop table if exists requestdatadetail cascade;
1991

1992
create table requestdatadetail (
1993
  REQUESTNO decimal(9,0) not null comment '????No'
1994
  , MAINCONSTRUCTIONCODE decimal(10,0) not null comment '?{?H?????'
1995
  , CONSTRUCTIONCODE decimal(10,0) not null comment '?H?????'
1996
  , CONSTRUCTIONKIND decimal(1,0) not null comment '?H????'
1997
  , REQUESTAMOUNT decimal(10,0) not null comment '???????z'
1998
  , TAXAMOUNT decimal(10,0) not null comment '?????'
1999
  , ENTRYDATE datetime not null comment '?o?^?N????'
2000
  , UPDATEDATE datetime not null comment '?X?V?N????'
2001
  , constraint requestdatadetail_PKC primary key (REQUESTNO,MAINCONSTRUCTIONCODE,CONSTRUCTIONCODE,CONSTRUCTIONKIND)
2002
) comment '?????f?[?^????' ;
2003

2004
-- ?????w?b?_
2005
drop table if exists requesthead cascade;
2006

2007
create table requesthead (
2008
  REQUESTNO decimal(9,0) not null comment '????No'
2009
  , REQCONSTRUCTIONCODE decimal(10,0) not null comment '?????H?????'
2010
  , ORDERNO decimal(2,0) not null comment '??t???'
2011
  , REQUESTMONTH decimal(6,0) not null comment '??????'
2012
  , ORDERERSDIVISION decimal(5,0) not null comment '???????'
2013
  , ORDERERSCODE decimal(5,0) not null comment '??????R?[?h'
2014
  , ORDERERSNAME varchar(120) not null comment '???????'
2015
  , REQCONSTRUCTIONNAME varchar(120) not null comment '?????H??????'
2016
  , REQUESTTOTALAMOUNT decimal(10,0) not null comment '???????z???v'
2017
  , REQUESTAMOUNT decimal(10,0) not null comment '???????z'
2018
  , TAXAMOUNT decimal(10,0) not null comment '?????'
2019
  , UNPAIDAMOUNT decimal(10,0) comment '??????'
2020
  , NOTE varchar(120) comment '???l'
2021
  , ASSIGNEDFLG decimal(1,0) comment '??????t???O'
2022
  , INVOICENO decimal(9,0) not null comment '??????No'
2023
  , ENTRYDATE datetime not null comment '?o?^?N????'
2024
  , UPDATEDATE datetime not null comment '?X?V?N????'
2025
  , constraint requesthead_PKC primary key (REQUESTNO)
2026
) comment '?????w?b?_' ;
2027

2028
alter table requesthead add unique REQCONSTRUCTIONCODE (REQCONSTRUCTIONCODE,ORDERNO) ;
2029

2030
-- ?????????t?f?[?^
2031
drop table if exists requestorderdate cascade;
2032

2033
create table requestorderdate (
2034
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
2035
  , InvoiceNo decimal(9,0) not null comment '??????No'
2036
  , SendDate date not null comment '???????????X????'
2037
  , EntryDate datetime not null comment '?o?^???t'
2038
  , UpdateDate datetime not null comment '?X?V???t'
2039
  , constraint requestorderdate_PKC primary key (ConstructionCode,InvoiceNo)
2040
) comment '?????????t?f?[?^' ;
2041

2042
-- ????O???t?f?[?^
2043
drop table if exists salesgraphdata cascade;
2044

2045
create table salesgraphdata (
2046
  GraphDataCode decimal(8,0) not null comment '?O???t?f?[?^?R?[?h'
2047
  , ConstructionPeriod decimal(4,0) unsigned not null comment '?????'
2048
  , SalesDataDays date not null comment '????N??'
2049
  , DisplayOrder decimal(8,0) unsigned not null comment '?\????'
2050
  , DataName varchar(100) not null comment '?f?[?^?\??????'
2051
  , SalesAmount decimal(10,0) not null comment '????f?[?^'
2052
  , AdministrativeExpense decimal(10,0) not null comment '???E?????o??'
2053
  , GrossProfit decimal(10,0) not null comment '?e???v'
2054
  , NetIncome decimal(10,0) not null comment '?????v(???v)'
2055
  , EntryDate datetime not null comment '?o?^???t'
2056
  , UpdateDate datetime not null comment '?X?V???t'
2057
  , constraint salesgraphdata_PKC primary key (GraphDataCode,ConstructionPeriod,SalesDataDays)
2058
) comment '????O???t?f?[?^' ;
2059

2060
create index SalesGraphData_Idx1
2061
  on salesgraphdata(DisplayOrder);
2062

2063
create index SalesGraphData_idx2
2064
  on salesgraphdata(ConstructionPeriod);
2065

2066
-- ?????}?X?^
2067
drop table if exists securitymaster cascade;
2068

2069
create table securitymaster (
2070
  SecCode decimal(2,0) unsigned not null comment '???????'
2071
  , DisplayOrder decimal(2,0) not null comment '?\????'
2072
  , SecName varchar(60) not null comment '????????'
2073
  , SecRank decimal(1,0) not null comment '?????????N'
2074
  , SecRange decimal(1,0) not null comment '???????'
2075
  , GeneralAffairs decimal(1,0) not null comment '????????t???O'
2076
  , SelectBackColor varchar(8) not null comment '?I??w?i?F'
2077
  , EntryDate datetime not null comment '?o?^???t'
2078
  , UpdateDate datetime not null comment '?X?V???t'
2079
  , constraint securitymaster_PKC primary key (SecCode)
2080
) comment '?????}?X?^' ;
2081

2082
create index SecurityMaster_Index1
2083
  on securitymaster(DisplayOrder);
2084

2085
create index SecurityMaster_Index2
2086
  on securitymaster(SecRank);
2087

2088
create index SecurityMaster_Index3
2089
  on securitymaster(SecRange);
2090

2091
-- ???S?p?g???[???f?[?^
2092
drop table if exists sfpdata cascade;
2093

2094
create table sfpdata (
2095
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
2096
  , DataCount decimal(2,0) unsigned not null comment '?p?g???[????'
2097
  , RequestDate datetime not null comment '?p?g???[???v??????'
2098
  , PersonCode decimal(8,0) unsigned not null comment '?\????R?[?h'
2099
  , StringValue varchar(300) comment '?R?????g'
2100
  , OrderNo decimal(2,0) unsigned not null comment '?\????t???'
2101
  , EntryDate datetime not null comment '?o?^???t'
2102
  , UpdateDate datetime not null comment '?X?V???t'
2103
  , constraint sfpdata_PKC primary key (ConstructionCode,DataCount)
2104
) comment '???S?p?g???[???f?[?^' ;
2105

2106
create index SFPData_Index1
2107
  on sfpdata(RequestDate);
2108

2109
-- ???S?p?g???[??????f?[?^
2110
drop table if exists sfpdatadetail cascade;
2111

2112
create table sfpdatadetail (
2113
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
2114
  , DataCount decimal(2,0) unsigned not null comment '?p?g???[????'
2115
  , SeqNo decimal(2,0) unsigned not null comment '?f?[?^?}??'
2116
  , CompanyCode decimal(8,0) unsigned not null comment '??????R?[?h'
2117
  , EntryDate datetime not null comment '?o?^???t'
2118
  , UpdateDate datetime not null comment '?X?V???t'
2119
  , constraint sfpdatadetail_PKC primary key (ConstructionCode,DataCount,SeqNo)
2120
) comment '???S?p?g???[??????f?[?^' ;
2121

2122
-- ??????{?H?H??o?^?\???f?[?^
2123
drop table if exists subconstrjobitemregist cascade;
2124

2125
create table subconstrjobitemregist (
2126
  PersonCode decimal(8,0) unsigned not null comment '?\??????'
2127
  , CreateDate date not null comment '????'
2128
  , SeqNo decimal(2,0) unsigned not null comment '?\???A??'
2129
  , DisplayOrder decimal(8,0) unsigned not null comment '?\????'
2130
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
2131
  , EntryDate datetime not null comment '?o?^???t'
2132
  , UpdateDate datetime not null comment '?X?V???t'
2133
  , constraint subconstrjobitemregist_PKC primary key (PersonCode,CreateDate,SeqNo,DisplayOrder)
2134
) comment '??????{?H?H??o?^?\???f?[?^' ;
2135

2136
-- ??????E?????N?o?^?\???f?[?^
2137
drop table if exists subconstrjoblinkregist cascade;
2138

2139
create table subconstrjoblinkregist (
2140
  PersonCode decimal(8,0) unsigned not null comment '?\??????'
2141
  , CreateDate date not null comment '????'
2142
  , SeqNo decimal(2,0) unsigned not null comment '?\???A??'
2143
  , DisplayOrder decimal(8,0) unsigned not null comment '?\????'
2144
  , JobCategoryCode decimal(5,0) not null comment '?E??L?['
2145
  , EntryDate datetime not null comment '?o?^???t'
2146
  , UpdateDate datetime not null comment '?X?V???t'
2147
  , constraint subconstrjoblinkregist_PKC primary key (PersonCode,CreateDate,SeqNo,DisplayOrder)
2148
) comment '??????E?????N?o?^?\???f?[?^' ;
2149

2150
-- ??????o?^?\???f?[?^
2151
drop table if exists subconstrregist cascade;
2152

2153
create table subconstrregist (
2154
  PersonCode decimal(8,0) unsigned not null comment '?\??????'
2155
  , CreateDate date not null comment '????'
2156
  , SeqNo decimal(2,0) unsigned not null comment '?\???A??'
2157
  , DataMode decimal(1,0) comment '?f?[?^??'
2158
  , SourceCode decimal(8,0) not null comment '??????R?[?h'
2159
  , PetitionPeriod decimal(4,0) unsigned not null comment '?\???N?x'
2160
  , CorporateStatusName varchar(40) comment '?@?l?i????'
2161
  , CorporateStatusPoint decimal(1,0) not null comment '?@?l?i?????u'
2162
  , CompanyName varchar(100) not null comment '???????'
2163
  , CEOPositionName varchar(60) comment '??\???E??'
2164
  , CEOName varchar(60) comment '??\?????'
2165
  , ContactPersonName varchar(60) comment '?S???????'
2166
  , ZipCode varchar(8) comment '?X????'
2167
  , Address1 varchar(60) comment '?Z???P'
2168
  , Address2 varchar(60) comment '?Z??2'
2169
  , Address3 varchar(60) comment '?Z??3'
2170
  , CellPhoneNumber varchar(13) comment '?g??d?b???'
2171
  , MailAddress varchar(257) comment '???[???A?h???X'
2172
  , PhoneNumber varchar(13) comment '?d?b???'
2173
  , FaxNumber varchar(13) comment 'FAX???'
2174
  , JapaneseSyllabary varchar(2) comment '50?????'
2175
  , StartDate date not null comment '????J?n?N????'
2176
  , Note varchar(300) comment '???l'
2177
  , labourKind decimal(1,0) not null comment '?x???????E????'
2178
  , OrderDate date comment '?\????'
2179
  , OrderNo decimal(2,0) unsigned not null comment '?\????t???'
2180
  , EntryDate datetime not null comment '?o?^???t'
2181
  , UpdateDate datetime not null comment '?X?V???t'
2182
  , constraint subconstrregist_PKC primary key (PersonCode,CreateDate,SeqNo)
2183
) comment '??????o?^?\???f?[?^' ;
2184

2185
-- ??????H??}?X?^
2186
drop table if exists subcontractoritemmaster cascade;
2187

2188
create table subcontractoritemmaster (
2189
  ItemCode decimal(5,0) unsigned not null comment '?H??L?['
2190
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2191
  , ItemName varchar(120) not null comment '?H????'
2192
  , DeleteFlg decimal(1,0) not null comment '???t???O'
2193
  , EntryDate datetime not null comment '?o?^???t'
2194
  , UpdateDate datetime not null comment '?X?V???t'
2195
  , constraint subcontractoritemmaster_PKC primary key (ItemCode)
2196
) comment '??????H??}?X?^' ;
2197

2198
-- ??????E??}?X?^
2199
drop table if exists subcontractorjobcategory cascade;
2200

2201
create table subcontractorjobcategory (
2202
  JobCategoryCode decimal(5,0) not null comment '?E??L?['
2203
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2204
  , JobCategoryName varchar(120) not null comment '?E????'
2205
  , DeleteFlg decimal(1,0) not null comment '???t???O'
2206
  , EntryDate datetime not null comment '?o?^???t'
2207
  , UpdateDate datetime not null comment '?X?V???t'
2208
  , constraint subcontractorjobcategory_PKC primary key (JobCategoryCode)
2209
) comment '??????E??}?X?^' ;
2210

2211
-- ??????{?H?H??f?[?^
2212
drop table if exists subcontractorjobitem cascade;
2213

2214
create table subcontractorjobitem (
2215
  CompanyCode decimal(8,0) not null comment '??????R?[?h'
2216
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
2217
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2218
  , EntryDate datetime not null comment '?o?^???t'
2219
  , UpdateDate datetime not null comment '?X?V???t'
2220
  , constraint subcontractorjobitem_PKC primary key (CompanyCode,ItemCode)
2221
) comment '??????{?H?H??f?[?^' ;
2222

2223
create index SubContractorJobItem_Index1
2224
  on subcontractorjobitem(CompanyCode);
2225

2226
create index SubContractorJobItem_Index2
2227
  on subcontractorjobitem(ItemCode);
2228

2229
-- ??????E?????N?}?X?^
2230
drop table if exists subcontractorjoblink cascade;
2231

2232
create table subcontractorjoblink (
2233
  CompanyCode decimal(8,0) not null comment '??????R?[?h'
2234
  , JobCategoryCode decimal(5,0) not null comment '?E??L?['
2235
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2236
  , EntryDate datetime not null comment '?o?^???t'
2237
  , UpdateDate datetime not null comment '?X?V???t'
2238
  , constraint subcontractorjoblink_PKC primary key (CompanyCode,JobCategoryCode)
2239
) comment '??????E?????N?}?X?^' ;
2240

2241
create index SubContractorJobLink_Index1
2242
  on subcontractorjoblink(CompanyCode);
2243

2244
create index SubContractorJobLink_Index2
2245
  on subcontractorjoblink(JobCategoryCode);
2246

2247
-- ??????}?X?^
2248
drop table if exists subcontractormaster cascade;
2249

2250
create table subcontractormaster (
2251
  CompanyCode decimal(8,0) not null comment '??????R?[?h'
2252
  , DisplayOrder decimal(8,0) unsigned not null comment '?\????'
2253
  , CorporateStatusName varchar(40) comment '?@?l?i????'
2254
  , CorporateStatusPoint decimal(1,0) not null comment '?@?l?i?????u'
2255
  , CompanyName varchar(100) not null comment '???????'
2256
  , CEOPositionName varchar(60) comment '??\???E??'
2257
  , CEOName varchar(60) comment '??\?????'
2258
  , ContactPersonName varchar(60) comment '?S???????'
2259
  , ZipCode varchar(8) comment '?X????'
2260
  , Address1 varchar(60) comment '?Z???P'
2261
  , Address2 varchar(60) comment '?Z??2'
2262
  , Address3 varchar(60) comment '?Z??3'
2263
  , CellPhoneNumber varchar(13) comment '?g??d?b???'
2264
  , MailAddress varchar(257) comment '???[???A?h???X'
2265
  , PhoneNumber varchar(13) comment '?d?b???'
2266
  , FaxNumber varchar(13) comment 'FAX???'
2267
  , JapaneseSyllabary varchar(2) comment '50?????'
2268
  , StartDate date not null comment '????J?n?N????'
2269
  , Note varchar(300) comment '???l'
2270
  , labourKind decimal(1,0) not null comment '?x???????E????'
2271
  , DeleteFlg decimal(1,0) default '0' not null comment '???t???O'
2272
  , EntryDate datetime not null comment '?o?^???t'
2273
  , UpdateDate datetime not null comment '?X?V???t'
2274
  , constraint subcontractormaster_PKC primary key (CompanyCode)
2275
) comment '??????}?X?^' ;
2276

2277
create index SubContractorMaster_Index1
2278
  on subcontractormaster(JapaneseSyllabary);
2279

2280
-- ?d????}?X?^
2281
drop table if exists suppliersmaster cascade;
2282

2283
create table suppliersmaster (
2284
  SuppliersCode decimal(5,0) unsigned not null comment '?d????R?[?h'
2285
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2286
  , SuppliersName1 varchar(60) not null comment '?d????1'
2287
  , SuppliersName2 varchar(60) comment '?d?????Q'
2288
  , ZipCode varchar(8) comment '?X????'
2289
  , Address1 varchar(60) comment '?Z???P'
2290
  , Address2 varchar(60) comment '?Z??2'
2291
  , Address3 varchar(60) comment '?Z??3'
2292
  , PhoneNumber varchar(13) comment '?d?b???'
2293
  , FaxNumber varchar(13) comment 'FAX???'
2294
  , Note varchar(300) comment '???l'
2295
  , DeleteFlg decimal(1,0) not null comment '???t???O'
2296
  , EntryDate datetime not null comment '?o?^???t'
2297
  , UpdateDate datetime not null comment '?X?V???t'
2298
  , constraint suppliersmaster_PKC primary key (SuppliersCode)
2299
) comment '?d????}?X?^' ;
2300

2301
-- ?V?X?e???N???m?F?f?[?^
2302
drop table if exists systemexecute cascade;
2303

2304
create table systemexecute (
2305
  PrimaryCode tinyint(4) not null comment '?L?[????'
2306
  , TargetDate date not null comment '?N?????t'
2307
  , SystemVersion int(11) not null comment '?{??E????o?[?W????'
2308
  , UpDateCopyVersion int(11) not null comment '?R?s?[?o?[?W????'
2309
  , EntryDate datetime not null comment '?o?^???t'
2310
  , UpdateDate datetime not null comment '?X?V???t'
2311
  , constraint systemexecute_PKC primary key (PrimaryCode)
2312
) comment '?V?X?e???N???m?F?f?[?^' ;
2313

2314
-- ????}?X?^
2315
drop table if exists systemmaster cascade;
2316

2317
create table systemmaster (
2318
  SystemCode decimal(3,0) unsigned not null comment '???R?[?h'
2319
  , CompanyName1 varchar(60) not null comment '?????P'
2320
  , CompanyName2 varchar(60) comment '?????Q'
2321
  , CEOName varchar(60) not null comment '??\?????'
2322
  , CEOPositionName varchar(60) comment '??\???E??'
2323
  , ZipCode varchar(8) not null comment '?X????'
2324
  , Address1 varchar(60) not null comment '?Z???P'
2325
  , Address2 varchar(60) comment '?Z??2'
2326
  , Address3 varchar(60) comment '?Z??3'
2327
  , PhoneNumber varchar(13) not null comment '?d?b???'
2328
  , FaxNumber varchar(13) comment 'FAX???'
2329
  , HomePageURL varchar(120) comment '?z?[???y?[?WURL'
2330
  , ConsumptionTax decimal(4,2) not null comment '?????'
2331
  , CooperationRate decimal(4,2) not null comment '???????'
2332
  , StatutoryWelfareRate decimal(4,2) not null comment '?@???????'
2333
  , FuelPrice decimal(5,2) not null comment '?R???L???P??'
2334
  , AreaDistance decimal(5,2) not null comment '????u????????'
2335
  , ExcelSavePath varchar(120) comment 'Excel????p?X'
2336
  , BusinessPeriod smallint(6) not null comment '????c?????'
2337
  , ConstrYear smallint(6) not null comment '????H???N?x'
2338
  , BusinessBeginDate datetime not null comment '?c????????'
2339
  , ConstrBeginDate datetime not null comment '?H???N?x?????'
2340
  , BusinessCompDate datetime not null comment '?c?????????'
2341
  , ConstrCompDate datetime not null comment '?H???N?x??????'
2342
  , ConstructionNoBase decimal(1,0) not null comment '?H????????l'
2343
  , SloganString1 varchar(100) comment '?W??1'
2344
  , SloganString2 varchar(100) comment '?W??2'
2345
  , SloganString3 varchar(100) comment '?W??3'
2346
  , EntryDate datetime not null comment '?o?^???t'
2347
  , UpdateDate datetime not null comment '?X?V???t'
2348
  , constraint systemmaster_PKC primary key (SystemCode)
2349
) comment '????}?X?^' ;
2350

2351
-- ?????}?X?^
2352
drop table if exists termmaster cascade;
2353

2354
create table termmaster (
2355
  ConstructionStatusFlg decimal(2,0) not null comment '?H?????t???O'
2356
  , FieldNo decimal(2,0) not null comment '?`?F?b?N???t?B?[???h???'
2357
  , SeqNo decimal(2,0) not null comment '?}??'
2358
  , DisplayOrder decimal(2,0) not null comment '?\????'
2359
  , CheckSchdule decimal(1,0) not null comment '?`?F?b?N?^?C?~???O'
2360
  , TermDays decimal(3,0) not null comment '?o???'
2361
  , SendTitile varchar(100) comment '?^?C?g??'
2362
  , SendMessage varchar(100) comment '???b?Z?[?W'
2363
  , BackColor varchar(8) comment '?w?i?F'
2364
  , ForeColor varchar(8) comment '?????F'
2365
  , EntryDate datetime not null comment '?o?^???t'
2366
  , UpdateDate datetime not null comment '?X?V???t'
2367
  , constraint termmaster_PKC primary key (ConstructionStatusFlg,FieldNo,SeqNo)
2368
) comment '?????}?X?^' ;
2369

2370
create index TermMaster_Index1
2371
  on termmaster(DisplayOrder);
2372

2373
-- ?o?????f?[?^
2374
drop table if exists tranceportdailydata cascade;
2375

2376
create table tranceportdailydata (
2377
  PersonCode decimal(8,0) unsigned not null comment '????R?[?h'
2378
  , AttendanceDate date not null comment '???????'
2379
  , StartDistance decimal(7,1) not null comment '?????o???L????'
2380
  , ComplateDistance decimal(7,1) not null comment '?????I???L????'
2381
  , TotalDistance decimal(6,1) not null comment '???????v?L????'
2382
  , OfficeGoFlg decimal(1,0) not null comment '???????o??t???O'
2383
  , OfficeOutFlg decimal(1,0) not null comment '???????A??t???O'
2384
  , TrancePayGoFlg decimal(1,0) not null comment '?L?????o??t???O'
2385
  , TrancePayOutFlg decimal(1,0) not null comment '?L?????A??t???O'
2386
  , WareHouseFlg decimal(1,0) not null comment '????u??t???O'
2387
  , EntryDate datetime not null comment '?o?^???t'
2388
  , UpdateDate datetime not null comment '?X?V???t'
2389
  , constraint tranceportdailydata_PKC primary key (PersonCode,AttendanceDate)
2390
) comment '?o?????f?[?^' ;
2391

2392
create index TranceportDailyData_Index1
2393
  on tranceportdailydata(AttendanceDate);
2394

2395
-- ?H?????o???}?X?^
2396
drop table if exists typeexpensesmaster cascade;
2397

2398
create table typeexpensesmaster (
2399
  TypeCode decimal(5,0) unsigned not null comment '?H?????R?[?h'
2400
  , ExpensesPeriod smallint(6) not null comment '?????'
2401
  , NameCode decimal(5,0) unsigned not null comment '?o????R?[?h'
2402
  , ExpensesRaito decimal(4,2) not null comment '?o??'
2403
  , DeleteFlg decimal(1,0) not null comment '???t???O'
2404
  , EntryDate datetime not null comment '?o?^???t'
2405
  , UpdateDate datetime not null comment '?X?V???t'
2406
  , constraint typeexpensesmaster_PKC primary key (TypeCode,ExpensesPeriod,NameCode)
2407
) comment '?H?????o???}?X?^' ;
2408

2409
-- ?P??}?X?^
2410
drop table if exists unitmaster cascade;
2411

2412
create table unitmaster (
2413
  UnitKey decimal(5,0) unsigned not null comment '?P??L?['
2414
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2415
  , UnitName varchar(30) not null comment '?P?????'
2416
  , EntryDate datetime not null comment '?o?^???t'
2417
  , UpdateDate datetime not null comment '?X?V???t'
2418
  , constraint unitmaster_PKC primary key (UnitKey)
2419
) comment '?P??}?X?^' ;
2420

2421
create index UnitMaster_Index1
2422
  on unitmaster(DisplayOrder);
2423

2424
-- ????}?X?^
2425
drop table if exists vehiclemaster cascade;
2426

2427
create table vehiclemaster (
2428
  VehicleCode decimal(5,0) unsigned not null comment '????R?[?h'
2429
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2430
  , VehicleName varchar(100) not null comment '???????'
2431
  , RegistrationNumber varchar(30) comment '?o?^???'
2432
  , IdentificationNumber varchar(30) comment '?????'
2433
  , ModelCode varchar(30) comment '?^??'
2434
  , DepartmentCode decimal(5,0) unsigned not null comment '???????'
2435
  , VehicleScheduleFlg decimal(1,0) not null comment '????\??\???t???O'
2436
  , PurchaseDate date comment '?w????'
2437
  , PurchaseName varchar(30) comment '?w????'
2438
  , PurchaseContactPersons varchar(30) comment '?w????S????'
2439
  , PurchasePhone varchar(13) comment '?w????d?b???'
2440
  , LeaseDate date comment '???[?X?J?n??'
2441
  , LeaseDestination varchar(30) comment '???[?X??'
2442
  , LeaseContactPersons varchar(30) comment '???[?X??S????'
2443
  , LeasePhone varchar(13) comment '???[?X??d?b???'
2444
  , InsuranceCompany varchar(30) comment '?C???????'
2445
  , InsuranceContactPersons varchar(30) comment '?C???????S????'
2446
  , InsurancePhone varchar(13) comment '?C???????d?b???'
2447
  , Note varchar(300) comment '???l'
2448
  , EntryDate datetime comment '?o?^???t'
2449
  , UpdateDate datetime comment '?X?V???t'
2450
  , constraint vehiclemaster_PKC primary key (VehicleCode)
2451
) comment '????}?X?^' ;
2452

2453
-- ????L?^?f?[?^
2454
drop table if exists vehiclerecorddata cascade;
2455

2456
create table vehiclerecorddata (
2457
  VehicleCode decimal(5,0) unsigned not null comment '????R?[?h'
2458
  , DivisionCode decimal(2,0) unsigned not null comment '?f?[?^??'
2459
  , SeqNo decimal(2,0) not null comment '?}??'
2460
  , RecordDate date comment '???n??'
2461
  , Mileage mediumint(9) comment '???s????'
2462
  , Content varchar(100) comment '???e'
2463
  , PaymentCost decimal(10,0) comment '??p'
2464
  , EntryDate datetime not null comment '?o?^???t'
2465
  , UpdateDate datetime not null comment '?X?V???t'
2466
  , constraint vehiclerecorddata_PKC primary key (VehicleCode,DivisionCode,SeqNo)
2467
) comment '????L?^?f?[?^' ;
2468

2469
-- ????\??f?[?^
2470
drop table if exists vehiclescheduledata cascade;
2471

2472
create table vehiclescheduledata (
2473
  TargetDate date not null comment '????'
2474
  , VehicleCode decimal(5,0) unsigned not null comment '????R?[?h'
2475
  , MorningAfternoon decimal(1,0) not null comment '??O?E???'
2476
  , PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
2477
  , TargetYear year(4) not null comment '?Y???N'
2478
  , TargetMonth tinyint(3) unsigned not null comment '?Y????'
2479
  , TargetDay year(4) not null comment '?Y????'
2480
  , EntryDate datetime not null comment '?o?^???t'
2481
  , UpdateDate datetime not null comment '?X?V???t'
2482
  , constraint vehiclescheduledata_PKC primary key (TargetDate,VehicleCode,MorningAfternoon)
2483
) comment '????\??f?[?^' ;
2484

2485
create index VehicleScheduleData_Index1
2486
  on vehiclescheduledata(TargetYear);
2487

2488
create index VehicleScheduleData_Index2
2489
  on vehiclescheduledata(TargetMonth);
2490

2491
create index VehicleScheduleData_Index3
2492
  on vehiclescheduledata(TargetDay);
2493

2494
-- ?N?}?X?^
2495
drop table if exists yearmaster cascade;
2496

2497
create table yearmaster (
2498
  years smallint(6) not null comment '?N'
2499
  , constraint yearmaster_PKC primary key (years)
2500
) comment '?N?}?X?^' ;
2501