プロジェクト

全般

プロフィール

統計
| リビジョン:

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

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

1
-- Project Name : noname
2
-- Date/Time    : 2018/03/28 9:13:42
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????{???
466
drop table if exists constructionbaseinfo cascade;
467

    
468
create table constructionbaseinfo (
469
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
470
  , TyingFlg decimal(1,0) not null comment '?R?t?f?[?^?t???O'
471
  , JoinFlg decimal(1,0) not null comment '?????_??H???t???O'
472
  , ConstructionYear smallint(5) unsigned not null comment '?H???N?x'
473
  , ConstructionPeriod smallint(5) unsigned not null comment '?H??????'
474
  , RequestedDate date comment '??????'
475
  , EstimatesSubmitDeadline date comment '?????o????'
476
  , EstimatesSubmittedDate date comment '?????o??'
477
  , ProvisionalOrderDate date comment '?????'
478
  , OrderDate date comment '???'
479
  , OrderStartingDate date comment '?J?n?\???'
480
  , OrderCompletionDate date comment '?????\???'
481
  , PreparationStartDate date comment '?{?H?????J?n??'
482
  , ConstructionStartingDate date comment '?{?H?J?n??'
483
  , ConstructionCompletionDate date comment '?{?H??????'
484
  , NonOrderDate date comment '????'
485
  , OrdersDecisionPrice decimal(12,0) not null comment '??????????z'
486
  , OrdersDecisionPriceInTax decimal(12,0) not null comment '??????????z'
487
  , SalesDepCode decimal(5,0) unsigned not null comment '?c??S????????R?[?h'
488
  , SalesPersonCode decimal(8,0) unsigned not null comment '?c??S????R?[?h'
489
  , ConstrDepCode decimal(5,0) unsigned not null comment '?H???S????????R?[?h'
490
  , ConstructionPersonCode decimal(8,0) not null comment '?H???S????R?[?h'
491
  , ConstrSubDepCode decimal(5,0) unsigned not null comment '?H?????S????????R?[?h'
492
  , ConstrSubPersonCode decimal(8,0) not null comment '?H?????S????R?[?h'
493
  , ConstrInstrDepCode decimal(5,0) unsigned not null comment '?H???w?????????R?[?h'
494
  , ConstructionInstructor decimal(8,0) not null comment '?H???w?????R?[?h'
495
  , TransferConstruction decimal(8,0) not null comment '?H??????R?[?h'
496
  , TransferConstructionDate date comment '?H??????'
497
  , OrderersDivision decimal(5,0) not null comment '????????R?[?h'
498
  , OrderersCode decimal(5,0) unsigned not null comment '??????R?[?h'
499
  , EstimatesExpirationDate date comment '????L??????'
500
  , ConstructionPeriodStart date comment '?_??H???J?n??'
501
  , ConstructionPeriodEnd date comment '?_??H??????'
502
  , ConstructionPeriodStart2 date comment '?_??H???J?n?i???????j'
503
  , ConstructionPeriodEnd2 date comment '?_??H???????i???????j'
504
  , StartDate date comment '?H???J?n??'
505
  , EndDate date comment '?H???I????'
506
  , PurchaseOrderMailingDate date comment '???????X????'
507
  , PurchaseOrderReturnDate date comment '???????????'
508
  , PurchaseOrderReturnCheckDate date comment '??????????m?F??'
509
  , ConsumptionTaxFlg decimal(1,0) not null comment '?????t???O'
510
  , PrimeContractorFlg decimal(1,0) not null comment '?????t???O'
511
  , SalesCostFlg decimal(1,0) not null comment '?c??o?????t???O'
512
  , ConstructionStatusFlg decimal(2,0) not null comment '?H?????t???O'
513
  , ConstructionType decimal(5,0) not null comment '?H?????R?[?h'
514
  , EstimateType decimal(1,0) not null comment '??????'
515
  , BillingStartDate date not null comment '?????????J?n??'
516
  , BillingDate date not null comment '??????'
517
  , BillingSplitFlg decimal(1,0) not null comment '??????t???O'
518
  , BillingSendDate date comment '???????X??/??n????'
519
  , LedgerComplateDate date not null comment '?H????????????????t'
520
  , InspectPlanningDate date not null comment '?????\???'
521
  , InspectExecuteDate date not null comment '???????s??'
522
  , RevCompleteDate date not null comment '??????????????'
523
  , EntryDate datetime not null comment '?o?^???t'
524
  , UpdateDate datetime not null comment '?X?V???t'
525
  , constraint constructionbaseinfo_PKC primary key (ConstructionCode)
526
) comment '?H????{???' ;
527

    
528
create index BaseInfo_Index1
529
  on constructionbaseinfo(ConstructionStatusFlg);
530

    
531
create index BaseInfo_Index2
532
  on constructionbaseinfo(EstimateType);
533

    
534
create index BaseInfo_Index3
535
  on constructionbaseinfo(SalesPersonCode);
536

    
537
create index BaseInfo_Index4
538
  on constructionbaseinfo(ConstructionPersonCode);
539

    
540
create index BaseInfo_Index5
541
  on constructionbaseinfo(ConstructionInstructor);
542

    
543
create index BaseInfo_Index6
544
  on constructionbaseinfo(ConstructionPeriod);
545

    
546
-- ?H????{????
547
drop table if exists constructionbaseinfodetail cascade;
548

    
549
create table constructionbaseinfodetail (
550
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
551
  , DetailNo decimal(3,0) not null comment '??????'
552
  , DetailString varchar(300) comment '??????e'
553
  , EntryDate datetime not null comment '?o?^???t'
554
  , UpdateDate datetime not null comment '?X?V???t'
555
  , constraint constructionbaseinfodetail_PKC primary key (ConstructionCode,DetailNo)
556
) comment '?H????{????' ;
557

    
558
create index BaseInfoDetail_Idx1
559
  on constructionbaseinfodetail(ConstructionCode);
560

    
561
create index BaseInfoDetail_Idx2
562
  on constructionbaseinfodetail(DetailNo);
563

    
564
-- ?H???{?H?\?Z?f?[?^
565
drop table if exists constructionbudget cascade;
566

    
567
create table constructionbudget (
568
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
569
  , CreatorCode decimal(8,0) not null comment '????R?[?h'
570
  , CreatorName varchar(60) comment '?????'
571
  , CreatorCosts decimal(11,0) not null comment '??????^'
572
  , AssistantCode decimal(8,0) not null comment '???S????R?[?h'
573
  , AssistantName varchar(60) comment '???S?????'
574
  , AssistantCosts decimal(11,0) not null comment '???S??????^'
575
  , InstructorCode decimal(8,0) not null comment '?H???w?????R?[?h'
576
  , InstructorName varchar(60) comment '?H???w??????'
577
  , InstructorCosts decimal(11,0) not null comment '?H???w???????^'
578
  , CreateDate date not null comment '????'
579
  , ConstructionTimes decimal(5,2) not null comment '?H???i?P??E???j'
580
  , ConstructionStart date not null comment '?_??H???J?n'
581
  , ConstructionEnd date not null comment '?_??H??????'
582
  , InstructorTimes decimal(5,2) not null comment '?w???????????'
583
  , SalaryFlg decimal(1,0) not null comment '???^?U????'
584
  , SalaryDays decimal(4,0) not null comment '?U??????'
585
  , A_SalaryFlg decimal(1,0) not null comment '???S??????^?U????'
586
  , A_SalaryDays decimal(4,0) not null comment '???S????U??????'
587
  , I_SalaryFlg decimal(1,0) not null comment '?w???????^?U????'
588
  , I_SalaryDays decimal(4,0) not null comment '?w?????U??????'
589
  , OrdersDecisionPrice decimal(12,0) not null comment '??????????z'
590
  , EntryDate datetime not null comment '?o?^???t'
591
  , UpdateDate datetime not null comment '?X?V???t'
592
  , constraint constructionbudget_PKC primary key (ConstructionCode)
593
) comment '?H???{?H?\?Z?f?[?^' ;
594

    
595
-- ?H???{?H?\?Z?f?[?^????
596
drop table if exists constructionbudgetdetail cascade;
597

    
598
create table constructionbudgetdetail (
599
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
600
  , GroupCount decimal(2,0) unsigned not null comment '?O???[?v???'
601
  , LineCount decimal(3,0) unsigned not null comment '?s???'
602
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
603
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
604
  , FirstString varchar(120) comment '???????'
605
  , SecondString varchar(120) comment '?H?????e'
606
  , CompanyType decimal(1,0) not null comment '??????R?[?h?^?C?v'
607
  , CompanyCode decimal(8,0) not null comment '??????R?[?h'
608
  , CompanyName varchar(120) comment '?????????'
609
  , EstimatePrice decimal(12,0) not null comment '??Z????????z'
610
  , NegotiationPrice decimal(12,0) not null comment '??Z????????z'
611
  , OrderDesiredAmount decimal(12,0) not null comment '??????]???z'
612
  , ExecutionAmount decimal(12,0) not null comment '???s???z'
613
  , AmountConfigRate decimal(5,2) not null comment '???z?\????'
614
  , NegotiateFlg decimal(1,0) not null comment '?????????t???O'
615
  , EntryDate datetime not null comment '?o?^???t'
616
  , UpdateDate datetime not null comment '?X?V???t'
617
  , constraint constructionbudgetdetail_PKC primary key (ConstructionCode,GroupCount,LineCount)
618
) comment '?H???{?H?\?Z?f?[?^????' ;
619

    
620
-- ?H??}?X?^
621
drop table if exists constructionitemmaster cascade;
622

    
623
create table constructionitemmaster (
624
  ItemCode decimal(5,0) unsigned not null comment '?H??L?['
625
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
626
  , ItemName varchar(120) not null comment '?H????'
627
  , SubItemsFlg decimal(1,0) comment '???????t???O'
628
  , MyExpensesFlg decimal(1,0) not null comment '????o??t???O'
629
  , DeleteFlg decimal(1,0) not null comment '???t???O'
630
  , EntryDate datetime not null comment '?o?^???t'
631
  , UpdateDate datetime not null comment '?X?V???t'
632
  , constraint constructionitemmaster_PKC primary key (ItemCode)
633
) comment '?H??}?X?^' ;
634

    
635
-- ?H???????f?[?^
636
drop table if exists constructionledger cascade;
637

    
638
create table constructionledger (
639
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
640
  , ConstructionPeriod decimal(4,0) unsigned not null comment '?????'
641
  , CreatorCode decimal(8,0) comment '????R?[?h'
642
  , CreatorName varchar(60) comment '?????'
643
  , CreateDate date not null comment '????'
644
  , ConstructionTimes decimal(5,2) not null comment '?H???i?P??E???j'
645
  , ConstructionStart date not null comment '?_??H???J?n'
646
  , ConstructionEnd date not null comment '?_??H??????'
647
  , OrdersDecisionPrice decimal(14,0) not null comment '??????????z'
648
  , CompanyExpenses decimal(10,0) not null comment '???o???v'
649
  , DepartmentExpenses decimal(10,0) not null comment '?????o???v'
650
  , SalesExpenses decimal(10,0) not null comment '?c??o???v'
651
  , TotalPayment decimal(10,0) not null comment '???x???z'
652
  , GrossProfit decimal(10,0) not null comment '?e??'
653
  , Allowance decimal(10,0) not null comment '???^'
654
  , NetProfit decimal(10,0) not null comment '?????v'
655
  , ComplateFlg decimal(1,0) not null comment '????????t???O'
656
  , IntegrationFlg decimal(1,0) not null comment '????z??Z?t???O'
657
  , EntryDate datetime not null comment '?o?^???t'
658
  , UpdateDate datetime not null comment '?X?V???t'
659
  , constraint constructionledger_PKC primary key (ConstructionCode)
660
) comment '?H???????f?[?^' ;
661

    
662
-- ?H??????????f?[?^
663
drop table if exists constructionledgerdetail cascade;
664

    
665
create table constructionledgerdetail (
666
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
667
  , GroupCount decimal(2,0) unsigned not null comment '?O???[?v???'
668
  , LineCount decimal(4,0) unsigned not null comment '?s???'
669
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
670
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
671
  , FirstString varchar(120) comment '???????'
672
  , SecondString varchar(120) comment '?H?????e'
673
  , CompanyType decimal(1,0) not null comment '??????R?[?h?^?C?v'
674
  , CompanyCode decimal(8,0) not null comment '??????R?[?h'
675
  , CompanyName varchar(120) comment '?????????'
676
  , EstimatePrice decimal(12,0) not null comment '?\?Z?i????j???z'
677
  , ExecutionAmount decimal(12,0) not null comment '???s???z'
678
  , AmountConfigRate decimal(5,2) not null comment '???z?\????'
679
  , PaymentBurden decimal(12,0) not null comment '?x????U?z'
680
  , FixDataFlg decimal(1,0) not null comment '???f?[?^?t???O'
681
  , IndependentFlg decimal(1,0) not null comment '????f?[?^?t???O'
682
  , FluctuationFlg decimal(1,0) not null comment '?????f?[?^?t???O'
683
  , SalaryFlg decimal(1,0) not null comment '???^?U????'
684
  , SalaryDays decimal(4,0) not null comment '???^?U??????'
685
  , OperatingFlg decimal(1,0) not null comment '?S?????t???O'
686
  , SourceCode decimal(10,0) unsigned not null comment '???H?????'
687
  , JoinTitleFlg decimal(1,0) not null comment '?H??????^?C?g??'
688
  , SalaryOnRegist decimal(12,0) not null comment '?o?^?????z???^'
689
  , PurchaseOrderFlg decimal(2,0) not null comment '?????????s?t???O'
690
  , DetailCount decimal(4,0) unsigned not null comment '??????'
691
  , EntryDate datetime not null comment '?o?^???t'
692
  , UpdateDate datetime not null comment '?X?V???t'
693
  , constraint constructionledgerdetail_PKC primary key (ConstructionCode,GroupCount,LineCount)
694
) comment '?H??????????f?[?^' ;
695

    
696
create index LedgerDetail_Index01
697
  on constructionledgerdetail(ConstructionCode);
698

    
699
create index LedgerDetail_Index02
700
  on constructionledgerdetail(GroupCount);
701

    
702
create index LedgerDetail_Index03
703
  on constructionledgerdetail(LineCount);
704

    
705
create index LedgerDetail_Index04
706
  on constructionledgerdetail(SourceCode);
707

    
708
create index LedgerDetail_Index05
709
  on constructionledgerdetail(DetailCount);
710

    
711
-- ?H?????????s?f?[?^
712
drop table if exists constructionledgerexcute cascade;
713

    
714
create table constructionledgerexcute (
715
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
716
  , GroupCount decimal(2,0) unsigned not null comment '?O???[?v???'
717
  , LineCount decimal(4,0) unsigned not null comment '?s???'
718
  , ColumnCount decimal(3,0) not null comment '????'
719
  , PaymentAmount decimal(12,0) not null comment '?x?????z'
720
  , TargetMonth date not null comment '???N??'
721
  , EntryDate datetime not null comment '?o?^???t'
722
  , UpdateDate datetime not null comment '?X?V???t'
723
  , constraint constructionledgerexcute_PKC primary key (ConstructionCode,GroupCount,LineCount,ColumnCount)
724
) comment '?H?????????s?f?[?^' ;
725

    
726
create index LedgerExcute_Index1
727
  on constructionledgerexcute(ConstructionCode,TargetMonth,GroupCount,LineCount);
728

    
729
-- ?H???????N???
730
drop table if exists constructionlink cascade;
731

    
732
create table constructionlink (
733
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
734
  , FluctuationCode decimal(10,0) not null comment '?q?H?????'
735
  , LinkType decimal(1,0) not null comment '?????N???'
736
  , EntryDate datetime not null comment '?o?^???t'
737
  , UpdateDate datetime not null comment '?X?V???t'
738
  , constraint constructionlink_PKC primary key (ConstructionCode,FluctuationCode)
739
) comment '?H???????N???' ;
740

    
741
create index ConstructionLink_Index1
742
  on constructionlink(ConstructionCode);
743

    
744
create index ConstructionLink_Index2
745
  on constructionlink(FluctuationCode);
746

    
747
create index ConstructionLink_Index3
748
  on constructionlink(LinkType);
749

    
750
-- ?H????????
751
drop table if exists constructionmaterialinfo cascade;
752

    
753
create table constructionmaterialinfo (
754
  CONSTRUCTIONCODE int(10) unsigned default 0 not null comment '?H?????'
755
  , MATERIALITEMCODE smallint(5) unsigned default 0 not null comment '????i??R?[?h'
756
  , PROCESSDATE datetime default '0000-00-00 00:00:00' not null comment '?????N????'
757
  , RENTCOUNT smallint(5) unsigned comment '??o??'
758
  , REPAYCOUNT smallint(5) unsigned comment '??p??'
759
  , JUNKCOUNT smallint(5) unsigned comment '?j????'
760
  , COMPLETEFLG tinyint(3) unsigned comment '?????t???O'
761
  , ENTRYDATE datetime comment '?o?^???t'
762
  , UPDATEDATE datetime comment '?X?V???t'
763
  , constraint constructionmaterialinfo_PKC primary key (CONSTRUCTIONCODE,MATERIALITEMCODE,PROCESSDATE)
764
) comment '?H????????' ;
765

    
766
-- ????i?????t?f?[?^
767
drop table if exists constructionprogressdate cascade;
768

    
769
create table constructionprogressdate (
770
  ConstructionCode decimal(10,0) not null comment '?H?????'
771
  , ConstructionStatusFlg decimal(2,0) not null comment '???H?????'
772
  , PreviousStatusFlg decimal(2,0) comment '??X?O???'
773
  , ChangeDate datetime not null comment '?????t'
774
  , ChangePersonCode decimal(8,0) not null comment '???S????'
775
  , EntryDate datetime not null comment '?o?^???t'
776
  , UpdateDate datetime not null comment '?X?V???t'
777
  , constraint constructionprogressdate_PKC primary key (ConstructionCode,ConstructionStatusFlg)
778
) comment '????i?????t?f?[?^' ;
779

    
780
-- ???}?X?^
781
drop table if exists constructionspecmaster cascade;
782

    
783
create table constructionspecmaster (
784
  ItemCode decimal(5,0) unsigned not null comment '?H??L?['
785
  , SpecCode decimal(5,0) unsigned not null comment '???L?['
786
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
787
  , ItemName varchar(120) comment '??????'
788
  , SpecName varchar(120) comment '??????'
789
  , UnitName varchar(30) comment '?P?????'
790
  , UnitPrice decimal(9,2) not null comment '?P??'
791
  , DeleteFlg decimal(1,0) not null comment '???t???O'
792
  , EntryDate datetime not null comment '?o?^???t'
793
  , UpdateDate datetime not null comment '?X?V???t'
794
  , constraint constructionspecmaster_PKC primary key (ItemCode,SpecCode)
795
) comment '???}?X?^' ;
796

    
797
create index ConstructionSpecMaster_Index1
798
  on constructionspecmaster(DisplayOrder);
799

    
800
-- ???P???}?X?^
801
drop table if exists constructionspecunitprice cascade;
802

    
803
create table constructionspecunitprice (
804
  ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
805
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
806
  , SpecCode decimal(5,0) unsigned not null comment '???L?['
807
  , ConstructionTypeCode mediumint(8) unsigned not null comment '?H?????R?[?h'
808
  , UnitPrice decimal(9,2) not null comment '?P??'
809
  , EntryDate datetime not null comment '?o?^???t'
810
  , UpdateDate datetime not null comment '?X?V???t'
811
  , constraint constructionspecunitprice_PKC primary key (ComponentCode,ItemCode,SpecCode,ConstructionTypeCode)
812
) comment '???P???}?X?^' ;
813

    
814
-- ?H?????}?X?^
815
drop table if exists constructiontypemaster cascade;
816

    
817
create table constructiontypemaster (
818
  TypeCode decimal(5,0) unsigned not null comment '?H?????R?[?h'
819
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
820
  , NameString varchar(100) not null comment '????'
821
  , PublicFlg decimal(1,0) not null comment '?H?????t???O'
822
  , SecRank decimal(1,0) not null comment '?????????N'
823
  , ExpensesLink decimal(1,0) not null comment '?o??g?p??'
824
  , DeleteFlg decimal(1,0) not null comment '???t???O'
825
  , EntryDate datetime not null comment '?o?^???t'
826
  , UpdateDate datetime not null comment '?X?V???t'
827
  , constraint constructiontypemaster_PKC primary key (TypeCode)
828
) comment '?H?????}?X?^' ;
829

    
830
-- ?S??????o??f?[?^
831
drop table if exists costdataofperson cascade;
832

    
833
create table costdataofperson (
834
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
835
  , ActionDate date not null comment '?????t'
836
  , DataType decimal(1,0) not null comment '?f?[?^??'
837
  , DataAddCount decimal(5,0) unsigned not null comment '?f?[?^??????'
838
  , TargetMonth varchar(7) not null comment '???N??'
839
  , ConstructionCode decimal(10,0) unsigned comment '?H???R?[?h'
840
  , SuppliersCode decimal(5,0) unsigned not null comment '?x????R?[?h'
841
  , SuppliersName varchar(120) comment '?x??????'
842
  , PaymentContent varchar(60) comment '?x?????e'
843
  , PaymentType decimal(1,0) not null comment '?x?????@?t???O'
844
  , EntryPrice decimal(12,0) not null comment '???z?i????j'
845
  , EntryPriceInTax decimal(12,0) not null comment '???z?i????j'
846
  , SlipNumber varchar(12) comment '?`?[???'
847
  , ComplateFlg decimal(1,0) not null comment '???????t???O'
848
  , ApprovalFlg decimal(1,0) not null comment '???F?t???O'
849
  , EntryDate datetime not null comment '?o?^???t'
850
  , UpdateDate datetime not null comment '?X?V???t'
851
  , constraint costdataofperson_PKC primary key (PersonCode,ActionDate,DataType,DataAddCount)
852
) comment '?S??????o??f?[?^' ;
853

    
854
create index CostDataOfPerson_Index1
855
  on costdataofperson(TargetMonth);
856

    
857
create index CostDataOfPerson_Index2
858
  on costdataofperson(ConstructionCode);
859

    
860
-- ??????o?^?\???f?[?^
861
drop table if exists costomerregist cascade;
862

    
863
create table costomerregist (
864
  CreatePersonCode decimal(8,0) unsigned not null comment '?\??????'
865
  , CreateDate date not null comment '????'
866
  , SeqNo decimal(2,0) not null comment '?L?[?A??'
867
  , DataMode decimal(1,0) not null comment '?f?[?^??'
868
  , SourceCotegory decimal(5,0) unsigned not null comment '???????'
869
  , SourceCode decimal(5,0) unsigned not null comment '??????R?[?h'
870
  , PetitionPeriod decimal(4,0) unsigned not null comment '?????'
871
  , OrderFlg decimal(1,0) not null comment '?@?l?c??E??l?t???O'
872
  , CorporateStatusName varchar(100) comment '?@?l?i????'
873
  , CorporateStatusPoint decimal(1,0) comment '?@?l?i?????u'
874
  , OrderersName1 varchar(60) not null comment '???????1'
875
  , OrderersName2 varchar(60) comment '????????Q'
876
  , DepartmentName varchar(60) comment '??????'
877
  , PersonName varchar(60) comment '?S?????'
878
  , ZipCode varchar(8) comment '?X????'
879
  , Address1 varchar(60) comment '?Z???P'
880
  , Address2 varchar(60) comment '?Z??2'
881
  , Address3 varchar(60) comment '?Z??3'
882
  , PhoneNumber varchar(13) comment '?d?b???'
883
  , FaxNumber varchar(13) comment 'FAX???'
884
  , MailAddress varchar(257) comment '???[???A?h???X'
885
  , Note varchar(300) comment '???l'
886
  , OrderCotegory decimal(5,0) unsigned not null comment '???????'
887
  , OrderDate date not null comment '?\????'
888
  , OrderNo decimal(2,0) unsigned not null comment '?\????t???'
889
  , CreateDepartmentCode decimal(5,0) unsigned not null comment '?\???????R?[?h'
890
  , CreateDepartmentName varchar(60) comment '?\????????'
891
  , EntryDate datetime not null comment '?o?^???t'
892
  , UpdateDate datetime not null comment '?X?V???t'
893
  , constraint costomerregist_PKC primary key (CreatePersonCode,CreateDate,SeqNo)
894
) comment '??????o?^?\???f?[?^' ;
895

    
896
create index CostomerRegist_Index1
897
  on costomerregist(PetitionPeriod);
898

    
899
create index CostomerRegist_Index2
900
  on costomerregist(CreatePersonCode);
901

    
902
create index CostomerRegist_Index3
903
  on costomerregist(CreateDepartmentCode);
904

    
905
-- ????f?[?^
906
drop table if exists dailydataconstruction cascade;
907

    
908
create table dailydataconstruction (
909
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
910
  , DailyDataDate date not null comment '???????'
911
  , ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
912
  , Weather varchar(60) comment '?V?C'
913
  , EntryDate datetime not null comment '?o?^???t'
914
  , UpdateDate datetime not null comment '?X?V???t'
915
  , constraint dailydataconstruction_PKC primary key (PersonCode,DailyDataDate,ConstructionCode)
916
) comment '????f?[?^' ;
917

    
918
create index DailyDataConstruction_Index1
919
  on dailydataconstruction(PersonCode);
920

    
921
create index DailyDataConstruction_Index2
922
  on dailydataconstruction(DailyDataDate);
923

    
924
create index DailyDataConstruction_Index3
925
  on dailydataconstruction(ConstructionCode);
926

    
927
-- ????f?[?^ (????)
928
drop table if exists dailydatadetail cascade;
929

    
930
create table dailydatadetail (
931
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
932
  , DailyDataDate date not null comment '???????'
933
  , ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
934
  , SeqNo decimal(3,0) unsigned not null comment '????s???'
935
  , JobCategoryCode decimal(5,0) not null comment '?E??L?['
936
  , CompanyCode decimal(8,0) not null comment '??????R?[?h'
937
  , TodayHeadCount decimal(4,1) not null comment '?????l????'
938
  , TotalHeadCount decimal(5,1) not null comment '??v?l????'
939
  , TodayWork varchar(100) comment '?????????e'
940
  , NextdayWork varchar(100) comment '?????????e'
941
  , NextdayHeadCount decimal(4,1) not null comment '?????l????'
942
  , EntryDate datetime not null comment '?o?^???t'
943
  , UpdateDate datetime not null comment '?X?V???t'
944
  , constraint dailydatadetail_PKC primary key (PersonCode,DailyDataDate,ConstructionCode,SeqNo)
945
) comment '????f?[?^ (????)' ;
946

    
947
create index DailyDataDetail_Index
948
  on dailydatadetail(PersonCode,DailyDataDate,ConstructionCode);
949

    
950
-- ????f?[?^ (??????)
951
drop table if exists dailydatafield cascade;
952

    
953
create table dailydatafield (
954
  PersonCode decimal(8,0) unsigned not null comment '????R?[?h'
955
  , DailyDataDate date not null comment '???????'
956
  , ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
957
  , SeqNo decimal(3,0) unsigned not null comment '????s???'
958
  , PatrolTime datetime not null comment '?????'
959
  , ContentsText varchar(200) comment '???e'
960
  , EntryDate datetime not null comment '?o?^???t'
961
  , UpdateDate datetime not null comment '?X?V???t'
962
  , constraint dailydatafield_PKC primary key (PersonCode,DailyDataDate,ConstructionCode,SeqNo)
963
) comment '????f?[?^ (??????)' ;
964

    
965
create index DailyDataField_Index
966
  on dailydatafield(PersonCode,DailyDataDate,ConstructionCode);
967

    
968
-- ????f?[?^ (????)
969
drop table if exists dailydatamaterials cascade;
970

    
971
create table dailydatamaterials (
972
  PersonCode decimal(8,0) unsigned not null comment '????R?[?h'
973
  , DailyDataDate date not null comment '???????'
974
  , ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
975
  , SeqNo decimal(3,0) unsigned not null comment '????s???'
976
  , Materials varchar(100) comment '?????'
977
  , Quantity varchar(100) comment '????'
978
  , Production varchar(100) comment '??????'
979
  , Delivery varchar(100) comment '?[?????'
980
  , QualityControl varchar(100) comment '?i?????????'
981
  , EntryDate datetime not null comment '?o?^???t'
982
  , UpdateDate datetime not null comment '?X?V???t'
983
  , constraint dailydatamaterials_PKC primary key (PersonCode,DailyDataDate,ConstructionCode,SeqNo)
984
) comment '????f?[?^ (????)' ;
985

    
986
create index DailyDataMaterials_Index
987
  on dailydatamaterials(PersonCode,DailyDataDate,ConstructionCode);
988

    
989
-- ????f?[?^ (??????w??)
990
drop table if exists dailydatasubcontractors cascade;
991

    
992
create table dailydatasubcontractors (
993
  PersonCode decimal(8,0) unsigned not null comment '????R?[?h'
994
  , DailyDataDate date not null comment '???????'
995
  , ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
996
  , SeqNo decimal(3,0) unsigned not null comment '????s???'
997
  , Attendee varchar(100) comment '?o???'
998
  , ContentsText varchar(200) comment '???e'
999
  , EntryDate datetime not null comment '?o?^???t'
1000
  , UpdateDate datetime not null comment '?X?V???t'
1001
  , constraint dailydatasubcontractors_PKC primary key (PersonCode,DailyDataDate,ConstructionCode,SeqNo)
1002
) comment '????f?[?^ (??????w??)' ;
1003

    
1004
create index DailyDataSubcontractors_Index
1005
  on dailydatasubcontractors(PersonCode,DailyDataDate,ConstructionCode);
1006

    
1007
-- ????f?[?^ (???)
1008
drop table if exists dailydatavehicles cascade;
1009

    
1010
create table dailydatavehicles (
1011
  PersonCode decimal(8,0) unsigned not null comment '????R?[?h'
1012
  , DailyDataDate date not null comment '???????'
1013
  , ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1014
  , SeqNo decimal(3,0) unsigned not null comment '????s???'
1015
  , Model varchar(100) comment '?@??'
1016
  , Performance varchar(100) comment '???\'
1017
  , Owner varchar(100) comment '???L???'
1018
  , Driver varchar(100) comment '?????^?]??'
1019
  , StartWorkingTime datetime not null comment '??????J?n'
1020
  , EndWorkingTime datetime not null comment '??????I??'
1021
  , EntryDate datetime not null comment '?o?^???t'
1022
  , UpdateDate datetime not null comment '?X?V???t'
1023
  , constraint dailydatavehicles_PKC primary key (PersonCode,DailyDataDate,ConstructionCode,SeqNo)
1024
) comment '????f?[?^ (???)' ;
1025

1026
create index DailyDataVehicles_Index
1027
  on dailydatavehicles(PersonCode,DailyDataDate,ConstructionCode);
1028

1029
-- ???}?X?^
1030
drop table if exists daymaster cascade;
1031

1032
create table daymaster (
1033
  days smallint(6) not null comment '??'
1034
) comment '???}?X?^' ;
1035

1036
create index day_Index1
1037
  on daymaster(days);
1038

1039
-- ?????}?X?^
1040
drop table if exists deadlinemaster cascade;
1041

1042
create table deadlinemaster (
1043
  LABOURKIND decimal(1,0) default '0' not null comment '??????'
1044
  , DEADLINE decimal(2,0) comment '????'
1045
  , PAYDAY decimal(2,0) comment '?x????'
1046
  , NOTE varchar(120) comment '???l'
1047
  , DELETEFLG decimal(1,0) comment '???t???O'
1048
  , ENTRYDATE datetime comment '?o?^???t'
1049
  , UPDATEDATE datetime comment '?X?V???t'
1050
  , constraint deadlinemaster_PKC primary key (LABOURKIND)
1051
) comment '?????}?X?^' ;
1052

1053
-- ?????o???}?X?^
1054
drop table if exists departmentexpensesmaster cascade;
1055

1056
create table departmentexpensesmaster (
1057
  DepartmentCode decimal(5,0) unsigned not null comment '?????R?[?h'
1058
  , ExpensesPeriod smallint(6) not null comment '?????'
1059
  , NameCode decimal(5,0) unsigned not null comment '?o????R?[?h'
1060
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
1061
  , ExpensesRaito decimal(4,2) not null comment '?o??'
1062
  , DeleteFlg decimal(1,0) not null comment '???t???O'
1063
  , EntryDate datetime not null comment '?o?^???t'
1064
  , UpdateDate datetime not null comment '?X?V???t'
1065
  , constraint departmentexpensesmaster_PKC primary key (DepartmentCode,ExpensesPeriod,NameCode)
1066
) comment '?????o???}?X?^' ;
1067

1068
-- ?????}?X?^
1069
drop table if exists departmentmaster cascade;
1070

1071
create table departmentmaster (
1072
  DepartmentCode decimal(5,0) unsigned not null comment '?????R?[?h'
1073
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
1074
  , DepartmentString varchar(100) not null comment '??????'
1075
  , ActionScheduleFlg decimal(1,0) not null comment '?s???\??\???t???O'
1076
  , StaffAssignFlg decimal(1,0) not null comment '?l???z?u?\???t???O'
1077
  , DeleteFlg decimal(1,0) not null comment '???t???O'
1078
  , EntryDate datetime not null comment '?o?^???t'
1079
  , UpdateDate datetime not null comment '?X?V???t'
1080
  , constraint departmentmaster_PKC primary key (DepartmentCode)
1081
) comment '?????}?X?^' ;
1082

1083
create index DepartmentMaster_index1
1084
  on departmentmaster(DisplayOrder);
1085

1086
-- ?????m?F???F?f?[?^
1087
drop table if exists depositapprovalinfo cascade;
1088

1089
create table depositapprovalinfo (
1090
  ORDERERSDIVISION decimal(5,0) not null comment '???????'
1091
  , ORDERERSCODE decimal(5,0) not null comment '??????R?[?h'
1092
  , TARGETDATE decimal(6,0) not null comment '???N??'
1093
  , SEQNO decimal(3,0) not null comment '?A??'
1094
  , LINECOUNT decimal(3,0) not null comment '?s???'
1095
  , APPROVALNO decimal(3,0) not null comment '???F????'
1096
  , APPROVALPERSON decimal(8,0) comment '???F??R?[?h'
1097
  , APPROVALPERSONNAME varchar(20) comment '???F???'
1098
  , APPROVALAUTHORITY decimal(1,0) comment '???F??????'
1099
  , APPROVALDATE date comment '???F???t'
1100
  , ENTRYDATE datetime comment '?o?^???t'
1101
  , UPDATEDATE datetime comment '?X?V???t'
1102
  , constraint depositapprovalinfo_PKC primary key (ORDERERSDIVISION,ORDERERSCODE,TARGETDATE,SEQNO,LINECOUNT,APPROVALNO)
1103
) comment '?????m?F???F?f?[?^' ;
1104

1105
-- ?????f?[?^
1106
drop table if exists depositdata cascade;
1107

1108
create table depositdata (
1109
  ORDERERSDIVISION decimal(5,0) not null comment '???????'
1110
  , ORDERERSCODE decimal(5,0) not null comment '??????R?[?h'
1111
  , TARGETDATE decimal(6,0) not null comment '???N??'
1112
  , SEQNO decimal(3,0) not null comment '?A??'
1113
  , BUSINESSPERIOD decimal(4,0) comment '?c???'
1114
  , DEPOSITDATE date comment '??????'
1115
  , DEPOSITAMOUNT decimal(12,0) comment '???????z'
1116
  , DEPOSITAMOUNTCASH decimal(10,0) comment '???????z?i?????j'
1117
  , DEPOSITAMOUNTBILL decimal(10,0) comment '???????z?i??`?j'
1118
  , DEPOSITPERSONCODE decimal(8,0) not null comment '?????S????R?[?h'
1119
  , NOTE varchar(120) comment '???l'
1120
  , ENTRYDATE datetime comment '?o?^???t'
1121
  , UPDATEDATE datetime comment '?X?V???t'
1122
  , constraint depositdata_PKC primary key (ORDERERSDIVISION,ORDERERSCODE,TARGETDATE,SEQNO)
1123
) comment '?????f?[?^' ;
1124

1125
-- ????????f?[?^
1126
drop table if exists depositdatadetail cascade;
1127

1128
create table depositdatadetail (
1129
  ORDERERSDIVISION decimal(5,0) not null comment '???????'
1130
  , ORDERERSCODE decimal(5,0) not null comment '??????R?[?h'
1131
  , TARGETDATE decimal(6,0) not null comment '???N??'
1132
  , REQUESTNO decimal(10,0) not null comment '????No'
1133
  , ORDERNO decimal(2,0) comment '??t???'
1134
  , DEPOSITAMOUNT decimal(10,0) comment '???????z'
1135
  , DISCOUNTAMOUNT decimal(10,0) comment '?l???????z'
1136
  , CNSTRPRICE decimal(10,0) comment '?????'
1137
  , FEES decimal(10,0) comment '????'
1138
  , OTHERADJUSTMENTS decimal(10,0) comment '?????'
1139
  , DIFFERENCEAMOUNT decimal(10,0) comment '????'
1140
  , CONFIRMATIONPERSONCODE decimal(8,0) comment '?m?F?S????R?[?h'
1141
  , CONFIRMATIONDATE date comment '?S????m?F???t'
1142
  , CONFIRMATIONENDFLG decimal(1,0) comment '?m?F?????t???O'
1143
  , NOTE varchar(120) comment '???l'
1144
  , ENTRYDATE datetime comment '?o?^???t'
1145
  , UPDATEDATE datetime comment '?X?V???t'
1146
  , constraint depositdatadetail_PKC primary key (ORDERERSDIVISION,ORDERERSCODE,TARGETDATE,REQUESTNO)
1147
) comment '????????f?[?^' ;
1148

1149
-- ???}?X?^
1150
drop table if exists divisionmaster cascade;
1151

1152
create table divisionmaster (
1153
  DivisionCode decimal(5,0) unsigned not null comment '???R?[?h'
1154
  , NameCode decimal(5,0) unsigned not null comment '????R?[?h'
1155
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
1156
  , NameString varchar(100) not null comment '????'
1157
  , DeleteFlg decimal(1,0) not null comment '???t???O'
1158
  , EntryDate datetime not null comment '?o?^???t'
1159
  , UpdateDate datetime not null comment '?X?V???t'
1160
  , constraint divisionmaster_PKC primary key (DivisionCode,NameCode)
1161
) comment '???}?X?^' ;
1162

1163
-- ??Z?\?Z???f?[?^
1164
drop table if exists estimatebudget cascade;
1165

1166
create table estimatebudget (
1167
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1168
  , ConstructionTime decimal(5,2) unsigned not null comment '?H??'
1169
  , IntegratedCode decimal(8,0) not null comment '??Z??'
1170
  , DataCreateDate datetime not null comment '?f?[?^??????'
1171
  , RetValue1 decimal(12,0) not null comment '?\???i'
1172
  , RetValue2 decimal(12,0) not null comment '????H????'
1173
  , RetValue3 decimal(12,0) not null comment '????????????'
1174
  , RetValue4 decimal(12,0) not null comment '????????????'
1175
  , RetPercent decimal(5,2) not null comment '???????'
1176
  , EntryDate datetime not null comment '?o?^???t'
1177
  , UpdateDate datetime not null comment '?X?V???t'
1178
  , constraint estimatebudget_PKC primary key (ConstructionCode)
1179
) comment '??Z?\?Z???f?[?^' ;
1180

1181
-- ??Z?\?Z????f?[?^????
1182
drop table if exists estimatebudgetdetail cascade;
1183

1184
create table estimatebudgetdetail (
1185
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1186
  , GroupCount decimal(2,0) unsigned not null comment '?O???[?v???'
1187
  , LineCount decimal(3,0) unsigned not null comment '?s???'
1188
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
1189
  , ItemCode decimal(5,0) unsigned comment '?H??L?['
1190
  , CompanyCode decimal(8,0) not null comment '??????R?[?h'
1191
  , FirstString varchar(120) comment '???????'
1192
  , SecondString varchar(120) comment '?H????E???????'
1193
  , Content varchar(120) comment '???e'
1194
  , EstimatePrice decimal(12,0) not null comment '????????z'
1195
  , NegotiationPrice decimal(12,0) not null comment '????????z'
1196
  , Notes varchar(120) comment '???????'
1197
  , EntryDate datetime not null comment '?o?^???t'
1198
  , UpdateDate datetime not null comment '?X?V???t'
1199
  , constraint estimatebudgetdetail_PKC primary key (ConstructionCode,GroupCount,LineCount)
1200
) comment '??Z?\?Z????f?[?^????' ;
1201

1202
-- ??Z????f?[?^
1203
drop table if exists estimatedata cascade;
1204

1205
create table estimatedata (
1206
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1207
  , LineCount decimal(3,0) unsigned not null comment '?s???'
1208
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
1209
  , FixedItemCode varchar(1) comment '?????L?['
1210
  , ItemName varchar(120) comment '??????'
1211
  , SpecName varchar(120) comment '???^?i???E?`??E???@'
1212
  , PriceValue decimal(14,0) not null comment '???z'
1213
  , note varchar(60) comment '???l'
1214
  , MyExpensesFlg decimal(1,0) not null comment '????o??t???O'
1215
  , InputFlg decimal(1,0) not null comment '????t???O'
1216
  , EntryDate datetime not null comment '?o?^???t'
1217
  , UpdateDate datetime not null comment '?X?V???t'
1218
  , constraint estimatedata_PKC primary key (ConstructionCode,LineCount)
1219
) comment '??Z????f?[?^' ;
1220

1221
create index EstimateData_Index1
1222
  on estimatedata(ConstructionCode,FixedItemCode);
1223

1224
-- ??Z????y?[?W?f?[?^
1225
drop table if exists estimatedatabody cascade;
1226

1227
create table estimatedatabody (
1228
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1229
  , PageCount decimal(4,0) unsigned not null comment '?y?[?W???'
1230
  , Category decimal(1,0) not null comment '?y?[?W??'
1231
  , UnionComponentCode decimal(5,0) unsigned not null comment '?????\???L?['
1232
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
1233
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
1234
  , SelectComponent decimal(5,0) unsigned not null comment '?I???\???L?['
1235
  , PageTitle varchar(120) not null comment '?y?[?W?\????'
1236
  , DetailLineCount decimal(3,0) unsigned not null comment '????s???'
1237
  , EntryDate datetime not null comment '?o?^???t'
1238
  , UpdateDate datetime not null comment '?X?V???t'
1239
  , constraint estimatedatabody_PKC primary key (ConstructionCode,PageCount)
1240
) comment '??Z????y?[?W?f?[?^' ;
1241

1242
create index EstimateDataBody_Index1
1243
  on estimatedatabody(ConstructionCode,ComponentCode,ItemCode);
1244

1245
-- ??Z????f?[?^????
1246
drop table if exists estimatedatadetail cascade;
1247

1248
create table estimatedatadetail (
1249
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1250
  , PageCount decimal(4,0) unsigned not null comment '?y?[?W???'
1251
  , LineCount decimal(3,0) unsigned not null comment '?s???'
1252
  , DataType decimal(1,0) not null comment '?f?[?^???'
1253
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
1254
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
1255
  , SpecCode decimal(5,0) unsigned not null comment '???L?['
1256
  , ItemName varchar(120) comment '??????'
1257
  , SpecName varchar(120) comment '???^?i???E?`??E???@'
1258
  , Unitcount decimal(8,2) not null comment '????'
1259
  , UnitName varchar(30) comment '?P?????'
1260
  , UnitPrice decimal(9,2) not null comment '?P??'
1261
  , LineTotal decimal(12,0) not null comment '???z'
1262
  , note varchar(60) comment '???l'
1263
  , CompanyCode decimal(8,0) not null comment '??????R?[?h'
1264
  , MyExpensesFlg decimal(1,0) not null comment '????o??t???O'
1265
  , InputFlg decimal(1,0) comment '????t???O'
1266
  , EntryDate datetime not null comment '?o?^???t'
1267
  , UpdateDate datetime not null comment '?X?V???t'
1268
  , constraint estimatedatadetail_PKC primary key (ConstructionCode,PageCount,LineCount)
1269
) comment '??Z????f?[?^????' ;
1270

1271
create index EstimateDataDetail_Index1
1272
  on estimatedatadetail(ConstructionCode,PageCount);
1273

1274
-- ?o???}?X?^
1275
drop table if exists expensesmaster cascade;
1276

1277
create table expensesmaster (
1278
  DivisionCode smallint(6) not null comment '?H?????R?[?h'
1279
  , NameCode smallint(6) not null comment '?o????R?[?h'
1280
  , DisplayOrder smallint(6) not null comment '?\????'
1281
  , ExpensesRatio decimal(4,2) not null comment '?o??'
1282
  , DeleteFlg decimal(1,0) not null comment '???t???O'
1283
  , EntryDate datetime not null comment '?o?^???t'
1284
  , UpdateDate datetime not null comment '?X?V???t'
1285
  , constraint expensesmaster_PKC primary key (DivisionCode,NameCode)
1286
) comment '?o???}?X?^' ;
1287

1288
-- ???x???}?X?^
1289
drop table if exists holidaycalendermaster cascade;
1290

1291
create table holidaycalendermaster (
1292
  Holiday date not null comment '?x??'
1293
  , BusinessYear smallint(5) unsigned not null comment '?c??N?x'
1294
  , TargetMonth tinyint(3) unsigned not null comment '?Y????'
1295
  , TargetDay tinyint(3) unsigned not null comment '?Y????'
1296
  , constraint holidaycalendermaster_PKC primary key (Holiday)
1297
) comment '???x???}?X?^' ;
1298

1299
create index HolidayCalender_Index1
1300
  on holidaycalendermaster(BusinessYear);
1301

1302
create index HolidayCalenderMaster_Index2
1303
  on holidaycalendermaster(TargetMonth);
1304

1305
create index HolidayCalenderMaster_Index3
1306
  on holidaycalendermaster(TargetDay);
1307

1308
-- ?????????????
1309
drop table if exists inputsearchlogdata cascade;
1310

1311
create table inputsearchlogdata (
1312
  ConstructionCode decimal(10,0) not null comment '?H???R?[?h'
1313
  , UsedProcessNo decimal(4,0) not null comment '?g?p?@?\???'
1314
  , DisplayOrder decimal(4,0) unsigned not null comment '?\????'
1315
  , DataType decimal(1,0) not null comment '?f?[?^???'
1316
  , InputCode decimal(10,0) comment '????R?[?h'
1317
  , constraint inputsearchlogdata_PKC primary key (ConstructionCode,UsedProcessNo,DisplayOrder)
1318
) comment '?????????????' ;
1319

1320
create index InputSearchLogData_Index1
1321
  on inputsearchlogdata(ConstructionCode,UsedProcessNo,InputCode);
1322

1323
-- ???????f?[?^
1324
drop table if exists invoicedata cascade;
1325

1326
create table invoicedata (
1327
  INVOICENO decimal(9,0) not null comment '??????No'
1328
  , ORDERERSDIVISION decimal(5,0) not null comment '???????'
1329
  , ORDERERSCODE decimal(5,0) not null comment '??????R?[?h'
1330
  , REQUESTMONTH decimal(6,0) not null comment '??????'
1331
  , SEQNO decimal(2,0) not null comment '?A??'
1332
  , CRETATEDATE date not null comment '????'
1333
  , REQUESTDATE date not null comment '??????'
1334
  , REQUESTNAME varchar(120) comment '??????'
1335
  , TOTALAMOUNT decimal(10,0) comment '???????v???z'
1336
  , TAXAMOUNT decimal(10,0) comment '???????z'
1337
  , COMMENT1 varchar(60) comment '?R?????g1'
1338
  , COMMENT2 varchar(60) comment '?R?????g2'
1339
  , COMMENT3 varchar(60) not null comment '?R?????g3'
1340
  , COMMENT4 varchar(60) not null comment '?R?????g4'
1341
  , COMMENT5 varchar(60) not null comment '?R?????g5'
1342
  , COMPLETEFLG decimal(1,0) default '0' not null comment '?????t???O'
1343
  , ENTRYDATE datetime not null comment '?o?^?N????'
1344
  , UPDATEDATE datetime not null comment '?X?V?N????'
1345
  , constraint invoicedata_PKC primary key (INVOICENO)
1346
) comment '???????f?[?^' ;
1347

1348
alter table invoicedata add unique ORDERERSDIVISION (ORDERERSDIVISION,ORDERERSCODE,REQUESTMONTH,SEQNO) ;
1349

1350
-- ??????
1351
drop table if exists materialinfo cascade;
1352

1353
create table materialinfo (
1354
  MATERIALITEMCODE smallint(5) unsigned default 0 not null comment '????i??R?[?h'
1355
  , MATERIALCOUNT smallint(5) unsigned comment '?????'
1356
  , RENTCOUNT smallint(5) unsigned comment '??o??\??'
1357
  , DELETEFLG smallint(5) unsigned comment '???t???O'
1358
  , ENTRYDATE datetime comment '?o?^???t'
1359
  , UPDATEDATE datetime comment '?X?V???t'
1360
  , constraint materialinfo_PKC primary key (MATERIALITEMCODE)
1361
) comment '??????' ;
1362

1363
-- ????i??}?X?^
1364
drop table if exists materialitemmaster cascade;
1365

1366
create table materialitemmaster (
1367
  MATERIALITEMCODE smallint(5) unsigned default 0 not null comment '????i??R?[?h'
1368
  , MATERIALKINDCODE smallint(5) unsigned comment '??????R?[?h'
1369
  , MATERIALITEMNAME varchar(40) comment '????i?????'
1370
  , DISPLAYORDER smallint(5) unsigned comment '?\????'
1371
  , DELETEFLG tinyint(3) unsigned comment '???t???O'
1372
  , ENTRYDATE datetime comment '?o?^???t'
1373
  , UPDATEDATE datetime comment '?X?V???t'
1374
  , VERSIONNO decimal(8,0) default '0' not null comment '?o?[?W???????'
1375
  , constraint materialitemmaster_PKC primary key (MATERIALITEMCODE)
1376
) comment '????i??}?X?^' ;
1377

1378
-- ??????}?X?^
1379
drop table if exists materialkindmaster cascade;
1380

1381
create table materialkindmaster (
1382
  MATERIALKINDCODE smallint(5) unsigned default 0 not null comment '??????R?[?h'
1383
  , MATERIALKINDNAME varchar(40) comment '?????????'
1384
  , DISPLAYORDER smallint(5) unsigned comment '?\????'
1385
  , DELETEFLG tinyint(3) unsigned comment '???t???O'
1386
  , ENTRYDATE datetime comment '?o?^???t'
1387
  , UPDATEDATE datetime comment '?X?V???t'
1388
  , constraint materialkindmaster_PKC primary key (MATERIALKINDCODE)
1389
) comment '??????}?X?^' ;
1390

1391
-- ??????????
1392
drop table if exists materialrecordinfo cascade;
1393

1394
create table materialrecordinfo (
1395
  MATERIALITEMCODE smallint(5) unsigned default 0 not null comment '????i??R?[?h'
1396
  , PROCESSDATE date default '0000-00-00' not null comment '?????N????'
1397
  , SEQNO smallint(5) unsigned default 0 not null comment '?A??'
1398
  , RECKIND tinyint(3) unsigned comment '???R?[?h??'
1399
  , CONSTRUCTIONCODE int(10) unsigned comment '?H?????'
1400
  , PERSONCODE int(10) unsigned comment '?S????R?[?h'
1401
  , MATERIALCOUNT smallint(5) unsigned comment '?????'
1402
  , REPAYPLANDATE date comment '??p?\??N????'
1403
  , COMMENTTEXT varchar(80) comment '?R?????g'
1404
  , ENTRYDATE datetime comment '?o?^???t'
1405
  , UPDATEDATE datetime comment '?X?V???t'
1406
  , constraint materialrecordinfo_PKC primary key (MATERIALITEMCODE,PROCESSDATE,SEQNO)
1407
) comment '??????????' ;
1408

1409
-- ?f??????b?Z?[?W
1410
drop table if exists messageboarddata cascade;
1411

1412
create table messageboarddata (
1413
  RecordNumber decimal(6,0) unsigned not null comment '???R?[?h???'
1414
  , BranchNumber decimal(3,0) unsigned not null comment '???R?[?h?}??'
1415
  , FromCode decimal(8,0) unsigned not null comment '???????R?[?h'
1416
  , FromName varchar(60) not null comment '???????'
1417
  , MessageTitile varchar(100) comment '?`???^?C?g??'
1418
  , MessageContent varchar(1333) not null comment '?`?????e'
1419
  , LinkType decimal(2,0) not null comment '?????N????^?C?v'
1420
  , LinkMessage varchar(200) comment '?????N??????'
1421
  , LinkCode varchar(30) comment '?????N?L?['
1422
  , WritingDate datetime not null comment '?????????'
1423
  , PersonCode decimal(8,0) not null comment '??????S????R?[?h'
1424
  , ShareFlag decimal(2,0) not null comment '???????t???O'
1425
  , MessageColor varchar(8) comment '?????F'
1426
  , BackColor varchar(8) comment '?o?b?N?J???['
1427
  , MessageFlag decimal(1,0) not null comment '???b?Z?[?W?t???O'
1428
  , EntryDate datetime not null comment '?o?^???t'
1429
  , UpdateDate datetime not null comment '?X?V???t'
1430
  , constraint messageboarddata_PKC primary key (RecordNumber,BranchNumber)
1431
) comment '?f??????b?Z?[?W' ;
1432

1433
create index MessageBoardData_Index1
1434
  on messageboarddata(WritingDate);
1435

1436
create index MessageBoardData_Index2
1437
  on messageboarddata(MessageFlag);
1438

1439
-- ?f???????e?[?u??
1440
drop table if exists messageboardterget cascade;
1441

1442
create table messageboardterget (
1443
  RecordNumber decimal(6,0) unsigned not null comment '???R?[?h???'
1444
  , BranchNumber decimal(3,0) unsigned not null comment '???R?[?h?}??'
1445
  , SeqNum decimal(3,0) unsigned not null comment '????'
1446
  , ToCode decimal(8,0) not null comment '????R?[?h'
1447
  , ToName varchar(60) not null comment '????'
1448
  , EntryDate datetime not null comment '?o?^???t'
1449
  , UpdateDate datetime not null comment '?X?V???t'
1450
  , constraint messageboardterget_PKC primary key (RecordNumber,BranchNumber,SeqNum)
1451
) comment '?f???????e?[?u??' ;
1452

1453
create index MessageBoardTerget_Index1
1454
  on messageboardterget(RecordNumber,BranchNumber);
1455

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

1459
create table messagebrowsinghistory (
1460
  RecordNumber decimal(6,0) unsigned not null comment '???R?[?h???'
1461
  , BranchNumber decimal(3,0) unsigned not null comment '???R?[?h?}??'
1462
  , SeqNum decimal(3,0) unsigned not null comment '????'
1463
  , BrowsingCode decimal(8,0) not null comment '?{????R?[?h'
1464
  , BrowsingDate datetime not null comment '?{?????t'
1465
  , EntryDate datetime not null comment '?o?^???t'
1466
  , UpdateDate datetime not null comment '?X?V???t'
1467
  , constraint messagebrowsinghistory_PKC primary key (RecordNumber,BranchNumber,SeqNum)
1468
) comment '?f??????b?Z?[?W?{??????' ;
1469

1470
-- ???}?X?^
1471
drop table if exists monthmaster cascade;
1472

1473
create table monthmaster (
1474
  month smallint(6) not null comment '??'
1475
) comment '???}?X?^' ;
1476

1477
create index month_Index1
1478
  on monthmaster(month);
1479

1480
-- ??????}?X?^
1481
drop table if exists orderersmaster cascade;
1482

1483
create table orderersmaster (
1484
  OrderCotegory decimal(5,0) unsigned not null comment '???????'
1485
  , OrderersCode decimal(5,0) unsigned not null comment '??????R?[?h'
1486
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
1487
  , OrderFlg decimal(1,0) not null comment '?@?l?c??E??l?t???O'
1488
  , CorporateStatusName varchar(100) comment '?@?l?i????'
1489
  , CorporateStatusPoint decimal(1,0) comment '?@?l?i?????u'
1490
  , OrderersName1 varchar(60) not null comment '???????1'
1491
  , OrderersName2 varchar(60) comment '????????Q'
1492
  , DepartmentName varchar(60) comment '??????'
1493
  , ChargePersonName varchar(60) comment '?S?????'
1494
  , ZipCode varchar(8) comment '?X????'
1495
  , Address1 varchar(60) comment '?Z???P'
1496
  , Address2 varchar(60) comment '?Z??2'
1497
  , Address3 varchar(60) comment '?Z??3'
1498
  , PhoneNumber varchar(13) comment '?d?b???'
1499
  , FaxNumber varchar(13) comment 'FAX???'
1500
  , MailAddress varchar(257) comment '???[???A?h???X'
1501
  , Note varchar(300) comment '???l'
1502
  , DeleteFlg decimal(1,0) not null comment '???t???O'
1503
  , EntryDate datetime not null comment '?o?^???t'
1504
  , UpdateDate datetime not null comment '?X?V???t'
1505
  , constraint orderersmaster_PKC primary key (OrderCotegory,OrderersCode)
1506
) comment '??????}?X?^' ;
1507

1508
-- ????z?f?[?^
1509
drop table if exists orderspricedata cascade;
1510

1511
create table orderspricedata (
1512
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1513
  , ChangeNo decimal(3,0) unsigned not null comment '??X???'
1514
  , ChangeDate date not null comment '??X??'
1515
  , ChangePersonCode decimal(8,0) unsigned not null comment '??X??R?[?h'
1516
  , ChangePersonName varchar(60) comment '??X???'
1517
  , BeforeValue decimal(14,0) not null comment '??X?O???????z'
1518
  , BeforeValueInTax decimal(14,0) not null comment '??X?O???????z'
1519
  , AfterValue decimal(14,0) not null comment '??X????????z'
1520
  , AfterValueInTax decimal(14,0) not null comment '??X????????z'
1521
  , ChangeComment varchar(200) comment '??X???R'
1522
  , EntryDate datetime not null comment '?o?^???t'
1523
  , UpdateDate datetime not null comment '?X?V???t'
1524
  , constraint orderspricedata_PKC primary key (ConstructionCode,ChangeNo)
1525
) comment '????z?f?[?^' ;
1526

1527
-- ?x?????F???f?[?^
1528
drop table if exists paymentapprovalinfo cascade;
1529

1530
create table paymentapprovalinfo (
1531
  COMPANYCODE decimal(8,0) default '0' not null comment '??????R?[?h'
1532
  , TARGETDATE decimal(6,0) default '0' not null comment '???N??'
1533
  , SEQNO decimal(3,0) default '0' not null comment '?A??'
1534
  , LINECOUNT decimal(3,0) default '0' not null comment '?s???'
1535
  , APPROVALNO decimal(3,0) default '0' not null comment '???F????'
1536
  , APPROVALPERSON decimal(8,0) comment '???F??R?[?h'
1537
  , APPROVALPERSONNAME varchar(20) comment '???F???'
1538
  , APPROVALAUTHORITY decimal(1,0) comment '???F??????'
1539
  , APPROVALDATE date comment '???F???t'
1540
  , ENTRYDATE datetime comment '?o?^???t'
1541
  , UPDATEDATE datetime comment '?X?V???t'
1542
  , constraint paymentapprovalinfo_PKC primary key (COMPANYCODE,TARGETDATE,SEQNO,LINECOUNT,APPROVALNO)
1543
) comment '?x?????F???f?[?^' ;
1544

1545
-- ?x??????f?[?^
1546
drop table if exists paymentdatadetail cascade;
1547

1548
create table paymentdatadetail (
1549
  COMPANYCODE decimal(8,0) default '0' not null comment '??????R?[?h'
1550
  , TARGETDATE decimal(6,0) default '0' not null comment '???N??'
1551
  , SEQNO decimal(3,0) default '0' not null comment '?A??'
1552
  , LINECOUNT decimal(3,0) default '0' not null comment '?s???'
1553
  , BILLPRICE decimal(10,0) comment '???????z'
1554
  , DISCOUNTPRICE decimal(10,0) comment '?l???????z'
1555
  , OFFSETPRICE decimal(10,0) comment '???E???z'
1556
  , NEXTCOPRICE decimal(10,0) comment '????J?z'
1557
  , HIGHWPRICE decimal(10,0) comment '??????'
1558
  , HARDWPRICE decimal(10,0) comment '??????'
1559
  , INDSWASTETAX decimal(10,0) comment '?Y?p??'
1560
  , CNSTRPRICE decimal(10,0) comment '?????'
1561
  , CNSTRPRICEEXIST decimal(1,0) comment '??????L??'
1562
  , APPROVALPERSONCODE decimal(8,0) comment '???F?S????R?[?h'
1563
  , APPROVALDATE date comment '?S??????F???t'
1564
  , APPROVALENDFLG decimal(1,0) comment '???F?????t???O'
1565
  , ENTRYDATE datetime comment '?o?^???t'
1566
  , UPDATEDATE datetime comment '?X?V???t'
1567
  , constraint paymentdatadetail_PKC primary key (COMPANYCODE,TARGETDATE,SEQNO,LINECOUNT)
1568
) comment '?x??????f?[?^' ;
1569

1570
create index PayDataDetail_Index1
1571
  on paymentdatadetail(TARGETDATE);
1572

1573
create index PayDataDetail_Index2
1574
  on paymentdatadetail(APPROVALPERSONCODE);
1575

1576
-- ?H??????????f?[?^
1577
drop table if exists periodavoidance cascade;
1578

1579
create table periodavoidance (
1580
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1581
  , ConstructionStatusFlg decimal(2,0) not null comment '?H?????t???O'
1582
  , FieldNo decimal(2,0) not null comment '?`?F?b?N???t?B?[???h???'
1583
  , EntryDate datetime not null comment '?o?^???t'
1584
  , UpdateDate datetime not null comment '?X?V???t'
1585
  , constraint periodavoidance_PKC primary key (ConstructionCode,ConstructionStatusFlg,FieldNo)
1586
) comment '?H??????????f?[?^' ;
1587

1588
create index PeriodAvoidance_Index1
1589
  on periodavoidance(ConstructionCode);
1590

1591
create index PeriodAvoidance_Index2
1592
  on periodavoidance(ConstructionStatusFlg);
1593

1594
create index PeriodAvoidance_Index3
1595
  on periodavoidance(FieldNo);
1596

1597
-- ?S??????F?f?[?^
1598
drop table if exists personapproval cascade;
1599

1600
create table personapproval (
1601
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
1602
  , ApprovalCode decimal(3,0) unsigned not null comment '???F?@?\???'
1603
  , OrderDate date not null comment '??t??'
1604
  , OrderNo decimal(2,0) unsigned not null comment '??t???'
1605
  , SeqNo decimal(2,0) not null comment '?}??'
1606
  , PersonCodeApproval decimal(8,0) unsigned not null comment '?\???E???F??R?[?h'
1607
  , PetitionApprovalDate datetime not null comment '?\???E???F???t'
1608
  , ApprovalLimitDates datetime not null comment '???F??]??'
1609
  , ApprovalStatus decimal(1,0) not null comment '???F???'
1610
  , InputComment varchar(300) comment '?R?????g'
1611
  , EntryDate datetime not null comment '?o?^???t'
1612
  , UpdateDate datetime not null comment '?X?V???t'
1613
  , constraint personapproval_PKC primary key (PersonCode,ApprovalCode,OrderDate,OrderNo,SeqNo)
1614
) comment '?S??????F?f?[?^' ;
1615

1616
-- ?S??????F?R?????g?f?[?^
1617
drop table if exists personapprovalcomment cascade;
1618

1619
create table personapprovalcomment (
1620
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
1621
  , ApprovalCode decimal(3,0) unsigned not null comment '???F?@?\???'
1622
  , OrderDate date not null comment '??t??'
1623
  , OrderNo decimal(2,0) unsigned not null comment '??t???'
1624
  , CommentNo decimal(2,0) not null comment '?R?????g???'
1625
  , ParentNo decimal(2,0) not null comment '?e?R?????g???'
1626
  , ApproValComment varchar(300) comment '?w???E?A???R?????g'
1627
  , EntryDate datetime not null comment '?o?^???t'
1628
  , UpdateDate datetime not null comment '?X?V???t'
1629
  , constraint personapprovalcomment_PKC primary key (PersonCode,ApprovalCode,OrderDate,OrderNo,CommentNo)
1630
) comment '?S??????F?R?????g?f?[?^' ;
1631

1632
-- ?S??????????}?X?^
1633
drop table if exists persondepartmentmaster cascade;
1634

1635
create table persondepartmentmaster (
1636
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
1637
  , DepartmentCode decimal(5,0) unsigned not null comment '?????R?[?h'
1638
  , AffiliationFlg decimal(1,0) not null comment '?????t???O'
1639
  , EntryDate datetime not null comment '?o?^???t'
1640
  , UpdateDate datetime not null comment '?X?V???t'
1641
  , constraint persondepartmentmaster_PKC primary key (PersonCode,DepartmentCode)
1642
) comment '?S??????????}?X?^' ;
1643

1644
create index PersonDepartmentMaster_Index1
1645
  on persondepartmentmaster(PersonCode);
1646

1647
create index PersonDepartmentMaster_Index2
1648
  on persondepartmentmaster(DepartmentCode);
1649

1650
-- ?S????}?X?^
1651
drop table if exists personinchargemaster cascade;
1652

1653
create table personinchargemaster (
1654
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
1655
  , DisplayOrder decimal(8,0) unsigned not null comment '?\????'
1656
  , PersonName varchar(60) not null comment '?S?????'
1657
  , StartDate date not null comment '?g?p?J?n?N????'
1658
  , EndDate date comment '?g?p?I???N????'
1659
  , PassWord varchar(16) comment '?p?X???[?h'
1660
  , SecurityManagement decimal(1,0) not null comment '?@????'
1661
  , SecCode decimal(2,0) unsigned not null comment '???????'
1662
  , MsgBackColor varchar(8) comment '???b?Z?[?W?w?i?F'
1663
  , DisplayString varchar(20) comment '?\???E???????'
1664
  , DepartmentCode decimal(5,0) unsigned comment '?????R?[?h'
1665
  , MonthlySalary decimal(11,0) not null comment '???????z'
1666
  , YearSalary decimal(12,0) not null comment '?N????z'
1667
  , Qualification varchar(120) comment '???i?????'
1668
  , SealPrintName varchar(5) comment '???\????'
1669
  , EmployeeClassFlg decimal(1,0) not null comment '?????'
1670
  , LedgerFlg decimal(1,0) not null comment '???v?Z???t???O'
1671
  , CommutingDistance decimal(5,2) not null comment '??????'
1672
  , CommuteCosts decimal(5,0) not null comment '??????'
1673
  , DeleteFlg decimal(1,0) not null comment '???t???O'
1674
  , EntryDate datetime not null comment '?o?^???t'
1675
  , UpdateDate datetime not null comment '?X?V???t'
1676
  , constraint personinchargemaster_PKC primary key (PersonCode)
1677
) comment '?S????}?X?^' ;
1678

1679
create index PersonInChargeMaster_Index1
1680
  on personinchargemaster(StartDate);
1681

1682
create index PersonInChargeMaster_Index2
1683
  on personinchargemaster(DepartmentCode);
1684

1685
-- ?S??????^?}?X?^
1686
drop table if exists personsalarymaster cascade;
1687

1688
create table personsalarymaster (
1689
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
1690
  , StartDate date not null comment '?g?p?J?n?N????'
1691
  , MonthlySalary decimal(11,0) not null comment '???????z'
1692
  , YearSalary decimal(12,0) not null comment '?N????z'
1693
  , EntryDate datetime not null comment '?o?^???t'
1694
  , UpdateDate datetime not null comment '?X?V???t'
1695
  , constraint personsalarymaster_PKC primary key (PersonCode,StartDate)
1696
) comment '?S??????^?}?X?^' ;
1697

1698
create index PersonSalaryMaster_Index1
1699
  on personsalarymaster(PersonCode);
1700

1701
create index PersonSalaryMaster_Index2
1702
  on personsalarymaster(StartDate);
1703

1704
-- ?w???????f?[?^
1705
drop table if exists pointingoutcomment cascade;
1706

1707
create table pointingoutcomment (
1708
  ConstructionCode decimal(10,0) not null comment '?H???R?[?h'
1709
  , ProcessNo smallint(6) not null comment '????????i??????j'
1710
  , SeqNo smallint(6) not null comment '????'
1711
  , PageCount smallint(6) not null comment '?y?[?W???'
1712
  , PersonCode decimal(8,0) not null comment '?L????R?[?h'
1713
  , DrowColor varchar(8) comment '?`??F'
1714
  , CommentMessage varchar(1000) comment '???b?Z?[?W'
1715
  , StartPointX smallint(6) not null comment '?w?E?????u?w'
1716
  , StartPointY smallint(6) not null comment '?w?E?????u?x'
1717
  , CurrentPointX smallint(6) not null comment '??????u?w'
1718
  , CurrentPointY smallint(6) not null comment '??????u?x'
1719
  , CurrentWidth smallint(6) not null comment '?\???T?C?YWidth'
1720
  , CurrentHeight smallint(6) not null comment '?\???T?C?YHeigth'
1721
  , EntryDate datetime not null comment '?o?^???t'
1722
  , UpdateDate datetime not null comment '?X?V???t'
1723
  , constraint pointingoutcomment_PKC primary key (ConstructionCode,ProcessNo,SeqNo)
1724
) comment '?w???????f?[?^' ;
1725

1726
-- ?????????????c???^?f?[?^
1727
drop table if exists proceedingsdata cascade;
1728

1729
create table proceedingsdata (
1730
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1731
  , ProceedingsDataDate date not null comment '?c???^????'
1732
  , StartMeetingTime decimal(4,0) unsigned not null comment '??c????J?n'
1733
  , EndMeetingTime decimal(4,0) unsigned not null comment '??c????I??'
1734
  , CreatorCode decimal(8,0) not null comment '????R?[?h'
1735
  , PalceFlag decimal(1,0) not null comment '???n?t???O'
1736
  , MeetingPalce varchar(120) comment '???????'
1737
  , EntryDate datetime not null comment '?o?^???t'
1738
  , UpdateDate datetime not null comment '?X?V???t'
1739
  , constraint proceedingsdata_PKC primary key (ConstructionCode,ProceedingsDataDate,StartMeetingTime)
1740
) comment '?????????????c???^?f?[?^' ;
1741

1742
-- ?????????????c???^?f?[?^?i?o???j
1743
drop table if exists proceedingsdataattend cascade;
1744

1745
create table proceedingsdataattend (
1746
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1747
  , ProceedingsDataDate date not null comment '?c???^????'
1748
  , StartMeetingTime decimal(4,0) unsigned not null comment '??c????J?n'
1749
  , SeqNo decimal(3,0) unsigned not null comment '????s???'
1750
  , Department varchar(20) comment '?o??????'
1751
  , AttendName varchar(10) comment '?o??????'
1752
  , EntryDate datetime not null comment '?o?^???t'
1753
  , UpdateDate datetime not null comment '?X?V???t'
1754
  , constraint proceedingsdataattend_PKC primary key (ConstructionCode,ProceedingsDataDate,StartMeetingTime,SeqNo)
1755
) comment '?????????????c???^?f?[?^?i?o???j' ;
1756

1757
-- ?????????????c???^?f?[?^?i????j
1758
drop table if exists proceedingsdatadetail cascade;
1759

1760
create table proceedingsdatadetail (
1761
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1762
  , ProceedingsDataDate date not null comment '?c???^????'
1763
  , StartMeetingTime decimal(4,0) unsigned not null comment '??c????J?n'
1764
  , SeqNo decimal(3,0) unsigned not null comment '????s???'
1765
  , TitleNo varchar(5) comment '?c????'
1766
  , Title varchar(20) comment '?c??'
1767
  , ContentsText varchar(50) comment '???e'
1768
  , EntryDate datetime not null comment '?o?^???t'
1769
  , UpdateDate datetime not null comment '?X?V???t'
1770
  , constraint proceedingsdatadetail_PKC primary key (ConstructionCode,ProceedingsDataDate,StartMeetingTime,SeqNo)
1771
) comment '?????????????c???^?f?[?^?i????j' ;
1772

1773
-- ???F?f?[?^
1774
drop table if exists processapproval cascade;
1775

1776
create table processapproval (
1777
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1778
  , ApprovalCode decimal(3,0) unsigned not null comment '???F?@?\???'
1779
  , OrderNo decimal(2,0) unsigned not null comment '??t???'
1780
  , SeqNo decimal(2,0) not null comment '?}??'
1781
  , PersonCode decimal(8,0) unsigned not null comment '?\???E???F??R?[?h'
1782
  , PetitionApprovalDate datetime not null comment '?\???E???F???t'
1783
  , ApprovalLimitDates datetime not null comment '???F??]??'
1784
  , ApprovalStatus decimal(1,0) not null comment '???F???'
1785
  , InputComment varchar(300) comment '?R?????g'
1786
  , EntryDate datetime not null comment '?o?^???t'
1787
  , UpdateDate datetime not null comment '?X?V???t'
1788
  , constraint processapproval_PKC primary key (ConstructionCode,ApprovalCode,OrderNo,SeqNo)
1789
) comment '???F?f?[?^' ;
1790

1791
-- ???F?R?????g?f?[?^
1792
drop table if exists processapprovalcomment cascade;
1793

1794
create table processapprovalcomment (
1795
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1796
  , ApprovalCode decimal(3,0) unsigned not null comment '???F?@?\???'
1797
  , OrderNo decimal(2,0) unsigned not null comment '??t???'
1798
  , CommentNo decimal(2,0) not null comment '?R?????g???'
1799
  , ParentNo decimal(2,0) not null comment '?e?R?????g???'
1800
  , ApproValComment varchar(300) comment '?w???E?A???R?????g'
1801
  , EntryDate datetime not null comment '?o?^???t'
1802
  , UpdateDate datetime not null comment '?X?V???t'
1803
  , constraint processapprovalcomment_PKC primary key (ConstructionCode,ApprovalCode,OrderNo,CommentNo)
1804
) comment '???F?R?????g?f?[?^' ;
1805

1806
-- ???F????f?[?^
1807
drop table if exists processapprovaldetail cascade;
1808

1809
create table processapprovaldetail (
1810
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1811
  , ApprovalCode decimal(3,0) unsigned not null comment '???F?@?\???'
1812
  , OrderNo decimal(2,0) unsigned not null comment '??t???'
1813
  , SerialNo decimal(2,0) unsigned not null comment '?}??'
1814
  , LinkCode decimal(10,0) not null comment '?????N???'
1815
  , EntryDate datetime not null comment '?o?^???t'
1816
  , UpdateDate datetime not null comment '?X?V???t'
1817
  , constraint processapprovaldetail_PKC primary key (ConstructionCode,ApprovalCode,OrderNo,SerialNo)
1818
) comment '???F????f?[?^' ;
1819

1820
-- ?N?????}?X?^
1821
drop table if exists processexcutemaster cascade;
1822

1823
create table processexcutemaster (
1824
  SecCode decimal(2,0) unsigned not null comment '???????'
1825
  , ExecCode decimal(4,0) unsigned not null comment '?N?????????'
1826
  , EditFlg decimal(1,0) not null comment '??W?t???O'
1827
  , EntryDate datetime not null comment '?o?^???t'
1828
  , UpdateDate datetime not null comment '?X?V???t'
1829
  , constraint processexcutemaster_PKC primary key (SecCode,ExecCode)
1830
) comment '?N?????}?X?^' ;
1831

1832
create index ProcessExcuteMaster_Index1
1833
  on processexcutemaster(SecCode);
1834

1835
create index ProcessExcuteMaster_Index2
1836
  on processexcutemaster(ExecCode);
1837

1838
-- ???????f?[?^
1839
drop table if exists purchaseorder cascade;
1840

1841
create table purchaseorder (
1842
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1843
  , SeqNo decimal(3,0) unsigned not null comment '???????}??'
1844
  , CompanyCode decimal(8,0) not null comment '??????R?[?h'
1845
  , CreateDate date comment '?????t'
1846
  , OrderPrice decimal(12,0) not null comment '???????z'
1847
  , LastRowStringDate date not null comment '??I?s?\?????t'
1848
  , OrderSheetType decimal(1,0) not null comment '???E?{???t???O'
1849
  , PaymentTerms decimal(1,0) not null comment '?x????????'
1850
  , CashRatio decimal(4,1) not null comment '?????????i???j'
1851
  , BillPeriod decimal(4,0) not null comment '??`????'
1852
  , PrePayments decimal(1,0) not null comment '?O????'
1853
  , PrePaymentsDays decimal(3,0) not null comment '?O????????'
1854
  , PrePaymentsPrice decimal(12,0) not null comment '?O???????z'
1855
  , PartialPayment decimal(1,0) not null comment '??????'
1856
  , PartialPaymentMounth decimal(2,0) unsigned not null comment '???????????'
1857
  , PartialPaymentDay1 decimal(2,0) unsigned not null comment '???????????'
1858
  , PartialPaymentDay2 decimal(2,0) unsigned not null comment '???????x????'
1859
  , PartialPaymentPrice decimal(12,0) not null comment '?????????z'
1860
  , CompletionPayment decimal(1,0) not null comment '???n??????x??'
1861
  , CompletionPaymentDays decimal(3,0) unsigned not null comment '???n??????x??????'
1862
  , CompletionPaymentPrice decimal(12,0) not null comment '???n??????x?????z'
1863
  , LeadEngineerCode decimal(8,0) comment '??C?Z?p??R?[?h'
1864
  , LeadEngineerName varchar(60) comment '??C?Z?p???'
1865
  , SafetyOfficerCode decimal(8,0) comment '???S?????R?[?h'
1866
  , SafetyOfficerName varchar(60) comment '???S??????'
1867
  , WorkersCount decimal(3,0) unsigned comment '??????'
1868
  , PrintoutDate date not null comment '????N????'
1869
  , EntryDate datetime not null comment '?o?^???t'
1870
  , UpdateDate datetime not null comment '?X?V???t'
1871
  , constraint purchaseorder_PKC primary key (ConstructionCode,SeqNo)
1872
) comment '???????f?[?^' ;
1873

1874
-- ?????????t?f?[?^
1875
drop table if exists purchaseorderdate cascade;
1876

1877
create table purchaseorderdate (
1878
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1879
  , SeqNo decimal(3,0) unsigned not null comment '???????}??'
1880
  , CompanyCode decimal(8,0) not null comment '??????R?[?h'
1881
  , SendDate date not null comment '???????X????'
1882
  , ReturnDate date not null comment '???????????'
1883
  , ReturnCheckDate date not null comment '??????????m?F??'
1884
  , EntryDate datetime not null comment '?o?^???t'
1885
  , UpdateDate datetime not null comment '?X?V???t'
1886
  , constraint purchaseorderdate_PKC primary key (ConstructionCode,SeqNo)
1887
) comment '?????????t?f?[?^' ;
1888

1889
-- ??????????f?[?^
1890
drop table if exists purchaseorderdetail cascade;
1891

1892
create table purchaseorderdetail (
1893
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1894
  , SeqNo decimal(3,0) unsigned not null comment '???????}??'
1895
  , GroupCount decimal(1,0) not null comment '?O???[?v???'
1896
  , LineCount decimal(3,0) unsigned not null comment '?s???'
1897
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
1898
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
1899
  , FirstString varchar(120) comment '?H??E?i??'
1900
  , SecondString varchar(120) comment '???e????'
1901
  , UnitCount decimal(8,2) not null comment '????'
1902
  , UnitName varchar(30) comment '?P??'
1903
  , UnitPrice decimal(10,0) not null comment '?P??'
1904
  , OrdersLinePrice decimal(12,0) comment '???z'
1905
  , SourceCode decimal(10,0) unsigned not null comment '???H?????'
1906
  , SourceDetailCnt decimal(4,0) unsigned not null comment '????????'
1907
  , DataTypeFlag decimal(1,0) unsigned not null comment '?f?[?^?^?C?v?t???O'
1908
  , EntryDate datetime not null comment '?o?^???t'
1909
  , UpdateDate datetime not null comment '?X?V???t'
1910
  , constraint purchaseorderdetail_PKC primary key (ConstructionCode,SeqNo,GroupCount,LineCount)
1911
) comment '??????????f?[?^' ;
1912

1913
create index POrderDetail_Index1
1914
  on purchaseorderdetail(SourceCode);
1915

1916
-- ?????f?[?^
1917
drop table if exists requestdata cascade;
1918

1919
create table requestdata (
1920
  REQUESTNO decimal(9,0) not null comment '????No'
1921
  , MAINCONSTRUCTIONCODE decimal(10,0) not null comment '?{?H?????'
1922
  , CONSTRUCTIONNAME varchar(120) not null comment '?H??????'
1923
  , CONTRACTAMOUNT decimal(10,0) not null comment '???????z'
1924
  , PAIDAMOUNT decimal(10,0) not null comment '????????z'
1925
  , REQUESTAMOUNT0 decimal(10,0) not null comment '???????z?O'
1926
  , REQUESTAMOUNT1 decimal(10,0) not null comment '???????z?P'
1927
  , REQUESTAMOUNT2 decimal(10,0) comment '???????z?Q'
1928
  , REQUESTAMOUNT3 decimal(10,0) comment '???????z?R'
1929
  , REQUESTAMOUNT4 decimal(10,0) comment '???????z?S'
1930
  , REQUESTAMOUNT5 decimal(10,0) comment '???????z?T'
1931
  , REQUESTAMOUNT6 decimal(10,0) comment '???????z?U'
1932
  , UNCLAIMEDAMOUNT decimal(10,0) not null comment '?????c???z'
1933
  , UNPAIDAMOUNT decimal(10,0) not null comment '?????????z'
1934
  , TAXAMOUNT decimal(10,0) not null comment '?????'
1935
  , NOTE varchar(120) not null comment '???l'
1936
  , ENTRYDATE datetime not null comment '?o?^?N????'
1937
  , UPDATEDATE datetime not null comment '?X?V?N????'
1938
  , constraint requestdata_PKC primary key (REQUESTNO,MAINCONSTRUCTIONCODE)
1939
) comment '?????f?[?^' ;
1940

1941
-- ?????f?[?^????
1942
drop table if exists requestdatadetail cascade;
1943

1944
create table requestdatadetail (
1945
  REQUESTNO decimal(9,0) not null comment '????No'
1946
  , MAINCONSTRUCTIONCODE decimal(10,0) not null comment '?{?H?????'
1947
  , CONSTRUCTIONCODE decimal(10,0) not null comment '?H?????'
1948
  , CONSTRUCTIONKIND decimal(1,0) not null comment '?H????'
1949
  , REQUESTAMOUNT decimal(10,0) not null comment '???????z'
1950
  , TAXAMOUNT decimal(10,0) not null comment '?????'
1951
  , ENTRYDATE datetime not null comment '?o?^?N????'
1952
  , UPDATEDATE datetime not null comment '?X?V?N????'
1953
  , constraint requestdatadetail_PKC primary key (REQUESTNO,MAINCONSTRUCTIONCODE,CONSTRUCTIONCODE,CONSTRUCTIONKIND)
1954
) comment '?????f?[?^????' ;
1955

1956
-- ?????w?b?_
1957
drop table if exists requesthead cascade;
1958

1959
create table requesthead (
1960
  REQUESTNO decimal(9,0) not null comment '????No'
1961
  , REQCONSTRUCTIONCODE decimal(10,0) not null comment '?????H?????'
1962
  , ORDERNO decimal(2,0) not null comment '??t???'
1963
  , REQUESTMONTH decimal(6,0) not null comment '??????'
1964
  , ORDERERSDIVISION decimal(5,0) not null comment '???????'
1965
  , ORDERERSCODE decimal(5,0) not null comment '??????R?[?h'
1966
  , ORDERERSNAME varchar(120) not null comment '???????'
1967
  , REQCONSTRUCTIONNAME varchar(120) not null comment '?????H??????'
1968
  , REQUESTTOTALAMOUNT decimal(10,0) not null comment '???????z???v'
1969
  , REQUESTAMOUNT decimal(10,0) not null comment '???????z'
1970
  , TAXAMOUNT decimal(10,0) not null comment '?????'
1971
  , UNPAIDAMOUNT decimal(10,0) comment '??????'
1972
  , NOTE varchar(120) comment '???l'
1973
  , ASSIGNEDFLG decimal(1,0) comment '??????t???O'
1974
  , INVOICENO decimal(9,0) not null comment '??????No'
1975
  , ENTRYDATE datetime not null comment '?o?^?N????'
1976
  , UPDATEDATE datetime not null comment '?X?V?N????'
1977
  , constraint requesthead_PKC primary key (REQUESTNO)
1978
) comment '?????w?b?_' ;
1979

1980
alter table requesthead add unique REQCONSTRUCTIONCODE (REQCONSTRUCTIONCODE,ORDERNO) ;
1981

1982
-- ?????????t?f?[?^
1983
drop table if exists requestorderdate cascade;
1984

1985
create table requestorderdate (
1986
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1987
  , InvoiceNo decimal(9,0) not null comment '??????No'
1988
  , SendDate date not null comment '???????????X????'
1989
  , EntryDate datetime not null comment '?o?^???t'
1990
  , UpdateDate datetime not null comment '?X?V???t'
1991
  , constraint requestorderdate_PKC primary key (ConstructionCode,InvoiceNo)
1992
) comment '?????????t?f?[?^' ;
1993

1994
-- ????O???t?f?[?^
1995
drop table if exists salesgraphdata cascade;
1996

1997
create table salesgraphdata (
1998
  GraphDataCode decimal(8,0) not null comment '?O???t?f?[?^?R?[?h'
1999
  , ConstructionPeriod decimal(4,0) unsigned not null comment '?????'
2000
  , SalesDataDays date not null comment '????N??'
2001
  , DisplayOrder decimal(8,0) unsigned not null comment '?\????'
2002
  , DataName varchar(100) not null comment '?f?[?^?\??????'
2003
  , SalesAmount decimal(10,0) not null comment '????f?[?^'
2004
  , AdministrativeExpense decimal(10,0) not null comment '???E?????o??'
2005
  , GrossProfit decimal(10,0) not null comment '?e???v'
2006
  , NetIncome decimal(10,0) not null comment '?????v(???v)'
2007
  , EntryDate datetime not null comment '?o?^???t'
2008
  , UpdateDate datetime not null comment '?X?V???t'
2009
  , constraint salesgraphdata_PKC primary key (GraphDataCode,ConstructionPeriod,SalesDataDays)
2010
) comment '????O???t?f?[?^' ;
2011

2012
create index SalesGraphData_Idx1
2013
  on salesgraphdata(DisplayOrder);
2014

2015
create index SalesGraphData_idx2
2016
  on salesgraphdata(ConstructionPeriod);
2017

2018
-- ?????}?X?^
2019
drop table if exists securitymaster cascade;
2020

2021
create table securitymaster (
2022
  SecCode decimal(2,0) unsigned not null comment '???????'
2023
  , DisplayOrder decimal(2,0) not null comment '?\????'
2024
  , SecName varchar(60) not null comment '????????'
2025
  , SecRank decimal(1,0) not null comment '?????????N'
2026
  , SecRange decimal(1,0) not null comment '???????'
2027
  , GeneralAffairs decimal(1,0) not null comment '????????t???O'
2028
  , SelectBackColor varchar(8) not null comment '?I??w?i?F'
2029
  , EntryDate datetime not null comment '?o?^???t'
2030
  , UpdateDate datetime not null comment '?X?V???t'
2031
  , constraint securitymaster_PKC primary key (SecCode)
2032
) comment '?????}?X?^' ;
2033

2034
create index SecurityMaster_Index1
2035
  on securitymaster(DisplayOrder);
2036

2037
create index SecurityMaster_Index2
2038
  on securitymaster(SecRank);
2039

2040
create index SecurityMaster_Index3
2041
  on securitymaster(SecRange);
2042

2043
-- ???S?p?g???[???f?[?^
2044
drop table if exists sfpdata cascade;
2045

2046
create table sfpdata (
2047
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
2048
  , DataCount decimal(2,0) unsigned not null comment '?p?g???[????'
2049
  , RequestDate datetime not null comment '?p?g???[???v??????'
2050
  , PersonCode decimal(8,0) unsigned not null comment '?\????R?[?h'
2051
  , StringValue varchar(300) comment '?R?????g'
2052
  , OrderNo decimal(2,0) unsigned not null comment '?\????t???'
2053
  , EntryDate datetime not null comment '?o?^???t'
2054
  , UpdateDate datetime not null comment '?X?V???t'
2055
  , constraint sfpdata_PKC primary key (ConstructionCode,DataCount)
2056
) comment '???S?p?g???[???f?[?^' ;
2057

2058
create index SFPData_Index1
2059
  on sfpdata(RequestDate);
2060

2061
-- ???S?p?g???[??????f?[?^
2062
drop table if exists sfpdatadetail cascade;
2063

2064
create table sfpdatadetail (
2065
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
2066
  , DataCount decimal(2,0) unsigned not null comment '?p?g???[????'
2067
  , SeqNo decimal(2,0) unsigned not null comment '?f?[?^?}??'
2068
  , CompanyCode decimal(8,0) unsigned not null comment '??????R?[?h'
2069
  , EntryDate datetime not null comment '?o?^???t'
2070
  , UpdateDate datetime not null comment '?X?V???t'
2071
  , constraint sfpdatadetail_PKC primary key (ConstructionCode,DataCount,SeqNo)
2072
) comment '???S?p?g???[??????f?[?^' ;
2073

2074
-- ??????{?H?H??o?^?\???f?[?^
2075
drop table if exists subconstrjobitemregist cascade;
2076

2077
create table subconstrjobitemregist (
2078
  PersonCode decimal(8,0) unsigned not null comment '?\??????'
2079
  , CreateDate date not null comment '????'
2080
  , SeqNo decimal(2,0) unsigned not null comment '?\???A??'
2081
  , DisplayOrder decimal(8,0) unsigned not null comment '?\????'
2082
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
2083
  , EntryDate datetime not null comment '?o?^???t'
2084
  , UpdateDate datetime not null comment '?X?V???t'
2085
  , constraint subconstrjobitemregist_PKC primary key (PersonCode,CreateDate,SeqNo,DisplayOrder)
2086
) comment '??????{?H?H??o?^?\???f?[?^' ;
2087

2088
-- ??????E?????N?o?^?\???f?[?^
2089
drop table if exists subconstrjoblinkregist cascade;
2090

2091
create table subconstrjoblinkregist (
2092
  PersonCode decimal(8,0) unsigned not null comment '?\??????'
2093
  , CreateDate date not null comment '????'
2094
  , SeqNo decimal(2,0) unsigned not null comment '?\???A??'
2095
  , DisplayOrder decimal(8,0) unsigned not null comment '?\????'
2096
  , JobCategoryCode decimal(5,0) not null comment '?E??L?['
2097
  , EntryDate datetime not null comment '?o?^???t'
2098
  , UpdateDate datetime not null comment '?X?V???t'
2099
  , constraint subconstrjoblinkregist_PKC primary key (PersonCode,CreateDate,SeqNo,DisplayOrder)
2100
) comment '??????E?????N?o?^?\???f?[?^' ;
2101

2102
-- ??????o?^?\???f?[?^
2103
drop table if exists subconstrregist cascade;
2104

2105
create table subconstrregist (
2106
  PersonCode decimal(8,0) unsigned not null comment '?\??????'
2107
  , CreateDate date not null comment '????'
2108
  , SeqNo decimal(2,0) unsigned not null comment '?\???A??'
2109
  , DataMode decimal(1,0) comment '?f?[?^??'
2110
  , SourceCode decimal(8,0) not null comment '??????R?[?h'
2111
  , PetitionPeriod decimal(4,0) unsigned not null comment '?\???N?x'
2112
  , CorporateStatusName varchar(40) comment '?@?l?i????'
2113
  , CorporateStatusPoint decimal(1,0) not null comment '?@?l?i?????u'
2114
  , CompanyName varchar(100) not null comment '???????'
2115
  , CEOPositionName varchar(60) comment '??\???E??'
2116
  , CEOName varchar(60) comment '??\?????'
2117
  , ContactPersonName varchar(60) comment '?S???????'
2118
  , ZipCode varchar(8) comment '?X????'
2119
  , Address1 varchar(60) comment '?Z???P'
2120
  , Address2 varchar(60) comment '?Z??2'
2121
  , Address3 varchar(60) comment '?Z??3'
2122
  , CellPhoneNumber varchar(13) comment '?g??d?b???'
2123
  , MailAddress varchar(257) comment '???[???A?h???X'
2124
  , PhoneNumber varchar(13) comment '?d?b???'
2125
  , FaxNumber varchar(13) comment 'FAX???'
2126
  , JapaneseSyllabary varchar(2) comment '50?????'
2127
  , StartDate date not null comment '????J?n?N????'
2128
  , Note varchar(300) comment '???l'
2129
  , labourKind decimal(1,0) not null comment '?x???????E????'
2130
  , OrderDate date comment '?\????'
2131
  , OrderNo decimal(2,0) unsigned not null comment '?\????t???'
2132
  , EntryDate datetime not null comment '?o?^???t'
2133
  , UpdateDate datetime not null comment '?X?V???t'
2134
  , constraint subconstrregist_PKC primary key (PersonCode,CreateDate,SeqNo)
2135
) comment '??????o?^?\???f?[?^' ;
2136

2137
-- ??????H??}?X?^
2138
drop table if exists subcontractoritemmaster cascade;
2139

2140
create table subcontractoritemmaster (
2141
  ItemCode decimal(5,0) unsigned not null comment '?H??L?['
2142
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2143
  , ItemName varchar(120) not null comment '?H????'
2144
  , DeleteFlg decimal(1,0) not null comment '???t???O'
2145
  , EntryDate datetime not null comment '?o?^???t'
2146
  , UpdateDate datetime not null comment '?X?V???t'
2147
  , constraint subcontractoritemmaster_PKC primary key (ItemCode)
2148
) comment '??????H??}?X?^' ;
2149

2150
-- ??????E??}?X?^
2151
drop table if exists subcontractorjobcategory cascade;
2152

2153
create table subcontractorjobcategory (
2154
  JobCategoryCode decimal(5,0) not null comment '?E??L?['
2155
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2156
  , JobCategoryName varchar(120) not null comment '?E????'
2157
  , DeleteFlg decimal(1,0) not null comment '???t???O'
2158
  , EntryDate datetime not null comment '?o?^???t'
2159
  , UpdateDate datetime not null comment '?X?V???t'
2160
  , constraint subcontractorjobcategory_PKC primary key (JobCategoryCode)
2161
) comment '??????E??}?X?^' ;
2162

2163
-- ??????{?H?H??f?[?^
2164
drop table if exists subcontractorjobitem cascade;
2165

2166
create table subcontractorjobitem (
2167
  CompanyCode decimal(8,0) not null comment '??????R?[?h'
2168
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
2169
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2170
  , EntryDate datetime not null comment '?o?^???t'
2171
  , UpdateDate datetime not null comment '?X?V???t'
2172
  , constraint subcontractorjobitem_PKC primary key (CompanyCode,ItemCode)
2173
) comment '??????{?H?H??f?[?^' ;
2174

2175
create index SubContractorJobItem_Index1
2176
  on subcontractorjobitem(CompanyCode);
2177

2178
create index SubContractorJobItem_Index2
2179
  on subcontractorjobitem(ItemCode);
2180

2181
-- ??????E?????N?}?X?^
2182
drop table if exists subcontractorjoblink cascade;
2183

2184
create table subcontractorjoblink (
2185
  CompanyCode decimal(8,0) not null comment '??????R?[?h'
2186
  , JobCategoryCode decimal(5,0) not null comment '?E??L?['
2187
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2188
  , EntryDate datetime not null comment '?o?^???t'
2189
  , UpdateDate datetime not null comment '?X?V???t'
2190
  , constraint subcontractorjoblink_PKC primary key (CompanyCode,JobCategoryCode)
2191
) comment '??????E?????N?}?X?^' ;
2192

2193
create index SubContractorJobLink_Index1
2194
  on subcontractorjoblink(CompanyCode);
2195

2196
create index SubContractorJobLink_Index2
2197
  on subcontractorjoblink(JobCategoryCode);
2198

2199
-- ??????}?X?^
2200
drop table if exists subcontractormaster cascade;
2201

2202
create table subcontractormaster (
2203
  CompanyCode decimal(8,0) not null comment '??????R?[?h'
2204
  , DisplayOrder decimal(8,0) unsigned not null comment '?\????'
2205
  , CorporateStatusName varchar(40) comment '?@?l?i????'
2206
  , CorporateStatusPoint decimal(1,0) not null comment '?@?l?i?????u'
2207
  , CompanyName varchar(100) not null comment '???????'
2208
  , CEOPositionName varchar(60) comment '??\???E??'
2209
  , CEOName varchar(60) comment '??\?????'
2210
  , ContactPersonName varchar(60) comment '?S???????'
2211
  , ZipCode varchar(8) comment '?X????'
2212
  , Address1 varchar(60) comment '?Z???P'
2213
  , Address2 varchar(60) comment '?Z??2'
2214
  , Address3 varchar(60) comment '?Z??3'
2215
  , CellPhoneNumber varchar(13) comment '?g??d?b???'
2216
  , MailAddress varchar(257) comment '???[???A?h???X'
2217
  , PhoneNumber varchar(13) comment '?d?b???'
2218
  , FaxNumber varchar(13) comment 'FAX???'
2219
  , JapaneseSyllabary varchar(2) comment '50?????'
2220
  , StartDate date not null comment '????J?n?N????'
2221
  , Note varchar(300) comment '???l'
2222
  , labourKind decimal(1,0) not null comment '?x???????E????'
2223
  , DeleteFlg decimal(1,0) default '0' not null comment '???t???O'
2224
  , EntryDate datetime not null comment '?o?^???t'
2225
  , UpdateDate datetime not null comment '?X?V???t'
2226
  , constraint subcontractormaster_PKC primary key (CompanyCode)
2227
) comment '??????}?X?^' ;
2228

2229
create index SubContractorMaster_Index1
2230
  on subcontractormaster(JapaneseSyllabary);
2231

2232
-- ?d????}?X?^
2233
drop table if exists suppliersmaster cascade;
2234

2235
create table suppliersmaster (
2236
  SuppliersCode decimal(5,0) unsigned not null comment '?d????R?[?h'
2237
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2238
  , SuppliersName1 varchar(60) not null comment '?d????1'
2239
  , SuppliersName2 varchar(60) comment '?d?????Q'
2240
  , ZipCode varchar(8) comment '?X????'
2241
  , Address1 varchar(60) comment '?Z???P'
2242
  , Address2 varchar(60) comment '?Z??2'
2243
  , Address3 varchar(60) comment '?Z??3'
2244
  , PhoneNumber varchar(13) comment '?d?b???'
2245
  , FaxNumber varchar(13) comment 'FAX???'
2246
  , Note varchar(300) comment '???l'
2247
  , DeleteFlg decimal(1,0) not null comment '???t???O'
2248
  , EntryDate datetime not null comment '?o?^???t'
2249
  , UpdateDate datetime not null comment '?X?V???t'
2250
  , constraint suppliersmaster_PKC primary key (SuppliersCode)
2251
) comment '?d????}?X?^' ;
2252

2253
-- ?V?X?e???N???m?F?f?[?^
2254
drop table if exists systemexecute cascade;
2255

2256
create table systemexecute (
2257
  PrimaryCode tinyint(4) not null comment '?L?[????'
2258
  , TargetDate date not null comment '?N?????t'
2259
  , SystemVersion int(11) not null comment '?{??E????o?[?W????'
2260
  , UpDateCopyVersion int(11) not null comment '?R?s?[?o?[?W????'
2261
  , EntryDate datetime not null comment '?o?^???t'
2262
  , UpdateDate datetime not null comment '?X?V???t'
2263
  , constraint systemexecute_PKC primary key (PrimaryCode)
2264
) comment '?V?X?e???N???m?F?f?[?^' ;
2265

2266
-- ????}?X?^
2267
drop table if exists systemmaster cascade;
2268

2269
create table systemmaster (
2270
  SystemCode decimal(3,0) unsigned not null comment '???R?[?h'
2271
  , CompanyName1 varchar(60) not null comment '?????P'
2272
  , CompanyName2 varchar(60) comment '?????Q'
2273
  , CEOName varchar(60) not null comment '??\?????'
2274
  , CEOPositionName varchar(60) comment '??\???E??'
2275
  , ZipCode varchar(8) not null comment '?X????'
2276
  , Address1 varchar(60) not null comment '?Z???P'
2277
  , Address2 varchar(60) comment '?Z??2'
2278
  , Address3 varchar(60) comment '?Z??3'
2279
  , PhoneNumber varchar(13) not null comment '?d?b???'
2280
  , FaxNumber varchar(13) comment 'FAX???'
2281
  , HomePageURL varchar(120) comment '?z?[???y?[?WURL'
2282
  , ConsumptionTax decimal(4,2) not null comment '?????'
2283
  , CooperationRate decimal(4,2) not null comment '???????'
2284
  , StatutoryWelfareRate decimal(4,2) not null comment '?@???????'
2285
  , FuelPrice decimal(5,2) not null comment '?R???L???P??'
2286
  , AreaDistance decimal(5,2) not null comment '????u????????'
2287
  , ExcelSavePath varchar(120) comment 'Excel????p?X'
2288
  , BusinessPeriod smallint(6) not null comment '????c?????'
2289
  , ConstrYear smallint(6) not null comment '????H???N?x'
2290
  , BusinessBeginDate datetime not null comment '?c????????'
2291
  , ConstrBeginDate datetime not null comment '?H???N?x?????'
2292
  , BusinessCompDate datetime not null comment '?c?????????'
2293
  , ConstrCompDate datetime not null comment '?H???N?x??????'
2294
  , ConstructionNoBase decimal(1,0) not null comment '?H????????l'
2295
  , SloganString1 varchar(100) comment '?W??1'
2296
  , SloganString2 varchar(100) comment '?W??2'
2297
  , SloganString3 varchar(100) comment '?W??3'
2298
  , EntryDate datetime not null comment '?o?^???t'
2299
  , UpdateDate datetime not null comment '?X?V???t'
2300
  , constraint systemmaster_PKC primary key (SystemCode)
2301
) comment '????}?X?^' ;
2302

2303
-- ?????}?X?^
2304
drop table if exists termmaster cascade;
2305

2306
create table termmaster (
2307
  ConstructionStatusFlg decimal(2,0) not null comment '?H?????t???O'
2308
  , FieldNo decimal(2,0) not null comment '?`?F?b?N???t?B?[???h???'
2309
  , SeqNo decimal(2,0) not null comment '?}??'
2310
  , DisplayOrder decimal(2,0) not null comment '?\????'
2311
  , CheckSchdule decimal(1,0) not null comment '?`?F?b?N?^?C?~???O'
2312
  , TermDays decimal(3,0) not null comment '?o???'
2313
  , SendTitile varchar(100) comment '?^?C?g??'
2314
  , SendMessage varchar(100) comment '???b?Z?[?W'
2315
  , BackColor varchar(8) comment '?w?i?F'
2316
  , ForeColor varchar(8) comment '?????F'
2317
  , EntryDate datetime not null comment '?o?^???t'
2318
  , UpdateDate datetime not null comment '?X?V???t'
2319
  , constraint termmaster_PKC primary key (ConstructionStatusFlg,FieldNo,SeqNo)
2320
) comment '?????}?X?^' ;
2321

2322
create index TermMaster_Index1
2323
  on termmaster(DisplayOrder);
2324

2325
-- ?o?????f?[?^
2326
drop table if exists tranceportdailydata cascade;
2327

2328
create table tranceportdailydata (
2329
  PersonCode decimal(8,0) unsigned not null comment '????R?[?h'
2330
  , AttendanceDate date not null comment '???????'
2331
  , StartDistance decimal(7,1) not null comment '?????o???L????'
2332
  , ComplateDistance decimal(7,1) not null comment '?????I???L????'
2333
  , TotalDistance decimal(6,1) not null comment '???????v?L????'
2334
  , OfficeGoFlg decimal(1,0) not null comment '???????o??t???O'
2335
  , OfficeOutFlg decimal(1,0) not null comment '???????A??t???O'
2336
  , TrancePayGoFlg decimal(1,0) not null comment '?L?????o??t???O'
2337
  , TrancePayOutFlg decimal(1,0) not null comment '?L?????A??t???O'
2338
  , WareHouseFlg decimal(1,0) not null comment '????u??t???O'
2339
  , EntryDate datetime not null comment '?o?^???t'
2340
  , UpdateDate datetime not null comment '?X?V???t'
2341
  , constraint tranceportdailydata_PKC primary key (PersonCode,AttendanceDate)
2342
) comment '?o?????f?[?^' ;
2343

2344
create index TranceportDailyData_Index1
2345
  on tranceportdailydata(AttendanceDate);
2346

2347
-- ?H?????o???}?X?^
2348
drop table if exists typeexpensesmaster cascade;
2349

2350
create table typeexpensesmaster (
2351
  TypeCode decimal(5,0) unsigned not null comment '?H?????R?[?h'
2352
  , ExpensesPeriod smallint(6) not null comment '?????'
2353
  , NameCode decimal(5,0) unsigned not null comment '?o????R?[?h'
2354
  , ExpensesRaito decimal(4,2) not null comment '?o??'
2355
  , DeleteFlg decimal(1,0) not null comment '???t???O'
2356
  , EntryDate datetime not null comment '?o?^???t'
2357
  , UpdateDate datetime not null comment '?X?V???t'
2358
  , constraint typeexpensesmaster_PKC primary key (TypeCode,ExpensesPeriod,NameCode)
2359
) comment '?H?????o???}?X?^' ;
2360

2361
-- ?P??}?X?^
2362
drop table if exists unitmaster cascade;
2363

2364
create table unitmaster (
2365
  UnitKey decimal(5,0) unsigned not null comment '?P??L?['
2366
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2367
  , UnitName varchar(30) not null comment '?P?????'
2368
  , EntryDate datetime not null comment '?o?^???t'
2369
  , UpdateDate datetime not null comment '?X?V???t'
2370
  , constraint unitmaster_PKC primary key (UnitKey)
2371
) comment '?P??}?X?^' ;
2372

2373
create index UnitMaster_Index1
2374
  on unitmaster(DisplayOrder);
2375

2376
-- ????}?X?^
2377
drop table if exists vehiclemaster cascade;
2378

2379
create table vehiclemaster (
2380
  VehicleCode decimal(5,0) unsigned not null comment '????R?[?h'
2381
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2382
  , VehicleName varchar(100) not null comment '???????'
2383
  , RegistrationNumber varchar(30) comment '?o?^???'
2384
  , IdentificationNumber varchar(30) comment '?????'
2385
  , ModelCode varchar(30) comment '?^??'
2386
  , DepartmentCode decimal(5,0) unsigned not null comment '???????'
2387
  , VehicleScheduleFlg decimal(1,0) not null comment '????\??\???t???O'
2388
  , PurchaseDate date comment '?w????'
2389
  , PurchaseName varchar(30) comment '?w????'
2390
  , PurchaseContactPersons varchar(30) comment '?w????S????'
2391
  , PurchasePhone varchar(13) comment '?w????d?b???'
2392
  , LeaseDate date comment '???[?X?J?n??'
2393
  , LeaseDestination varchar(30) comment '???[?X??'
2394
  , LeaseContactPersons varchar(30) comment '???[?X??S????'
2395
  , LeasePhone varchar(13) comment '???[?X??d?b???'
2396
  , InsuranceCompany varchar(30) comment '?C???????'
2397
  , InsuranceContactPersons varchar(30) comment '?C???????S????'
2398
  , InsurancePhone varchar(13) comment '?C???????d?b???'
2399
  , Note varchar(300) comment '???l'
2400
  , EntryDate datetime comment '?o?^???t'
2401
  , UpdateDate datetime comment '?X?V???t'
2402
  , constraint vehiclemaster_PKC primary key (VehicleCode)
2403
) comment '????}?X?^' ;
2404

2405
-- ????L?^?f?[?^
2406
drop table if exists vehiclerecorddata cascade;
2407

2408
create table vehiclerecorddata (
2409
  VehicleCode decimal(5,0) unsigned not null comment '????R?[?h'
2410
  , DivisionCode decimal(2,0) unsigned not null comment '?f?[?^??'
2411
  , SeqNo decimal(2,0) not null comment '?}??'
2412
  , RecordDate date comment '???n??'
2413
  , Mileage mediumint(9) comment '???s????'
2414
  , Content varchar(100) comment '???e'
2415
  , PaymentCost decimal(10,0) comment '??p'
2416
  , EntryDate datetime not null comment '?o?^???t'
2417
  , UpdateDate datetime not null comment '?X?V???t'
2418
  , constraint vehiclerecorddata_PKC primary key (VehicleCode,DivisionCode,SeqNo)
2419
) comment '????L?^?f?[?^' ;
2420

2421
-- ????\??f?[?^
2422
drop table if exists vehiclescheduledata cascade;
2423

2424
create table vehiclescheduledata (
2425
  TargetDate date not null comment '????'
2426
  , VehicleCode decimal(5,0) unsigned not null comment '????R?[?h'
2427
  , MorningAfternoon decimal(1,0) not null comment '??O?E???'
2428
  , PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
2429
  , TargetYear year(4) not null comment '?Y???N'
2430
  , TargetMonth tinyint(3) unsigned not null comment '?Y????'
2431
  , TargetDay year(4) not null comment '?Y????'
2432
  , EntryDate datetime not null comment '?o?^???t'
2433
  , UpdateDate datetime not null comment '?X?V???t'
2434
  , constraint vehiclescheduledata_PKC primary key (TargetDate,VehicleCode,MorningAfternoon)
2435
) comment '????\??f?[?^' ;
2436

2437
create index VehicleScheduleData_Index1
2438
  on vehiclescheduledata(TargetYear);
2439

2440
create index VehicleScheduleData_Index2
2441
  on vehiclescheduledata(TargetMonth);
2442

2443
create index VehicleScheduleData_Index3
2444
  on vehiclescheduledata(TargetDay);
2445

2446
-- ?N?}?X?^
2447
drop table if exists yearmaster cascade;
2448

2449
create table yearmaster (
2450
  years smallint(6) not null comment '?N'
2451
) comment '?N?}?X?^' ;
2452

2453
create index year_Index1
2454
  on yearmaster(years);
2455