プロジェクト

全般

プロフィール

統計
| リビジョン:

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

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

1
-- Project Name : noname
2
-- Date/Time    : 2018/04/06 11:54:53
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
  , SalesSubDepCode decimal(5,0) unsigned not null comment '?c????S????????R?[?h'
490
  , SalesSubPersonCode decimal(8,0) unsigned not null comment '?c????S????R?[?h'
491
  , ConstrDepCode decimal(5,0) unsigned not null comment '?H???S????????R?[?h'
492
  , ConstructionPersonCode decimal(8,0) not null comment '?H???S????R?[?h'
493
  , ConstrSubDepCode decimal(5,0) unsigned not null comment '?H?????S????????R?[?h'
494
  , ConstrSubPersonCode decimal(8,0) not null comment '?H?????S????R?[?h'
495
  , ConstrInstrDepCode decimal(5,0) unsigned not null comment '?H???w?????????R?[?h'
496
  , ConstructionInstructor decimal(8,0) not null comment '?H???w?????R?[?h'
497
  , TransferConstruction decimal(8,0) not null comment '?H??????R?[?h'
498
  , TransferConstructionDate date comment '?H??????'
499
  , OrderersDivision decimal(5,0) not null comment '????????R?[?h'
500
  , OrderersCode decimal(5,0) unsigned not null comment '??????R?[?h'
501
  , EstimatesExpirationDate date comment '????L??????'
502
  , ConstructionPeriodStart date comment '?_??H???J?n??'
503
  , ConstructionPeriodEnd date comment '?_??H??????'
504
  , ConstructionPeriodStart2 date comment '?_??H???J?n?i???????j'
505
  , ConstructionPeriodEnd2 date comment '?_??H???????i???????j'
506
  , StartDate date comment '?H???J?n??'
507
  , EndDate date comment '?H???I????'
508
  , PurchaseOrderMailingDate date comment '???????X????'
509
  , PurchaseOrderReturnDate date comment '???????????'
510
  , PurchaseOrderReturnCheckDate date comment '??????????m?F??'
511
  , ConsumptionTaxFlg decimal(1,0) not null comment '?????t???O'
512
  , PrimeContractorFlg decimal(1,0) not null comment '?????t???O'
513
  , SalesCostFlg decimal(1,0) not null comment '?c??o?????t???O'
514
  , ConstructionStatusFlg decimal(2,0) not null comment '?H?????t???O'
515
  , ConstructionType decimal(5,0) not null comment '?H?????R?[?h'
516
  , EstimateType decimal(1,0) not null comment '??????'
517
  , BillingStartDate date not null comment '?????????J?n??'
518
  , BillingDate date not null comment '??????'
519
  , BillingSplitFlg decimal(1,0) not null comment '??????t???O'
520
  , BillingSendDate date comment '???????X??/??n????'
521
  , LedgerComplateDate date not null comment '?H????????????????t'
522
  , InspectPlanningDate date not null comment '?????\???'
523
  , InspectExecuteDate date not null comment '???????s??'
524
  , RevCompleteDate date not null comment '??????????????'
525
  , EntryDate datetime not null comment '?o?^???t'
526
  , UpdateDate datetime not null comment '?X?V???t'
527
  , constraint constructionbaseinfo_PKC primary key (ConstructionCode)
528
) comment '?H????{???' ;
529

    
530
create index BaseInfo_Index1
531
  on constructionbaseinfo(ConstructionStatusFlg);
532

    
533
create index BaseInfo_Index2
534
  on constructionbaseinfo(EstimateType);
535

    
536
create index BaseInfo_Index3
537
  on constructionbaseinfo(SalesPersonCode);
538

    
539
create index BaseInfo_Index4
540
  on constructionbaseinfo(ConstructionPersonCode);
541

    
542
create index BaseInfo_Index5
543
  on constructionbaseinfo(ConstructionInstructor);
544

    
545
create index BaseInfo_Index6
546
  on constructionbaseinfo(ConstructionPeriod);
