プロジェクト

全般

プロフィール

統計
| リビジョン:

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

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

1
-- Project Name : noname
2
-- Date/Time    : 2017/09/16 11:05:22
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
  , ActionResult varchar(30) not null comment '?s??????'
54
  , StartTime datetime comment '?J?n????'
55
  , CompTime datetime comment '?I??????'
56
  , DayTimes decimal(4,1) not null comment '????????v????'
57
  , WorkingComment varchar(120) comment '?R?????g'
58
  , NightFlg decimal(1,0) not null comment '?????t???O'
59
  , EntryDate datetime not null comment '?o?^???t'
60
  , UpdateDate datetime not null comment '?X?V???t'
61
  , constraint attendancedailydata_PKC primary key (PersonCode,AttendanceDate,SeqNo)
62
) comment '?o?????f?[?^' ;
63

    
64
create index AttendDaily_Index1
65
  on attendancedailydata(ActionResult);
66

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

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

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

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

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

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

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

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

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

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

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

    
156
-- ?H???????f?[?^?y???p?z
157
drop table if exists bk_constructionledger cascade;
158

    
159
create table bk_constructionledger (
160
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
161
  , ConstructionPeriod decimal(4,0) unsigned not null comment '?????'
162
  , CreatorCode decimal(8,0) comment '????R?[?h'
163
  , CreatorName varchar(60) comment '?????'
164
  , CreateDate date not null comment '????'
165
  , ConstructionTimes decimal(5,2) not null comment '?H???i?P??E???j'
166
  , ConstructionStart date not null comment '?_??H???J?n'
167
  , ConstructionEnd date not null comment '?_??H??????'
168
  , OrdersDecisionPrice decimal(14,0) not null comment '??????????z'
169
  , CompanyExpenses decimal(10,0) not null comment '???o???v'
170
  , DepartmentExpenses decimal(10,0) not null comment '?????o???v'
171
  , SalesExpenses decimal(10,0) not null comment '?c??o???v'
172
  , TotalPayment decimal(10,0) not null comment '???x???z'
173
  , GrossProfit decimal(10,0) not null comment '?e??'
174
  , Allowance decimal(10,0) not null comment '???^'
175
  , NetProfit decimal(10,0) not null comment '?????v'
176
  , ComplateFlg decimal(1,0) not null comment '????????t???O'
177
  , IntegrationFlg decimal(1,0) not null comment '????z??Z?t???O'
178
  , EntryDate datetime not null comment '?o?^???t'
179
  , UpdateDate datetime not null comment '?X?V???t'
180
  , constraint bk_constructionledger_PKC primary key (ConstructionCode)
181
) comment '?H???????f?[?^?y???p?z' ;
182

    
183
-- ?H??????????f?[?^?y???p?z
184
drop table if exists bk_constructionledgerdetail cascade;
185

    
186
create table bk_constructionledgerdetail (
187
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
188
  , GroupCount decimal(2,0) unsigned not null comment '?O???[?v???'
189
  , LineCount decimal(5,0) unsigned not null comment '?s???'
190
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
191
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
192
  , FirstString varchar(120) comment '???????'
193
  , SecondString varchar(120) comment '?H?????e'
194
  , CompanyType decimal(1,0) not null comment '??????R?[?h?^?C?v'
195
  , CompanyCode decimal(8,0) not null comment '??????R?[?h'
196
  , CompanyName varchar(120) comment '?????????'
197
  , EstimatePrice decimal(12,0) not null comment '?\?Z?i????j???z'
198
  , ExecutionAmount decimal(12,0) not null comment '???s???z'
199
  , AmountConfigRate decimal(5,2) not null comment '???z?\????'
200
  , PaymentBurden decimal(12,0) not null comment '?x????U?z'
201
  , FixDataFlg decimal(1,0) not null comment '???f?[?^?t???O'
202
  , IndependentFlg decimal(1,0) not null comment '????f?[?^?t???O'
203
  , FluctuationFlg decimal(1,0) not null comment '?????f?[?^?t???O'
204
  , SalaryFlg decimal(1,0) not null comment '???^?U????'
205
  , SalaryDays decimal(4,0) not null comment '???^?U??????'
206
  , OperatingFlg decimal(1,0) not null comment '?S?????t???O'
207
  , SourceCode decimal(10,0) unsigned not null comment '???H?????'
208
  , JoinTitleFlg decimal(1,0) not null comment '?H??????^?C?g??'
209
  , SalaryOnRegist decimal(12,0) not null comment '?o?^?????z???^'
210
  , PurchaseOrderFlg decimal(2,0) not null comment '?????????s?t???O'
211
  , EntryDate datetime not null comment '?o?^???t'
212
  , UpdateDate datetime not null comment '?X?V???t'
213
  , constraint bk_constructionledgerdetail_PKC primary key (ConstructionCode,GroupCount,LineCount)
214
) comment '?H??????????f?[?^?y???p?z' ;
215

    
216
-- ?H?????????s?f?[?^?y???p?z
217
drop table if exists bk_constructionledgerexcute cascade;
218

    
219
create table bk_constructionledgerexcute (
220
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
221
  , GroupCount decimal(2,0) unsigned not null comment '?O???[?v???'
222
  , LineCount decimal(5,0) unsigned not null comment '?s???'
223
  , ColumnCount decimal(3,0) not null comment '????'
224
  , PaymentAmount decimal(12,0) not null comment '?x?????z'
225
  , TargetMonth date not null comment '???N??'
226
  , EntryDate datetime not null comment '?o?^???t'
227
  , UpdateDate datetime not null comment '?X?V???t'
228
  , constraint bk_constructionledgerexcute_PKC primary key (ConstructionCode,GroupCount,LineCount,ColumnCount)
229
) comment '?H?????????s?f?[?^?y???p?z' ;
230

    
231
-- ??Z????f?[?^?y???p?z
232
drop table if exists bk_estimatedata cascade;
233

    
234
create table bk_estimatedata (
235
  SaveDate datetime not null comment '?????t'
236
  , ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
237
  , LineCount decimal(3,0) unsigned not null comment '?s???'
238
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
239
  , FixedItemCode varchar(1) comment '?????L?['
240
  , ItemName varchar(120) comment '??????'
241
  , SpecName varchar(120) comment '???^?i???E?`??E???@'
242
  , PriceValue decimal(14,0) not null comment '???z'
243
  , note varchar(60) comment '???l'
244
  , MyExpensesFlg decimal(1,0) not null comment '????o??t???O'
245
  , InputFlg decimal(1,0) not null comment '????t???O'
246
  , EntryDate datetime not null comment '?o?^???t'
247
  , UpdateDate datetime not null comment '?X?V???t'
248
  , constraint bk_estimatedata_PKC primary key (SaveDate,ConstructionCode,LineCount)
249
) comment '??Z????f?[?^?y???p?z' ;
250

    
251
-- ??Z????y?[?W?f?[?^?y???p?z
252
drop table if exists bk_estimatedatabody cascade;
253

    
254
create table bk_estimatedatabody (
255
  SaveDate datetime not null comment '?????t'
256
  , ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
257
  , PageCount decimal(4,0) unsigned not null comment '?y?[?W???'
258
  , Category decimal(1,0) not null comment '?y?[?W??'
259
  , UnionComponentCode decimal(5,0) unsigned not null comment '?????\???L?['
260
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
261
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
262
  , SelectComponent decimal(5,0) unsigned not null comment '?I???\???L?['
263
  , PageTitle varchar(120) not null comment '?y?[?W?\????'
264
  , DetailLineCount decimal(3,0) unsigned not null comment '????s???'
265
  , EntryDate datetime not null comment '?o?^???t'
266
  , UpdateDate datetime not null comment '?X?V???t'
267
  , constraint bk_estimatedatabody_PKC primary key (SaveDate,ConstructionCode,PageCount)
268
) comment '??Z????y?[?W?f?[?^?y???p?z' ;
269

    
270
-- ??Z????f?[?^????y???p?z
271
drop table if exists bk_estimatedatadetail cascade;
272

    
273
create table bk_estimatedatadetail (
274
  SaveDate datetime not null comment '?????t'
275
  , ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
276
  , PageCount decimal(4,0) unsigned not null comment '?y?[?W???'
277
  , LineCount decimal(3,0) unsigned not null comment '?s???'
278
  , DataType decimal(1,0) not null comment '?f?[?^???'
279
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
280
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
281
  , SpecCode decimal(5,0) unsigned not null comment '???L?['
282
  , ItemName varchar(120) comment '??????'
283
  , SpecName varchar(120) comment '???^?i???E?`??E???@'
284
  , Unitcount decimal(8,2) not null comment '????'
285
  , UnitName varchar(30) comment '?P?????'
286
  , UnitPrice decimal(9,2) not null comment '?P??'
287
  , LineTotal decimal(12,0) not null comment '???z'
288
  , note varchar(60) comment '???l'
289
  , CompanyCode decimal(8,0) not null comment '??????R?[?h'
290
  , MyExpensesFlg decimal(1,0) not null comment '????o??t???O'
291
  , InputFlg decimal(1,0) comment '????t???O'
292
  , EntryDate datetime not null comment '?o?^???t'
293
  , UpdateDate datetime not null comment '?X?V???t'
294
  , constraint bk_estimatedatadetail_PKC primary key (SaveDate,ConstructionCode,PageCount,LineCount)
295
) comment '??Z????f?[?^????y???p?z' ;
296

    
297
-- ?@?l?i?}?X?^
298
drop table if exists businesstypemaster cascade;
299

    
300
create table businesstypemaster (
301
  BusinessTypeCode decimal(5,0) unsigned not null comment '?@?l?i?R?[?h'
302
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
303
  , BusinessTypeName varchar(100) not null comment '???'
304
  , EntryDate datetime not null comment '?o?^???t'
305
  , UpdateDate datetime not null comment '?X?V???t'
306
  , constraint businesstypemaster_PKC primary key (BusinessTypeCode)
307
) comment '?@?l?i?}?X?^' ;
308

    
309
create index BusinessTypeMaster_Index1
310
  on businesstypemaster(DisplayOrder);
311

    
312
-- ????????}?X?^
313
drop table if exists commoncostlarge cascade;
314

    
315
create table commoncostlarge (
316
  LargeCode decimal(5,0) unsigned not null comment '????L?['
317
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
318
  , LargeName varchar(50) not null comment '???????'
319
  , CommentText varchar(120) comment '????????'
320
  , DeleteFlg decimal(1,0) not null comment '???t???O'
321
  , EntryDate datetime not null comment '?o?^???t'
322
  , UpdateDate datetime not null comment '?X?V???t'
323
  , constraint commoncostlarge_PKC primary key (LargeCode)
324
) comment '????????}?X?^' ;
325

    
326
-- ?????H???A?}?X?^
327
drop table if exists commoncostlinkms cascade;
328

    
329
create table commoncostlinkms (
330
  LargeCode decimal(5,0) unsigned not null comment '????L?['
331
  , MiddleCode decimal(5,0) unsigned not null comment '??????L?['
332
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
333
  , EntryDate datetime comment '?o?^???t'
334
  , UpdateDate datetime comment '?X?V???t'
335
  , constraint commoncostlinkms_PKC primary key (LargeCode,MiddleCode,ItemCode)
336
) comment '?????H???A?}?X?^' ;
337

    
338
-- ?????????}?X?^
339
drop table if exists commoncostmiddle cascade;
340

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

    
353
-- ?????????L?[?}?X?^
354
drop table if exists commoncostmiddlesearchword cascade;
355

    
356
create table commoncostmiddlesearchword (
357
  LargeCode decimal(5,0) unsigned not null comment '????L?['
358
  , MiddleCode decimal(5,0) unsigned not null comment '??????L?['
359
  , SeqNo decimal(5,0) unsigned not null comment '????'
360
  , SearchWord varchar(50) not null comment '????????'
361
  , EntryDate datetime not null comment '?o?^???t'
362
  , UpdateDate datetime not null comment '?X?V???t'
363
  , constraint commoncostmiddlesearchword_PKC primary key (LargeCode,MiddleCode,SeqNo)
364
) comment '?????????L?[?}?X?^' ;
365

    
366
-- ?\???H???A?}?X?^
367
drop table if exists componentlinkmaster cascade;
368

    
369
create table componentlinkmaster (
370
  ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
371
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
372
  , DisplayOrder decimal(5,0) unsigned comment '?\????'
373
  , EntryDate datetime not null comment '?o?^???t'
374
  , UpdateDate datetime not null comment '?X?V???t'
375
  , constraint componentlinkmaster_PKC primary key (ComponentCode,ItemCode)
376
) comment '?\???H???A?}?X?^' ;
377

    
378
create index ComponentLinkMaster_Index1
379
  on componentlinkmaster(ComponentCode);
380

    
381
create index ComponentLinkMaster_Index2
382
  on componentlinkmaster(ItemCode);
383

    
384
-- ?\???}?X?^
385
drop table if exists componentmaster cascade;
386

    
387
create table componentmaster (
388
  ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
389
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
390
  , ComponentName varchar(120) not null comment '?\??????'
391
  , SubItemsFlg decimal(1,0) comment '???????t???O'
392
  , DirectInputFlg decimal(1,0) comment '???????t???O'
393
  , MyExpensesFlg decimal(1,0) comment '????o??t???O'
394
  , DeleteFlg decimal(1,0) not null comment '???t???O'
395
  , EntryDate datetime not null comment '?o?^???t'
396
  , UpdateDate datetime not null comment '?X?V???t'
397
  , constraint componentmaster_PKC primary key (ComponentCode)
398
) comment '?\???}?X?^' ;
399

    
400
create index ComponentMaster_Index1
401
  on componentmaster(DisplayOrder);
402

    
403
-- ?\???H??????A?}?X?^
404
drop table if exists componenttotypemaster cascade;
405

    
406
create table componenttotypemaster (
407
  ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
408
  , TypeCode decimal(5,0) unsigned not null comment '?H?????R?[?h'
409
  , Dummy decimal(1,0) not null comment '?_?~?[????'
410
  , EntryDate datetime not null comment '?o?^???t'
411
  , UpdateDate datetime not null comment '?X?V???t'
412
  , constraint componenttotypemaster_PKC primary key (ComponentCode,TypeCode)
413
) comment '?\???H??????A?}?X?^' ;
414

    
415
create index ComponentToTypeMaster_Index1
416
  on componenttotypemaster(ComponentCode);
417

    
418
create index ComponentToTypeMaster_Index2
419
  on componenttotypemaster(TypeCode);