547

    
548
-- ?H????{????
549
drop table if exists constructionbaseinfodetail cascade;
550

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

    
560
create index BaseInfoDetail_Idx1
561
  on constructionbaseinfodetail(ConstructionCode);
562

    
563
create index BaseInfoDetail_Idx2
564
  on constructionbaseinfodetail(DetailNo);
565

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

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

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

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

    
622
-- ?H??}?X?^
623
drop table if exists constructionitemmaster cascade;
624

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

    
637
-- ?H???????f?[?^
638
drop table if exists constructionledger cascade;
639

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

    
664
create index constructionledger_Index1
665
  on constructionledger(ConstructionStart);
666

    
667
create index constructionledger_Index2
668
  on constructionledger(ConstructionEnd);
669

    
670
-- ?H??????????f?[?^
671
drop table if exists constructionledgerdetail cascade;
672

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

    
704
create index LedgerDetail_Index01
705
  on constructionledgerdetail(ConstructionCode);
706

    
707
create index LedgerDetail_Index02
708
  on constructionledgerdetail(GroupCount);
709

    
710
create index LedgerDetail_Index03
711
  on constructionledgerdetail(LineCount);
712

    
713
create index LedgerDetail_Index04
714
  on constructionledgerdetail(SourceCode);
715

    
716
create index LedgerDetail_Index05
717
  on constructionledgerdetail(DetailCount);
718

    
719
create index LedgerDetail_Index06
720
  on constructionledgerdetail(SalaryFlg);
721

    
722
create index LedgerDetail_Index07
723
  on constructionledgerdetail(CompanyCode);
724

    
725
-- ?H?????????s?f?[?^
726
drop table if exists constructionledgerexcute cascade;
727

    
728
create table constructionledgerexcute (
729
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
730
  , GroupCount decimal(2,0) unsigned not null comment '?O???[?v???'
731
  , LineCount decimal(4,0) unsigned not null comment '?s???'
732
  , ColumnCount decimal(3,0) not null comment '????'
733
  , PaymentAmount decimal(12,0) not null comment '?x?????z'
734
  , TargetMonth date not null comment '???N??'
735
  , EntryDate datetime not null comment '?o?^???t'
736
  , UpdateDate datetime not null comment '?X?V???t'
737
  , constraint constructionledgerexcute_PKC primary key (ConstructionCode,GroupCount,LineCount,ColumnCount)
738
) comment '?H?????????s?f?[?^' ;
739

    
740
create index LedgerExcute_Index1
741
  on constructionledgerexcute(ConstructionCode,TargetMonth,GroupCount,LineCount);
742

    
743
-- ?H???????N???
744
drop table if exists constructionlink cascade;
745

    
746
create table constructionlink (
747
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
748
  , FluctuationCode decimal(10,0) not null comment '?q?H?????'
749
  , LinkType decimal(1,0) not null comment '?????N???'
750
  , EntryDate datetime not null comment '?o?^???t'
751
  , UpdateDate datetime not null comment '?X?V???t'
752
  , constraint constructionlink_PKC primary key (ConstructionCode,FluctuationCode)
753
) comment '?H???????N???' ;
754

    
755
create index ConstructionLink_Index1
756
  on constructionlink(ConstructionCode);
757

    
758
create index ConstructionLink_Index2
759
  on constructionlink(FluctuationCode);
760

    
761
create index ConstructionLink_Index3
762
  on constructionlink(LinkType);
763

    
764
-- ?H????????
765
drop table if exists constructionmaterialinfo cascade;
766

    
767
create table constructionmaterialinfo (
768
  CONSTRUCTIONCODE int(10) unsigned default 0 not null comment '?H?????'
769
  , MATERIALITEMCODE smallint(5) unsigned default 0 not null comment '????i??R?[?h'
770
  , PROCESSDATE datetime default '0000-00-00 00:00:00' not null comment '?????N????'
771
  , RENTCOUNT smallint(5) unsigned comment '??o??'
772
  , REPAYCOUNT smallint(5) unsigned comment '??p??'
773
  , JUNKCOUNT smallint(5) unsigned comment '?j????'
774
  , COMPLETEFLG tinyint(3) unsigned comment '?????t???O'
775
  , ENTRYDATE datetime comment '?o?^???t'
776
  , UPDATEDATE datetime comment '?X?V???t'
777
  , constraint constructionmaterialinfo_PKC primary key (CONSTRUCTIONCODE,MATERIALITEMCODE,PROCESSDATE)
778
) comment '?H????????' ;
779

    
780
-- ????i?????t?f?[?^
781
drop table if exists constructionprogressdate cascade;
782

    
783
create table constructionprogressdate (
784
  ConstructionCode decimal(10,0) not null comment '?H?????'
785
  , ConstructionStatusFlg decimal(2,0) not null comment '???H?????'
786
  , PreviousStatusFlg decimal(2,0) comment '??X?O???'
787
  , ChangeDate datetime not null comment '?????t'
788
  , ChangePersonCode decimal(8,0) not null comment '???S????'
789
  , EntryDate datetime not null comment '?o?^???t'
790
  , UpdateDate datetime not null comment '?X?V???t'
791
  , constraint constructionprogressdate_PKC primary key (ConstructionCode,ConstructionStatusFlg)
792
) comment '????i?????t?f?[?^' ;
793

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

    
797
create table constructionspecmaster (
798
  ItemCode decimal(5,0) unsigned not null comment '?H??L?['
799
  , SpecCode decimal(5,0) unsigned not null comment '???L?['
800
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
801
  , ItemName varchar(120) comment '??????'
802
  , SpecName varchar(120) comment '??????'
803
  , UnitName varchar(30) comment '?P?????'
804
  , UnitPrice decimal(9,2) not null comment '?P??'
805
  , DeleteFlg decimal(1,0) not null comment '???t???O'
806
  , EntryDate datetime not null comment '?o?^???t'
807
  , UpdateDate datetime not null comment '?X?V???t'
808
  , constraint constructionspecmaster_PKC primary key (ItemCode,SpecCode)
809
) comment '???}?X?^' ;
810

    
811
create index ConstructionSpecMaster_Index1
812
  on constructionspecmaster(DisplayOrder);
813

    
814
-- ???P???}?X?^
815
drop table if exists constructionspecunitprice cascade;
816

    
817
create table constructionspecunitprice (
818
  ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
819
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
820
  , SpecCode decimal(5,0) unsigned not null comment '???L?['
821
  , ConstructionTypeCode mediumint(8) unsigned not null comment '?H?????R?[?h'
822
  , UnitPrice decimal(9,2) not null comment '?P??'
823
  , EntryDate datetime not null comment '?o?^???t'
824
  , UpdateDate datetime not null comment '?X?V???t'
825
  , constraint constructionspecunitprice_PKC primary key (ComponentCode,ItemCode,SpecCode,ConstructionTypeCode)
826
) comment '???P???}?X?^' ;
827

    
828
-- ?H?????}?X?^
829
drop table if exists constructiontypemaster cascade;
830

    
831
create table constructiontypemaster (
832
  TypeCode decimal(5,0) unsigned not null comment '?H?????R?[?h'
833
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
834
  , NameString varchar(100) not null comment '????'
835
  , PublicFlg decimal(1,0) not null comment '?H?????t???O'
836
  , SecRank decimal(1,0) not null comment '?????????N'
837
  , ExpensesLink decimal(1,0) not null comment '?o??g?p??'
838
  , DeleteFlg decimal(1,0) not null comment '???t???O'
839
  , EntryDate datetime not null comment '?o?^???t'
840
  , UpdateDate datetime not null comment '?X?V???t'
841
  , constraint constructiontypemaster_PKC primary key (TypeCode)
842
) comment '?H?????}?X?^' ;
843

    
844
-- ?S??????o??f?[?^
845
drop table if exists costdataofperson cascade;
846

    
847
create table costdataofperson (
848
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
849
  , ActionDate date not null comment '?????t'
850
  , DataType decimal(1,0) not null comment '?f?[?^??'
851
  , DataAddCount decimal(5,0) unsigned not null comment '?f?[?^??????'
852
  , TargetMonth varchar(7) not null comment '???N??'
853
  , ConstructionCode decimal(10,0) unsigned comment '?H???R?[?h'
854
  , SuppliersCode decimal(5,0) unsigned not null comment '?x????R?[?h'
855
  , SuppliersName varchar(120) comment '?x??????'
856
  , PaymentContent varchar(60) comment '?x?????e'
857
  , PaymentType decimal(1,0) not null comment '?x?????@?t???O'
858
  , EntryPrice decimal(12,0) not null comment '???z?i????j'
859
  , EntryPriceInTax decimal(12,0) not null comment '???z?i????j'
860
  , SlipNumber varchar(12) comment '?`?[???'
861
  , ComplateFlg decimal(1,0) not null comment '???????t???O'
862
  , ApprovalFlg decimal(1,0) not null comment '???F?t???O'
863
  , EntryDate datetime not null comment '?o?^???t'
864
  , UpdateDate datetime not null comment '?X?V???t'
865
  , constraint costdataofperson_PKC primary key (PersonCode,ActionDate,DataType,DataAddCount)
866
) comment '?S??????o??f?[?^' ;
867

    
868
create index CostDataOfPerson_Index1
869
  on costdataofperson(TargetMonth);
870

    
871
create index CostDataOfPerson_Index2
872
  on costdataofperson(ConstructionCode);
873

    
874
-- ??????o?^?\???f?[?^
875
drop table if exists costomerregist cascade;
876

    
877
create table costomerregist (
878
  CreatePersonCode decimal(8,0) unsigned not null comment '?\??????'
879
  , CreateDate date not null comment '????'
880
  , SeqNo decimal(2,0) not null comment '?L?[?A??'
881
  , DataMode decimal(1,0) not null comment '?f?[?^??'
882
  , SourceCotegory decimal(5,0) unsigned not null comment '???????'
883
  , SourceCode decimal(5,0) unsigned not null comment '??????R?[?h'
884
  , PetitionPeriod decimal(4,0) unsigned not null comment '?????'
885
  , OrderFlg decimal(1,0) not null comment '?@?l?c??E??l?t???O'
886
  , CorporateStatusName varchar(100) comment '?@?l?i????'
887
  , CorporateStatusPoint decimal(1,0) comment '?@?l?i?????u'
888
  , OrderersName1 varchar(60) not null comment '???????1'
889
  , OrderersName2 varchar(60) comment '????????Q'
890
  , DepartmentName varchar(60) comment '??????'
891
  , PersonName varchar(60) comment '?S?????'
892
  , ZipCode varchar(8) comment '?X????'
893
  , Address1 varchar(60) comment '?Z???P'
894
  , Address2 varchar(60) comment '?Z??2'
895
  , Address3 varchar(60) comment '?Z??3'
896
  , PhoneNumber varchar(13) comment '?d?b???'
897
  , FaxNumber varchar(13) comment 'FAX???'
898
  , MailAddress varchar(257) comment '???[???A?h???X'
899
  , Note varchar(300) comment '???l'
900
  , OrderCotegory decimal(5,0) unsigned not null comment '???????'
901
  , OrderDate date not null comment '?\????'
902
  , OrderNo decimal(2,0) unsigned not null comment '?\????t???'
903
  , CreateDepartmentCode decimal(5,0) unsigned not null comment '?\???????R?[?h'
904
  , CreateDepartmentName varchar(60) comment '?\????????'
905
  , EntryDate datetime not null comment '?o?^???t'
906
  , UpdateDate datetime not null comment '?X?V???t'
907
  , constraint costomerregist_PKC primary key (CreatePersonCode,CreateDate,SeqNo)
908
) comment '??????o?^?\???f?[?^' ;
909

    
910
create index CostomerRegist_Index1
911
  on costomerregist(PetitionPeriod);
912

    
913
create index CostomerRegist_Index2
914
  on costomerregist(CreatePersonCode);
915

    
916
create index CostomerRegist_Index3
917
  on costomerregist(CreateDepartmentCode);
918

    
919
-- ????f?[?^
920
drop table if exists dailydataconstruction cascade;
921

    
922
create table dailydataconstruction (
923
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
924
  , DailyDataDate date not null comment '???????'
925
  , ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
926
  , Weather varchar(60) comment '?V?C'
927
  , EntryDate datetime not null comment '?o?^???t'
928
  , UpdateDate datetime not null comment '?X?V???t'
929
  , constraint dailydataconstruction_PKC primary key (PersonCode,DailyDataDate,ConstructionCode)
930
) comment '????f?[?^' ;
931

    
932
create index DailyDataConstruction_Index1
933
  on dailydataconstruction(PersonCode);
934

    
935
create index DailyDataConstruction_Index2
936
  on dailydataconstruction(DailyDataDate);
937

    
938
create index DailyDataConstruction_Index3
939
  on dailydataconstruction(ConstructionCode);
940

    
941
-- ????f?[?^ (????)
942
drop table if exists dailydatadetail cascade;
943

    
944
create table dailydatadetail (
945
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
946
  , DailyDataDate date not null comment '???????'
947
  , ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
948
  , SeqNo decimal(3,0) unsigned not null comment '????s???'
949
  , JobCategoryCode decimal(5,0) not null comment '?E??L?['
950
  , CompanyCode decimal(8,0) not null comment '??????R?[?h'
951
  , TodayHeadCount decimal(4,1) not null comment '?????l????'
952
  , TotalHeadCount decimal(5,1) not null comment '??v?l????'
953
  , TodayWork varchar(100) comment '?????????e'
954
  , NextdayWork varchar(100) comment '?????????e'
955
  , NextdayHeadCount decimal(4,1) not null comment '?????l????'
956
  , EntryDate datetime not null comment '?o?^???t'
957
  , UpdateDate datetime not null comment '?X?V???t'
958
  , constraint dailydatadetail_PKC primary key (PersonCode,DailyDataDate,ConstructionCode,SeqNo)
959
) comment '????f?[?^ (????)' ;
960

    
961
create index DailyDataDetail_Index
962
  on dailydatadetail(PersonCode,DailyDataDate,ConstructionCode);
963

    
964
-- ????f?[?^ (??????)
965
drop table if exists dailydatafield cascade;
966

    
967
create table dailydatafield (
968
  PersonCode decimal(8,0) unsigned not null comment '????R?[?h'
969
  , DailyDataDate date not null comment '???????'
970
  , ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
971
  , SeqNo decimal(3,0) unsigned not null comment '????s???'
972
  , PatrolTime datetime not null comment '?????'
973
  , ContentsText varchar(200) comment '???e'
974
  , EntryDate datetime not null comment '?o?^???t'
975
  , UpdateDate datetime not null comment '?X?V???t'
976
  , constraint dailydatafield_PKC primary key (PersonCode,DailyDataDate,ConstructionCode,SeqNo)
977
) comment '????f?[?^ (??????)' ;
978

    
979
create index DailyDataField_Index
980
  on dailydatafield(PersonCode,DailyDataDate,ConstructionCode);
981

    
982
-- ????f?[?^ (????)
983
drop table if exists dailydatamaterials cascade;
984

    
985
create table dailydatamaterials (
986
  PersonCode decimal(8,0) unsigned not null comment '????R?[?h'
987
  , DailyDataDate date not null comment '???????'
988
  , ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
989
  , SeqNo decimal(3,0) unsigned not null comment '????s???'
990
  , Materials varchar(100) comment '?????'
991
  , Quantity varchar(100) comment '????'
992
  , Production varchar(100) comment '??????'
993
  , Delivery varchar(100) comment '?[?????'
994
  , QualityControl varchar(100) comment '?i?????????'
995
  , EntryDate datetime not null comment '?o?^???t'
996
  , UpdateDate datetime not null comment '?X?V???t'
997
  , constraint dailydatamaterials_PKC primary key (PersonCode,DailyDataDate,ConstructionCode,SeqNo)
998
) comment '????f?[?^ (????)' ;
999

    
1000
create index DailyDataMaterials_Index
1001
  on dailydatamaterials(PersonCode,DailyDataDate,ConstructionCode);
1002

    
1003
-- ????f?[?^ (??????w??)
1004
drop table if exists dailydatasubcontractors cascade;
1005

    
1006
create table dailydatasubcontractors (
1007
  PersonCode decimal(8,0) unsigned not null comment '????R?[?h'
1008
  , DailyDataDate date not null comment '???????'
1009
  , ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1010
  , SeqNo decimal(3,0) unsigned not null comment '????s???'
1011
  , Attendee varchar(100) comment '?o???'
1012
  , ContentsText varchar(200) comment '???e'
1013
  , EntryDate datetime not null comment '?o?^???t'
1014
  , UpdateDate datetime not null comment '?X?V???t'
1015
  , constraint dailydatasubcontractors_PKC primary key (PersonCode,DailyDataDate,ConstructionCode,SeqNo)
1016
) comment '????f?[?^ (??????w??)' ;
1017

    
1018
create index DailyDataSubcontractors_Index
1019
  on dailydatasubcontractors(PersonCode,DailyDataDate,ConstructionCode);
1020

    
1021
-- ????f?[?^ (???)
1022
drop table if exists dailydatavehicles cascade;
1023

    
1024
create table dailydatavehicles (
1025
  PersonCode decimal(8,0) unsigned not null comment '????R?[?h'
1026
  , DailyDataDate date not null comment '???????'
1027
  , ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1028
  , SeqNo decimal(3,0) unsigned not null comment '????s???'
1029
  , Model varchar(100) comment '?@??'
1030
  , Performance varchar(100) comment '???\'
1031
  , Owner varchar(100) comment '???L???'
1032
  , Driver varchar(100) comment '?????^?]??'
1033
  , StartWorkingTime datetime not null comment '??????J?n'
1034
  , EndWorkingTime datetime not null comment '??????I??'
1035
  , EntryDate datetime not null comment '?o?^???t'
1036
  , UpdateDate datetime not null comment '?X?V???t'
1037
  , constraint dailydatavehicles_PKC primary key (PersonCode,DailyDataDate,ConstructionCode,SeqNo)
1038
) comment '????f?[?^ (???)' ;
1039

1040
create index DailyDataVehicles_Index
1041
  on dailydatavehicles(PersonCode,DailyDataDate,ConstructionCode);
1042

1043
-- ???}?X?^
1044
drop table if exists daymaster cascade;
1045

1046
create table daymaster (
1047
  days smallint(6) not null comment '??'
1048
  , constraint daymaster_PKC primary key (days)
1049
) comment '???}?X?^' ;
1050

1051
-- ?????}?X?^
1052
drop table if exists deadlinemaster cascade;
1053

1054
create table deadlinemaster (
1055
  LABOURKIND decimal(1,0) default '0' not null comment '??????'
1056
  , DEADLINE decimal(2,0) comment '????'
1057
  , PAYDAY decimal(2,0) comment '?x????'
1058
  , NOTE varchar(120) comment '???l'
1059
  , DELETEFLG decimal(1,0) comment '???t???O'
1060
  , ENTRYDATE datetime comment '?o?^???t'
1061
  , UPDATEDATE datetime comment '?X?V???t'
1062
  , constraint deadlinemaster_PKC primary key (LABOURKIND)
1063
) comment '?????}?X?^' ;
1064

1065
-- ?????o???}?X?^
1066
drop table if exists departmentexpensesmaster cascade;
1067

1068
create table departmentexpensesmaster (
1069
  DepartmentCode decimal(5,0) unsigned not null comment '?????R?[?h'
1070
  , ExpensesPeriod smallint(6) not null comment '?????'
1071
  , NameCode decimal(5,0) unsigned not null comment '?o????R?[?h'
1072
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
1073
  , ExpensesRaito decimal(4,2) not null comment '?o??'
1074
  , DeleteFlg decimal(1,0) not null comment '???t???O'
1075
  , EntryDate datetime not null comment '?o?^???t'
1076
  , UpdateDate datetime not null comment '?X?V???t'
1077
  , constraint departmentexpensesmaster_PKC primary key (DepartmentCode,ExpensesPeriod,NameCode)
1078
) comment '?????o???}?X?^' ;
1079

1080
-- ?????}?X?^
1081
drop table if exists departmentmaster cascade;
1082

1083
create table departmentmaster (
1084
  DepartmentCode decimal(5,0) unsigned not null comment '?????R?[?h'
1085
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
1086
  , DepartmentString varchar(100) not null comment '??????'
1087
  , ActionScheduleFlg decimal(1,0) not null comment '?s???\??\???t???O'
1088
  , StaffAssignFlg decimal(1,0) not null comment '?l???z?u?\???t???O'
1089
  , StartDate datetime not null comment '?J?n???t'
1090
  , CompDate datetime not null comment '?I?????t'
1091
  , DeleteFlg decimal(1,0) not null comment '???t???O'
1092
  , EntryDate datetime not null comment '?o?^???t'
1093
  , UpdateDate datetime not null comment '?X?V???t'
1094
  , constraint departmentmaster_PKC primary key (DepartmentCode)
1095
) comment '?????}?X?^' ;
1096

1097
create index DepartmentMaster_index1
1098
  on departmentmaster(DisplayOrder);
1099

1100
-- ?????m?F???F?f?[?^
1101
drop table if exists depositapprovalinfo cascade;
1102

1103
create table depositapprovalinfo (
1104
  ORDERERSDIVISION decimal(5,0) not null comment '???????'
1105
  , ORDERERSCODE decimal(5,0) not null comment '??????R?[?h'
1106
  , TARGETDATE decimal(6,0) not null comment '???N??'
1107
  , SEQNO decimal(3,0) not null comment '?A??'
1108
  , LINECOUNT decimal(3,0) not null comment '?s???'
1109
  , APPROVALNO decimal(3,0) not null comment '???F????'
1110
  , APPROVALPERSON decimal(8,0) comment '???F??R?[?h'
1111
  , APPROVALPERSONNAME varchar(20) comment '???F???'
1112
  , APPROVALAUTHORITY decimal(1,0) comment '???F??????'
1113
  , APPROVALDATE date comment '???F???t'
1114
  , ENTRYDATE datetime comment '?o?^???t'
1115
  , UPDATEDATE datetime comment '?X?V???t'
1116
  , constraint depositapprovalinfo_PKC primary key (ORDERERSDIVISION,ORDERERSCODE,TARGETDATE,SEQNO,LINECOUNT,APPROVALNO)
1117
) comment '?????m?F???F?f?[?^' ;
1118

1119
-- ?????f?[?^
1120
drop table if exists depositdata cascade;
1121

1122
create table depositdata (
1123
  ORDERERSDIVISION decimal(5,0) not null comment '???????'
1124
  , ORDERERSCODE decimal(5,0) not null comment '??????R?[?h'
1125
  , TARGETDATE decimal(6,0) not null comment '???N??'
1126
  , SEQNO decimal(3,0) not null comment '?A??'
1127
  , BUSINESSPERIOD decimal(4,0) comment '?c???'
1128
  , DEPOSITDATE date comment '??????'
1129
  , DEPOSITAMOUNT decimal(12,0) comment '???????z'
1130
  , DEPOSITAMOUNTCASH decimal(10,0) comment '???????z?i?????j'
1131
  , DEPOSITAMOUNTBILL decimal(10,0) comment '???????z?i??`?j'
1132
  , DEPOSITPERSONCODE decimal(8,0) not null comment '?????S????R?[?h'
1133
  , NOTE varchar(120) comment '???l'
1134
  , ENTRYDATE datetime comment '?o?^???t'
1135
  , UPDATEDATE datetime comment '?X?V???t'
1136
  , constraint depositdata_PKC primary key (ORDERERSDIVISION,ORDERERSCODE,TARGETDATE,SEQNO)
1137
) comment '?????f?[?^' ;
1138

1139
-- ????????f?[?^
1140
drop table if exists depositdatadetail cascade;
1141

1142
create table depositdatadetail (
1143
  ORDERERSDIVISION decimal(5,0) not null comment '???????'
1144
  , ORDERERSCODE decimal(5,0) not null comment '??????R?[?h'
1145
  , TARGETDATE decimal(6,0) not null comment '???N??'
1146
  , REQUESTNO decimal(10,0) not null comment '????No'
1147
  , ORDERNO decimal(2,0) comment '??t???'
1148
  , DEPOSITAMOUNT decimal(10,0) comment '???????z'
1149
  , DISCOUNTAMOUNT decimal(10,0) comment '?l???????z'
1150
  , CNSTRPRICE decimal(10,0) comment '?????'
1151
  , FEES decimal(10,0) comment '????'
1152
  , OTHERADJUSTMENTS decimal(10,0) comment '?????'
1153
  , DIFFERENCEAMOUNT decimal(10,0) comment '????'
1154
  , CONFIRMATIONPERSONCODE decimal(8,0) comment '?m?F?S????R?[?h'
1155
  , CONFIRMATIONDATE date comment '?S????m?F???t'
1156
  , CONFIRMATIONENDFLG decimal(1,0) comment '?m?F?????t???O'
1157
  , NOTE varchar(120) comment '???l'
1158
  , ENTRYDATE datetime comment '?o?^???t'
1159
  , UPDATEDATE datetime comment '?X?V???t'
1160
  , constraint depositdatadetail_PKC primary key (ORDERERSDIVISION,ORDERERSCODE,TARGETDATE,REQUESTNO)
1161
) comment '????????f?[?^' ;
1162

1163
-- ???}?X?^
1164
drop table if exists divisionmaster cascade;
1165

1166
create table divisionmaster (
1167
  DivisionCode decimal(5,0) unsigned not null comment '???R?[?h'
1168
  , NameCode decimal(5,0) unsigned not null comment '????R?[?h'
1169
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
1170
  , NameString varchar(100) not null comment '????'
1171
  , DeleteFlg decimal(1,0) not null comment '???t???O'
1172
  , EntryDate datetime not null comment '?o?^???t'
1173
  , UpdateDate datetime not null comment '?X?V???t'
1174
  , constraint divisionmaster_PKC primary key (DivisionCode,NameCode)
1175
) comment '???}?X?^' ;
1176

1177
-- ??Z?\?Z???f?[?^
1178
drop table if exists estimatebudget cascade;
1179

1180
create table estimatebudget (
1181
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1182
  , ConstructionTime decimal(5,2) unsigned not null comment '?H??'
1183
  , IntegratedCode decimal(8,0) not null comment '??Z??'
1184
  , DataCreateDate datetime not null comment '?f?[?^??????'
1185
  , RetValue1 decimal(12,0) not null comment '?\???i'
1186
  , RetValue2 decimal(12,0) not null comment '????H????'
1187
  , RetValue3 decimal(12,0) not null comment '????????????'
1188
  , RetValue4 decimal(12,0) not null comment '????????????'
1189
  , RetPercent decimal(5,2) not null comment '???????'
1190
  , EntryDate datetime not null comment '?o?^???t'
1191
  , UpdateDate datetime not null comment '?X?V???t'
1192
  , constraint estimatebudget_PKC primary key (ConstructionCode)
1193
) comment '??Z?\?Z???f?[?^' ;
1194

1195
-- ??Z?\?Z????f?[?^????
1196
drop table if exists estimatebudgetdetail cascade;
1197

1198
create table estimatebudgetdetail (
1199
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1200
  , GroupCount decimal(2,0) unsigned not null comment '?O???[?v???'
1201
  , LineCount decimal(3,0) unsigned not null comment '?s???'
1202
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
1203
  , ItemCode decimal(5,0) unsigned comment '?H??L?['
1204
  , CompanyCode decimal(8,0) not null comment '??????R?[?h'
1205
  , FirstString varchar(120) comment '???????'
1206
  , SecondString varchar(120) comment '?H????E???????'
1207
  , Content varchar(120) comment '???e'
1208
  , EstimatePrice decimal(12,0) not null comment '????????z'
1209
  , NegotiationPrice decimal(12,0) not null comment '????????z'
1210
  , Notes varchar(120) comment '???????'
1211
  , EntryDate datetime not null comment '?o?^???t'
1212
  , UpdateDate datetime not null comment '?X?V???t'
1213
  , constraint estimatebudgetdetail_PKC primary key (ConstructionCode,GroupCount,LineCount)
1214
) comment '??Z?\?Z????f?[?^????' ;
1215

1216
-- ??Z????f?[?^
1217
drop table if exists estimatedata cascade;
1218

1219
create table estimatedata (
1220
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1221
  , LineCount decimal(3,0) unsigned not null comment '?s???'
1222
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
1223
  , FixedItemCode varchar(1) comment '?????L?['
1224
  , ItemName varchar(120) comment '??????'
1225
  , SpecName varchar(120) comment '???^?i???E?`??E???@'
1226
  , PriceValue decimal(14,0) not null comment '???z'
1227
  , note varchar(60) comment '???l'
1228
  , MyExpensesFlg decimal(1,0) not null comment '????o??t???O'
1229
  , InputFlg decimal(1,0) not null comment '????t???O'
1230
  , EntryDate datetime not null comment '?o?^???t'
1231
  , UpdateDate datetime not null comment '?X?V???t'
1232
  , constraint estimatedata_PKC primary key (ConstructionCode,LineCount)
1233
) comment '??Z????f?[?^' ;
1234

1235
create index EstimateData_Index1
1236
  on estimatedata(ConstructionCode,FixedItemCode);
1237

1238
-- ??Z????y?[?W?f?[?^
1239
drop table if exists estimatedatabody cascade;
1240

1241
create table estimatedatabody (
1242
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1243
  , PageCount decimal(4,0) unsigned not null comment '?y?[?W???'
1244
  , Category decimal(1,0) not null comment '?y?[?W??'
1245
  , UnionComponentCode decimal(5,0) unsigned not null comment '?????\???L?['
1246
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
1247
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
1248
  , SelectComponent decimal(5,0) unsigned not null comment '?I???\???L?['
1249
  , PageTitle varchar(120) not null comment '?y?[?W?\????'
1250
  , DetailLineCount decimal(3,0) unsigned not null comment '????s???'
1251
  , EntryDate datetime not null comment '?o?^???t'
1252
  , UpdateDate datetime not null comment '?X?V???t'
1253
  , constraint estimatedatabody_PKC primary key (ConstructionCode,PageCount)
1254
) comment '??Z????y?[?W?f?[?^' ;
1255

1256
create index EstimateDataBody_Index1
1257
  on estimatedatabody(ConstructionCode,ComponentCode,ItemCode);
1258

1259
-- ??Z????f?[?^????
1260
drop table if exists estimatedatadetail cascade;
1261

1262
create table estimatedatadetail (
1263
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1264
  , PageCount decimal(4,0) unsigned not null comment '?y?[?W???'
1265
  , LineCount decimal(3,0) unsigned not null comment '?s???'
1266
  , DataType decimal(1,0) not null comment '?f?[?^???'
1267
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
1268
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
1269
  , SpecCode decimal(5,0) unsigned not null comment '???L?['
1270
  , ItemName varchar(120) comment '??????'
1271
  , SpecName varchar(120) comment '???^?i???E?`??E???@'
1272
  , Unitcount decimal(8,2) not null comment '????'
1273
  , UnitName varchar(30) comment '?P?????'
1274
  , UnitPrice decimal(9,2) not null comment '?P??'
1275
  , LineTotal decimal(12,0) not null comment '???z'
1276
  , note varchar(60) comment '???l'
1277
  , CompanyCode decimal(8,0) not null comment '??????R?[?h'
1278
  , MyExpensesFlg decimal(1,0) not null comment '????o??t???O'
1279
  , InputFlg decimal(1,0) comment '????t???O'
1280
  , EntryDate datetime not null comment '?o?^???t'
1281
  , UpdateDate datetime not null comment '?X?V???t'
1282
  , constraint estimatedatadetail_PKC primary key (ConstructionCode,PageCount,LineCount)
1283
) comment '??Z????f?[?^????' ;
1284

1285
create index EstimateDataDetail_Index1
1286
  on estimatedatadetail(ConstructionCode,PageCount);
1287

1288
-- ?o???}?X?^
1289
drop table if exists expensesmaster cascade;
1290

1291
create table expensesmaster (
1292
  DivisionCode smallint(6) not null comment '?H?????R?[?h'
1293
  , NameCode smallint(6) not null comment '?o????R?[?h'
1294
  , DisplayOrder smallint(6) not null comment '?\????'
1295
  , ExpensesRatio decimal(4,2) not null comment '?o??'
1296
  , DeleteFlg decimal(1,0) not null comment '???t???O'
1297
  , EntryDate datetime not null comment '?o?^???t'
1298
  , UpdateDate datetime not null comment '?X?V???t'
1299
  , constraint expensesmaster_PKC primary key (DivisionCode,NameCode)
1300
) comment '?o???}?X?^' ;
1301

1302
-- ???x???}?X?^
1303
drop table if exists holidaycalendermaster cascade;
1304

1305
create table holidaycalendermaster (
1306
  Holiday date not null comment '?x??'
1307
  , BusinessYear smallint(5) unsigned not null comment '?c??N?x'
1308
  , TargetMonth tinyint(3) unsigned not null comment '?Y????'
1309
  , TargetDay tinyint(3) unsigned not null comment '?Y????'
1310
  , constraint holidaycalendermaster_PKC primary key (Holiday)
1311
) comment '???x???}?X?^' ;
1312

1313
create index HolidayCalender_Index1
1314
  on holidaycalendermaster(BusinessYear);
1315

1316
create index HolidayCalenderMaster_Index2
1317
  on holidaycalendermaster(TargetMonth);
1318

1319
create index HolidayCalenderMaster_Index3
1320
  on holidaycalendermaster(TargetDay);
1321

1322
-- ?????????????
1323
drop table if exists inputsearchlogdata cascade;
1324

1325
create table inputsearchlogdata (
1326
  ConstructionCode decimal(10,0) not null comment '?H???R?[?h'
1327
  , UsedProcessNo decimal(4,0) not null comment '?g?p?@?\???'
1328
  , DisplayOrder decimal(4,0) unsigned not null comment '?\????'
1329
  , DataType decimal(1,0) not null comment '?f?[?^???'
1330
  , InputCode decimal(10,0) comment '????R?[?h'
1331
  , constraint inputsearchlogdata_PKC primary key (ConstructionCode,UsedProcessNo,DisplayOrder)
1332
) comment '?????????????' ;
1333

1334
create index InputSearchLogData_Index1
1335
  on inputsearchlogdata(ConstructionCode,UsedProcessNo,InputCode);
1336

1337
-- ???????f?[?^
1338
drop table if exists invoicedata cascade;
1339

1340
create table invoicedata (
1341
  INVOICENO decimal(9,0) not null comment '??????No'
1342
  , ORDERERSDIVISION decimal(5,0) not null comment '???????'
1343
  , ORDERERSCODE decimal(5,0) not null comment '??????R?[?h'
1344
  , REQUESTMONTH decimal(6,0) not null comment '??????'
1345
  , SEQNO decimal(2,0) not null comment '?A??'
1346
  , CRETATEDATE date not null comment '????'
1347
  , REQUESTDATE date not null comment '??????'
1348
  , REQUESTNAME varchar(120) comment '??????'
1349
  , TOTALAMOUNT decimal(10,0) comment '???????v???z'
1350
  , TAXAMOUNT decimal(10,0) comment '???????z'
1351
  , COMMENT1 varchar(60) comment '?R?????g1'
1352
  , COMMENT2 varchar(60) comment '?R?????g2'
1353
  , COMMENT3 varchar(60) not null comment '?R?????g3'
1354
  , COMMENT4 varchar(60) not null comment '?R?????g4'
1355
  , COMMENT5 varchar(60) not null comment '?R?????g5'
1356
  , COMPLETEFLG decimal(1,0) default '0' not null comment '?????t???O'
1357
  , ENTRYDATE datetime not null comment '?o?^?N????'
1358
  , UPDATEDATE datetime not null comment '?X?V?N????'
1359
  , constraint invoicedata_PKC primary key (INVOICENO)
1360
) comment '???????f?[?^' ;
1361

1362
alter table invoicedata add unique ORDERERSDIVISION (ORDERERSDIVISION,ORDERERSCODE,REQUESTMONTH,SEQNO) ;
1363

1364
-- ??????
1365
drop table if exists materialinfo cascade;
1366

1367
create table materialinfo (
1368
  MATERIALITEMCODE smallint(5) unsigned default 0 not null comment '????i??R?[?h'
1369
  , MATERIALCOUNT smallint(5) unsigned comment '?????'
1370
  , RENTCOUNT smallint(5) unsigned comment '??o??\??'
1371
  , DELETEFLG smallint(5) unsigned comment '???t???O'
1372
  , ENTRYDATE datetime comment '?o?^???t'
1373
  , UPDATEDATE datetime comment '?X?V???t'
1374
  , constraint materialinfo_PKC primary key (MATERIALITEMCODE)
1375
) comment '??????' ;
1376

1377
-- ????i??}?X?^
1378
drop table if exists materialitemmaster cascade;
1379

1380
create table materialitemmaster (
1381
  MATERIALITEMCODE smallint(5) unsigned default 0 not null comment '????i??R?[?h'
1382
  , MATERIALKINDCODE smallint(5) unsigned comment '??????R?[?h'
1383
  , MATERIALITEMNAME varchar(40) comment '????i?????'
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
  , VERSIONNO decimal(8,0) default '0' not null comment '?o?[?W???????'
1389
  , constraint materialitemmaster_PKC primary key (MATERIALITEMCODE)
1390
) comment '????i??}?X?^' ;
1391

1392
-- ??????}?X?^
1393
drop table if exists materialkindmaster cascade;
1394

1395
create table materialkindmaster (
1396
  MATERIALKINDCODE smallint(5) unsigned default 0 not null comment '??????R?[?h'
1397
  , MATERIALKINDNAME varchar(40) comment '?????????'
1398
  , DISPLAYORDER smallint(5) unsigned comment '?\????'
1399
  , DELETEFLG tinyint(3) unsigned comment '???t???O'
1400
  , ENTRYDATE datetime comment '?o?^???t'
1401
  , UPDATEDATE datetime comment '?X?V???t'
1402
  , constraint materialkindmaster_PKC primary key (MATERIALKINDCODE)
1403
) comment '??????}?X?^' ;
1404

1405
-- ??????????
1406
drop table if exists materialrecordinfo cascade;
1407

1408
create table materialrecordinfo (
1409
  MATERIALITEMCODE smallint(5) unsigned default 0 not null comment '????i??R?[?h'
1410
  , PROCESSDATE date default '0000-00-00' not null comment '?????N????'
1411
  , SEQNO smallint(5) unsigned default 0 not null comment '?A??'
1412
  , RECKIND tinyint(3) unsigned comment '???R?[?h??'
1413
  , CONSTRUCTIONCODE int(10) unsigned comment '?H?????'
1414
  , PERSONCODE int(10) unsigned comment '?S????R?[?h'
1415
  , MATERIALCOUNT smallint(5) unsigned comment '?????'
1416
  , REPAYPLANDATE date comment '??p?\??N????'
1417
  , COMMENTTEXT varchar(80) comment '?R?????g'
1418
  , ENTRYDATE datetime comment '?o?^???t'
1419
  , UPDATEDATE datetime comment '?X?V???t'
1420
  , constraint materialrecordinfo_PKC primary key (MATERIALITEMCODE,PROCESSDATE,SEQNO)
1421
) comment '??????????' ;
1422

1423
-- ?f??????b?Z?[?W
1424
drop table if exists messageboarddata cascade;
1425

1426
create table messageboarddata (
1427
  RecordNumber decimal(6,0) unsigned not null comment '???R?[?h???'
1428
  , BranchNumber decimal(3,0) unsigned not null comment '???R?[?h?}??'
1429
  , FromCode decimal(8,0) unsigned not null comment '???????R?[?h'
1430
  , FromName varchar(60) not null comment '???????'
1431
  , MessageTitile varchar(100) comment '?`???^?C?g??'
1432
  , MessageContent varchar(1333) not null comment '?`?????e'
1433
  , LinkType decimal(2,0) not null comment '?????N????^?C?v'
1434
  , LinkMessage varchar(200) comment '?????N??????'
1435
  , LinkCode varchar(30) comment '?????N?L?['
1436
  , WritingDate datetime not null comment '?????????'
1437
  , PersonCode decimal(8,0) not null comment '??????S????R?[?h'
1438
  , ShareFlag decimal(2,0) not null comment '???????t???O'
1439
  , MessageColor varchar(8) comment '?????F'
1440
  , BackColor varchar(8) comment '?o?b?N?J???['
1441
  , MessageFlag decimal(1,0) not null comment '???b?Z?[?W?t???O'
1442
  , EntryDate datetime not null comment '?o?^???t'
1443
  , UpdateDate datetime not null comment '?X?V???t'
1444
  , constraint messageboarddata_PKC primary key (RecordNumber,BranchNumber)
1445
) comment '?f??????b?Z?[?W' ;
1446

1447
create index MessageBoardData_Index1
1448
  on messageboarddata(WritingDate);
1449

1450
create index MessageBoardData_Index2
1451
  on messageboarddata(MessageFlag);
1452

1453
-- ?f???????e?[?u??
1454
drop table if exists messageboardterget cascade;
1455

1456
create table messageboardterget (
1457
  RecordNumber decimal(6,0) unsigned not null comment '???R?[?h???'
1458
  , BranchNumber decimal(3,0) unsigned not null comment '???R?[?h?}??'
1459
  , SeqNum decimal(3,0) unsigned not null comment '????'
1460
  , ToCode decimal(8,0) not null comment '????R?[?h'
1461
  , ToName varchar(60) not null comment '????'
1462
  , EntryDate datetime not null comment '?o?^???t'
1463
  , UpdateDate datetime not null comment '?X?V???t'
1464
  , constraint messageboardterget_PKC primary key (RecordNumber,BranchNumber,SeqNum)
1465
) comment '?f???????e?[?u??' ;
1466

1467
create index MessageBoardTerget_Index1
1468
  on messageboardterget(RecordNumber,BranchNumber);
1469

1470
-- ?f??????b?Z?[?W?{??????
1471
drop table if exists messagebrowsinghistory cascade;
1472

1473
create table messagebrowsinghistory (
1474
  RecordNumber decimal(6,0) unsigned not null comment '???R?[?h???'
1475
  , BranchNumber decimal(3,0) unsigned not null comment '???R?[?h?}??'
1476
  , SeqNum decimal(3,0) unsigned not null comment '????'
1477
  , BrowsingCode decimal(8,0) not null comment '?{????R?[?h'
1478
  , BrowsingDate datetime not null comment '?{?????t'
1479
  , EntryDate datetime not null comment '?o?^???t'
1480
  , UpdateDate datetime not null comment '?X?V???t'
1481
  , constraint messagebrowsinghistory_PKC primary key (RecordNumber,BranchNumber,SeqNum)
1482
) comment '?f??????b?Z?[?W?{??????' ;
1483

1484
-- ???}?X?^
1485
drop table if exists monthmaster cascade;
1486

1487
create table monthmaster (
1488
  month smallint(6) not null comment '??'
1489
  , constraint monthmaster_PKC primary key (month)
1490
) comment '???}?X?^' ;
1491

1492
-- ??????}?X?^
1493
drop table if exists orderersmaster cascade;
1494

1495
create table orderersmaster (
1496
  OrderCotegory decimal(5,0) unsigned not null comment '???????'
1497
  , OrderersCode decimal(5,0) unsigned not null comment '??????R?[?h'
1498
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
1499
  , OrderFlg decimal(1,0) not null comment '?@?l?c??E??l?t???O'
1500
  , CorporateStatusName varchar(100) comment '?@?l?i????'
1501
  , CorporateStatusPoint decimal(1,0) comment '?@?l?i?????u'
1502
  , OrderersName1 varchar(60) not null comment '???????1'
1503
  , OrderersName2 varchar(60) comment '????????Q'
1504
  , DepartmentName varchar(60) comment '??????'
1505
  , ChargePersonName varchar(60) comment '?S?????'
1506
  , ZipCode varchar(8) comment '?X????'
1507
  , Address1 varchar(60) comment '?Z???P'
1508
  , Address2 varchar(60) comment '?Z??2'
1509
  , Address3 varchar(60) comment '?Z??3'
1510
  , PhoneNumber varchar(13) comment '?d?b???'
1511
  , FaxNumber varchar(13) comment 'FAX???'
1512
  , MailAddress varchar(257) comment '???[???A?h???X'
1513
  , Note varchar(300) comment '???l'
1514
  , DeleteFlg decimal(1,0) not null comment '???t???O'
1515
  , EntryDate datetime not null comment '?o?^???t'
1516
  , UpdateDate datetime not null comment '?X?V???t'
1517
  , constraint orderersmaster_PKC primary key (OrderCotegory,OrderersCode)
1518
) comment '??????}?X?^' ;
1519

1520
-- ????z?f?[?^
1521
drop table if exists orderspricedata cascade;
1522

1523
create table orderspricedata (
1524
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1525
  , ChangeNo decimal(3,0) unsigned not null comment '??X???'
1526
  , ChangeDate date not null comment '??X??'
1527
  , ChangePersonCode decimal(8,0) unsigned not null comment '??X??R?[?h'
1528
  , ChangePersonName varchar(60) comment '??X???'
1529
  , BeforeValue decimal(14,0) not null comment '??X?O???????z'
1530
  , BeforeValueInTax decimal(14,0) not null comment '??X?O???????z'
1531
  , AfterValue decimal(14,0) not null comment '??X????????z'
1532
  , AfterValueInTax decimal(14,0) not null comment '??X????????z'
1533
  , ChangeComment varchar(200) comment '??X???R'
1534
  , EntryDate datetime not null comment '?o?^???t'
1535
  , UpdateDate datetime not null comment '?X?V???t'
1536
  , constraint orderspricedata_PKC primary key (ConstructionCode,ChangeNo)
1537
) comment '????z?f?[?^' ;
1538

1539
-- ?x?????F???f?[?^
1540
drop table if exists paymentapprovalinfo cascade;
1541

1542
create table paymentapprovalinfo (
1543
  COMPANYCODE decimal(8,0) default '0' not null comment '??????R?[?h'
1544
  , TARGETDATE decimal(6,0) default '0' not null comment '???N??'
1545
  , SEQNO decimal(3,0) default '0' not null comment '?A??'
1546
  , LINECOUNT decimal(3,0) default '0' not null comment '?s???'
1547
  , APPROVALNO decimal(3,0) default '0' not null comment '???F????'
1548
  , APPROVALPERSON decimal(8,0) comment '???F??R?[?h'
1549
  , APPROVALPERSONNAME varchar(20) comment '???F???'
1550
  , APPROVALAUTHORITY decimal(1,0) comment '???F??????'
1551
  , APPROVALDATE date comment '???F???t'
1552
  , ENTRYDATE datetime comment '?o?^???t'
1553
  , UPDATEDATE datetime comment '?X?V???t'
1554
  , constraint paymentapprovalinfo_PKC primary key (COMPANYCODE,TARGETDATE,SEQNO,LINECOUNT,APPROVALNO)
1555
) comment '?x?????F???f?[?^' ;
1556

1557
-- ?x??????f?[?^
1558
drop table if exists paymentdatadetail cascade;
1559

1560
create table paymentdatadetail (
1561
  COMPANYCODE decimal(8,0) default '0' not null comment '??????R?[?h'
1562
  , TARGETDATE decimal(6,0) default '0' not null comment '???N??'
1563
  , SEQNO decimal(3,0) default '0' not null comment '?A??'
1564
  , LINECOUNT decimal(3,0) default '0' not null comment '?s???'
1565
  , BILLPRICE decimal(10,0) comment '???????z'
1566
  , DISCOUNTPRICE decimal(10,0) comment '?l???????z'
1567
  , OFFSETPRICE decimal(10,0) comment '???E???z'
1568
  , NEXTCOPRICE decimal(10,0) comment '????J?z'
1569
  , HIGHWPRICE decimal(10,0) comment '??????'
1570
  , HARDWPRICE decimal(10,0) comment '??????'
1571
  , INDSWASTETAX decimal(10,0) comment '?Y?p??'
1572
  , CNSTRPRICE decimal(10,0) comment '?????'
1573
  , CNSTRPRICEEXIST decimal(1,0) comment '??????L??'
1574
  , APPROVALPERSONCODE decimal(8,0) comment '???F?S????R?[?h'
1575
  , APPROVALDATE date comment '?S??????F???t'
1576
  , APPROVALENDFLG decimal(1,0) comment '???F?????t???O'
1577
  , ENTRYDATE datetime comment '?o?^???t'
1578
  , UPDATEDATE datetime comment '?X?V???t'
1579
  , constraint paymentdatadetail_PKC primary key (COMPANYCODE,TARGETDATE,SEQNO,LINECOUNT)
1580
) comment '?x??????f?[?^' ;
1581

1582
create index PayDataDetail_Index1
1583
  on paymentdatadetail(TARGETDATE);
1584

1585
create index PayDataDetail_Index2
1586
  on paymentdatadetail(APPROVALPERSONCODE);
1587

1588
-- ?H??????????f?[?^
1589
drop table if exists periodavoidance cascade;
1590

1591
create table periodavoidance (
1592
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1593
  , ConstructionStatusFlg decimal(2,0) not null comment '?H?????t???O'
1594
  , FieldNo decimal(2,0) not null comment '?`?F?b?N???t?B?[???h???'
1595
  , EntryDate datetime not null comment '?o?^???t'
1596
  , UpdateDate datetime not null comment '?X?V???t'
1597
  , constraint periodavoidance_PKC primary key (ConstructionCode,ConstructionStatusFlg,FieldNo)
1598
) comment '?H??????????f?[?^' ;
1599

1600
create index PeriodAvoidance_Index1
1601
  on periodavoidance(ConstructionCode);
1602

1603
create index PeriodAvoidance_Index2
1604
  on periodavoidance(ConstructionStatusFlg);
1605

1606
create index PeriodAvoidance_Index3
1607
  on periodavoidance(FieldNo);
1608

1609
-- ?S??????F?f?[?^
1610
drop table if exists personapproval cascade;
1611

1612
create table personapproval (
1613
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
1614
  , ApprovalCode decimal(3,0) unsigned not null comment '???F?@?\???'
1615
  , OrderDate date not null comment '??t??'
1616
  , OrderNo decimal(2,0) unsigned not null comment '??t???'
1617
  , SeqNo decimal(2,0) not null comment '?}??'
1618
  , PersonCodeApproval decimal(8,0) unsigned not null comment '?\???E???F??R?[?h'
1619
  , PetitionApprovalDate datetime not null comment '?\???E???F???t'
1620
  , ApprovalLimitDates datetime not null comment '???F??]??'
1621
  , ApprovalStatus decimal(1,0) not null comment '???F???'
1622
  , InputComment varchar(300) comment '?R?????g'
1623
  , EntryDate datetime not null comment '?o?^???t'
1624
  , UpdateDate datetime not null comment '?X?V???t'
1625
  , constraint personapproval_PKC primary key (PersonCode,ApprovalCode,OrderDate,OrderNo,SeqNo)
1626
) comment '?S??????F?f?[?^' ;
1627

1628
-- ?S??????F?R?????g?f?[?^
1629
drop table if exists personapprovalcomment cascade;
1630

1631
create table personapprovalcomment (
1632
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
1633
  , ApprovalCode decimal(3,0) unsigned not null comment '???F?@?\???'
1634
  , OrderDate date not null comment '??t??'
1635
  , OrderNo decimal(2,0) unsigned not null comment '??t???'
1636
  , CommentNo decimal(2,0) not null comment '?R?????g???'
1637
  , ParentNo decimal(2,0) not null comment '?e?R?????g???'
1638
  , ApproValComment varchar(300) comment '?w???E?A???R?????g'
1639
  , EntryDate datetime not null comment '?o?^???t'
1640
  , UpdateDate datetime not null comment '?X?V???t'
1641
  , constraint personapprovalcomment_PKC primary key (PersonCode,ApprovalCode,OrderDate,OrderNo,CommentNo)
1642
) comment '?S??????F?R?????g?f?[?^' ;
1643

1644
-- ?S??????????}?X?^
1645
drop table if exists persondepartmentmaster cascade;
1646

1647
create table persondepartmentmaster (
1648
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
1649
  , DepartmentCode decimal(5,0) unsigned not null comment '?????R?[?h'
1650
  , AffiliationFlg decimal(1,0) not null comment '?????t???O'
1651
  , EntryDate datetime not null comment '?o?^???t'
1652
  , UpdateDate datetime not null comment '?X?V???t'
1653
  , constraint persondepartmentmaster_PKC primary key (PersonCode,DepartmentCode)
1654
) comment '?S??????????}?X?^' ;
1655

1656
create index PersonDepartmentMaster_Index1
1657
  on persondepartmentmaster(PersonCode);
1658

1659
create index PersonDepartmentMaster_Index2
1660
  on persondepartmentmaster(DepartmentCode);
1661

1662
-- ?S????}?X?^
1663
drop table if exists personinchargemaster cascade;
1664

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

1691
create index PersonInChargeMaster_Index1
1692
  on personinchargemaster(StartDate);
1693

1694
create index PersonInChargeMaster_Index2
1695
  on personinchargemaster(DepartmentCode);
1696

1697
-- ?S??????^?}?X?^
1698
drop table if exists personsalarymaster cascade;
1699

1700
create table personsalarymaster (
1701
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
1702
  , StartDate date not null comment '?g?p?J?n?N????'
1703
  , MonthlySalary decimal(11,0) not null comment '???????z'
1704
  , YearSalary decimal(12,0) not null comment '?N????z'
1705
  , EntryDate datetime not null comment '?o?^???t'
1706
  , UpdateDate datetime not null comment '?X?V???t'
1707
  , constraint personsalarymaster_PKC primary key (PersonCode,StartDate)
1708
) comment '?S??????^?}?X?^' ;
1709

1710
create index PersonSalaryMaster_Index1
1711
  on personsalarymaster(PersonCode);
1712

1713
create index PersonSalaryMaster_Index2
1714
  on personsalarymaster(StartDate);
1715

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

1719
create table pointingoutcomment (
1720
  ConstructionCode decimal(10,0) not null comment '?H???R?[?h'
1721
  , ProcessNo smallint(6) not null comment '????????i??????j'
1722
  , SeqNo smallint(6) not null comment '????'
1723
  , PageCount smallint(6) not null comment '?y?[?W???'
1724
  , PersonCode decimal(8,0) not null comment '?L????R?[?h'
1725
  , DrowColor varchar(8) comment '?`??F'
1726
  , CommentMessage varchar(1000) comment '???b?Z?[?W'
1727
  , StartPointX smallint(6) not null comment '?w?E?????u?w'
1728
  , StartPointY smallint(6) not null comment '?w?E?????u?x'
1729
  , CurrentPointX smallint(6) not null comment '??????u?w'
1730
  , CurrentPointY smallint(6) not null comment '??????u?x'
1731
  , CurrentWidth smallint(6) not null comment '?\???T?C?YWidth'
1732
  , CurrentHeight smallint(6) not null comment '?\???T?C?YHeigth'
1733
  , EntryDate datetime not null comment '?o?^???t'
1734
  , UpdateDate datetime not null comment '?X?V???t'
1735
  , constraint pointingoutcomment_PKC primary key (ConstructionCode,ProcessNo,SeqNo)
1736
) comment '?w???????f?[?^' ;
1737

1738
-- ?????????????c???^?f?[?^
1739
drop table if exists proceedingsdata cascade;
1740

1741
create table proceedingsdata (
1742
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1743
  , ProceedingsDataDate date not null comment '?c???^????'
1744
  , StartMeetingTime decimal(4,0) unsigned not null comment '??c????J?n'
1745
  , EndMeetingTime decimal(4,0) unsigned not null comment '??c????I??'
1746
  , CreatorCode decimal(8,0) not null comment '????R?[?h'
1747
  , PalceFlag decimal(1,0) not null comment '???n?t???O'
1748
  , MeetingPalce varchar(120) comment '???????'
1749
  , EntryDate datetime not null comment '?o?^???t'
1750
  , UpdateDate datetime not null comment '?X?V???t'
1751
  , constraint proceedingsdata_PKC primary key (ConstructionCode,ProceedingsDataDate,StartMeetingTime)
1752
) comment '?????????????c???^?f?[?^' ;
1753

1754
-- ?????????????c???^?f?[?^?i?o???j
1755
drop table if exists proceedingsdataattend cascade;
1756

1757
create table proceedingsdataattend (
1758
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1759
  , ProceedingsDataDate date not null comment '?c???^????'
1760
  , StartMeetingTime decimal(4,0) unsigned not null comment '??c????J?n'
1761
  , SeqNo decimal(3,0) unsigned not null comment '????s???'
1762
  , Department varchar(20) comment '?o??????'
1763
  , AttendName varchar(10) comment '?o??????'
1764
  , EntryDate datetime not null comment '?o?^???t'
1765
  , UpdateDate datetime not null comment '?X?V???t'
1766
  , constraint proceedingsdataattend_PKC primary key (ConstructionCode,ProceedingsDataDate,StartMeetingTime,SeqNo)
1767
) comment '?????????????c???^?f?[?^?i?o???j' ;
1768

1769
-- ?????????????c???^?f?[?^?i????j
1770
drop table if exists proceedingsdatadetail cascade;
1771

1772
create table proceedingsdatadetail (
1773
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1774
  , ProceedingsDataDate date not null comment '?c???^????'
1775
  , StartMeetingTime decimal(4,0) unsigned not null comment '??c????J?n'
1776
  , SeqNo decimal(3,0) unsigned not null comment '????s???'
1777
  , TitleNo varchar(5) comment '?c????'
1778
  , Title varchar(20) comment '?c??'
1779
  , ContentsText varchar(50) comment '???e'
1780
  , EntryDate datetime not null comment '?o?^???t'
1781
  , UpdateDate datetime not null comment '?X?V???t'
1782
  , constraint proceedingsdatadetail_PKC primary key (ConstructionCode,ProceedingsDataDate,StartMeetingTime,SeqNo)
1783
) comment '?????????????c???^?f?[?^?i????j' ;
1784

1785
-- ???F?f?[?^
1786
drop table if exists processapproval cascade;
1787

1788
create table processapproval (
1789
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1790
  , ApprovalCode decimal(3,0) unsigned not null comment '???F?@?\???'
1791
  , OrderNo decimal(2,0) unsigned not null comment '??t???'
1792
  , SeqNo decimal(2,0) not null comment '?}??'
1793
  , PersonCode decimal(8,0) unsigned not null comment '?\???E???F??R?[?h'
1794
  , PetitionApprovalDate datetime not null comment '?\???E???F???t'
1795
  , ApprovalLimitDates datetime not null comment '???F??]??'
1796
  , ApprovalStatus decimal(1,0) not null comment '???F???'
1797
  , InputComment varchar(300) comment '?R?????g'
1798
  , EntryDate datetime not null comment '?o?^???t'
1799
  , UpdateDate datetime not null comment '?X?V???t'
1800
  , constraint processapproval_PKC primary key (ConstructionCode,ApprovalCode,OrderNo,SeqNo)
1801
) comment '???F?f?[?^' ;
1802

1803
-- ???F?R?????g?f?[?^
1804
drop table if exists processapprovalcomment cascade;
1805

1806
create table processapprovalcomment (
1807
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1808
  , ApprovalCode decimal(3,0) unsigned not null comment '???F?@?\???'
1809
  , OrderNo decimal(2,0) unsigned not null comment '??t???'
1810
  , CommentNo decimal(2,0) not null comment '?R?????g???'
1811
  , ParentNo decimal(2,0) not null comment '?e?R?????g???'
1812
  , ApproValComment varchar(300) comment '?w???E?A???R?????g'
1813
  , EntryDate datetime not null comment '?o?^???t'
1814
  , UpdateDate datetime not null comment '?X?V???t'
1815
  , constraint processapprovalcomment_PKC primary key (ConstructionCode,ApprovalCode,OrderNo,CommentNo)
1816
) comment '???F?R?????g?f?[?^' ;
1817

1818
-- ???F????f?[?^
1819
drop table if exists processapprovaldetail cascade;
1820

1821
create table processapprovaldetail (
1822
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1823
  , ApprovalCode decimal(3,0) unsigned not null comment '???F?@?\???'
1824
  , OrderNo decimal(2,0) unsigned not null comment '??t???'
1825
  , SerialNo decimal(2,0) unsigned not null comment '?}??'
1826
  , LinkCode decimal(10,0) not null comment '?????N???'
1827
  , EntryDate datetime not null comment '?o?^???t'
1828
  , UpdateDate datetime not null comment '?X?V???t'
1829
  , constraint processapprovaldetail_PKC primary key (ConstructionCode,ApprovalCode,OrderNo,SerialNo)
1830
) comment '???F????f?[?^' ;
1831

1832
-- ?N?????}?X?^
1833
drop table if exists processexcutemaster cascade;
1834

1835
create table processexcutemaster (
1836
  SecCode decimal(2,0) unsigned not null comment '???????'
1837
  , ExecCode decimal(4,0) unsigned not null comment '?N?????????'
1838
  , EditFlg decimal(1,0) not null comment '??W?t???O'
1839
  , EntryDate datetime not null comment '?o?^???t'
1840
  , UpdateDate datetime not null comment '?X?V???t'
1841
  , constraint processexcutemaster_PKC primary key (SecCode,ExecCode)
1842
) comment '?N?????}?X?^' ;
1843

1844
create index ProcessExcuteMaster_Index1
1845
  on processexcutemaster(SecCode);
1846

1847
create index ProcessExcuteMaster_Index2
1848
  on processexcutemaster(ExecCode);
1849

1850
-- ???????f?[?^
1851
drop table if exists purchaseorder cascade;
1852

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

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

1889
create table purchaseorderdate (
1890
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1891
  , SeqNo decimal(3,0) unsigned not null comment '???????}??'
1892
  , CompanyCode decimal(8,0) not null comment '??????R?[?h'
1893
  , SendDate date not null comment '???????X????'
1894
  , ReturnDate date not null comment '???????????'
1895
  , ReturnCheckDate date not null comment '??????????m?F??'
1896
  , EntryDate datetime not null comment '?o?^???t'
1897
  , UpdateDate datetime not null comment '?X?V???t'
1898
  , constraint purchaseorderdate_PKC primary key (ConstructionCode,SeqNo)
1899
) comment '?????????t?f?[?^' ;
1900

1901
-- ??????????f?[?^
1902
drop table if exists purchaseorderdetail cascade;
1903

1904
create table purchaseorderdetail (
1905
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1906
  , SeqNo decimal(3,0) unsigned not null comment '???????}??'
1907
  , GroupCount decimal(1,0) not null comment '?O???[?v???'
1908
  , LineCount decimal(3,0) unsigned not null comment '?s???'
1909
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
1910
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
1911
  , FirstString varchar(120) comment '?H??E?i??'
1912
  , SecondString varchar(120) comment '???e????'
1913
  , UnitCount decimal(8,2) not null comment '????'
1914
  , UnitName varchar(30) comment '?P??'
1915
  , UnitPrice decimal(10,0) not null comment '?P??'
1916
  , OrdersLinePrice decimal(12,0) comment '???z'
1917
  , SourceCode decimal(10,0) unsigned not null comment '???H?????'
1918
  , SourceDetailCnt decimal(4,0) unsigned not null comment '????????'
1919
  , DataTypeFlag decimal(1,0) unsigned not null comment '?f?[?^?^?C?v?t???O'
1920
  , EntryDate datetime not null comment '?o?^???t'
1921
  , UpdateDate datetime not null comment '?X?V???t'
1922
  , constraint purchaseorderdetail_PKC primary key (ConstructionCode,SeqNo,GroupCount,LineCount)
1923
) comment '??????????f?[?^' ;
1924

1925
create index POrderDetail_Index1
1926
  on purchaseorderdetail(SourceCode);
1927

1928
-- ?????f?[?^
1929
drop table if exists requestdata cascade;
1930

1931
create table requestdata (
1932
  REQUESTNO decimal(9,0) not null comment '????No'
1933
  , MAINCONSTRUCTIONCODE decimal(10,0) not null comment '?{?H?????'
1934
  , CONSTRUCTIONNAME varchar(120) not null comment '?H??????'
1935
  , CONTRACTAMOUNT decimal(10,0) not null comment '???????z'
1936
  , PAIDAMOUNT decimal(10,0) not null comment '????????z'
1937
  , REQUESTAMOUNT0 decimal(10,0) not null comment '???????z?O'
1938
  , REQUESTAMOUNT1 decimal(10,0) not null comment '???????z?P'
1939
  , REQUESTAMOUNT2 decimal(10,0) comment '???????z?Q'
1940
  , REQUESTAMOUNT3 decimal(10,0) comment '???????z?R'
1941
  , REQUESTAMOUNT4 decimal(10,0) comment '???????z?S'
1942
  , REQUESTAMOUNT5 decimal(10,0) comment '???????z?T'
1943
  , REQUESTAMOUNT6 decimal(10,0) comment '???????z?U'
1944
  , UNCLAIMEDAMOUNT decimal(10,0) not null comment '?????c???z'
1945
  , UNPAIDAMOUNT decimal(10,0) not null comment '?????????z'
1946
  , TAXAMOUNT decimal(10,0) not null comment '?????'
1947
  , NOTE varchar(120) not null comment '???l'
1948
  , ENTRYDATE datetime not null comment '?o?^?N????'
1949
  , UPDATEDATE datetime not null comment '?X?V?N????'
1950
  , constraint requestdata_PKC primary key (REQUESTNO,MAINCONSTRUCTIONCODE)
1951
) comment '?????f?[?^' ;
1952

1953
-- ?????f?[?^????
1954
drop table if exists requestdatadetail cascade;
1955

1956
create table requestdatadetail (
1957
  REQUESTNO decimal(9,0) not null comment '????No'
1958
  , MAINCONSTRUCTIONCODE decimal(10,0) not null comment '?{?H?????'
1959
  , CONSTRUCTIONCODE decimal(10,0) not null comment '?H?????'
1960
  , CONSTRUCTIONKIND decimal(1,0) not null comment '?H????'
1961
  , REQUESTAMOUNT decimal(10,0) not null comment '???????z'
1962
  , TAXAMOUNT decimal(10,0) not null comment '?????'
1963
  , ENTRYDATE datetime not null comment '?o?^?N????'
1964
  , UPDATEDATE datetime not null comment '?X?V?N????'
1965
  , constraint requestdatadetail_PKC primary key (REQUESTNO,MAINCONSTRUCTIONCODE,CONSTRUCTIONCODE,CONSTRUCTIONKIND)
1966
) comment '?????f?[?^????' ;
1967

1968
-- ?????w?b?_
1969
drop table if exists requesthead cascade;
1970

1971
create table requesthead (
1972
  REQUESTNO decimal(9,0) not null comment '????No'
1973
  , REQCONSTRUCTIONCODE decimal(10,0) not null comment '?????H?????'
1974
  , ORDERNO decimal(2,0) not null comment '??t???'
1975
  , REQUESTMONTH decimal(6,0) not null comment '??????'
1976
  , ORDERERSDIVISION decimal(5,0) not null comment '???????'
1977
  , ORDERERSCODE decimal(5,0) not null comment '??????R?[?h'
1978
  , ORDERERSNAME varchar(120) not null comment '???????'
1979
  , REQCONSTRUCTIONNAME varchar(120) not null comment '?????H??????'
1980
  , REQUESTTOTALAMOUNT decimal(10,0) not null comment '???????z???v'
1981
  , REQUESTAMOUNT decimal(10,0) not null comment '???????z'
1982
  , TAXAMOUNT decimal(10,0) not null comment '?????'
1983
  , UNPAIDAMOUNT decimal(10,0) comment '??????'
1984
  , NOTE varchar(120) comment '???l'
1985
  , ASSIGNEDFLG decimal(1,0) comment '??????t???O'
1986
  , INVOICENO decimal(9,0) not null comment '??????No'
1987
  , ENTRYDATE datetime not null comment '?o?^?N????'
1988
  , UPDATEDATE datetime not null comment '?X?V?N????'
1989
  , constraint requesthead_PKC primary key (REQUESTNO)
1990
) comment '?????w?b?_' ;
1991

1992
alter table requesthead add unique REQCONSTRUCTIONCODE (REQCONSTRUCTIONCODE,ORDERNO) ;
1993

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

1997
create table requestorderdate (
1998
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1999
  , InvoiceNo decimal(9,0) not null comment '??????No'
2000
  , SendDate date not null comment '???????????X????'
2001
  , EntryDate datetime not null comment '?o?^???t'
2002
  , UpdateDate datetime not null comment '?X?V???t'
2003
  , constraint requestorderdate_PKC primary key (ConstructionCode,InvoiceNo)
2004
) comment '?????????t?f?[?^' ;
2005

2006
-- ????O???t?f?[?^
2007
drop table if exists salesgraphdata cascade;
2008

2009
create table salesgraphdata (
2010
  GraphDataCode decimal(8,0) not null comment '?O???t?f?[?^?R?[?h'
2011
  , ConstructionPeriod decimal(4,0) unsigned not null comment '?????'
2012
  , SalesDataDays date not null comment '????N??'
2013
  , DisplayOrder decimal(8,0) unsigned not null comment '?\????'
2014
  , DataName varchar(100) not null comment '?f?[?^?\??????'
2015
  , SalesAmount decimal(10,0) not null comment '????f?[?^'
2016
  , AdministrativeExpense decimal(10,0) not null comment '???E?????o??'
2017
  , GrossProfit decimal(10,0) not null comment '?e???v'
2018
  , NetIncome decimal(10,0) not null comment '?????v(???v)'
2019
  , EntryDate datetime not null comment '?o?^???t'
2020
  , UpdateDate datetime not null comment '?X?V???t'
2021
  , constraint salesgraphdata_PKC primary key (GraphDataCode,ConstructionPeriod,SalesDataDays)
2022
) comment '????O???t?f?[?^' ;
2023

2024
create index SalesGraphData_Idx1
2025
  on salesgraphdata(DisplayOrder);
2026

2027
create index SalesGraphData_idx2
2028
  on salesgraphdata(ConstructionPeriod);
2029

2030
-- ?????}?X?^
2031
drop table if exists securitymaster cascade;
2032

2033
create table securitymaster (
2034
  SecCode decimal(2,0) unsigned not null comment '???????'
2035
  , DisplayOrder decimal(2,0) not null comment '?\????'
2036
  , SecName varchar(60) not null comment '????????'
2037
  , SecRank decimal(1,0) not null comment '?????????N'
2038
  , SecRange decimal(1,0) not null comment '???????'
2039
  , GeneralAffairs decimal(1,0) not null comment '????????t???O'
2040
  , SelectBackColor varchar(8) not null comment '?I??w?i?F'
2041
  , EntryDate datetime not null comment '?o?^???t'
2042
  , UpdateDate datetime not null comment '?X?V???t'
2043
  , constraint securitymaster_PKC primary key (SecCode)
2044
) comment '?????}?X?^' ;
2045

2046
create index SecurityMaster_Index1
2047
  on securitymaster(DisplayOrder);
2048

2049
create index SecurityMaster_Index2
2050
  on securitymaster(SecRank);
2051

2052
create index SecurityMaster_Index3
2053
  on securitymaster(SecRange);
2054

2055
-- ???S?p?g???[???f?[?^
2056
drop table if exists sfpdata cascade;
2057

2058
create table sfpdata (
2059
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
2060
  , DataCount decimal(2,0) unsigned not null comment '?p?g???[????'
2061
  , RequestDate datetime not null comment '?p?g???[???v??????'
2062
  , PersonCode decimal(8,0) unsigned not null comment '?\????R?[?h'
2063
  , StringValue varchar(300) comment '?R?????g'
2064
  , OrderNo decimal(2,0) unsigned not null comment '?\????t???'
2065
  , EntryDate datetime not null comment '?o?^???t'
2066
  , UpdateDate datetime not null comment '?X?V???t'
2067
  , constraint sfpdata_PKC primary key (ConstructionCode,DataCount)
2068
) comment '???S?p?g???[???f?[?^' ;
2069

2070
create index SFPData_Index1
2071
  on sfpdata(RequestDate);
2072

2073
-- ???S?p?g???[??????f?[?^
2074
drop table if exists sfpdatadetail cascade;
2075

2076
create table sfpdatadetail (
2077
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
2078
  , DataCount decimal(2,0) unsigned not null comment '?p?g???[????'
2079
  , SeqNo decimal(2,0) unsigned not null comment '?f?[?^?}??'
2080
  , CompanyCode decimal(8,0) unsigned not null comment '??????R?[?h'
2081
  , EntryDate datetime not null comment '?o?^???t'
2082
  , UpdateDate datetime not null comment '?X?V???t'
2083
  , constraint sfpdatadetail_PKC primary key (ConstructionCode,DataCount,SeqNo)
2084
) comment '???S?p?g???[??????f?[?^' ;
2085

2086
-- ??????{?H?H??o?^?\???f?[?^
2087
drop table if exists subconstrjobitemregist cascade;
2088

2089
create table subconstrjobitemregist (
2090
  PersonCode decimal(8,0) unsigned not null comment '?\??????'
2091
  , CreateDate date not null comment '????'
2092
  , SeqNo decimal(2,0) unsigned not null comment '?\???A??'
2093
  , DisplayOrder decimal(8,0) unsigned not null comment '?\????'
2094
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
2095
  , EntryDate datetime not null comment '?o?^???t'
2096
  , UpdateDate datetime not null comment '?X?V???t'
2097
  , constraint subconstrjobitemregist_PKC primary key (PersonCode,CreateDate,SeqNo,DisplayOrder)
2098
) comment '??????{?H?H??o?^?\???f?[?^' ;
2099

2100
-- ??????E?????N?o?^?\???f?[?^
2101
drop table if exists subconstrjoblinkregist cascade;
2102

2103
create table subconstrjoblinkregist (
2104
  PersonCode decimal(8,0) unsigned not null comment '?\??????'
2105
  , CreateDate date not null comment '????'
2106
  , SeqNo decimal(2,0) unsigned not null comment '?\???A??'
2107
  , DisplayOrder decimal(8,0) unsigned not null comment '?\????'
2108
  , JobCategoryCode decimal(5,0) not null comment '?E??L?['
2109
  , EntryDate datetime not null comment '?o?^???t'
2110
  , UpdateDate datetime not null comment '?X?V???t'
2111
  , constraint subconstrjoblinkregist_PKC primary key (PersonCode,CreateDate,SeqNo,DisplayOrder)
2112
) comment '??????E?????N?o?^?\???f?[?^' ;
2113

2114
-- ??????o?^?\???f?[?^
2115
drop table if exists subconstrregist cascade;
2116

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

2149
-- ??????H??}?X?^
2150
drop table if exists subcontractoritemmaster cascade;
2151

2152
create table subcontractoritemmaster (
2153
  ItemCode decimal(5,0) unsigned not null comment '?H??L?['
2154
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2155
  , ItemName varchar(120) not null comment '?H????'
2156
  , DeleteFlg decimal(1,0) not null comment '???t???O'
2157
  , EntryDate datetime not null comment '?o?^???t'
2158
  , UpdateDate datetime not null comment '?X?V???t'
2159
  , constraint subcontractoritemmaster_PKC primary key (ItemCode)
2160
) comment '??????H??}?X?^' ;
2161

2162
-- ??????E??}?X?^
2163
drop table if exists subcontractorjobcategory cascade;
2164

2165
create table subcontractorjobcategory (
2166
  JobCategoryCode decimal(5,0) not null comment '?E??L?['
2167
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2168
  , JobCategoryName varchar(120) not null comment '?E????'
2169
  , DeleteFlg decimal(1,0) not null comment '???t???O'
2170
  , EntryDate datetime not null comment '?o?^???t'
2171
  , UpdateDate datetime not null comment '?X?V???t'
2172
  , constraint subcontractorjobcategory_PKC primary key (JobCategoryCode)
2173
) comment '??????E??}?X?^' ;
2174

2175
-- ??????{?H?H??f?[?^
2176
drop table if exists subcontractorjobitem cascade;
2177

2178
create table subcontractorjobitem (
2179
  CompanyCode decimal(8,0) not null comment '??????R?[?h'
2180
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
2181
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2182
  , EntryDate datetime not null comment '?o?^???t'
2183
  , UpdateDate datetime not null comment '?X?V???t'
2184
  , constraint subcontractorjobitem_PKC primary key (CompanyCode,ItemCode)
2185
) comment '??????{?H?H??f?[?^' ;
2186

2187
create index SubContractorJobItem_Index1
2188
  on subcontractorjobitem(CompanyCode);
2189

2190
create index SubContractorJobItem_Index2
2191
  on subcontractorjobitem(ItemCode);
2192

2193
-- ??????E?????N?}?X?^
2194
drop table if exists subcontractorjoblink cascade;
2195

2196
create table subcontractorjoblink (
2197
  CompanyCode decimal(8,0) not null comment '??????R?[?h'
2198
  , JobCategoryCode decimal(5,0) not null comment '?E??L?['
2199
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2200
  , EntryDate datetime not null comment '?o?^???t'
2201
  , UpdateDate datetime not null comment '?X?V???t'
2202
  , constraint subcontractorjoblink_PKC primary key (CompanyCode,JobCategoryCode)
2203
) comment '??????E?????N?}?X?^' ;
2204

2205
create index SubContractorJobLink_Index1
2206
  on subcontractorjoblink(CompanyCode);
2207

2208
create index SubContractorJobLink_Index2
2209
  on subcontractorjoblink(JobCategoryCode);
2210

2211
-- ??????}?X?^
2212
drop table if exists subcontractormaster cascade;
2213

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

2241
create index SubContractorMaster_Index1
2242
  on subcontractormaster(JapaneseSyllabary);
2243

2244
-- ?d????}?X?^
2245
drop table if exists suppliersmaster cascade;
2246

2247
create table suppliersmaster (
2248
  SuppliersCode decimal(5,0) unsigned not null comment '?d????R?[?h'
2249
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2250
  , SuppliersName1 varchar(60) not null comment '?d????1'
2251
  , SuppliersName2 varchar(60) comment '?d?????Q'
2252
  , ZipCode varchar(8) comment '?X????'
2253
  , Address1 varchar(60) comment '?Z???P'
2254
  , Address2 varchar(60) comment '?Z??2'
2255
  , Address3 varchar(60) comment '?Z??3'
2256
  , PhoneNumber varchar(13) comment '?d?b???'
2257
  , FaxNumber varchar(13) comment 'FAX???'
2258
  , Note varchar(300) comment '???l'
2259
  , DeleteFlg decimal(1,0) not null comment '???t???O'
2260
  , EntryDate datetime not null comment '?o?^???t'
2261
  , UpdateDate datetime not null comment '?X?V???t'
2262
  , constraint suppliersmaster_PKC primary key (SuppliersCode)
2263
) comment '?d????}?X?^' ;
2264

2265
-- ?V?X?e???N???m?F?f?[?^
2266
drop table if exists systemexecute cascade;
2267

2268
create table systemexecute (
2269
  PrimaryCode tinyint(4) not null comment '?L?[????'
2270
  , TargetDate date not null comment '?N?????t'
2271
  , SystemVersion int(11) not null comment '?{??E????o?[?W????'
2272
  , UpDateCopyVersion int(11) not null comment '?R?s?[?o?[?W????'
2273
  , EntryDate datetime not null comment '?o?^???t'
2274
  , UpdateDate datetime not null comment '?X?V???t'
2275
  , constraint systemexecute_PKC primary key (PrimaryCode)
2276
) comment '?V?X?e???N???m?F?f?[?^' ;
2277

2278
-- ????}?X?^
2279
drop table if exists systemmaster cascade;
2280

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

2315
-- ?????}?X?^
2316
drop table if exists termmaster cascade;
2317

2318
create table termmaster (
2319
  ConstructionStatusFlg decimal(2,0) not null comment '?H?????t???O'
2320
  , FieldNo decimal(2,0) not null comment '?`?F?b?N???t?B?[???h???'
2321
  , SeqNo decimal(2,0) not null comment '?}??'
2322
  , DisplayOrder decimal(2,0) not null comment '?\????'
2323
  , CheckSchdule decimal(1,0) not null comment '?`?F?b?N?^?C?~???O'
2324
  , TermDays decimal(3,0) not null comment '?o???'
2325
  , SendTitile varchar(100) comment '?^?C?g??'
2326
  , SendMessage varchar(100) comment '???b?Z?[?W'
2327
  , BackColor varchar(8) comment '?w?i?F'
2328
  , ForeColor varchar(8) comment '?????F'
2329
  , EntryDate datetime not null comment '?o?^???t'
2330
  , UpdateDate datetime not null comment '?X?V???t'
2331
  , constraint termmaster_PKC primary key (ConstructionStatusFlg,FieldNo,SeqNo)
2332
) comment '?????}?X?^' ;
2333

2334
create index TermMaster_Index1
2335
  on termmaster(DisplayOrder);
2336

2337
-- ?o?????f?[?^
2338
drop table if exists tranceportdailydata cascade;
2339

2340
create table tranceportdailydata (
2341
  PersonCode decimal(8,0) unsigned not null comment '????R?[?h'
2342
  , AttendanceDate date not null comment '???????'
2343
  , StartDistance decimal(7,1) not null comment '?????o???L????'
2344
  , ComplateDistance decimal(7,1) not null comment '?????I???L????'
2345
  , TotalDistance decimal(6,1) not null comment '???????v?L????'
2346
  , OfficeGoFlg decimal(1,0) not null comment '???????o??t???O'
2347
  , OfficeOutFlg decimal(1,0) not null comment '???????A??t???O'
2348
  , TrancePayGoFlg decimal(1,0) not null comment '?L?????o??t???O'
2349
  , TrancePayOutFlg decimal(1,0) not null comment '?L?????A??t???O'
2350
  , WareHouseFlg decimal(1,0) not null comment '????u??t???O'
2351
  , EntryDate datetime not null comment '?o?^???t'
2352
  , UpdateDate datetime not null comment '?X?V???t'
2353
  , constraint tranceportdailydata_PKC primary key (PersonCode,AttendanceDate)
2354
) comment '?o?????f?[?^' ;
2355

2356
create index TranceportDailyData_Index1
2357
  on tranceportdailydata(AttendanceDate);
2358

2359
-- ?H?????o???}?X?^
2360
drop table if exists typeexpensesmaster cascade;
2361

2362
create table typeexpensesmaster (
2363
  TypeCode decimal(5,0) unsigned not null comment '?H?????R?[?h'
2364
  , ExpensesPeriod smallint(6) not null comment '?????'
2365
  , NameCode decimal(5,0) unsigned not null comment '?o????R?[?h'
2366
  , ExpensesRaito decimal(4,2) not null comment '?o??'
2367
  , DeleteFlg decimal(1,0) not null comment '???t???O'
2368
  , EntryDate datetime not null comment '?o?^???t'
2369
  , UpdateDate datetime not null comment '?X?V???t'
2370
  , constraint typeexpensesmaster_PKC primary key (TypeCode,ExpensesPeriod,NameCode)
2371
) comment '?H?????o???}?X?^' ;
2372

2373
-- ?P??}?X?^
2374
drop table if exists unitmaster cascade;
2375

2376
create table unitmaster (
2377
  UnitKey decimal(5,0) unsigned not null comment '?P??L?['
2378
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2379
  , UnitName varchar(30) not null comment '?P?????'
2380
  , EntryDate datetime not null comment '?o?^???t'
2381
  , UpdateDate datetime not null comment '?X?V???t'
2382
  , constraint unitmaster_PKC primary key (UnitKey)
2383
) comment '?P??}?X?^' ;
2384

2385
create index UnitMaster_Index1
2386
  on unitmaster(DisplayOrder);
2387

2388
-- ????}?X?^
2389
drop table if exists vehiclemaster cascade;
2390

2391
create table vehiclemaster (
2392
  VehicleCode decimal(5,0) unsigned not null comment '????R?[?h'
2393
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2394
  , VehicleName varchar(100) not null comment '???????'
2395
  , RegistrationNumber varchar(30) comment '?o?^???'
2396
  , IdentificationNumber varchar(30) comment '?????'
2397
  , ModelCode varchar(30) comment '?^??'
2398
  , DepartmentCode decimal(5,0) unsigned not null comment '???????'
2399
  , VehicleScheduleFlg decimal(1,0) not null comment '????\??\???t???O'
2400
  , PurchaseDate date comment '?w????'
2401
  , PurchaseName varchar(30) comment '?w????'
2402
  , PurchaseContactPersons varchar(30) comment '?w????S????'
2403
  , PurchasePhone varchar(13) comment '?w????d?b???'
2404
  , LeaseDate date comment '???[?X?J?n??'
2405
  , LeaseDestination varchar(30) comment '???[?X??'
2406
  , LeaseContactPersons varchar(30) comment '???[?X??S????'
2407
  , LeasePhone varchar(13) comment '???[?X??d?b???'
2408
  , InsuranceCompany varchar(30) comment '?C???????'
2409
  , InsuranceContactPersons varchar(30) comment '?C???????S????'
2410
  , InsurancePhone varchar(13) comment '?C???????d?b???'
2411
  , Note varchar(300) comment '???l'
2412
  , EntryDate datetime comment '?o?^???t'
2413
  , UpdateDate datetime comment '?X?V???t'
2414
  , constraint vehiclemaster_PKC primary key (VehicleCode)
2415
) comment '????}?X?^' ;
2416

2417
-- ????L?^?f?[?^
2418
drop table if exists vehiclerecorddata cascade;
2419

2420
create table vehiclerecorddata (
2421
  VehicleCode decimal(5,0) unsigned not null comment '????R?[?h'
2422
  , DivisionCode decimal(2,0) unsigned not null comment '?f?[?^??'
2423
  , SeqNo decimal(2,0) not null comment '?}??'
2424
  , RecordDate date comment '???n??'
2425
  , Mileage mediumint(9) comment '???s????'
2426
  , Content varchar(100) comment '???e'
2427
  , PaymentCost decimal(10,0) comment '??p'
2428
  , EntryDate datetime not null comment '?o?^???t'
2429
  , UpdateDate datetime not null comment '?X?V???t'
2430
  , constraint vehiclerecorddata_PKC primary key (VehicleCode,DivisionCode,SeqNo)
2431
) comment '????L?^?f?[?^' ;
2432

2433
-- ????\??f?[?^
2434
drop table if exists vehiclescheduledata cascade;
2435

2436
create table vehiclescheduledata (
2437
  TargetDate date not null comment '????'
2438
  , VehicleCode decimal(5,0) unsigned not null comment '????R?[?h'
2439
  , MorningAfternoon decimal(1,0) not null comment '??O?E???'
2440
  , PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
2441
  , TargetYear year(4) not null comment '?Y???N'
2442
  , TargetMonth tinyint(3) unsigned not null comment '?Y????'
2443
  , TargetDay year(4) not null comment '?Y????'
2444
  , EntryDate datetime not null comment '?o?^???t'
2445
  , UpdateDate datetime not null comment '?X?V???t'
2446
  , constraint vehiclescheduledata_PKC primary key (TargetDate,VehicleCode,MorningAfternoon)
2447
) comment '????\??f?[?^' ;
2448

2449
create index VehicleScheduleData_Index1
2450
  on vehiclescheduledata(TargetYear);
2451

2452
create index VehicleScheduleData_Index2
2453
  on vehiclescheduledata(TargetMonth);
2454

2455
create index VehicleScheduleData_Index3
2456
  on vehiclescheduledata(TargetDay);
2457

2458
-- ?N?}?X?^
2459
drop table if exists yearmaster cascade;
2460

2461
create table yearmaster (
2462
  years smallint(6) not null comment '?N'
2463
  , constraint yearmaster_PKC primary key (years)
2464
) comment '?N?}?X?^' ;
2465