420

    
421
-- ?H????{???
422
drop table if exists constructionbaseinfo cascade;
423

    
424
create table constructionbaseinfo (
425
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
426
  , TyingFlg decimal(1,0) not null comment '?R?t?f?[?^?t???O'
427
  , JoinFlg decimal(1,0) not null comment '?????_??H???t???O'
428
  , ConstructionYear smallint(5) unsigned not null comment '?H???N?x'
429
  , ConstructionPeriod smallint(5) unsigned not null comment '?H??????'
430
  , RequestedDate date comment '??????'
431
  , EstimatesSubmitDeadline date comment '?????o????'
432
  , EstimatesSubmittedDate date comment '?????o??'
433
  , ProvisionalOrderDate date comment '?????'
434
  , OrderDate date comment '???'
435
  , OrderStartingDate date comment '?J?n?\???'
436
  , OrderCompletionDate date comment '?????\???'
437
  , PreparationStartDate date comment '?{?H?????J?n??'
438
  , ConstructionStartingDate date comment '?{?H?J?n??'
439
  , ConstructionCompletionDate date comment '?{?H??????'
440
  , NonOrderDate date comment '????'
441
  , OrdersDecisionPrice decimal(12,0) not null comment '??????????z'
442
  , OrdersDecisionPriceInTax decimal(12,0) not null comment '??????????z'
443
  , SalesPersonCode decimal(8,0) comment '?c??S?????'
444
  , ConstructionPersonCode decimal(8,0) not null comment '?H???S????'
445
  , ConstrSubPersonCode decimal(8,0) not null comment '?H?????S????'
446
  , ConstructionInstructor decimal(8,0) not null comment '?H???w????'
447
  , TransferConstruction decimal(8,0) not null comment '?H??????R?[?h'
448
  , TransferConstructionDate date comment '?H??????'
449
  , OrderersDivision decimal(5,0) not null comment '???????'
450
  , OrderersCode decimal(5,0) unsigned not null comment '??????R?[?h'
451
  , EstimatesExpirationDate date comment '????L??????'
452
  , ConstructionPeriodStart date comment '?_??H???J?n??'
453
  , ConstructionPeriodEnd date comment '?_??H??????'
454
  , ConstructionPeriodStart2 date comment '?_??H???J?n?i???????j'
455
  , ConstructionPeriodEnd2 date comment '?_??H???????i???????j'
456
  , StartDate date comment '?H???J?n??'
457
  , EndDate date comment '?H???I????'
458
  , PurchaseOrderMailingDate date comment '???????X????'
459
  , PurchaseOrderReturnDate date comment '???????????'
460
  , PurchaseOrderReturnCheckDate date comment '??????????m?F??'
461
  , ConsumptionTaxFlg decimal(1,0) not null comment '?????t???O'
462
  , PrimeContractorFlg decimal(1,0) not null comment '?????t???O'
463
  , SalesCostFlg decimal(1,0) not null comment '?c??o?????t???O'
464
  , ConstructionStatusFlg decimal(2,0) not null comment '?H?????t???O'
465
  , ConstructionType decimal(5,0) not null comment '?H?????R?[?h'
466
  , EstimateType decimal(1,0) not null comment '??????'
467
  , BillingStartDate date not null comment '?????????J?n??'
468
  , BillingDate date not null comment '??????'
469
  , BillingSplitFlg decimal(1,0) not null comment '??????t???O'
470
  , BillingSendDate date comment '???????X??/??n????'
471
  , LedgerComplateDate date not null comment '?H????????????????t'
472
  , EntryDate datetime not null comment '?o?^???t'
473
  , UpdateDate datetime not null comment '?X?V???t'
474
  , constraint constructionbaseinfo_PKC primary key (ConstructionCode)
475
) comment '?H????{???' ;
476

    
477
create index BaseInfo_Index1
478
  on constructionbaseinfo(ConstructionStatusFlg);
479

    
480
create index BaseInfo_Index2
481
  on constructionbaseinfo(EstimateType);
482

    
483
create index BaseInfo_Index3
484
  on constructionbaseinfo(SalesPersonCode);
485

    
486
create index BaseInfo_Index4
487
  on constructionbaseinfo(ConstructionPersonCode);
488

    
489
create index BaseInfo_Index5
490
  on constructionbaseinfo(ConstructionInstructor);
491

    
492
create index BaseInfo_Index6
493
  on constructionbaseinfo(ConstructionPeriod);
494

    
495
-- ?H????{????
496
drop table if exists constructionbaseinfodetail cascade;
497

    
498
create table constructionbaseinfodetail (
499
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
500
  , DetailNo decimal(2,0) not null comment '??????'
501
  , DetailString varchar(120) comment '??????e'
502
  , EntryDate datetime not null comment '?o?^???t'
503
  , UpdateDate datetime not null comment '?X?V???t'
504
  , constraint constructionbaseinfodetail_PKC primary key (ConstructionCode,DetailNo)
505
) comment '?H????{????' ;
506

    
507
create index BaseInfoDetail_Idx1
508
  on constructionbaseinfodetail(ConstructionCode);
509

    
510
create index BaseInfoDetail_Idx2
511
  on constructionbaseinfodetail(DetailNo);
512

    
513
-- ?H???{?H?\?Z?f?[?^
514
drop table if exists constructionbudget cascade;
515

    
516
create table constructionbudget (
517
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
518
  , CreatorCode decimal(8,0) not null comment '????R?[?h'
519
  , CreatorName varchar(60) comment '?????'
520
  , CreatorCosts decimal(11,0) not null comment '??????^'
521
  , AssistantCode decimal(8,0) not null comment '???S????R?[?h'
522
  , AssistantName varchar(60) comment '???S?????'
523
  , AssistantCosts decimal(11,0) not null comment '???S??????^'
524
  , InstructorCode decimal(8,0) not null comment '?H???w?????R?[?h'
525
  , InstructorName varchar(60) comment '?H???w??????'
526
  , InstructorCosts decimal(11,0) not null comment '?H???w???????^'
527
  , CreateDate date not null comment '????'
528
  , ConstructionTimes decimal(5,2) not null comment '?H???i?P??E???j'
529
  , ConstructionStart date not null comment '?_??H???J?n'
530
  , ConstructionEnd date not null comment '?_??H??????'
531
  , InstructorTimes decimal(5,2) not null comment '?w???????????'
532
  , SalaryFlg decimal(1,0) not null comment '???^?U????'
533
  , SalaryDays decimal(4,0) not null comment '?U??????'
534
  , A_SalaryFlg decimal(1,0) not null comment '???S??????^?U????'
535
  , A_SalaryDays decimal(4,0) not null comment '???S????U??????'
536
  , I_SalaryFlg decimal(1,0) not null comment '?w???????^?U????'
537
  , I_SalaryDays decimal(4,0) not null comment '?w?????U??????'
538
  , OrdersDecisionPrice decimal(12,0) not null comment '??????????z'
539
  , EntryDate datetime not null comment '?o?^???t'
540
  , UpdateDate datetime not null comment '?X?V???t'
541
  , constraint constructionbudget_PKC primary key (ConstructionCode)
542
) comment '?H???{?H?\?Z?f?[?^' ;
543

    
544
-- ?H???{?H?\?Z?f?[?^????
545
drop table if exists constructionbudgetdetail cascade;
546

    
547
create table constructionbudgetdetail (
548
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
549
  , GroupCount decimal(2,0) unsigned not null comment '?O???[?v???'
550
  , LineCount decimal(3,0) unsigned not null comment '?s???'
551
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
552
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
553
  , FirstString varchar(120) comment '???????'
554
  , SecondString varchar(120) comment '?H?????e'
555
  , CompanyType decimal(1,0) not null comment '??????R?[?h?^?C?v'
556
  , CompanyCode decimal(8,0) not null comment '??????R?[?h'
557
  , CompanyName varchar(120) comment '?????????'
558
  , EstimatePrice decimal(12,0) not null comment '??Z????????z'
559
  , NegotiationPrice decimal(12,0) not null comment '??Z????????z'
560
  , OrderDesiredAmount decimal(12,0) not null comment '??????]???z'
561
  , ExecutionAmount decimal(12,0) not null comment '???s???z'
562
  , AmountConfigRate decimal(5,2) not null comment '???z?\????'
563
  , NegotiateFlg decimal(1,0) not null comment '?????????t???O'
564
  , EntryDate datetime not null comment '?o?^???t'
565
  , UpdateDate datetime not null comment '?X?V???t'
566
  , constraint constructionbudgetdetail_PKC primary key (ConstructionCode,GroupCount,LineCount)
567
) comment '?H???{?H?\?Z?f?[?^????' ;
568

    
569
-- ?H??}?X?^
570
drop table if exists constructionitemmaster cascade;
571

    
572
create table constructionitemmaster (
573
  ItemCode decimal(5,0) unsigned not null comment '?H??L?['
574
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
575
  , ItemName varchar(120) not null comment '?H????'
576
  , SubItemsFlg decimal(1,0) comment '???????t???O'
577
  , MyExpensesFlg decimal(1,0) not null comment '????o??t???O'
578
  , DeleteFlg decimal(1,0) not null comment '???t???O'
579
  , EntryDate datetime not null comment '?o?^???t'
580
  , UpdateDate datetime not null comment '?X?V???t'
581
  , constraint constructionitemmaster_PKC primary key (ItemCode)
582
) comment '?H??}?X?^' ;
583

    
584
-- ?H???????f?[?^
585
drop table if exists constructionledger cascade;
586

    
587
create table constructionledger (
588
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
589
  , ConstructionPeriod decimal(4,0) unsigned not null comment '?????'
590
  , CreatorCode decimal(8,0) comment '????R?[?h'
591
  , CreatorName varchar(60) comment '?????'
592
  , CreateDate date not null comment '????'
593
  , ConstructionTimes decimal(5,2) not null comment '?H???i?P??E???j'
594
  , ConstructionStart date not null comment '?_??H???J?n'
595
  , ConstructionEnd date not null comment '?_??H??????'
596
  , OrdersDecisionPrice decimal(14,0) not null comment '??????????z'
597
  , CompanyExpenses decimal(10,0) not null comment '???o???v'
598
  , DepartmentExpenses decimal(10,0) not null comment '?????o???v'
599
  , SalesExpenses decimal(10,0) not null comment '?c??o???v'
600
  , TotalPayment decimal(10,0) not null comment '???x???z'
601
  , GrossProfit decimal(10,0) not null comment '?e??'
602
  , Allowance decimal(10,0) not null comment '???^'
603
  , NetProfit decimal(10,0) not null comment '?????v'
604
  , ComplateFlg decimal(1,0) not null comment '????????t???O'
605
  , IntegrationFlg decimal(1,0) not null comment '????z??Z?t???O'
606
  , EntryDate datetime not null comment '?o?^???t'
607
  , UpdateDate datetime not null comment '?X?V???t'
608
  , constraint constructionledger_PKC primary key (ConstructionCode)
609
) comment '?H???????f?[?^' ;
610

    
611
-- ?H??????????f?[?^
612
drop table if exists constructionledgerdetail cascade;
613

    
614
create table constructionledgerdetail (
615
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
616
  , GroupCount decimal(2,0) unsigned not null comment '?O???[?v???'
617
  , LineCount decimal(3,0) unsigned not null comment '?s???'
618
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
619
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
620
  , FirstString varchar(120) comment '???????'
621
  , SecondString varchar(120) comment '?H?????e'
622
  , CompanyType decimal(1,0) not null comment '??????R?[?h?^?C?v'
623
  , CompanyCode decimal(8,0) not null comment '??????R?[?h'
624
  , CompanyName varchar(120) comment '?????????'
625
  , EstimatePrice decimal(12,0) not null comment '?\?Z?i????j???z'
626
  , ExecutionAmount decimal(12,0) not null comment '???s???z'
627
  , AmountConfigRate decimal(5,2) not null comment '???z?\????'
628
  , PaymentBurden decimal(12,0) not null comment '?x????U?z'
629
  , FixDataFlg decimal(1,0) not null comment '???f?[?^?t???O'
630
  , IndependentFlg decimal(1,0) not null comment '????f?[?^?t???O'
631
  , FluctuationFlg decimal(1,0) not null comment '?????f?[?^?t???O'
632
  , SalaryFlg decimal(1,0) not null comment '???^?U????'
633
  , SalaryDays decimal(4,0) not null comment '???^?U??????'
634
  , OperatingFlg decimal(1,0) not null comment '?S?????t???O'
635
  , SourceCode decimal(10,0) unsigned not null comment '???H?????'
636
  , JoinTitleFlg decimal(1,0) not null comment '?H??????^?C?g??'
637
  , SalaryOnRegist decimal(12,0) not null comment '?o?^?????z???^'
638
  , PurchaseOrderFlg decimal(2,0) not null comment '?????????s?t???O'
639
  , EntryDate datetime not null comment '?o?^???t'
640
  , UpdateDate datetime not null comment '?X?V???t'
641
  , constraint constructionledgerdetail_PKC primary key (ConstructionCode,GroupCount,LineCount)
642
) comment '?H??????????f?[?^' ;
643

    
644
create index LedgerDetail_Index01
645
  on constructionledgerdetail(ConstructionCode);
646

    
647
create index LedgerDetail_Index02
648
  on constructionledgerdetail(GroupCount);
649

    
650
create index LedgerDetail_Index03
651
  on constructionledgerdetail(SourceCode);
652

    
653
-- ?H?????????s?f?[?^
654
drop table if exists constructionledgerexcute cascade;
655

    
656
create table constructionledgerexcute (
657
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
658
  , GroupCount decimal(2,0) unsigned not null comment '?O???[?v???'
659
  , LineCount decimal(3,0) unsigned not null comment '?s???'
660
  , ColumnCount decimal(3,0) not null comment '????'
661
  , PaymentAmount decimal(12,0) not null comment '?x?????z'
662
  , TargetMonth date not null comment '???N??'
663
  , EntryDate datetime not null comment '?o?^???t'
664
  , UpdateDate datetime not null comment '?X?V???t'
665
  , constraint constructionledgerexcute_PKC primary key (ConstructionCode,GroupCount,LineCount,ColumnCount)
666
) comment '?H?????????s?f?[?^' ;
667

    
668
create index LedgerExcute_Index1
669
  on constructionledgerexcute(ConstructionCode,TargetMonth,GroupCount,LineCount);
670

    
671
-- ?H???????N???
672
drop table if exists constructionlink cascade;
673

    
674
create table constructionlink (
675
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
676
  , FluctuationCode decimal(10,0) not null comment '?q?H?????'
677
  , LinkType decimal(1,0) not null comment '?????N???'
678
  , EntryDate datetime not null comment '?o?^???t'
679
  , UpdateDate datetime not null comment '?X?V???t'
680
  , constraint constructionlink_PKC primary key (ConstructionCode,FluctuationCode)
681
) comment '?H???????N???' ;
682

    
683
create index ConstructionLink_Index1
684
  on constructionlink(ConstructionCode);
685

    
686
create index ConstructionLink_Index2
687
  on constructionlink(FluctuationCode);
688

    
689
create index ConstructionLink_Index3
690
  on constructionlink(LinkType);
691

    
692
-- ?H????????
693
drop table if exists constructionmaterialinfo cascade;
694

    
695
create table constructionmaterialinfo (
696
  CONSTRUCTIONCODE int(10) unsigned default 0 not null comment '?H?????'
697
  , MATERIALITEMCODE smallint(5) unsigned default 0 not null comment '????i??R?[?h'
698
  , RENTCOUNT smallint(5) unsigned comment '??o??'
699
  , REPAYCOUNT smallint(5) unsigned comment '??p??'
700
  , COMPLETEFLG tinyint(3) unsigned comment '?????t???O'
701
  , ENTRYDATE datetime comment '?o?^???t'
702
  , UPDATEDATE datetime comment '?X?V???t'
703
  , constraint constructionmaterialinfo_PKC primary key (CONSTRUCTIONCODE,MATERIALITEMCODE)
704
) comment '?H????????' ;
705

    
706
-- ????i?????t?f?[?^
707
drop table if exists constructionprogressdate cascade;
708

    
709
create table constructionprogressdate (
710
  ConstructionCode decimal(10,0) not null comment '?H?????'
711
  , ConstructionStatusFlg decimal(2,0) not null comment '???H?????'
712
  , PreviousStatusFlg decimal(2,0) comment '??X?O???'
713
  , ChangeDate datetime not null comment '?????t'
714
  , ChangePersonCode decimal(8,0) not null comment '???S????'
715
  , EntryDate datetime not null comment '?o?^???t'
716
  , UpdateDate datetime not null comment '?X?V???t'
717
  , constraint constructionprogressdate_PKC primary key (ConstructionCode,ConstructionStatusFlg)
718
) comment '????i?????t?f?[?^' ;
719

    
720
-- ???}?X?^
721
drop table if exists constructionspecmaster cascade;
722

    
723
create table constructionspecmaster (
724
  ItemCode decimal(5,0) unsigned not null comment '?H??L?['
725
  , SpecCode decimal(5,0) unsigned not null comment '???L?['
726
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
727
  , ItemName varchar(120) comment '??????'
728
  , SpecName varchar(120) comment '??????'
729
  , UnitName varchar(30) comment '?P?????'
730
  , UnitPrice decimal(9,2) not null comment '?P??'
731
  , DeleteFlg decimal(1,0) not null comment '???t???O'
732
  , EntryDate datetime not null comment '?o?^???t'
733
  , UpdateDate datetime not null comment '?X?V???t'
734
  , constraint constructionspecmaster_PKC primary key (ItemCode,SpecCode)
735
) comment '???}?X?^' ;
736

    
737
create index ConstructionSpecMaster_Index1
738
  on constructionspecmaster(DisplayOrder);
739

    
740
-- ???P???}?X?^
741
drop table if exists constructionspecunitprice cascade;
742

    
743
create table constructionspecunitprice (
744
  ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
745
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
746
  , SpecCode decimal(5,0) unsigned not null comment '???L?['
747
  , ConstructionTypeCode mediumint(8) unsigned not null comment '?H?????R?[?h'
748
  , UnitPrice decimal(9,2) not null comment '?P??'
749
  , EntryDate datetime not null comment '?o?^???t'
750
  , UpdateDate datetime not null comment '?X?V???t'
751
  , constraint constructionspecunitprice_PKC primary key (ComponentCode,ItemCode,SpecCode,ConstructionTypeCode)
752
) comment '???P???}?X?^' ;
753

    
754
-- ?H?????}?X?^
755
drop table if exists constructiontypemaster cascade;
756

    
757
create table constructiontypemaster (
758
  TypeCode decimal(5,0) unsigned not null comment '?H?????R?[?h'
759
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
760
  , NameString varchar(100) not null comment '????'
761
  , PublicFlg decimal(1,0) not null comment '?H?????t???O'
762
  , SecRank decimal(1,0) not null comment '?????????N'
763
  , ExpensesLink decimal(1,0) not null comment '?o??g?p??'
764
  , DeleteFlg decimal(1,0) not null comment '???t???O'
765
  , EntryDate datetime not null comment '?o?^???t'
766
  , UpdateDate datetime not null comment '?X?V???t'
767
  , constraint constructiontypemaster_PKC primary key (TypeCode)
768
) comment '?H?????}?X?^' ;
769

    
770
-- ?S??????o??f?[?^
771
drop table if exists costdataofperson cascade;
772

    
773
create table costdataofperson (
774
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
775
  , ActionDate date not null comment '?????t'
776
  , DataType decimal(1,0) not null comment '?f?[?^??'
777
  , DataAddCount decimal(5,0) unsigned not null comment '?f?[?^??????'
778
  , TargetMonth varchar(7) not null comment '???N??'
779
  , ConstructionCode decimal(10,0) unsigned comment '?H???R?[?h'
780
  , SuppliersCode decimal(5,0) unsigned not null comment '?x????R?[?h'
781
  , SuppliersName varchar(120) comment '?x??????'
782
  , PaymentContent varchar(60) comment '?x?????e'
783
  , PaymentType decimal(1,0) not null comment '?x?????@?t???O'
784
  , EntryPrice decimal(12,0) not null comment '???z?i????j'
785
  , EntryPriceInTax decimal(12,0) not null comment '???z?i????j'
786
  , SlipNumber varchar(12) comment '?`?[???'
787
  , ComplateFlg decimal(1,0) not null comment '???????t???O'
788
  , ApprovalFlg decimal(1,0) not null comment '???F?t???O'
789
  , EntryDate datetime not null comment '?o?^???t'
790
  , UpdateDate datetime not null comment '?X?V???t'
791
  , constraint costdataofperson_PKC primary key (PersonCode,ActionDate,DataType,DataAddCount)
792
) comment '?S??????o??f?[?^' ;
793

    
794
create index CostDataOfPerson_Index1
795
  on costdataofperson(TargetMonth);
796

    
797
create index CostDataOfPerson_Index2
798
  on costdataofperson(ConstructionCode);
799

    
800
-- ??????o?^?\???f?[?^
801
drop table if exists costomerregist cascade;
802

    
803
create table costomerregist (
804
  PersonCode decimal(8,0) unsigned not null comment '?\??????'
805
  , CreateDate date not null comment '????'
806
  , SeqNo decimal(2,0) not null comment '?L?[?A??'
807
  , DataMode decimal(1,0) not null comment '?f?[?^??'
808
  , SourceCotegory decimal(5,0) unsigned not null comment '???????'
809
  , SourceCode decimal(5,0) unsigned not null comment '??????R?[?h'
810
  , PetitionPeriod decimal(4,0) unsigned not null comment '?????'
811
  , OrderFlg decimal(1,0) not null comment '?@?l?c??E??l?t???O'
812
  , CorporateStatusName varchar(100) comment '?@?l?i????'
813
  , CorporateStatusPoint decimal(1,0) comment '?@?l?i?????u'
814
  , OrderersName1 varchar(60) not null comment '???????1'
815
  , OrderersName2 varchar(60) comment '????????Q'
816
  , DepartmentName varchar(60) comment '??????'
817
  , ChargePersonName varchar(60) comment '?S?????'
818
  , ZipCode varchar(8) comment '?X????'
819
  , Address1 varchar(60) comment '?Z???P'
820
  , Address2 varchar(60) comment '?Z??2'
821
  , Address3 varchar(60) comment '?Z??3'
822
  , PhoneNumber varchar(13) comment '?d?b???'
823
  , FaxNumber varchar(13) comment 'FAX???'
824
  , MailAddress varchar(257) comment '???[???A?h???X'
825
  , Note varchar(300) comment '???l'
826
  , OrderCotegory decimal(5,0) unsigned not null comment '???????'
827
  , OrderDate date not null comment '?\????'
828
  , OrderNo decimal(2,0) unsigned not null comment '?\????t???'
829
  , EntryDate datetime not null comment '?o?^???t'
830
  , UpdateDate datetime not null comment '?X?V???t'
831
  , constraint costomerregist_PKC primary key (PersonCode,CreateDate,SeqNo)
832
) comment '??????o?^?\???f?[?^' ;
833

    
834
create index CostomerRegist_Index1
835
  on costomerregist(PetitionPeriod);
836

    
837
-- ????f?[?^
838
drop table if exists dailydataconstruction cascade;
839

    
840
create table dailydataconstruction (
841
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
842
  , DailyDataDate date not null comment '???????'
843
  , ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
844
  , Weather varchar(60) comment '?V?C'
845
  , EntryDate datetime not null comment '?o?^???t'
846
  , UpdateDate datetime not null comment '?X?V???t'
847
  , constraint dailydataconstruction_PKC primary key (PersonCode,DailyDataDate,ConstructionCode)
848
) comment '????f?[?^' ;
849

    
850
create index DailyDataConstruction_Index1
851
  on dailydataconstruction(PersonCode);
852

    
853
create index DailyDataConstruction_Index2
854
  on dailydataconstruction(DailyDataDate);
855

    
856
create index DailyDataConstruction_Index3
857
  on dailydataconstruction(ConstructionCode);
858

    
859
-- ????f?[?^ (????)
860
drop table if exists dailydatadetail cascade;
861

    
862
create table dailydatadetail (
863
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
864
  , DailyDataDate date not null comment '???????'
865
  , ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
866
  , SeqNo decimal(3,0) unsigned not null comment '????s???'
867
  , JobCategoryCode decimal(5,0) not null comment '?E??L?['
868
  , CompanyCode decimal(8,0) not null comment '??????R?[?h'
869
  , TodayHeadCount decimal(4,1) not null comment '?????l????'
870
  , TotalHeadCount decimal(5,1) not null comment '??v?l????'
871
  , TodayWork varchar(100) comment '?????????e'
872
  , NextdayWork varchar(100) comment '?????????e'
873
  , NextdayHeadCount decimal(4,1) not null comment '?????l????'
874
  , EntryDate datetime not null comment '?o?^???t'
875
  , UpdateDate datetime not null comment '?X?V???t'
876
  , constraint dailydatadetail_PKC primary key (PersonCode,DailyDataDate,ConstructionCode,SeqNo)
877
) comment '????f?[?^ (????)' ;
878

    
879
create index DailyDataDetail_Index
880
  on dailydatadetail(PersonCode,DailyDataDate,ConstructionCode);
881

    
882
-- ????f?[?^ (??????)
883
drop table if exists dailydatafield cascade;
884

    
885
create table dailydatafield (
886
  PersonCode decimal(8,0) unsigned not null comment '????R?[?h'
887
  , DailyDataDate date not null comment '???????'
888
  , ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
889
  , SeqNo decimal(3,0) unsigned not null comment '????s???'
890
  , PatrolTime datetime not null comment '?????'
891
  , ContentsText varchar(200) comment '???e'
892
  , EntryDate datetime not null comment '?o?^???t'
893
  , UpdateDate datetime not null comment '?X?V???t'
894
  , constraint dailydatafield_PKC primary key (PersonCode,DailyDataDate,ConstructionCode,SeqNo)
895
) comment '????f?[?^ (??????)' ;
896

    
897
create index DailyDataField_Index
898
  on dailydatafield(PersonCode,DailyDataDate,ConstructionCode);
899

    
900
-- ????f?[?^ (????)
901
drop table if exists dailydatamaterials cascade;
902

    
903
create table dailydatamaterials (
904
  PersonCode decimal(8,0) unsigned not null comment '????R?[?h'
905
  , DailyDataDate date not null comment '???????'
906
  , ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
907
  , SeqNo decimal(3,0) unsigned not null comment '????s???'
908
  , Materials varchar(100) comment '?????'
909
  , Quantity varchar(100) comment '????'
910
  , Production varchar(100) comment '??????'
911
  , Delivery varchar(100) comment '?[?????'
912
  , QualityControl varchar(100) comment '?i?????????'
913
  , EntryDate datetime not null comment '?o?^???t'
914
  , UpdateDate datetime not null comment '?X?V???t'
915
  , constraint dailydatamaterials_PKC primary key (PersonCode,DailyDataDate,ConstructionCode,SeqNo)
916
) comment '????f?[?^ (????)' ;
917

    
918
create index DailyDataMaterials_Index
919
  on dailydatamaterials(PersonCode,DailyDataDate,ConstructionCode);
920

    
921
-- ????f?[?^ (??????w??)
922
drop table if exists dailydatasubcontractors cascade;
923

    
924
create table dailydatasubcontractors (
925
  PersonCode decimal(8,0) unsigned not null comment '????R?[?h'
926
  , DailyDataDate date not null comment '???????'
927
  , ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
928
  , SeqNo decimal(3,0) unsigned not null comment '????s???'
929
  , Attendee varchar(100) comment '?o???'
930
  , ContentsText varchar(200) comment '???e'
931
  , EntryDate datetime not null comment '?o?^???t'
932
  , UpdateDate datetime not null comment '?X?V???t'
933
  , constraint dailydatasubcontractors_PKC primary key (PersonCode,DailyDataDate,ConstructionCode,SeqNo)
934
) comment '????f?[?^ (??????w??)' ;
935

    
936
create index DailyDataSubcontractors_Index
937
  on dailydatasubcontractors(PersonCode,DailyDataDate,ConstructionCode);
938

    
939
-- ????f?[?^ (???)
940
drop table if exists dailydatavehicles cascade;
941

    
942
create table dailydatavehicles (
943
  PersonCode decimal(8,0) unsigned not null comment '????R?[?h'
944
  , DailyDataDate date not null comment '???????'
945
  , ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
946
  , SeqNo decimal(3,0) unsigned not null comment '????s???'
947
  , Model varchar(100) comment '?@??'
948
  , Performance varchar(100) comment '???\'
949
  , Owner varchar(100) comment '???L???'
950
  , Driver varchar(100) comment '?????^?]??'
951
  , StartWorkingTime datetime not null comment '??????J?n'
952
  , EndWorkingTime datetime not null comment '??????I??'
953
  , EntryDate datetime not null comment '?o?^???t'
954
  , UpdateDate datetime not null comment '?X?V???t'
955
  , constraint dailydatavehicles_PKC primary key (PersonCode,DailyDataDate,ConstructionCode,SeqNo)
956
) comment '????f?[?^ (???)' ;
957

958
create index DailyDataVehicles_Index
959
  on dailydatavehicles(PersonCode,DailyDataDate,ConstructionCode);
960

961
-- ???}?X?^
962
drop table if exists daymaster cascade;
963

964
create table daymaster (
965
  days smallint(6) not null comment '??'
966
) comment '???}?X?^' ;
967

968
create index day_Index1
969
  on daymaster(days);
970

971
-- ?????}?X?^
972
drop table if exists deadlinemaster cascade;
973

974
create table deadlinemaster (
975
  LABOURKIND decimal(1,0) default '0' not null comment '??????'
976
  , DEADLINE decimal(2,0) comment '????'
977
  , PAYDAY decimal(2,0) comment '?x????'
978
  , NOTE varchar(120) comment '???l'
979
  , DELETEFLG decimal(1,0) comment '???t???O'
980
  , ENTRYDATE datetime comment '?o?^???t'
981
  , UPDATEDATE datetime comment '?X?V???t'
982
  , constraint deadlinemaster_PKC primary key (LABOURKIND)
983
) comment '?????}?X?^' ;
984

985
-- ?????o???}?X?^
986
drop table if exists departmentexpensesmaster cascade;
987

988
create table departmentexpensesmaster (
989
  DepartmentCode decimal(5,0) unsigned not null comment '?????R?[?h'
990
  , ExpensesPeriod smallint(6) not null comment '?????'
991
  , NameCode decimal(5,0) unsigned not null comment '?o????R?[?h'
992
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
993
  , ExpensesRaito decimal(4,2) not null comment '?o??'
994
  , DeleteFlg decimal(1,0) not null comment '???t???O'
995
  , EntryDate datetime not null comment '?o?^???t'
996
  , UpdateDate datetime not null comment '?X?V???t'
997
  , constraint departmentexpensesmaster_PKC primary key (DepartmentCode,ExpensesPeriod,NameCode)
998
) comment '?????o???}?X?^' ;
999

1000
-- ?????}?X?^
1001
drop table if exists departmentmaster cascade;
1002

1003
create table departmentmaster (
1004
  DepartmentCode decimal(5,0) unsigned not null comment '?????R?[?h'
1005
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
1006
  , DepartmentString varchar(100) not null comment '??????'
1007
  , ActionScheduleFlg decimal(1,0) not null comment '?s???\??\???t???O'
1008
  , StaffAssignFlg decimal(1,0) not null comment '?l???z?u?\???t???O'
1009
  , DeleteFlg decimal(1,0) not null comment '???t???O'
1010
  , EntryDate datetime not null comment '?o?^???t'
1011
  , UpdateDate datetime not null comment '?X?V???t'
1012
  , constraint departmentmaster_PKC primary key (DepartmentCode)
1013
) comment '?????}?X?^' ;
1014

1015
create index DepartmentMaster_index1
1016
  on departmentmaster(DisplayOrder);
1017

1018
-- ?????m?F???F?f?[?^
1019
drop table if exists depositapprovalinfo cascade;
1020

1021
create table depositapprovalinfo (
1022
  ORDERERSDIVISION decimal(5,0) not null comment '???????'
1023
  , ORDERERSCODE decimal(5,0) not null comment '??????R?[?h'
1024
  , TARGETDATE decimal(6,0) not null comment '???N??'
1025
  , SEQNO decimal(3,0) not null comment '?A??'
1026
  , LINECOUNT decimal(3,0) not null comment '?s???'
1027
  , APPROVALNO decimal(3,0) not null comment '???F????'
1028
  , APPROVALPERSON decimal(8,0) comment '???F??R?[?h'
1029
  , APPROVALPERSONNAME varchar(20) comment '???F???'
1030
  , APPROVALAUTHORITY decimal(1,0) comment '???F??????'
1031
  , APPROVALDATE date comment '???F???t'
1032
  , ENTRYDATE datetime comment '?o?^???t'
1033
  , UPDATEDATE datetime comment '?X?V???t'
1034
  , constraint depositapprovalinfo_PKC primary key (ORDERERSDIVISION,ORDERERSCODE,TARGETDATE,SEQNO,LINECOUNT,APPROVALNO)
1035
) comment '?????m?F???F?f?[?^' ;
1036

1037
-- ?????f?[?^
1038
drop table if exists depositdata cascade;
1039

1040
create table depositdata (
1041
  ORDERERSDIVISION decimal(5,0) not null comment '???????'
1042
  , ORDERERSCODE decimal(5,0) not null comment '??????R?[?h'
1043
  , TARGETDATE decimal(6,0) not null comment '???N??'
1044
  , SEQNO decimal(3,0) not null comment '?A??'
1045
  , BUSINESSPERIOD decimal(4,0) comment '?c???'
1046
  , DEPOSITDATE date comment '??????'
1047
  , DEPOSITAMOUNT decimal(12,0) comment '???????z'
1048
  , DEPOSITAMOUNTCASH decimal(10,0) comment '???????z?i?????j'
1049
  , DEPOSITAMOUNTBILL decimal(10,0) comment '???????z?i??`?j'
1050
  , DEPOSITPERSONCODE decimal(8,0) not null comment '?????S????R?[?h'
1051
  , NOTE varchar(120) comment '???l'
1052
  , ENTRYDATE datetime comment '?o?^???t'
1053
  , UPDATEDATE datetime comment '?X?V???t'
1054
  , constraint depositdata_PKC primary key (ORDERERSDIVISION,ORDERERSCODE,TARGETDATE,SEQNO)
1055
) comment '?????f?[?^' ;
1056

1057
-- ????????f?[?^
1058
drop table if exists depositdatadetail cascade;
1059

1060
create table depositdatadetail (
1061
  ORDERERSDIVISION decimal(5,0) not null comment '???????'
1062
  , ORDERERSCODE decimal(5,0) not null comment '??????R?[?h'
1063
  , TARGETDATE decimal(6,0) not null comment '???N??'
1064
  , REQUESTNO decimal(10,0) not null comment '????No'
1065
  , ORDERNO decimal(2,0) comment '??t???'
1066
  , DEPOSITAMOUNT decimal(10,0) comment '???????z'
1067
  , DISCOUNTAMOUNT decimal(10,0) comment '?l???????z'
1068
  , CNSTRPRICE decimal(10,0) comment '?????'
1069
  , FEES decimal(10,0) comment '????'
1070
  , OTHERADJUSTMENTS decimal(10,0) comment '?????'
1071
  , DIFFERENCEAMOUNT decimal(10,0) comment '????'
1072
  , CONFIRMATIONPERSONCODE decimal(8,0) comment '?m?F?S????R?[?h'
1073
  , CONFIRMATIONDATE date comment '?S????m?F???t'
1074
  , CONFIRMATIONENDFLG decimal(1,0) comment '?m?F?????t???O'
1075
  , NOTE varchar(120) comment '???l'
1076
  , ENTRYDATE datetime comment '?o?^???t'
1077
  , UPDATEDATE datetime comment '?X?V???t'
1078
  , constraint depositdatadetail_PKC primary key (ORDERERSDIVISION,ORDERERSCODE,TARGETDATE,REQUESTNO)
1079
) comment '????????f?[?^' ;
1080

1081
-- ???}?X?^
1082
drop table if exists divisionmaster cascade;
1083

1084
create table divisionmaster (
1085
  DivisionCode decimal(5,0) unsigned not null comment '???R?[?h'
1086
  , NameCode decimal(5,0) unsigned not null comment '????R?[?h'
1087
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
1088
  , NameString varchar(100) not null comment '????'
1089
  , DeleteFlg decimal(1,0) not null comment '???t???O'
1090
  , EntryDate datetime not null comment '?o?^???t'
1091
  , UpdateDate datetime not null comment '?X?V???t'
1092
  , constraint divisionmaster_PKC primary key (DivisionCode,NameCode)
1093
) comment '???}?X?^' ;
1094

1095
-- ??Z?\?Z???f?[?^
1096
drop table if exists estimatebudget cascade;
1097

1098
create table estimatebudget (
1099
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1100
  , ConstructionTime decimal(5,2) unsigned not null comment '?H??'
1101
  , IntegratedCode decimal(8,0) not null comment '??Z??'
1102
  , DataCreateDate datetime not null comment '?f?[?^??????'
1103
  , RetValue1 decimal(12,0) not null comment '?\???i'
1104
  , RetValue2 decimal(12,0) not null comment '????H????'
1105
  , RetValue3 decimal(12,0) not null comment '????????????'
1106
  , RetValue4 decimal(12,0) not null comment '????????????'
1107
  , RetPercent decimal(5,2) not null comment '???????'
1108
  , EntryDate datetime not null comment '?o?^???t'
1109
  , UpdateDate datetime not null comment '?X?V???t'
1110
  , constraint estimatebudget_PKC primary key (ConstructionCode)
1111
) comment '??Z?\?Z???f?[?^' ;
1112

1113
-- ??Z?\?Z????f?[?^????
1114
drop table if exists estimatebudgetdetail cascade;
1115

1116
create table estimatebudgetdetail (
1117
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1118
  , GroupCount decimal(2,0) unsigned not null comment '?O???[?v???'
1119
  , LineCount decimal(3,0) unsigned not null comment '?s???'
1120
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
1121
  , ItemCode decimal(5,0) unsigned comment '?H??L?['
1122
  , CompanyCode decimal(8,0) not null comment '??????R?[?h'
1123
  , FirstString varchar(120) comment '???????'
1124
  , SecondString varchar(120) comment '?H????E???????'
1125
  , Content varchar(120) comment '???e'
1126
  , EstimatePrice decimal(12,0) not null comment '????????z'
1127
  , NegotiationPrice decimal(12,0) not null comment '????????z'
1128
  , Notes varchar(120) comment '???????'
1129
  , EntryDate datetime not null comment '?o?^???t'
1130
  , UpdateDate datetime not null comment '?X?V???t'
1131
  , constraint estimatebudgetdetail_PKC primary key (ConstructionCode,GroupCount,LineCount)
1132
) comment '??Z?\?Z????f?[?^????' ;
1133

1134
-- ??Z????f?[?^
1135
drop table if exists estimatedata cascade;
1136

1137
create table estimatedata (
1138
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1139
  , LineCount decimal(3,0) unsigned not null comment '?s???'
1140
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
1141
  , FixedItemCode varchar(1) comment '?????L?['
1142
  , ItemName varchar(120) comment '??????'
1143
  , SpecName varchar(120) comment '???^?i???E?`??E???@'
1144
  , PriceValue decimal(14,0) not null comment '???z'
1145
  , note varchar(60) comment '???l'
1146
  , MyExpensesFlg decimal(1,0) not null comment '????o??t???O'
1147
  , InputFlg decimal(1,0) not null comment '????t???O'
1148
  , EntryDate datetime not null comment '?o?^???t'
1149
  , UpdateDate datetime not null comment '?X?V???t'
1150
  , constraint estimatedata_PKC primary key (ConstructionCode,LineCount)
1151
) comment '??Z????f?[?^' ;
1152

1153
create index EstimateData_Index1
1154
  on estimatedata(ConstructionCode,FixedItemCode);
1155

1156
-- ??Z????y?[?W?f?[?^
1157
drop table if exists estimatedatabody cascade;
1158

1159
create table estimatedatabody (
1160
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1161
  , PageCount decimal(4,0) unsigned not null comment '?y?[?W???'
1162
  , Category decimal(1,0) not null comment '?y?[?W??'
1163
  , UnionComponentCode decimal(5,0) unsigned not null comment '?????\???L?['
1164
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
1165
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
1166
  , SelectComponent decimal(5,0) unsigned not null comment '?I???\???L?['
1167
  , PageTitle varchar(120) not null comment '?y?[?W?\????'
1168
  , DetailLineCount decimal(3,0) unsigned not null comment '????s???'
1169
  , EntryDate datetime not null comment '?o?^???t'
1170
  , UpdateDate datetime not null comment '?X?V???t'
1171
  , constraint estimatedatabody_PKC primary key (ConstructionCode,PageCount)
1172
) comment '??Z????y?[?W?f?[?^' ;
1173

1174
create index EstimateDataBody_Index1
1175
  on estimatedatabody(ConstructionCode,ComponentCode,ItemCode);
1176

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

1180
create table estimatedatadetail (
1181
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1182
  , PageCount decimal(4,0) unsigned not null comment '?y?[?W???'
1183
  , LineCount decimal(3,0) unsigned not null comment '?s???'
1184
  , DataType decimal(1,0) not null comment '?f?[?^???'
1185
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
1186
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
1187
  , SpecCode decimal(5,0) unsigned not null comment '???L?['
1188
  , ItemName varchar(120) comment '??????'
1189
  , SpecName varchar(120) comment '???^?i???E?`??E???@'
1190
  , Unitcount decimal(8,2) not null comment '????'
1191
  , UnitName varchar(30) comment '?P?????'
1192
  , UnitPrice decimal(9,2) not null comment '?P??'
1193
  , LineTotal decimal(12,0) not null comment '???z'
1194
  , note varchar(60) comment '???l'
1195
  , CompanyCode decimal(8,0) not null comment '??????R?[?h'
1196
  , MyExpensesFlg decimal(1,0) not null comment '????o??t???O'
1197
  , InputFlg decimal(1,0) comment '????t???O'
1198
  , EntryDate datetime not null comment '?o?^???t'
1199
  , UpdateDate datetime not null comment '?X?V???t'
1200
  , constraint estimatedatadetail_PKC primary key (ConstructionCode,PageCount,LineCount)
1201
) comment '??Z????f?[?^????' ;
1202

1203
create index EstimateDataDetail_Index1
1204
  on estimatedatadetail(ConstructionCode,PageCount);
1205

1206
-- ?o???}?X?^
1207
drop table if exists expensesmaster cascade;
1208

1209
create table expensesmaster (
1210
  DivisionCode smallint(6) not null comment '?H?????R?[?h'
1211
  , NameCode smallint(6) not null comment '?o????R?[?h'
1212
  , DisplayOrder smallint(6) not null comment '?\????'
1213
  , ExpensesRatio decimal(4,2) not null comment '?o??'
1214
  , DeleteFlg decimal(1,0) not null comment '???t???O'
1215
  , EntryDate datetime not null comment '?o?^???t'
1216
  , UpdateDate datetime not null comment '?X?V???t'
1217
  , constraint expensesmaster_PKC primary key (DivisionCode,NameCode)
1218
) comment '?o???}?X?^' ;
1219

1220
-- ???x???}?X?^
1221
drop table if exists holidaycalendermaster cascade;
1222

1223
create table holidaycalendermaster (
1224
  Holiday date not null comment '?x??'
1225
  , BusinessYear smallint(5) unsigned not null comment '?c??N?x'
1226
  , TargetMonth tinyint(3) unsigned not null comment '?Y????'
1227
  , TargetDay tinyint(3) unsigned not null comment '?Y????'
1228
  , constraint holidaycalendermaster_PKC primary key (Holiday)
1229
) comment '???x???}?X?^' ;
1230

1231
create index HolidayCalender_Index1
1232
  on holidaycalendermaster(BusinessYear);
1233

1234
create index HolidayCalenderMaster_Index2
1235
  on holidaycalendermaster(TargetMonth);
1236

1237
create index HolidayCalenderMaster_Index3
1238
  on holidaycalendermaster(TargetDay);
1239

1240
-- ?????????????
1241
drop table if exists inputsearchlogdata cascade;
1242

1243
create table inputsearchlogdata (
1244
  ConstructionCode decimal(10,0) not null comment '?H???R?[?h'
1245
  , UsedProcessNo decimal(4,0) not null comment '?g?p?@?\???'
1246
  , DisplayOrder decimal(4,0) unsigned not null comment '?\????'
1247
  , DataType decimal(1,0) not null comment '?f?[?^???'
1248
  , InputCode decimal(10,0) comment '????R?[?h'
1249
  , constraint inputsearchlogdata_PKC primary key (ConstructionCode,UsedProcessNo,DisplayOrder)
1250
) comment '?????????????' ;
1251

1252
create index InputSearchLogData_Index1
1253
  on inputsearchlogdata(ConstructionCode,UsedProcessNo,InputCode);
1254

1255
-- ???????f?[?^
1256
drop table if exists invoicedata cascade;
1257

1258
create table invoicedata (
1259
  INVOICENO decimal(9,0) not null comment '??????No'
1260
  , ORDERERSDIVISION decimal(5,0) not null comment '???????'
1261
  , ORDERERSCODE decimal(5,0) not null comment '??????R?[?h'
1262
  , REQUESTMONTH decimal(6,0) not null comment '??????'
1263
  , SEQNO decimal(2,0) not null comment '?A??'
1264
  , CRETATEDATE date not null comment '????'
1265
  , REQUESTDATE date not null comment '??????'
1266
  , REQUESTNAME varchar(120) comment '??????'
1267
  , TOTALAMOUNT decimal(10,0) comment '???????v???z'
1268
  , TAXAMOUNT decimal(10,0) comment '???????z'
1269
  , COMMENT1 varchar(60) comment '?R?????g1'
1270
  , COMMENT2 varchar(60) comment '?R?????g2'
1271
  , COMMENT3 varchar(60) not null comment '?R?????g3'
1272
  , COMMENT4 varchar(60) not null comment '?R?????g4'
1273
  , COMMENT5 varchar(60) not null comment '?R?????g5'
1274
  , COMPLETEFLG decimal(1,0) default '0' not null comment '?????t???O'
1275
  , ENTRYDATE datetime not null comment '?o?^?N????'
1276
  , UPDATEDATE datetime not null comment '?X?V?N????'
1277
  , constraint invoicedata_PKC primary key (INVOICENO)
1278
) comment '???????f?[?^' ;
1279

1280
alter table invoicedata add unique ORDERERSDIVISION (ORDERERSDIVISION,ORDERERSCODE,REQUESTMONTH,SEQNO) ;
1281

1282
-- ??????
1283
drop table if exists materialinfo cascade;
1284

1285
create table materialinfo (
1286
  MATERIALITEMCODE smallint(5) unsigned default 0 not null comment '????i??R?[?h'
1287
  , MATERIALCOUNT smallint(5) unsigned comment '?????'
1288
  , RENTCOUNT smallint(5) unsigned comment '??o??\??'
1289
  , DELETEFLG smallint(5) unsigned comment '???t???O'
1290
  , ENTRYDATE datetime comment '?o?^???t'
1291
  , UPDATEDATE datetime comment '?X?V???t'
1292
  , constraint materialinfo_PKC primary key (MATERIALITEMCODE)
1293
) comment '??????' ;
1294

1295
-- ????i??}?X?^
1296
drop table if exists materialitemmaster cascade;
1297

1298
create table materialitemmaster (
1299
  MATERIALITEMCODE smallint(5) unsigned default 0 not null comment '????i??R?[?h'
1300
  , MATERIALKINDCODE smallint(5) unsigned comment '??????R?[?h'
1301
  , MATERIALITEMNAME varchar(40) comment '????i?????'
1302
  , DISPLAYORDER smallint(5) unsigned comment '?\????'
1303
  , DELETEFLG tinyint(3) unsigned comment '???t???O'
1304
  , ENTRYDATE datetime comment '?o?^???t'
1305
  , UPDATEDATE datetime comment '?X?V???t'
1306
  , VERSIONNO decimal(8,0) default '0' not null comment '?o?[?W???????'
1307
  , constraint materialitemmaster_PKC primary key (MATERIALITEMCODE)
1308
) comment '????i??}?X?^' ;
1309

1310
-- ??????}?X?^
1311
drop table if exists materialkindmaster cascade;
1312

1313
create table materialkindmaster (
1314
  MATERIALKINDCODE smallint(5) unsigned default 0 not null comment '??????R?[?h'
1315
  , MATERIALKINDNAME varchar(40) comment '?????????'
1316
  , DISPLAYORDER smallint(5) unsigned comment '?\????'
1317
  , DELETEFLG tinyint(3) unsigned comment '???t???O'
1318
  , ENTRYDATE datetime comment '?o?^???t'
1319
  , UPDATEDATE datetime comment '?X?V???t'
1320
  , constraint materialkindmaster_PKC primary key (MATERIALKINDCODE)
1321
) comment '??????}?X?^' ;
1322

1323
-- ??????????
1324
drop table if exists materialrecordinfo cascade;
1325

1326
create table materialrecordinfo (
1327
  MATERIALITEMCODE smallint(5) unsigned default 0 not null comment '????i??R?[?h'
1328
  , PROCESSDATE date default '0000-00-00' not null comment '?????N????'
1329
  , SEQNO smallint(5) unsigned default 0 not null comment '?A??'
1330
  , RECKIND tinyint(3) unsigned comment '???R?[?h??'
1331
  , CONSTRUCTIONCODE int(10) unsigned comment '?H?????'
1332
  , PERSONCODE int(10) unsigned comment '?S????R?[?h'
1333
  , MATERIALCOUNT smallint(5) unsigned comment '?????'
1334
  , REPAYPLANDATE date comment '??p?\??N????'
1335
  , COMMENTTEXT varchar(80) comment '?R?????g'
1336
  , ENTRYDATE datetime comment '?o?^???t'
1337
  , UPDATEDATE datetime comment '?X?V???t'
1338
  , constraint materialrecordinfo_PKC primary key (MATERIALITEMCODE,PROCESSDATE,SEQNO)
1339
) comment '??????????' ;
1340

1341
-- ?f??????b?Z?[?W
1342
drop table if exists messageboarddata cascade;
1343

1344
create table messageboarddata (
1345
  RecordNumber decimal(6,0) unsigned not null comment '???R?[?h???'
1346
  , BranchNumber decimal(3,0) unsigned not null comment '???R?[?h?}??'
1347
  , FromCode decimal(8,0) unsigned not null comment '???????R?[?h'
1348
  , FromName varchar(60) not null comment '???????'
1349
  , MessageTitile varchar(100) comment '?`???^?C?g??'
1350
  , MessageContent varchar(1333) not null comment '?`?????e'
1351
  , LinkType decimal(2,0) not null comment '?????N????^?C?v'
1352
  , LinkMessage varchar(200) comment '?????N??????'
1353
  , LinkCode varchar(30) comment '?????N?L?['
1354
  , WritingDate datetime not null comment '?????????'
1355
  , PersonCode decimal(8,0) not null comment '??????S????R?[?h'
1356
  , ShareFlag decimal(2,0) not null comment '???????t???O'
1357
  , MessageColor varchar(8) comment '?????F'
1358
  , BackColor varchar(8) comment '?o?b?N?J???['
1359
  , MessageFlag decimal(1,0) not null comment '???b?Z?[?W?t???O'
1360
  , EntryDate datetime not null comment '?o?^???t'
1361
  , UpdateDate datetime not null comment '?X?V???t'
1362
  , constraint messageboarddata_PKC primary key (RecordNumber,BranchNumber)
1363
) comment '?f??????b?Z?[?W' ;
1364

1365
create index MessageBoardData_Index1
1366
  on messageboarddata(WritingDate);
1367

1368
create index MessageBoardData_Index2
1369
  on messageboarddata(MessageFlag);
1370

1371
-- ?f???????e?[?u??
1372
drop table if exists messageboardterget cascade;
1373

1374
create table messageboardterget (
1375
  RecordNumber decimal(6,0) unsigned not null comment '???R?[?h???'
1376
  , BranchNumber decimal(3,0) unsigned not null comment '???R?[?h?}??'
1377
  , SeqNum decimal(3,0) unsigned not null comment '????'
1378
  , ToCode decimal(8,0) not null comment '????R?[?h'
1379
  , ToName varchar(60) not null comment '????'
1380
  , EntryDate datetime not null comment '?o?^???t'
1381
  , UpdateDate datetime not null comment '?X?V???t'
1382
  , constraint messageboardterget_PKC primary key (RecordNumber,BranchNumber,SeqNum)
1383
) comment '?f???????e?[?u??' ;
1384

1385
create index MessageBoardTerget_Index1
1386
  on messageboardterget(RecordNumber,BranchNumber);
1387

1388
-- ?f??????b?Z?[?W?{??????
1389
drop table if exists messagebrowsinghistory cascade;
1390

1391
create table messagebrowsinghistory (
1392
  RecordNumber decimal(6,0) unsigned not null comment '???R?[?h???'
1393
  , BranchNumber decimal(3,0) unsigned not null comment '???R?[?h?}??'
1394
  , SeqNum decimal(3,0) unsigned not null comment '????'
1395
  , BrowsingCode decimal(8,0) not null comment '?{????R?[?h'
1396
  , BrowsingDate datetime not null comment '?{?????t'
1397
  , EntryDate datetime not null comment '?o?^???t'
1398
  , UpdateDate datetime not null comment '?X?V???t'
1399
  , constraint messagebrowsinghistory_PKC primary key (RecordNumber,BranchNumber,SeqNum)
1400
) comment '?f??????b?Z?[?W?{??????' ;
1401

1402
-- ???}?X?^
1403
drop table if exists monthmaster cascade;
1404

1405
create table monthmaster (
1406
  month smallint(6) not null comment '??'
1407
) comment '???}?X?^' ;
1408

1409
create index month_Index1
1410
  on monthmaster(month);
1411

1412
-- ??????}?X?^
1413
drop table if exists orderersmaster cascade;
1414

1415
create table orderersmaster (
1416
  OrderCotegory decimal(5,0) unsigned not null comment '???????'
1417
  , OrderersCode decimal(5,0) unsigned not null comment '??????R?[?h'
1418
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
1419
  , OrderFlg decimal(1,0) not null comment '?@?l?c??E??l?t???O'
1420
  , CorporateStatusName varchar(100) comment '?@?l?i????'
1421
  , CorporateStatusPoint decimal(1,0) comment '?@?l?i?????u'
1422
  , OrderersName1 varchar(60) not null comment '???????1'
1423
  , OrderersName2 varchar(60) comment '????????Q'
1424
  , DepartmentName varchar(60) comment '??????'
1425
  , ChargePersonName varchar(60) comment '?S?????'
1426
  , ZipCode varchar(8) comment '?X????'
1427
  , Address1 varchar(60) comment '?Z???P'
1428
  , Address2 varchar(60) comment '?Z??2'
1429
  , Address3 varchar(60) comment '?Z??3'
1430
  , PhoneNumber varchar(13) comment '?d?b???'
1431
  , FaxNumber varchar(13) comment 'FAX???'
1432
  , MailAddress varchar(257) comment '???[???A?h???X'
1433
  , Note varchar(300) comment '???l'
1434
  , DeleteFlg decimal(1,0) not null comment '???t???O'
1435
  , EntryDate datetime not null comment '?o?^???t'
1436
  , UpdateDate datetime not null comment '?X?V???t'
1437
  , constraint orderersmaster_PKC primary key (OrderCotegory,OrderersCode)
1438
) comment '??????}?X?^' ;
1439

1440
-- ????z?f?[?^
1441
drop table if exists orderspricedata cascade;
1442

1443
create table orderspricedata (
1444
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1445
  , ChangeNo decimal(3,0) unsigned not null comment '??X???'
1446
  , ChangeDate date not null comment '??X??'
1447
  , ChangePersonCode decimal(8,0) unsigned not null comment '??X??R?[?h'
1448
  , ChangePersonName varchar(60) comment '??X???'
1449
  , BeforeValue decimal(14,0) not null comment '??X?O???????z'
1450
  , BeforeValueInTax decimal(14,0) not null comment '??X?O???????z'
1451
  , AfterValue decimal(14,0) not null comment '??X????????z'
1452
  , AfterValueInTax decimal(14,0) not null comment '??X????????z'
1453
  , ChangeComment varchar(200) comment '??X???R'
1454
  , EntryDate datetime not null comment '?o?^???t'
1455
  , UpdateDate datetime not null comment '?X?V???t'
1456
  , constraint orderspricedata_PKC primary key (ConstructionCode,ChangeNo)
1457
) comment '????z?f?[?^' ;
1458

1459
-- ?x?????F???f?[?^
1460
drop table if exists paymentapprovalinfo cascade;
1461

1462
create table paymentapprovalinfo (
1463
  COMPANYCODE decimal(8,0) default '0' not null comment '??????R?[?h'
1464
  , TARGETDATE decimal(6,0) default '0' not null comment '???N??'
1465
  , SEQNO decimal(3,0) default '0' not null comment '?A??'
1466
  , LINECOUNT decimal(3,0) default '0' not null comment '?s???'
1467
  , APPROVALNO decimal(3,0) default '0' not null comment '???F????'
1468
  , APPROVALPERSON decimal(8,0) comment '???F??R?[?h'
1469
  , APPROVALPERSONNAME varchar(20) comment '???F???'
1470
  , APPROVALAUTHORITY decimal(1,0) comment '???F??????'
1471
  , APPROVALDATE date comment '???F???t'
1472
  , ENTRYDATE datetime comment '?o?^???t'
1473
  , UPDATEDATE datetime comment '?X?V???t'
1474
  , constraint paymentapprovalinfo_PKC primary key (COMPANYCODE,TARGETDATE,SEQNO,LINECOUNT,APPROVALNO)
1475
) comment '?x?????F???f?[?^' ;
1476

1477
-- ?x??????f?[?^
1478
drop table if exists paymentdatadetail cascade;
1479

1480
create table paymentdatadetail (
1481
  COMPANYCODE decimal(8,0) default '0' not null comment '??????R?[?h'
1482
  , TARGETDATE decimal(6,0) default '0' not null comment '???N??'
1483
  , SEQNO decimal(3,0) default '0' not null comment '?A??'
1484
  , LINECOUNT decimal(3,0) default '0' not null comment '?s???'
1485
  , BILLPRICE decimal(10,0) comment '???????z'
1486
  , DISCOUNTPRICE decimal(10,0) comment '?l???????z'
1487
  , OFFSETPRICE decimal(10,0) comment '???E???z'
1488
  , NEXTCOPRICE decimal(10,0) comment '????J?z'
1489
  , HIGHWPRICE decimal(10,0) comment '??????'
1490
  , HARDWPRICE decimal(10,0) comment '??????'
1491
  , INDSWASTETAX decimal(10,0) comment '?Y?p??'
1492
  , CNSTRPRICE decimal(10,0) comment '?????'
1493
  , CNSTRPRICEEXIST decimal(1,0) comment '??????L??'
1494
  , APPROVALPERSONCODE decimal(8,0) comment '???F?S????R?[?h'
1495
  , APPROVALDATE date comment '?S??????F???t'
1496
  , APPROVALENDFLG decimal(1,0) comment '???F?????t???O'
1497
  , ENTRYDATE datetime comment '?o?^???t'
1498
  , UPDATEDATE datetime comment '?X?V???t'
1499
  , constraint paymentdatadetail_PKC primary key (COMPANYCODE,TARGETDATE,SEQNO,LINECOUNT)
1500
) comment '?x??????f?[?^' ;
1501

1502
-- ?S??????F?f?[?^
1503
drop table if exists personapproval cascade;
1504

1505
create table personapproval (
1506
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
1507
  , ApprovalCode decimal(3,0) unsigned not null comment '???F?@?\???'
1508
  , OrderDate date not null comment '??t??'
1509
  , OrderNo decimal(2,0) unsigned not null comment '??t???'
1510
  , SeqNo decimal(2,0) not null comment '?}??'
1511
  , PersonCodeApproval decimal(8,0) unsigned not null comment '?\???E???F??R?[?h'
1512
  , PetitionApprovalDate datetime not null comment '?\???E???F???t'
1513
  , ApprovalLimitDates datetime not null comment '???F??]??'
1514
  , ApprovalStatus decimal(1,0) not null comment '???F???'
1515
  , InputComment varchar(300) comment '?R?????g'
1516
  , EntryDate datetime not null comment '?o?^???t'
1517
  , UpdateDate datetime not null comment '?X?V???t'
1518
  , constraint personapproval_PKC primary key (PersonCode,ApprovalCode,OrderDate,OrderNo,SeqNo)
1519
) comment '?S??????F?f?[?^' ;
1520

1521
-- ?S??????F?R?????g?f?[?^
1522
drop table if exists personapprovalcomment cascade;
1523

1524
create table personapprovalcomment (
1525
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
1526
  , ApprovalCode decimal(3,0) unsigned not null comment '???F?@?\???'
1527
  , OrderDate date not null comment '??t??'
1528
  , OrderNo decimal(2,0) unsigned not null comment '??t???'
1529
  , CommentNo decimal(2,0) not null comment '?R?????g???'
1530
  , ParentNo decimal(2,0) not null comment '?e?R?????g???'
1531
  , ApproValComment varchar(300) comment '?w???E?A???R?????g'
1532
  , EntryDate datetime not null comment '?o?^???t'
1533
  , UpdateDate datetime not null comment '?X?V???t'
1534
  , constraint personapprovalcomment_PKC primary key (PersonCode,ApprovalCode,OrderDate,OrderNo,CommentNo)
1535
) comment '?S??????F?R?????g?f?[?^' ;
1536

1537
-- ?S??????????}?X?^
1538
drop table if exists persondepartmentmaster cascade;
1539

1540
create table persondepartmentmaster (
1541
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
1542
  , DepartmentCode decimal(5,0) unsigned not null comment '?????R?[?h'
1543
  , AffiliationFlg decimal(1,0) not null comment '?????t???O'
1544
  , EntryDate datetime not null comment '?o?^???t'
1545
  , UpdateDate datetime not null comment '?X?V???t'
1546
  , constraint persondepartmentmaster_PKC primary key (PersonCode,DepartmentCode)
1547
) comment '?S??????????}?X?^' ;
1548

1549
create index PersonDepartmentMaster_Index1
1550
  on persondepartmentmaster(PersonCode);
1551

1552
create index PersonDepartmentMaster_Index2
1553
  on persondepartmentmaster(DepartmentCode);
1554

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

1558
create table personinchargemaster (
1559
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
1560
  , DisplayOrder decimal(8,0) unsigned not null comment '?\????'
1561
  , PersonName varchar(60) not null comment '?S?????'
1562
  , StartDate date not null comment '?g?p?J?n?N????'
1563
  , EndDate date comment '?g?p?I???N????'
1564
  , PassWord varchar(16) comment '?p?X???[?h'
1565
  , SecurityManagement decimal(1,0) not null comment '?@????'
1566
  , SecCode decimal(2,0) unsigned not null comment '???????'
1567
  , MsgBackColor varchar(8) comment '???b?Z?[?W?w?i?F'
1568
  , DisplayString varchar(20) comment '?\???E???????'
1569
  , DepartmentCode decimal(5,0) unsigned comment '?????R?[?h'
1570
  , MonthlySalary decimal(11,0) not null comment '???????z'
1571
  , YearSalary decimal(12,0) not null comment '?N????z'
1572
  , Qualification varchar(120) comment '???i?????'
1573
  , SealPrintName varchar(5) comment '???\????'
1574
  , EmployeeClassFlg decimal(1,0) not null comment '?????'
1575
  , LedgerFlg decimal(1,0) not null comment '???v?Z???t???O'
1576
  , CommutingDistance decimal(5,2) not null comment '??????'
1577
  , CommuteCosts decimal(5,0) not null comment '??????'
1578
  , DeleteFlg decimal(1,0) not null comment '???t???O'
1579
  , EntryDate datetime not null comment '?o?^???t'
1580
  , UpdateDate datetime not null comment '?X?V???t'
1581
  , constraint personinchargemaster_PKC primary key (PersonCode)
1582
) comment '?S????}?X?^' ;
1583

1584
create index PersonInChargeMaster_Index1
1585
  on personinchargemaster(StartDate);
1586

1587
create index PersonInChargeMaster_Index2
1588
  on personinchargemaster(DepartmentCode);
1589

1590
-- ?S??????^?}?X?^
1591
drop table if exists personsalarymaster cascade;
1592

1593
create table personsalarymaster (
1594
  PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
1595
  , StartDate date not null comment '?g?p?J?n?N????'
1596
  , MonthlySalary decimal(11,0) not null comment '???????z'
1597
  , YearSalary decimal(12,0) not null comment '?N????z'
1598
  , EntryDate datetime not null comment '?o?^???t'
1599
  , UpdateDate datetime not null comment '?X?V???t'
1600
  , constraint personsalarymaster_PKC primary key (PersonCode,StartDate)
1601
) comment '?S??????^?}?X?^' ;
1602

1603
create index PersonSalaryMaster_Index1
1604
  on personsalarymaster(PersonCode);
1605

1606
create index PersonSalaryMaster_Index2
1607
  on personsalarymaster(StartDate);
1608

1609
-- ?w???????f?[?^
1610
drop table if exists pointingoutcomment cascade;
1611

1612
create table pointingoutcomment (
1613
  ConstructionCode decimal(10,0) not null comment '?H???R?[?h'
1614
  , ProcessNo smallint(6) not null comment '????????i??????j'
1615
  , SeqNo smallint(6) not null comment '????'
1616
  , PageCount smallint(6) not null comment '?y?[?W???'
1617
  , PersonCode decimal(8,0) not null comment '?L????R?[?h'
1618
  , DrowColor varchar(8) comment '?`??F'
1619
  , CommentMessage varchar(1000) comment '???b?Z?[?W'
1620
  , StartPointX smallint(6) not null comment '?w?E?????u?w'
1621
  , StartPointY smallint(6) not null comment '?w?E?????u?x'
1622
  , CurrentPointX smallint(6) not null comment '??????u?w'
1623
  , CurrentPointY smallint(6) not null comment '??????u?x'
1624
  , CurrentWidth smallint(6) not null comment '?\???T?C?YWidth'
1625
  , CurrentHeight smallint(6) not null comment '?\???T?C?YHeigth'
1626
  , EntryDate datetime not null comment '?o?^???t'
1627
  , UpdateDate datetime not null comment '?X?V???t'
1628
  , constraint pointingoutcomment_PKC primary key (ConstructionCode,ProcessNo,SeqNo)
1629
) comment '?w???????f?[?^' ;
1630

1631
-- ?????????????c???^?f?[?^
1632
drop table if exists proceedingsdata cascade;
1633

1634
create table proceedingsdata (
1635
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1636
  , ProceedingsDataDate date not null comment '?c???^????'
1637
  , StartMeetingTime decimal(4,0) unsigned not null comment '??c????J?n'
1638
  , EndMeetingTime decimal(4,0) unsigned not null comment '??c????I??'
1639
  , CreatorCode decimal(8,0) not null comment '????R?[?h'
1640
  , PalceFlag decimal(1,0) not null comment '???n?t???O'
1641
  , MeetingPalce varchar(120) comment '???????'
1642
  , EntryDate datetime not null comment '?o?^???t'
1643
  , UpdateDate datetime not null comment '?X?V???t'
1644
  , constraint proceedingsdata_PKC primary key (ConstructionCode,ProceedingsDataDate,StartMeetingTime)
1645
) comment '?????????????c???^?f?[?^' ;
1646

1647
-- ?????????????c???^?f?[?^?i?o???j
1648
drop table if exists proceedingsdataattend cascade;
1649

1650
create table proceedingsdataattend (
1651
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1652
  , ProceedingsDataDate date not null comment '?c???^????'
1653
  , StartMeetingTime decimal(4,0) unsigned not null comment '??c????J?n'
1654
  , SeqNo decimal(3,0) unsigned not null comment '????s???'
1655
  , Department varchar(20) comment '?o??????'
1656
  , AttendName varchar(10) comment '?o??????'
1657
  , EntryDate datetime not null comment '?o?^???t'
1658
  , UpdateDate datetime not null comment '?X?V???t'
1659
  , constraint proceedingsdataattend_PKC primary key (ConstructionCode,ProceedingsDataDate,StartMeetingTime,SeqNo)
1660
) comment '?????????????c???^?f?[?^?i?o???j' ;
1661

1662
-- ?????????????c???^?f?[?^?i?o???j
1663
drop table if exists proceedingsdataattendee cascade;
1664

1665
create table proceedingsdataattendee (
1666
  PersonCode decimal(8,0) not null comment '????R?[?h'
1667
  , ProceedingsDataDate date not null comment '?c???^????'
1668
  , ConstructionCode int(11) not null comment '?H?????'
1669
  , SeqNo smallint(6) not null comment '?f?[?^?s???'
1670
  , Department varchar(100) comment '?o??????'
1671
  , AttendeeName varchar(100) comment '?o??????'
1672
  , EntryDate datetime not null comment '?o?^?N????'
1673
  , UpdateDate datetime not null comment '?X?V?N????'
1674
  , constraint proceedingsdataattendee_PKC primary key (PersonCode,ProceedingsDataDate,ConstructionCode,SeqNo)
1675
) comment '?????????????c???^?f?[?^?i?o???j' ;
1676

1677
-- ?????????????c???^?f?[?^?i????j
1678
drop table if exists proceedingsdatadetail cascade;
1679

1680
create table proceedingsdatadetail (
1681
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1682
  , ProceedingsDataDate date not null comment '?c???^????'
1683
  , StartMeetingTime decimal(4,0) unsigned not null comment '??c????J?n'
1684
  , SeqNo decimal(3,0) unsigned not null comment '????s???'
1685
  , TitleNo varchar(5) comment '?c????'
1686
  , Title varchar(20) comment '?c??'
1687
  , ContentsText varchar(50) comment '???e'
1688
  , EntryDate datetime not null comment '?o?^???t'
1689
  , UpdateDate datetime not null comment '?X?V???t'
1690
  , constraint proceedingsdatadetail_PKC primary key (ConstructionCode,ProceedingsDataDate,StartMeetingTime,SeqNo)
1691
) comment '?????????????c???^?f?[?^?i????j' ;
1692

1693
-- ???F?f?[?^
1694
drop table if exists processapproval cascade;
1695

1696
create table processapproval (
1697
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1698
  , ApprovalCode decimal(3,0) unsigned not null comment '???F?@?\???'
1699
  , OrderNo decimal(2,0) unsigned not null comment '??t???'
1700
  , SeqNo decimal(2,0) not null comment '?}??'
1701
  , PersonCode decimal(8,0) unsigned not null comment '?\???E???F??R?[?h'
1702
  , PetitionApprovalDate datetime not null comment '?\???E???F???t'
1703
  , ApprovalLimitDates datetime not null comment '???F??]??'
1704
  , ApprovalStatus decimal(1,0) not null comment '???F???'
1705
  , InputComment varchar(300) comment '?R?????g'
1706
  , EntryDate datetime not null comment '?o?^???t'
1707
  , UpdateDate datetime not null comment '?X?V???t'
1708
  , constraint processapproval_PKC primary key (ConstructionCode,ApprovalCode,OrderNo,SeqNo)
1709
) comment '???F?f?[?^' ;
1710

1711
-- ???F?R?????g?f?[?^
1712
drop table if exists processapprovalcomment cascade;
1713

1714
create table processapprovalcomment (
1715
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1716
  , ApprovalCode decimal(3,0) unsigned not null comment '???F?@?\???'
1717
  , OrderNo decimal(2,0) unsigned not null comment '??t???'
1718
  , CommentNo decimal(2,0) not null comment '?R?????g???'
1719
  , ParentNo decimal(2,0) not null comment '?e?R?????g???'
1720
  , ApproValComment varchar(300) comment '?w???E?A???R?????g'
1721
  , EntryDate datetime not null comment '?o?^???t'
1722
  , UpdateDate datetime not null comment '?X?V???t'
1723
  , constraint processapprovalcomment_PKC primary key (ConstructionCode,ApprovalCode,OrderNo,CommentNo)
1724
) comment '???F?R?????g?f?[?^' ;
1725

1726
-- ???F????f?[?^
1727
drop table if exists processapprovaldetail cascade;
1728

1729
create table processapprovaldetail (
1730
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1731
  , ApprovalCode decimal(3,0) unsigned not null comment '???F?@?\???'
1732
  , OrderNo decimal(2,0) unsigned not null comment '??t???'
1733
  , SerialNo decimal(2,0) unsigned not null comment '?}??'
1734
  , LinkCode decimal(10,0) not null comment '?????N???'
1735
  , EntryDate datetime not null comment '?o?^???t'
1736
  , UpdateDate datetime not null comment '?X?V???t'
1737
  , constraint processapprovaldetail_PKC primary key (ConstructionCode,ApprovalCode,OrderNo,SerialNo)
1738
) comment '???F????f?[?^' ;
1739

1740
-- ?N?????}?X?^
1741
drop table if exists processexcutemaster cascade;
1742

1743
create table processexcutemaster (
1744
  SecCode decimal(2,0) unsigned not null comment '???????'
1745
  , ExecCode decimal(4,0) unsigned not null comment '?N?????????'
1746
  , EditFlg decimal(1,0) not null comment '??W?t???O'
1747
  , EntryDate datetime not null comment '?o?^???t'
1748
  , UpdateDate datetime not null comment '?X?V???t'
1749
  , constraint processexcutemaster_PKC primary key (SecCode,ExecCode)
1750
) comment '?N?????}?X?^' ;
1751

1752
create index ProcessExcuteMaster_Index1
1753
  on processexcutemaster(SecCode);
1754

1755
create index ProcessExcuteMaster_Index2
1756
  on processexcutemaster(ExecCode);
1757

1758
-- ???????f?[?^
1759
drop table if exists purchaseorder cascade;
1760

1761
create table purchaseorder (
1762
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1763
  , SeqNo decimal(3,0) unsigned not null comment '???????}??'
1764
  , CompanyCode decimal(8,0) not null comment '??????R?[?h'
1765
  , CreateDate date comment '?????t'
1766
  , OrderPrice decimal(12,0) not null comment '???????z'
1767
  , LastRowStringDate date not null comment '??I?s?\?????t'
1768
  , OrderSheetType decimal(1,0) not null comment '???E?{???t???O'
1769
  , PaymentTerms decimal(1,0) not null comment '?x????????'
1770
  , CashRatio decimal(4,1) not null comment '?????????i???j'
1771
  , BillPeriod decimal(4,0) not null comment '??`????'
1772
  , PrePayments decimal(1,0) not null comment '?O????'
1773
  , PrePaymentsDays decimal(3,0) not null comment '?O????????'
1774
  , PrePaymentsPrice decimal(12,0) not null comment '?O???????z'
1775
  , PartialPayment decimal(1,0) not null comment '??????'
1776
  , PartialPaymentMounth decimal(2,0) unsigned not null comment '???????????'
1777
  , PartialPaymentDay1 decimal(2,0) unsigned not null comment '???????????'
1778
  , PartialPaymentDay2 decimal(2,0) unsigned not null comment '???????x????'
1779
  , PartialPaymentPrice decimal(12,0) not null comment '?????????z'
1780
  , CompletionPayment decimal(1,0) not null comment '???n??????x??'
1781
  , CompletionPaymentDays decimal(3,0) unsigned not null comment '???n??????x??????'
1782
  , CompletionPaymentPrice decimal(12,0) not null comment '???n??????x?????z'
1783
  , LeadEngineerCode decimal(8,0) comment '??C?Z?p??R?[?h'
1784
  , LeadEngineerName varchar(60) comment 'LeadEngineerName'
1785
  , SafetyOfficerCode decimal(8,0) comment '???S?????R?[?h'
1786
  , SafetyOfficerName varchar(60) comment '???S??????'
1787
  , WorkersCount decimal(3,0) unsigned comment '??????'
1788
  , PrintoutDate date not null comment '????N????'
1789
  , EntryDate datetime not null comment '?o?^???t'
1790
  , UpdateDate datetime not null comment '?X?V???t'
1791
  , constraint purchaseorder_PKC primary key (ConstructionCode,SeqNo)
1792
) comment '???????f?[?^' ;
1793

1794
-- ?????????t?f?[?^
1795
drop table if exists purchaseorderdate cascade;
1796

1797
create table purchaseorderdate (
1798
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1799
  , SeqNo decimal(3,0) unsigned not null comment '???????}??'
1800
  , CompanyCode decimal(8,0) not null comment '??????R?[?h'
1801
  , SendDate date not null comment '???????X????'
1802
  , ReturnDate date not null comment '???????????'
1803
  , ReturnCheckDate date not null comment '??????????m?F??'
1804
  , EntryDate datetime not null comment '?o?^???t'
1805
  , UpdateDate datetime not null comment '?X?V???t'
1806
  , constraint purchaseorderdate_PKC primary key (ConstructionCode,SeqNo)
1807
) comment '?????????t?f?[?^' ;
1808

1809
-- ??????????f?[?^
1810
drop table if exists purchaseorderdetail cascade;
1811

1812
create table purchaseorderdetail (
1813
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1814
  , SeqNo decimal(3,0) unsigned not null comment '???????}??'
1815
  , GroupCount decimal(1,0) not null comment '?O???[?v???'
1816
  , LineCount decimal(3,0) unsigned not null comment '?s???'
1817
  , ComponentCode decimal(5,0) unsigned not null comment '?\???L?['
1818
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
1819
  , FirstString varchar(120) comment '?H??E?i??'
1820
  , SecondString varchar(120) comment '???e????'
1821
  , UnitCount decimal(8,2) not null comment '????'
1822
  , UnitName varchar(30) comment '?P??'
1823
  , UnitPrice decimal(10,0) not null comment '?P??'
1824
  , OrdersLinePrice decimal(12,0) comment '???z'
1825
  , SourceCode decimal(10,0) unsigned not null comment '?\?Z?????H?????'
1826
  , SourceLineCnt decimal(3,0) unsigned not null comment '?????????????s???'
1827
  , EntryDate datetime not null comment '?o?^???t'
1828
  , UpdateDate datetime not null comment '?X?V???t'
1829
  , constraint purchaseorderdetail_PKC primary key (ConstructionCode,SeqNo,GroupCount,LineCount)
1830
) comment '??????????f?[?^' ;
1831

1832
create index POrderDetail_Index1
1833
  on purchaseorderdetail(SourceCode);
1834

1835
-- ?????f?[?^
1836
drop table if exists requestdata cascade;
1837

1838
create table requestdata (
1839
  REQUESTNO decimal(9,0) not null comment '????No'
1840
  , MAINCONSTRUCTIONCODE decimal(10,0) not null comment '?{?H?????'
1841
  , CONSTRUCTIONNAME varchar(120) not null comment '?H??????'
1842
  , CONTRACTAMOUNT decimal(10,0) not null comment '???????z'
1843
  , PAIDAMOUNT decimal(10,0) not null comment '????????z'
1844
  , REQUESTAMOUNT0 decimal(10,0) not null comment '???????z?O'
1845
  , REQUESTAMOUNT1 decimal(10,0) not null comment '???????z?P'
1846
  , REQUESTAMOUNT2 decimal(10,0) comment '???????z?Q'
1847
  , REQUESTAMOUNT3 decimal(10,0) comment '???????z?R'
1848
  , REQUESTAMOUNT4 decimal(10,0) comment '???????z?S'
1849
  , REQUESTAMOUNT5 decimal(10,0) comment '???????z?T'
1850
  , REQUESTAMOUNT6 decimal(10,0) comment '???????z?U'
1851
  , UNCLAIMEDAMOUNT decimal(10,0) not null comment '?????c???z'
1852
  , UNPAIDAMOUNT decimal(10,0) not null comment '?????????z'
1853
  , TAXAMOUNT decimal(10,0) not null comment '?????'
1854
  , NOTE varchar(120) not null comment '???l'
1855
  , ENTRYDATE datetime not null comment '?o?^?N????'
1856
  , UPDATEDATE datetime not null comment '?X?V?N????'
1857
  , constraint requestdata_PKC primary key (REQUESTNO,MAINCONSTRUCTIONCODE)
1858
) comment '?????f?[?^' ;
1859

1860
-- ?????f?[?^????
1861
drop table if exists requestdatadetail cascade;
1862

1863
create table requestdatadetail (
1864
  REQUESTNO decimal(9,0) not null comment '????No'
1865
  , MAINCONSTRUCTIONCODE decimal(10,0) not null comment '?{?H?????'
1866
  , CONSTRUCTIONCODE decimal(10,0) not null comment '?H?????'
1867
  , CONSTRUCTIONKIND decimal(1,0) not null comment '?H????'
1868
  , REQUESTAMOUNT decimal(10,0) not null comment '???????z'
1869
  , TAXAMOUNT decimal(10,0) not null comment '?????'
1870
  , ENTRYDATE datetime not null comment '?o?^?N????'
1871
  , UPDATEDATE datetime not null comment '?X?V?N????'
1872
  , constraint requestdatadetail_PKC primary key (REQUESTNO,MAINCONSTRUCTIONCODE,CONSTRUCTIONCODE,CONSTRUCTIONKIND)
1873
) comment '?????f?[?^????' ;
1874

1875
-- ?????w?b?_
1876
drop table if exists requesthead cascade;
1877

1878
create table requesthead (
1879
  REQUESTNO decimal(9,0) not null comment '????No'
1880
  , REQCONSTRUCTIONCODE decimal(10,0) not null comment '?????H?????'
1881
  , ORDERNO decimal(2,0) not null comment '??t???'
1882
  , REQUESTMONTH decimal(6,0) not null comment '??????'
1883
  , ORDERERSDIVISION decimal(5,0) not null comment '???????'
1884
  , ORDERERSCODE decimal(5,0) not null comment '??????R?[?h'
1885
  , ORDERERSNAME varchar(120) not null comment '???????'
1886
  , REQCONSTRUCTIONNAME varchar(120) not null comment '?????H??????'
1887
  , REQUESTTOTALAMOUNT decimal(10,0) not null comment '???????z???v'
1888
  , REQUESTAMOUNT decimal(10,0) not null comment '???????z'
1889
  , TAXAMOUNT decimal(10,0) not null comment '?????'
1890
  , UNPAIDAMOUNT decimal(10,0) comment '??????'
1891
  , NOTE varchar(120) comment '???l'
1892
  , ASSIGNEDFLG decimal(1,0) comment '??????t???O'
1893
  , INVOICENO decimal(9,0) not null comment '??????No'
1894
  , ENTRYDATE datetime not null comment '?o?^?N????'
1895
  , UPDATEDATE datetime not null comment '?X?V?N????'
1896
  , constraint requesthead_PKC primary key (REQUESTNO)
1897
) comment '?????w?b?_' ;
1898

1899
alter table requesthead add unique REQCONSTRUCTIONCODE (REQCONSTRUCTIONCODE,ORDERNO) ;
1900

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

1904
create table requestorderdate (
1905
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1906
  , InvoiceNo decimal(9,0) not null comment '??????No'
1907
  , SendDate date not null comment '???????????X????'
1908
  , EntryDate datetime not null comment '?o?^???t'
1909
  , UpdateDate datetime not null comment '?X?V???t'
1910
  , constraint requestorderdate_PKC primary key (ConstructionCode,InvoiceNo)
1911
) comment '?????????t?f?[?^' ;
1912

1913
-- ????O???t?f?[?^
1914
drop table if exists salesgraphdata cascade;
1915

1916
create table salesgraphdata (
1917
  GraphDataCode decimal(8,0) not null comment '?O???t?f?[?^?R?[?h'
1918
  , ConstructionPeriod decimal(4,0) unsigned not null comment '?????'
1919
  , SalesDataDays date not null comment '????N??'
1920
  , DisplayOrder decimal(8,0) unsigned not null comment '?\????'
1921
  , DataName varchar(100) not null comment '?f?[?^?\??????'
1922
  , SalesAmount decimal(10,0) not null comment '????f?[?^'
1923
  , AdministrativeExpense decimal(10,0) not null comment '???E?????o??'
1924
  , GrossProfit decimal(10,0) not null comment '?e???v'
1925
  , NetIncome decimal(10,0) not null comment '?????v(???v)'
1926
  , EntryDate datetime not null comment '?o?^???t'
1927
  , UpdateDate datetime not null comment '?X?V???t'
1928
  , constraint salesgraphdata_PKC primary key (GraphDataCode,ConstructionPeriod,SalesDataDays)
1929
) comment '????O???t?f?[?^' ;
1930

1931
create index SalesGraphData_Idx1
1932
  on salesgraphdata(DisplayOrder);
1933

1934
create index SalesGraphData_idx2
1935
  on salesgraphdata(ConstructionPeriod);
1936

1937
-- ?????}?X?^
1938
drop table if exists securitymaster cascade;
1939

1940
create table securitymaster (
1941
  SecCode decimal(2,0) unsigned not null comment '???????'
1942
  , DisplayOrder decimal(2,0) not null comment '?\????'
1943
  , SecName varchar(60) not null comment '????????'
1944
  , SecRank decimal(1,0) not null comment '?????????N'
1945
  , SecRange decimal(1,0) not null comment '???????'
1946
  , GeneralAffairs decimal(1,0) not null comment '????????t???O'
1947
  , SelectBackColor varchar(8) not null comment '?I??w?i?F'
1948
  , EntryDate datetime not null comment '?o?^???t'
1949
  , UpdateDate datetime not null comment '?X?V???t'
1950
  , constraint securitymaster_PKC primary key (SecCode)
1951
) comment '?????}?X?^' ;
1952

1953
create index SecurityMaster_Index1
1954
  on securitymaster(DisplayOrder);
1955

1956
create index SecurityMaster_Index2
1957
  on securitymaster(SecRank);
1958

1959
create index SecurityMaster_Index3
1960
  on securitymaster(SecRange);
1961

1962
-- ???S?p?g???[???f?[?^
1963
drop table if exists sfpdata cascade;
1964

1965
create table sfpdata (
1966
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1967
  , DataCount decimal(2,0) unsigned not null comment '?p?g???[????'
1968
  , RequestDate datetime not null comment '?p?g???[???v??????'
1969
  , PersonCode decimal(8,0) unsigned not null comment '?\????R?[?h'
1970
  , StringValue varchar(300) comment '?R?????g'
1971
  , OrderNo decimal(2,0) unsigned not null comment '?\????t???'
1972
  , EntryDate datetime not null comment '?o?^???t'
1973
  , UpdateDate datetime not null comment '?X?V???t'
1974
  , constraint sfpdata_PKC primary key (ConstructionCode,DataCount)
1975
) comment '???S?p?g???[???f?[?^' ;
1976

1977
create index SFPData_Index1
1978
  on sfpdata(RequestDate);
1979

1980
-- ???S?p?g???[??????f?[?^
1981
drop table if exists sfpdatadetail cascade;
1982

1983
create table sfpdatadetail (
1984
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
1985
  , DataCount decimal(2,0) unsigned not null comment '?p?g???[????'
1986
  , SeqNo decimal(2,0) unsigned not null comment '?f?[?^?}??'
1987
  , CompanyCode decimal(8,0) unsigned not null comment '??????R?[?h'
1988
  , EntryDate datetime not null comment '?o?^???t'
1989
  , UpdateDate datetime not null comment '?X?V???t'
1990
  , constraint sfpdatadetail_PKC primary key (ConstructionCode,DataCount,SeqNo)
1991
) comment '???S?p?g???[??????f?[?^' ;
1992

1993
-- ??????{?H?H??o?^?\???f?[?^
1994
drop table if exists subconstrjobitemregist cascade;
1995

1996
create table subconstrjobitemregist (
1997
  PersonCode decimal(8,0) unsigned not null comment '?\??????'
1998
  , CreateDate date not null comment '????'
1999
  , SeqNo decimal(2,0) unsigned not null comment '?\???A??'
2000
  , DisplayOrder decimal(8,0) unsigned not null comment '?\????'
2001
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
2002
  , EntryDate datetime not null comment '?o?^???t'
2003
  , UpdateDate datetime not null comment '?X?V???t'
2004
  , constraint subconstrjobitemregist_PKC primary key (PersonCode,CreateDate,SeqNo,DisplayOrder)
2005
) comment '??????{?H?H??o?^?\???f?[?^' ;
2006

2007
-- ??????E?????N?o?^?\???f?[?^
2008
drop table if exists subconstrjoblinkregist cascade;
2009

2010
create table subconstrjoblinkregist (
2011
  PersonCode decimal(8,0) unsigned not null comment '?\??????'
2012
  , CreateDate date not null comment '????'
2013
  , SeqNo decimal(2,0) unsigned not null comment '?\???A??'
2014
  , DisplayOrder decimal(8,0) unsigned not null comment '?\????'
2015
  , JobCategoryCode decimal(5,0) not null comment '?E??L?['
2016
  , EntryDate datetime not null comment '?o?^???t'
2017
  , UpdateDate datetime not null comment '?X?V???t'
2018
  , constraint subconstrjoblinkregist_PKC primary key (PersonCode,CreateDate,SeqNo,DisplayOrder)
2019
) comment '??????E?????N?o?^?\???f?[?^' ;
2020

2021
-- ??????o?^?\???f?[?^
2022
drop table if exists subconstrregist cascade;
2023

2024
create table subconstrregist (
2025
  PersonCode decimal(8,0) unsigned not null comment '?\??????'
2026
  , CreateDate date not null comment '????'
2027
  , SeqNo decimal(2,0) unsigned not null comment '?\???A??'
2028
  , DataMode decimal(1,0) comment '?f?[?^??'
2029
  , SourceCode decimal(8,0) not null comment '??????R?[?h'
2030
  , PetitionPeriod decimal(4,0) unsigned not null comment '?\???N?x'
2031
  , CorporateStatusName varchar(40) comment '?@?l?i????'
2032
  , CorporateStatusPoint decimal(1,0) not null comment '?@?l?i?????u'
2033
  , CompanyName varchar(100) not null comment '???????'
2034
  , CEOPositionName varchar(60) comment '??\???E??'
2035
  , CEOName varchar(60) comment '??\?????'
2036
  , ContactPersonName varchar(60) comment '?S???????'
2037
  , ZipCode varchar(8) comment '?X????'
2038
  , Address1 varchar(60) comment '?Z???P'
2039
  , Address2 varchar(60) comment '?Z??2'
2040
  , Address3 varchar(60) comment '?Z??3'
2041
  , CellPhoneNumber varchar(13) comment '?g??d?b???'
2042
  , MailAddress varchar(257) comment '???[???A?h???X'
2043
  , PhoneNumber varchar(13) comment '?d?b???'
2044
  , FaxNumber varchar(13) comment 'FAX???'
2045
  , JapaneseSyllabary varchar(2) comment '50?????'
2046
  , StartDate date not null comment '????J?n?N????'
2047
  , Note varchar(300) comment '???l'
2048
  , labourKind decimal(1,0) not null comment '?x???????E????'
2049
  , OrderDate date comment '?\????'
2050
  , OrderNo decimal(2,0) unsigned not null comment '?\????t???'
2051
  , EntryDate datetime not null comment '?o?^???t'
2052
  , UpdateDate datetime not null comment '?X?V???t'
2053
  , constraint subconstrregist_PKC primary key (PersonCode,CreateDate,SeqNo)
2054
) comment '??????o?^?\???f?[?^' ;
2055

2056
-- ??????H??}?X?^
2057
drop table if exists subcontractoritemmaster cascade;
2058

2059
create table subcontractoritemmaster (
2060
  ItemCode decimal(5,0) unsigned not null comment '?H??L?['
2061
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2062
  , ItemName varchar(120) not null comment '?H????'
2063
  , DeleteFlg decimal(1,0) not null comment '???t???O'
2064
  , EntryDate datetime not null comment '?o?^???t'
2065
  , UpdateDate datetime not null comment '?X?V???t'
2066
  , constraint subcontractoritemmaster_PKC primary key (ItemCode)
2067
) comment '??????H??}?X?^' ;
2068

2069
-- ??????E??}?X?^
2070
drop table if exists subcontractorjobcategory cascade;
2071

2072
create table subcontractorjobcategory (
2073
  JobCategoryCode decimal(5,0) not null comment '?E??L?['
2074
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2075
  , JobCategoryName varchar(120) not null comment '?E????'
2076
  , DeleteFlg decimal(1,0) not null comment '???t???O'
2077
  , EntryDate datetime not null comment '?o?^???t'
2078
  , UpdateDate datetime not null comment '?X?V???t'
2079
  , constraint subcontractorjobcategory_PKC primary key (JobCategoryCode)
2080
) comment '??????E??}?X?^' ;
2081

2082
-- ??????{?H?H??f?[?^
2083
drop table if exists subcontractorjobitem cascade;
2084

2085
create table subcontractorjobitem (
2086
  CompanyCode decimal(8,0) not null comment '??????R?[?h'
2087
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
2088
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2089
  , EntryDate datetime not null comment '?o?^???t'
2090
  , UpdateDate datetime not null comment '?X?V???t'
2091
  , constraint subcontractorjobitem_PKC primary key (CompanyCode,ItemCode)
2092
) comment '??????{?H?H??f?[?^' ;
2093

2094
create index SubContractorJobItem_Index1
2095
  on subcontractorjobitem(CompanyCode);
2096

2097
create index SubContractorJobItem_Index2
2098
  on subcontractorjobitem(ItemCode);
2099

2100
-- ??????E?????N?}?X?^
2101
drop table if exists subcontractorjoblink cascade;
2102

2103
create table subcontractorjoblink (
2104
  CompanyCode decimal(8,0) not null comment '??????R?[?h'
2105
  , JobCategoryCode decimal(5,0) not null comment '?E??L?['
2106
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2107
  , EntryDate datetime not null comment '?o?^???t'
2108
  , UpdateDate datetime not null comment '?X?V???t'
2109
  , constraint subcontractorjoblink_PKC primary key (CompanyCode,JobCategoryCode)
2110
) comment '??????E?????N?}?X?^' ;
2111

2112
create index SubContractorJobLink_Index1
2113
  on subcontractorjoblink(CompanyCode);
2114

2115
create index SubContractorJobLink_Index2
2116
  on subcontractorjoblink(JobCategoryCode);
2117

2118
-- ??????}?X?^
2119
drop table if exists subcontractormaster cascade;
2120

2121
create table subcontractormaster (
2122
  CompanyCode decimal(8,0) not null comment '??????R?[?h'
2123
  , DisplayOrder decimal(8,0) unsigned not null comment '?\????'
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
  , DeleteFlg decimal(1,0) default '0' not null comment '???t???O'
2143
  , EntryDate datetime not null comment '?o?^???t'
2144
  , UpdateDate datetime not null comment '?X?V???t'
2145
  , constraint subcontractormaster_PKC primary key (CompanyCode)
2146
) comment '??????}?X?^' ;
2147

2148
create index SubContractorMaster_Index1
2149
  on subcontractormaster(JapaneseSyllabary);
2150

2151
-- ?d????}?X?^
2152
drop table if exists suppliersmaster cascade;
2153

2154
create table suppliersmaster (
2155
  SuppliersCode decimal(5,0) unsigned not null comment '?d????R?[?h'
2156
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2157
  , SuppliersName1 varchar(60) not null comment '?d????1'
2158
  , SuppliersName2 varchar(60) comment '?d?????Q'
2159
  , ZipCode varchar(8) comment '?X????'
2160
  , Address1 varchar(60) comment '?Z???P'
2161
  , Address2 varchar(60) comment '?Z??2'
2162
  , Address3 varchar(60) comment '?Z??3'
2163
  , PhoneNumber varchar(13) comment '?d?b???'
2164
  , FaxNumber varchar(13) comment 'FAX???'
2165
  , Note varchar(300) comment '???l'
2166
  , DeleteFlg decimal(1,0) not null comment '???t???O'
2167
  , EntryDate datetime not null comment '?o?^???t'
2168
  , UpdateDate datetime not null comment '?X?V???t'
2169
  , constraint suppliersmaster_PKC primary key (SuppliersCode)
2170
) comment '?d????}?X?^' ;
2171

2172
-- ?V?X?e???N???m?F?f?[?^
2173
drop table if exists systemexecute cascade;
2174

2175
create table systemexecute (
2176
  PrimaryCode tinyint(4) not null comment '?L?[????'
2177
  , TargetDate date not null comment '?N?????t'
2178
  , SystemVersion int(11) not null comment '?{??E????o?[?W????'
2179
  , UpDateCopyVersion int(11) not null comment '?R?s?[?o?[?W????'
2180
  , EntryDate datetime not null comment '?o?^???t'
2181
  , UpdateDate datetime not null comment '?X?V???t'
2182
  , constraint systemexecute_PKC primary key (PrimaryCode)
2183
) comment '?V?X?e???N???m?F?f?[?^' ;
2184

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

2188
create table systemmaster (
2189
  SystemCode decimal(3,0) unsigned not null comment '???R?[?h'
2190
  , CompanyName1 varchar(60) not null comment '?????P'
2191
  , CompanyName2 varchar(60) comment '?????Q'
2192
  , CEOName varchar(60) not null comment '??\?????'
2193
  , CEOPositionName varchar(60) comment '??\???E??'
2194
  , ZipCode varchar(8) not null comment '?X????'
2195
  , Address1 varchar(60) not null comment '?Z???P'
2196
  , Address2 varchar(60) comment '?Z??2'
2197
  , Address3 varchar(60) comment '?Z??3'
2198
  , PhoneNumber varchar(13) not null comment '?d?b???'
2199
  , FaxNumber varchar(13) comment 'FAX???'
2200
  , HomePageURL varchar(120) comment '?z?[???y?[?WURL'
2201
  , ConstructionExpenses decimal(4,2) not null comment '?H?????o??'
2202
  , OfficeExpenses decimal(4,2) not null comment '???????o??'
2203
  , OperatingExpenses decimal(4,2) not null comment '?c??o??'
2204
  , ConsumptionTax decimal(4,2) not null comment '?????'
2205
  , CooperationRate decimal(4,2) not null comment '???????'
2206
  , StatutoryWelfareRate decimal(4,2) not null comment '?@???????'
2207
  , FuelPrice decimal(5,2) not null comment '?R???L???P??'
2208
  , AreaDistance decimal(5,2) not null comment '????u????????'
2209
  , ExcelSavePath varchar(120) comment 'Excel????p?X'
2210
  , BusinessPeriod smallint(6) not null comment '????c?????'
2211
  , ConstructionYear smallint(6) not null comment '????H???N?x'
2212
  , BusinessBeginningDate varchar(5) not null comment '?c????????'
2213
  , ConstructionBeginningDate varchar(5) not null comment '?H???N?x?????'
2214
  , ConstructionNoBase decimal(1,0) not null comment '?H????????l'
2215
  , SloganString1 varchar(100) comment '?W??1'
2216
  , SloganString2 varchar(100) comment '?W??2'
2217
  , SloganString3 varchar(100) comment '?W??3'
2218
  , EntryDate datetime not null comment '?o?^???t'
2219
  , UpdateDate datetime not null comment '?X?V???t'
2220
  , constraint systemmaster_PKC primary key (SystemCode)
2221
) comment '????}?X?^' ;
2222

2223
-- ?????}?X?^
2224
drop table if exists termmaster cascade;
2225

2226
create table termmaster (
2227
  ConstructionStatusFlg decimal(2,0) not null comment '?H?????t???O'
2228
  , FieldNo decimal(2,0) not null comment '?`?F?b?N???t?B?[???h???'
2229
  , SeqNo decimal(2,0) not null comment '?}??'
2230
  , DisplayOrder decimal(2,0) not null comment '?\????'
2231
  , CheckSchdule decimal(1,0) not null comment '?`?F?b?N?^?C?~???O'
2232
  , TermDays decimal(3,0) not null comment '?o???'
2233
  , SendTitile varchar(100) comment '?^?C?g??'
2234
  , SendMessage varchar(100) comment '???b?Z?[?W'
2235
  , BackColor varchar(8) comment '?w?i?F'
2236
  , ForeColor varchar(8) comment '?????F'
2237
  , EntryDate datetime not null comment '?o?^???t'
2238
  , UpdateDate datetime not null comment '?X?V???t'
2239
  , constraint termmaster_PKC primary key (ConstructionStatusFlg,FieldNo,SeqNo)
2240
) comment '?????}?X?^' ;
2241

2242
create index TermMaster_Index1
2243
  on termmaster(DisplayOrder);
2244

2245
-- ?o?????f?[?^
2246
drop table if exists tranceportdailydata cascade;
2247

2248
create table tranceportdailydata (
2249
  PersonCode decimal(8,0) unsigned not null comment '????R?[?h'
2250
  , AttendanceDate date not null comment '???????'
2251
  , StartDistance decimal(7,1) not null comment '?????o???L????'
2252
  , ComplateDistance decimal(7,1) not null comment '?????I???L????'
2253
  , TotalDistance decimal(6,1) not null comment '???????v?L????'
2254
  , OfficeGoFlg decimal(1,0) not null comment '???????o??t???O'
2255
  , OfficeOutFlg decimal(1,0) not null comment '???????A??t???O'
2256
  , TrancePayGoFlg decimal(1,0) not null comment '?L?????o??t???O'
2257
  , TrancePayOutFlg decimal(1,0) not null comment '?L?????A??t???O'
2258
  , WareHouseFlg decimal(1,0) not null comment '????u??t???O'
2259
  , EntryDate datetime not null comment '?o?^???t'
2260
  , UpdateDate datetime not null comment '?X?V???t'
2261
  , constraint tranceportdailydata_PKC primary key (PersonCode,AttendanceDate)
2262
) comment '?o?????f?[?^' ;
2263

2264
create index TranceportDailyData_Index1
2265
  on tranceportdailydata(AttendanceDate);
2266

2267
-- ?H?????o???}?X?^
2268
drop table if exists typeexpensesmaster cascade;
2269

2270
create table typeexpensesmaster (
2271
  TypeCode decimal(5,0) unsigned not null comment '?H?????R?[?h'
2272
  , ExpensesPeriod smallint(6) not null comment '?????'
2273
  , NameCode decimal(5,0) unsigned not null comment '?o????R?[?h'
2274
  , ExpensesRaito decimal(4,2) not null comment '?o??'
2275
  , DeleteFlg decimal(1,0) not null comment '???t???O'
2276
  , EntryDate datetime not null comment '?o?^???t'
2277
  , UpdateDate datetime not null comment '?X?V???t'
2278
  , constraint typeexpensesmaster_PKC primary key (TypeCode,ExpensesPeriod,NameCode)
2279
) comment '?H?????o???}?X?^' ;
2280

2281
-- ?P??}?X?^
2282
drop table if exists unitmaster cascade;
2283

2284
create table unitmaster (
2285
  UnitKey decimal(5,0) unsigned not null comment '?P??L?['
2286
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2287
  , UnitName varchar(30) not null comment '?P?????'
2288
  , EntryDate datetime not null comment '?o?^???t'
2289
  , UpdateDate datetime not null comment '?X?V???t'
2290
  , constraint unitmaster_PKC primary key (UnitKey)
2291
) comment '?P??}?X?^' ;
2292

2293
create index UnitMaster_Index1
2294
  on unitmaster(DisplayOrder);
2295

2296
-- ????}?X?^
2297
drop table if exists vehiclemaster cascade;
2298

2299
create table vehiclemaster (
2300
  VehicleCode decimal(5,0) unsigned not null comment '????R?[?h'
2301
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2302
  , VehicleName varchar(100) not null comment '???????'
2303
  , RegistrationNumber varchar(30) comment '?o?^???'
2304
  , IdentificationNumber varchar(30) comment '?????'
2305
  , ModelCode varchar(30) comment '?^??'
2306
  , DepartmentCode decimal(5,0) unsigned not null comment '???????'
2307
  , VehicleScheduleFlg decimal(1,0) not null comment '????\??\???t???O'
2308
  , PurchaseDate date comment '?w????'
2309
  , PurchaseName varchar(30) comment '?w????'
2310
  , PurchaseContactPersons varchar(30) comment '?w????S????'
2311
  , PurchasePhone varchar(13) comment '?w????d?b???'
2312
  , LeaseDate date comment '???[?X?J?n??'
2313
  , LeaseDestination varchar(30) comment '???[?X??'
2314
  , LeaseContactPersons varchar(30) comment '???[?X??S????'
2315
  , LeasePhone varchar(13) comment '???[?X??d?b???'
2316
  , InsuranceCompany varchar(30) comment '?C???????'
2317
  , InsuranceContactPersons varchar(30) comment '?C???????S????'
2318
  , InsurancePhone varchar(13) comment '?C???????d?b???'
2319
  , Note varchar(300) comment '???l'
2320
  , EntryDate datetime comment '?o?^???t'
2321
  , UpdateDate datetime comment '?X?V???t'
2322
  , constraint vehiclemaster_PKC primary key (VehicleCode)
2323
) comment '????}?X?^' ;
2324

2325
-- ????L?^?f?[?^
2326
drop table if exists vehiclerecorddata cascade;
2327

2328
create table vehiclerecorddata (
2329
  VehicleCode decimal(5,0) unsigned not null comment '????R?[?h'
2330
  , DivisionCode decimal(2,0) unsigned not null comment '?f?[?^??'
2331
  , SeqNo decimal(2,0) not null comment '?}??'
2332
  , RecordDate date comment '???n??'
2333
  , Mileage mediumint(9) comment '???s????'
2334
  , Content varchar(100) comment '???e'
2335
  , PaymentCost decimal(10,0) comment '??p'
2336
  , EntryDate datetime not null comment '?o?^???t'
2337
  , UpdateDate datetime not null comment '?X?V???t'
2338
  , constraint vehiclerecorddata_PKC primary key (VehicleCode,DivisionCode,SeqNo)
2339
) comment '????L?^?f?[?^' ;
2340

2341
-- ????\??f?[?^
2342
drop table if exists vehiclescheduledata cascade;
2343

2344
create table vehiclescheduledata (
2345
  TargetDate date not null comment '????'
2346
  , VehicleCode decimal(5,0) unsigned not null comment '????R?[?h'
2347
  , MorningAfternoon decimal(1,0) not null comment '??O?E???'
2348
  , PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
2349
  , TargetYear year(4) not null comment '?Y???N'
2350
  , TargetMonth tinyint(3) unsigned not null comment '?Y????'
2351
  , TargetDay year(4) not null comment '?Y????'
2352
  , EntryDate datetime not null comment '?o?^???t'
2353
  , UpdateDate datetime not null comment '?X?V???t'
2354
  , constraint vehiclescheduledata_PKC primary key (TargetDate,VehicleCode,MorningAfternoon)
2355
) comment '????\??f?[?^' ;
2356

2357
create index VehicleScheduleData_Index1
2358
  on vehiclescheduledata(TargetYear);
2359

2360
create index VehicleScheduleData_Index2
2361
  on vehiclescheduledata(TargetMonth);
2362

2363
create index VehicleScheduleData_Index3
2364
  on vehiclescheduledata(TargetDay);
2365

2366
-- ?N?}?X?^
2367
drop table if exists yearmaster cascade;
2368

2369
create table yearmaster (
2370
  years smallint(6) not null comment '?N'
2371
) comment '?N?}?X?^' ;
2372

2373
create index year_Index1
2374
  on yearmaster(years);
2375

2376