プロジェクト

全般

プロフィール

統計
| リビジョン:

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

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

1
-- Project Name : noname
2
-- Date/Time    : 2018/06/19 8:22:40
3
-- Author       : Horiuchi
4
-- RDBMS Type   : MySQL
5
-- Application  : A5:SQL Mk-2
6

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
370
-- ????????}?X?^
371
drop table if exists commoncostlarge cascade;
372

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

    
384
-- ?????H???A?}?X?^
385
drop table if exists commoncostlinkms cascade;
386

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

    
396
-- ?????????}?X?^
397
drop table if exists commoncostmiddle cascade;
398

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

    
411
-- ?????????L?[?}?X?^
412
drop table if exists commoncostmiddlesearchword cascade;
413

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

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

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

    
436
create index ComponentLinkMaster_Index1
437
  on componentlinkmaster(ComponentCode);
438

    
439
create index ComponentLinkMaster_Index2
440
  on componentlinkmaster(ItemCode);
441

    
442
-- ?\???}?X?^
443
drop table if exists componentmaster cascade;
444

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

    
458
create index ComponentMaster_Index1
459
  on componentmaster(DisplayOrder);
460

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

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

    
473
create index ComponentToTypeMaster_Index1
474
  on componenttotypemaster(ComponentCode);
475

    
476
create index ComponentToTypeMaster_Index2
477
  on componenttotypemaster(TypeCode);
478

    
479
-- ?H???????o??f?[?^
480
drop table if exists constrledgerexpenses cascade;
481

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

    
493
create index ConstrLedgerExpenses_Index1
494
  on constrledgerexpenses(ConstructionCode);
495

    
496
create index ConstrLedgerExpenses_Index2
497
  on constrledgerexpenses(SeqNo);
498

    
499
create index ConstrLedgerExpenses_Index3
500
  on constrledgerexpenses(NameCode);
501

    
502
-- ?H????{???
503
drop table if exists constructionbaseinfo cascade;
504

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

    
567
create index BaseInfo_Index1
568
  on constructionbaseinfo(ConstructionStatusFlg);
569

    
570
create index BaseInfo_Index2
571
  on constructionbaseinfo(EstimateType);
572

    
573
create index BaseInfo_Index3
574
  on constructionbaseinfo(SalesPersonCode);
575

    
576
create index BaseInfo_Index4
577
  on constructionbaseinfo(ConstructionPersonCode);
578

    
579
create index BaseInfo_Index5
580
  on constructionbaseinfo(ConstructionInstructor);
581

    
582
create index BaseInfo_Index6
583
  on constructionbaseinfo(ConstructionPeriod);
584

    
585
-- ?H????{????
586
drop table if exists constructionbaseinfodetail cascade;
587

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

    
597
create index BaseInfoDetail_Idx1
598
  on constructionbaseinfodetail(ConstructionCode);
599

    
600
create index BaseInfoDetail_Idx2
601
  on constructionbaseinfodetail(DetailNo);
602

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

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

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

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

    
659
-- ?H??}?X?^
660
drop table if exists constructionitemmaster cascade;
661

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

    
674
-- ?H???????f?[?^
675
drop table if exists constructionledger cascade;
676

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

    
701
create index constructionledger_Index1
702
  on constructionledger(ConstructionStart);
703

    
704
create index constructionledger_Index2
705
  on constructionledger(ConstructionEnd);
706

    
707
-- ?H??????????f?[?^
708
drop table if exists constructionledgerdetail cascade;
709

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

    
741
create index LedgerDetail_Index01
742
  on constructionledgerdetail(ConstructionCode);
743

    
744
create index LedgerDetail_Index02
745
  on constructionledgerdetail(GroupCount);
746

    
747
create index LedgerDetail_Index03
748
  on constructionledgerdetail(LineCount);
749

    
750
create index LedgerDetail_Index04
751
  on constructionledgerdetail(SourceCode);
752

    
753
create index LedgerDetail_Index05
754
  on constructionledgerdetail(DetailCount);
755

    
756
create index LedgerDetail_Index06
757
  on constructionledgerdetail(SalaryFlg);
758

    
759
create index LedgerDetail_Index07
760
  on constructionledgerdetail(CompanyCode);
761

    
762
-- ?H?????????s?f?[?^
763
drop table if exists constructionledgerexcute cascade;
764

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

    
777
create index LedgerExcute_Index1
778
  on constructionledgerexcute(ConstructionCode,TargetMonth,GroupCount,LineCount);
779

    
780
-- ?H???????N???
781
drop table if exists constructionlink cascade;
782

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

    
792
create index ConstructionLink_Index1
793
  on constructionlink(ConstructionCode);
794

    
795
create index ConstructionLink_Index2
796
  on constructionlink(FluctuationCode);
797

    
798
create index ConstructionLink_Index3
799
  on constructionlink(LinkType);
800

    
801
-- ?H????????
802
drop table if exists constructionmaterialinfo cascade;
803

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

    
817
-- ????i?????t?f?[?^
818
drop table if exists constructionprogressdate cascade;
819

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

    
831
create index ConstrProg_Index1
832
  on constructionprogressdate(ConstructionCode);
833

    
834
create index ConstrProg_Index2
835
  on constructionprogressdate(ConstructionStatusFlg);
836

    
837
create index ConstrProg_Index3
838
  on constructionprogressdate(ChangeDate);
839

    
840
-- ???}?X?^
841
drop table if exists constructionspecmaster cascade;
842

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

    
857
create index ConstructionSpecMaster_Index1
858
  on constructionspecmaster(DisplayOrder);
859

    
860
-- ???P???}?X?^
861
drop table if exists constructionspecunitprice cascade;
862

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

    
874
-- ?H?????}?X?^
875
drop table if exists constructiontypemaster cascade;
876

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

    
891
-- ?????o?[?f?[?^
892
drop table if exists costdataofdepartment cascade;
893

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

    
912
-- ?S??????o??f?[?^
913
drop table if exists costdataofperson cascade;
914

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

    
936
create index CostDataOfPerson_Index1
937
  on costdataofperson(TargetMonth);
938

    
939
create index CostDataOfPerson_Index2
940
  on costdataofperson(ConstructionCode);
941

    
942
-- ??????o?^?\???f?[?^
943
drop table if exists costomerregist cascade;
944

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

    
978
create index CostomerRegist_Index1
979
  on costomerregist(PetitionPeriod);
980

    
981
create index CostomerRegist_Index2
982
  on costomerregist(CreatePersonCode);
983

    
984
create index CostomerRegist_Index3
985
  on costomerregist(CreateDepartmentCode);
986

    
987
-- ????f?[?^
988
drop table if exists dailydataconstruction cascade;
989

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

    
1000
create index DailyDataConstruction_Index1
1001
  on dailydataconstruction(PersonCode);
1002

    
1003
create index DailyDataConstruction_Index2
1004
  on dailydataconstruction(DailyDataDate);
1005

    
1006
create index DailyDataConstruction_Index3
1007
  on dailydataconstruction(ConstructionCode);
1008

    
1009
-- ????f?[?^ (????)
1010
drop table if exists dailydatadetail cascade;
1011

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

    
1029
create index DailyDataDetail_Index
1030
  on dailydatadetail(PersonCode,DailyDataDate,ConstructionCode);
1031

    
1032
-- ????f?[?^ (??????)
1033
drop table if exists dailydatafield cascade;
1034

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

    
1047
create index DailyDataField_Index
1048
  on dailydatafield(PersonCode,DailyDataDate,ConstructionCode);
1049

    
1050
-- ????f?[?^ (????)
1051
drop table if exists dailydatamaterials cascade;
1052

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

    
1068
create index DailyDataMaterials_Index
1069
  on dailydatamaterials(PersonCode,DailyDataDate,ConstructionCode);
1070

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

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

    
1086
create index DailyDataSubcontractors_Index
1087
  on dailydatasubcontractors(PersonCode,DailyDataDate,ConstructionCode);
1088

    
1089
-- ????f?[?^ (???)
1090
drop table if exists dailydatavehicles cascade;
1091

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

1108
create index DailyDataVehicles_Index
1109
  on dailydatavehicles(PersonCode,DailyDataDate,ConstructionCode);
1110

1111
-- ???}?X?^
1112
drop table if exists daymaster cascade;
1113

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

1119
-- ?????}?X?^
1120
drop table if exists deadlinemaster cascade;
1121

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

1133
-- ?????o???}?X?^
1134
drop table if exists departmentexpensesmaster cascade;
1135

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

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

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

1166
create index DepartmentMaster_index1
1167
  on departmentmaster(DisplayOrder);
1168

1169
-- ?????m?F???F?f?[?^
1170
drop table if exists depositapprovalinfo cascade;
1171

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

1188
-- ?????f?[?^
1189
drop table if exists depositdata cascade;
1190

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

1208
-- ????????f?[?^
1209
drop table if exists depositdatadetail cascade;
1210

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

1232
-- ???}?X?^
1233
drop table if exists divisionmaster cascade;
1234

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

1246
-- ??Z?\?Z???f?[?^
1247
drop table if exists estimatebudget cascade;
1248

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

1264
-- ??Z?\?Z????f?[?^????
1265
drop table if exists estimatebudgetdetail cascade;
1266

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

1285
-- ??Z????f?[?^
1286
drop table if exists estimatedata cascade;
1287

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

1304
create index EstimateData_Index1
1305
  on estimatedata(ConstructionCode,FixedItemCode);
1306

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

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

1325
create index EstimateDataBody_Index1
1326
  on estimatedatabody(ConstructionCode,ComponentCode,ItemCode);
1327

1328
-- ??Z????f?[?^????
1329
drop table if exists estimatedatadetail cascade;
1330

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

1354
create index EstimateDataDetail_Index1
1355
  on estimatedatadetail(ConstructionCode,PageCount);
1356

1357
-- ?o???}?X?^
1358
drop table if exists expensesmaster cascade;
1359

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

1371
-- ???x???}?X?^
1372
drop table if exists holidaycalendermaster cascade;
1373

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

1382
create index HolidayCalender_Index1
1383
  on holidaycalendermaster(BusinessYear);
1384

1385
create index HolidayCalenderMaster_Index2
1386
  on holidaycalendermaster(TargetMonth);
1387

1388
create index HolidayCalenderMaster_Index3
1389
  on holidaycalendermaster(TargetDay);
1390

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

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

1403
create index InputSearchLogData_Index1
1404
  on inputsearchlogdata(ConstructionCode,UsedProcessNo,InputCode);
1405

1406
-- ???????f?[?^
1407
drop table if exists invoicedata cascade;
1408

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

1431
alter table invoicedata add unique ORDERERSDIVISION (ORDERERSDIVISION,ORDERERSCODE,REQUESTMONTH,SEQNO) ;
1432

1433
-- ??????
1434
drop table if exists materialinfo cascade;
1435

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

1446
-- ????i??}?X?^
1447
drop table if exists materialitemmaster cascade;
1448

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

1461
-- ??????}?X?^
1462
drop table if exists materialkindmaster cascade;
1463

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

1474
-- ??????????
1475
drop table if exists materialrecordinfo cascade;
1476

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

1492
-- ?f??????b?Z?[?W
1493
drop table if exists messageboarddata cascade;
1494

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

1516
create index MessageBoardData_Index1
1517
  on messageboarddata(WritingDate);
1518

1519
create index MessageBoardData_Index2
1520
  on messageboarddata(MessageFlag);
1521

1522
-- ?f???????e?[?u??
1523
drop table if exists messageboardterget cascade;
1524

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

1536
create index MessageBoardTerget_Index1
1537
  on messageboardterget(RecordNumber,BranchNumber);
1538

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

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

1553
-- ???}?X?^
1554
drop table if exists monthmaster cascade;
1555

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

1561
-- ??????}?X?^
1562
drop table if exists orderersmaster cascade;
1563

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

1589
-- ????z?f?[?^
1590
drop table if exists orderspricedata cascade;
1591

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

1608
-- ?x?????F???f?[?^
1609
drop table if exists paymentapprovalinfo cascade;
1610

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

1626
-- ?x??????f?[?^
1627
drop table if exists paymentdatadetail cascade;
1628

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

1651
create index PayDataDetail_Index1
1652
  on paymentdatadetail(TARGETDATE);
1653

1654
create index PayDataDetail_Index2
1655
  on paymentdatadetail(APPROVALPERSONCODE);
1656

1657
-- ?H??????????f?[?^
1658
drop table if exists periodavoidance cascade;
1659

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

1669
create index PeriodAvoidance_Index1
1670
  on periodavoidance(ConstructionCode);
1671

1672
create index PeriodAvoidance_Index2
1673
  on periodavoidance(ConstructionStatusFlg);
1674

1675
create index PeriodAvoidance_Index3
1676
  on periodavoidance(FieldNo);
1677

1678
-- ?S??????F?f?[?^
1679
drop table if exists personapproval cascade;
1680

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

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

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

1713
-- ?S??????????}?X?^
1714
drop table if exists persondepartmentmaster cascade;
1715

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

1725
create index PersonDepartmentMaster_Index1
1726
  on persondepartmentmaster(PersonCode);
1727

1728
create index PersonDepartmentMaster_Index2
1729
  on persondepartmentmaster(DepartmentCode);
1730

1731
-- ?S????}?X?^
1732
drop table if exists personinchargemaster cascade;
1733

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

1760
create index PersonInChargeMaster_Index1
1761
  on personinchargemaster(StartDate);
1762

1763
create index PersonInChargeMaster_Index2
1764
  on personinchargemaster(DepartmentCode);
1765

1766
-- ?S??????^?}?X?^
1767
drop table if exists personsalarymaster cascade;
1768

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

1779
create index PersonSalaryMaster_Index1
1780
  on personsalarymaster(PersonCode);
1781

1782
create index PersonSalaryMaster_Index2
1783
  on personsalarymaster(StartDate);
1784

1785
create index PersonSalaryMaster_Index3
1786
  on personsalarymaster(MonthlySalary);
1787

1788
-- ?w???????f?[?^
1789
drop table if exists pointingoutcomment cascade;
1790

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

1810
-- ?????????????c???^?f?[?^
1811
drop table if exists proceedingsdata cascade;
1812

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

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

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

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

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

1857
-- ???F?f?[?^
1858
drop table if exists processapproval cascade;
1859

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

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

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

1890
-- ???F????f?[?^
1891
drop table if exists processapprovaldetail cascade;
1892

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

1904
-- ?N?????}?X?^
1905
drop table if exists processexcutemaster cascade;
1906

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

1916
create index ProcessExcuteMaster_Index1
1917
  on processexcutemaster(SecCode);
1918

1919
create index ProcessExcuteMaster_Index2
1920
  on processexcutemaster(ExecCode);
1921

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

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

1958
-- ?????????t?f?[?^
1959
drop table if exists purchaseorderdate cascade;
1960

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

1973
-- ??????????f?[?^
1974
drop table if exists purchaseorderdetail cascade;
1975

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

1998
create index POrderDetail_Index1
1999
  on purchaseorderdetail(SourceCode);
2000

2001
-- ?????f?[?^
2002
drop table if exists requestdata cascade;
2003

2004
create table requestdata (
2005
  REQUESTNO decimal(9,0) not null comment '????No'
2006
  , MAINCONSTRUCTIONCODE decimal(10,0) not null comment '?{?H?????'
2007
  , CONSTRUCTIONNAME varchar(120) not null comment '?H??????'
2008
  , CONTRACTAMOUNT decimal(10,0) not null comment '???????z'
2009
  , PAIDAMOUNT decimal(10,0) not null comment '????????z'
2010
  , REQUESTAMOUNT0 decimal(10,0) not null comment '???????z?O'
2011
  , REQUESTAMOUNT1 decimal(10,0) not null comment '???????z?P'
2012
  , REQUESTAMOUNT2 decimal(10,0) comment '???????z?Q'
2013
  , REQUESTAMOUNT3 decimal(10,0) comment '???????z?R'
2014
  , REQUESTAMOUNT4 decimal(10,0) comment '???????z?S'
2015
  , REQUESTAMOUNT5 decimal(10,0) comment '???????z?T'
2016
  , REQUESTAMOUNT6 decimal(10,0) comment '???????z?U'
2017
  , UNCLAIMEDAMOUNT decimal(10,0) not null comment '?????c???z'
2018
  , UNPAIDAMOUNT decimal(10,0) not null comment '?????????z'
2019
  , TAXAMOUNT decimal(10,0) not null comment '?????'
2020
  , NOTE varchar(120) not null comment '???l'
2021
  , ENTRYDATE datetime not null comment '?o?^?N????'
2022
  , UPDATEDATE datetime not null comment '?X?V?N????'
2023
  , constraint requestdata_PKC primary key (REQUESTNO,MAINCONSTRUCTIONCODE)
2024
) comment '?????f?[?^' ;
2025

2026
-- ?????f?[?^????
2027
drop table if exists requestdatadetail cascade;
2028

2029
create table requestdatadetail (
2030
  REQUESTNO decimal(9,0) not null comment '????No'
2031
  , MAINCONSTRUCTIONCODE decimal(10,0) not null comment '?{?H?????'
2032
  , CONSTRUCTIONCODE decimal(10,0) not null comment '?H?????'
2033
  , CONSTRUCTIONKIND decimal(1,0) not null comment '?H????'
2034
  , REQUESTAMOUNT decimal(10,0) not null comment '???????z'
2035
  , TAXAMOUNT decimal(10,0) not null comment '?????'
2036
  , ENTRYDATE datetime not null comment '?o?^?N????'
2037
  , UPDATEDATE datetime not null comment '?X?V?N????'
2038
  , constraint requestdatadetail_PKC primary key (REQUESTNO,MAINCONSTRUCTIONCODE,CONSTRUCTIONCODE,CONSTRUCTIONKIND)
2039
) comment '?????f?[?^????' ;
2040

2041
-- ?????w?b?_
2042
drop table if exists requesthead cascade;
2043

2044
create table requesthead (
2045
  REQUESTNO decimal(9,0) not null comment '????No'
2046
  , REQCONSTRUCTIONCODE decimal(10,0) not null comment '?????H?????'
2047
  , ORDERNO decimal(2,0) not null comment '??t???'
2048
  , REQUESTMONTH decimal(6,0) not null comment '??????'
2049
  , ORDERERSDIVISION decimal(5,0) not null comment '???????'
2050
  , ORDERERSCODE decimal(5,0) not null comment '??????R?[?h'
2051
  , ORDERERSNAME varchar(120) not null comment '???????'
2052
  , REQCONSTRUCTIONNAME varchar(120) not null comment '?????H??????'
2053
  , REQUESTTOTALAMOUNT decimal(10,0) not null comment '???????z???v'
2054
  , REQUESTAMOUNT decimal(10,0) not null comment '???????z'
2055
  , TAXAMOUNT decimal(10,0) not null comment '?????'
2056
  , UNPAIDAMOUNT decimal(10,0) comment '??????'
2057
  , NOTE varchar(120) comment '???l'
2058
  , ASSIGNEDFLG decimal(1,0) comment '??????t???O'
2059
  , INVOICENO decimal(9,0) not null comment '??????No'
2060
  , ENTRYDATE datetime not null comment '?o?^?N????'
2061
  , UPDATEDATE datetime not null comment '?X?V?N????'
2062
  , constraint requesthead_PKC primary key (REQUESTNO)
2063
) comment '?????w?b?_' ;
2064

2065
alter table requesthead add unique REQCONSTRUCTIONCODE (REQCONSTRUCTIONCODE,ORDERNO) ;
2066

2067
-- ?????????t?f?[?^
2068
drop table if exists requestorderdate cascade;
2069

2070
create table requestorderdate (
2071
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
2072
  , InvoiceNo decimal(9,0) not null comment '??????No'
2073
  , SendDate date not null comment '???????????X????'
2074
  , EntryDate datetime not null comment '?o?^???t'
2075
  , UpdateDate datetime not null comment '?X?V???t'
2076
  , constraint requestorderdate_PKC primary key (ConstructionCode,InvoiceNo)
2077
) comment '?????????t?f?[?^' ;
2078

2079
-- ????O???t?f?[?^
2080
drop table if exists salesgraphdata cascade;
2081

2082
create table salesgraphdata (
2083
  GraphDataCode decimal(8,0) not null comment '?O???t?f?[?^?R?[?h'
2084
  , ConstructionPeriod decimal(4,0) unsigned not null comment '?????'
2085
  , SalesDataDays date not null comment '????N??'
2086
  , DisplayOrder decimal(8,0) unsigned not null comment '?\????'
2087
  , DataName varchar(100) not null comment '?f?[?^?\??????'
2088
  , SalesAmount decimal(10,0) not null comment '????f?[?^'
2089
  , AdministrativeExpense decimal(10,0) not null comment '???E?????o??'
2090
  , GrossProfit decimal(10,0) not null comment '?e???v'
2091
  , NetIncome decimal(10,0) not null comment '?????v(???v)'
2092
  , EntryDate datetime not null comment '?o?^???t'
2093
  , UpdateDate datetime not null comment '?X?V???t'
2094
  , constraint salesgraphdata_PKC primary key (GraphDataCode,ConstructionPeriod,SalesDataDays)
2095
) comment '????O???t?f?[?^' ;
2096

2097
create index SalesGraphData_Idx1
2098
  on salesgraphdata(DisplayOrder);
2099

2100
create index SalesGraphData_idx2
2101
  on salesgraphdata(ConstructionPeriod);
2102

2103
-- ?????}?X?^
2104
drop table if exists securitymaster cascade;
2105

2106
create table securitymaster (
2107
  SecCode decimal(2,0) unsigned not null comment '???????'
2108
  , DisplayOrder decimal(2,0) not null comment '?\????'
2109
  , SecName varchar(60) not null comment '????????'
2110
  , SecRank decimal(1,0) not null comment '?????????N'
2111
  , SecRange decimal(1,0) not null comment '???????'
2112
  , GeneralAffairs decimal(1,0) not null comment '????????t???O'
2113
  , SelectBackColor varchar(8) not null comment '?I??w?i?F'
2114
  , EntryDate datetime not null comment '?o?^???t'
2115
  , UpdateDate datetime not null comment '?X?V???t'
2116
  , constraint securitymaster_PKC primary key (SecCode)
2117
) comment '?????}?X?^' ;
2118

2119
create index SecurityMaster_Index1
2120
  on securitymaster(DisplayOrder);
2121

2122
create index SecurityMaster_Index2
2123
  on securitymaster(SecRank);
2124

2125
create index SecurityMaster_Index3
2126
  on securitymaster(SecRange);
2127

2128
-- ???S?p?g???[???f?[?^
2129
drop table if exists sfpdata cascade;
2130

2131
create table sfpdata (
2132
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
2133
  , DataCount decimal(2,0) unsigned not null comment '?p?g???[????'
2134
  , RequestDate datetime not null comment '?p?g???[???v??????'
2135
  , PersonCode decimal(8,0) unsigned not null comment '?\????R?[?h'
2136
  , StringValue varchar(300) comment '?R?????g'
2137
  , OrderNo decimal(2,0) unsigned not null comment '?\????t???'
2138
  , EntryDate datetime not null comment '?o?^???t'
2139
  , UpdateDate datetime not null comment '?X?V???t'
2140
  , constraint sfpdata_PKC primary key (ConstructionCode,DataCount)
2141
) comment '???S?p?g???[???f?[?^' ;
2142

2143
create index SFPData_Index1
2144
  on sfpdata(RequestDate);
2145

2146
-- ???S?p?g???[??????f?[?^
2147
drop table if exists sfpdatadetail cascade;
2148

2149
create table sfpdatadetail (
2150
  ConstructionCode decimal(10,0) unsigned not null comment '?H???R?[?h'
2151
  , DataCount decimal(2,0) unsigned not null comment '?p?g???[????'
2152
  , SeqNo decimal(2,0) unsigned not null comment '?f?[?^?}??'
2153
  , CompanyCode decimal(8,0) unsigned not null comment '??????R?[?h'
2154
  , EntryDate datetime not null comment '?o?^???t'
2155
  , UpdateDate datetime not null comment '?X?V???t'
2156
  , constraint sfpdatadetail_PKC primary key (ConstructionCode,DataCount,SeqNo)
2157
) comment '???S?p?g???[??????f?[?^' ;
2158

2159
-- ??????{?H?H??o?^?\???f?[?^
2160
drop table if exists subconstrjobitemregist cascade;
2161

2162
create table subconstrjobitemregist (
2163
  PersonCode decimal(8,0) unsigned not null comment '?\??????'
2164
  , CreateDate date not null comment '????'
2165
  , SeqNo decimal(2,0) unsigned not null comment '?\???A??'
2166
  , DisplayOrder decimal(8,0) unsigned not null comment '?\????'
2167
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
2168
  , EntryDate datetime not null comment '?o?^???t'
2169
  , UpdateDate datetime not null comment '?X?V???t'
2170
  , constraint subconstrjobitemregist_PKC primary key (PersonCode,CreateDate,SeqNo,DisplayOrder)
2171
) comment '??????{?H?H??o?^?\???f?[?^' ;
2172

2173
-- ??????E?????N?o?^?\???f?[?^
2174
drop table if exists subconstrjoblinkregist cascade;
2175

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

2187
-- ??????o?^?\???f?[?^
2188
drop table if exists subconstrregist cascade;
2189

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

2222
-- ??????H??}?X?^
2223
drop table if exists subcontractoritemmaster cascade;
2224

2225
create table subcontractoritemmaster (
2226
  ItemCode decimal(5,0) unsigned not null comment '?H??L?['
2227
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2228
  , ItemName varchar(120) not null comment '?H????'
2229
  , DeleteFlg decimal(1,0) not null comment '???t???O'
2230
  , EntryDate datetime not null comment '?o?^???t'
2231
  , UpdateDate datetime not null comment '?X?V???t'
2232
  , constraint subcontractoritemmaster_PKC primary key (ItemCode)
2233
) comment '??????H??}?X?^' ;
2234

2235
-- ??????E??}?X?^
2236
drop table if exists subcontractorjobcategory cascade;
2237

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

2248
-- ??????{?H?H??f?[?^
2249
drop table if exists subcontractorjobitem cascade;
2250

2251
create table subcontractorjobitem (
2252
  CompanyCode decimal(8,0) not null comment '??????R?[?h'
2253
  , ItemCode decimal(5,0) unsigned not null comment '?H??L?['
2254
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2255
  , EntryDate datetime not null comment '?o?^???t'
2256
  , UpdateDate datetime not null comment '?X?V???t'
2257
  , constraint subcontractorjobitem_PKC primary key (CompanyCode,ItemCode)
2258
) comment '??????{?H?H??f?[?^' ;
2259

2260
create index SubContractorJobItem_Index1
2261
  on subcontractorjobitem(CompanyCode);
2262

2263
create index SubContractorJobItem_Index2
2264
  on subcontractorjobitem(ItemCode);
2265

2266
-- ??????E?????N?}?X?^
2267
drop table if exists subcontractorjoblink cascade;
2268

2269
create table subcontractorjoblink (
2270
  CompanyCode decimal(8,0) not null comment '??????R?[?h'
2271
  , JobCategoryCode decimal(5,0) not null comment '?E??L?['
2272
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2273
  , EntryDate datetime not null comment '?o?^???t'
2274
  , UpdateDate datetime not null comment '?X?V???t'
2275
  , constraint subcontractorjoblink_PKC primary key (CompanyCode,JobCategoryCode)
2276
) comment '??????E?????N?}?X?^' ;
2277

2278
create index SubContractorJobLink_Index1
2279
  on subcontractorjoblink(CompanyCode);
2280

2281
create index SubContractorJobLink_Index2
2282
  on subcontractorjoblink(JobCategoryCode);
2283

2284
-- ??????}?X?^
2285
drop table if exists subcontractormaster cascade;
2286

2287
create table subcontractormaster (
2288
  CompanyCode decimal(8,0) not null comment '??????R?[?h'
2289
  , DisplayOrder decimal(8,0) unsigned not null comment '?\????'
2290
  , CorporateStatusName varchar(40) comment '?@?l?i????'
2291
  , CorporateStatusPoint decimal(1,0) not null comment '?@?l?i?????u'
2292
  , CompanyName varchar(100) not null comment '???????'
2293
  , CEOPositionName varchar(60) comment '??\???E??'
2294
  , CEOName varchar(60) comment '??\?????'
2295
  , ContactPersonName varchar(60) comment '?S???????'
2296
  , ZipCode varchar(8) comment '?X????'
2297
  , Address1 varchar(60) comment '?Z???P'
2298
  , Address2 varchar(60) comment '?Z??2'
2299
  , Address3 varchar(60) comment '?Z??3'
2300
  , CellPhoneNumber varchar(13) comment '?g??d?b???'
2301
  , MailAddress varchar(257) comment '???[???A?h???X'
2302
  , PhoneNumber varchar(13) comment '?d?b???'
2303
  , FaxNumber varchar(13) comment 'FAX???'
2304
  , JapaneseSyllabary varchar(2) comment '50?????'
2305
  , StartDate date not null comment '????J?n?N????'
2306
  , Note varchar(300) comment '???l'
2307
  , labourKind decimal(1,0) not null comment '?x???????E????'
2308
  , DeleteFlg decimal(1,0) default '0' not null comment '???t???O'
2309
  , EntryDate datetime not null comment '?o?^???t'
2310
  , UpdateDate datetime not null comment '?X?V???t'
2311
  , constraint subcontractormaster_PKC primary key (CompanyCode)
2312
) comment '??????}?X?^' ;
2313

2314
create index SubContractorMaster_Index1
2315
  on subcontractormaster(JapaneseSyllabary);
2316

2317
-- ?d????}?X?^
2318
drop table if exists suppliersmaster cascade;
2319

2320
create table suppliersmaster (
2321
  SuppliersCode decimal(5,0) unsigned not null comment '?d????R?[?h'
2322
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2323
  , SuppliersName1 varchar(60) not null comment '?d????1'
2324
  , SuppliersName2 varchar(60) comment '?d?????Q'
2325
  , ZipCode varchar(8) comment '?X????'
2326
  , Address1 varchar(60) comment '?Z???P'
2327
  , Address2 varchar(60) comment '?Z??2'
2328
  , Address3 varchar(60) comment '?Z??3'
2329
  , PhoneNumber varchar(13) comment '?d?b???'
2330
  , FaxNumber varchar(13) comment 'FAX???'
2331
  , Note varchar(300) comment '???l'
2332
  , DeleteFlg decimal(1,0) not null comment '???t???O'
2333
  , EntryDate datetime not null comment '?o?^???t'
2334
  , UpdateDate datetime not null comment '?X?V???t'
2335
  , constraint suppliersmaster_PKC primary key (SuppliersCode)
2336
) comment '?d????}?X?^' ;
2337

2338
-- ?V?X?e???N???m?F?f?[?^
2339
drop table if exists systemexecute cascade;
2340

2341
create table systemexecute (
2342
  PrimaryCode tinyint(4) not null comment '?L?[????'
2343
  , TargetDate date not null comment '?N?????t'
2344
  , SystemVersion int(11) not null comment '?{??E????o?[?W????'
2345
  , UpDateCopyVersion int(11) not null comment '?R?s?[?o?[?W????'
2346
  , EntryDate datetime not null comment '?o?^???t'
2347
  , UpdateDate datetime not null comment '?X?V???t'
2348
  , constraint systemexecute_PKC primary key (PrimaryCode)
2349
) comment '?V?X?e???N???m?F?f?[?^' ;
2350

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

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

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

2391
create table termmaster (
2392
  ConstructionStatusFlg decimal(2,0) not null comment '?H?????t???O'
2393
  , FieldNo decimal(2,0) not null comment '?`?F?b?N???t?B?[???h???'
2394
  , SeqNo decimal(2,0) not null comment '?}??'
2395
  , DisplayOrder decimal(2,0) not null comment '?\????'
2396
  , CheckSchdule decimal(1,0) not null comment '?`?F?b?N?^?C?~???O'
2397
  , TermDays decimal(3,0) not null comment '?o???'
2398
  , SendTitile varchar(100) comment '?^?C?g??'
2399
  , SendMessage varchar(100) comment '???b?Z?[?W'
2400
  , BackColor varchar(8) comment '?w?i?F'
2401
  , ForeColor varchar(8) comment '?????F'
2402
  , EntryDate datetime not null comment '?o?^???t'
2403
  , UpdateDate datetime not null comment '?X?V???t'
2404
  , constraint termmaster_PKC primary key (ConstructionStatusFlg,FieldNo,SeqNo)
2405
) comment '?????}?X?^' ;
2406

2407
create index TermMaster_Index1
2408
  on termmaster(DisplayOrder);
2409

2410
-- ?o?????f?[?^
2411
drop table if exists tranceportdailydata cascade;
2412

2413
create table tranceportdailydata (
2414
  PersonCode decimal(8,0) unsigned not null comment '????R?[?h'
2415
  , AttendanceDate date not null comment '???????'
2416
  , StartDistance decimal(7,1) not null comment '?????o???L????'
2417
  , ComplateDistance decimal(7,1) not null comment '?????I???L????'
2418
  , TotalDistance decimal(6,1) not null comment '???????v?L????'
2419
  , OfficeGoFlg decimal(1,0) not null comment '???????o??t???O'
2420
  , OfficeOutFlg decimal(1,0) not null comment '???????A??t???O'
2421
  , TrancePayGoFlg decimal(1,0) not null comment '?L?????o??t???O'
2422
  , TrancePayOutFlg decimal(1,0) not null comment '?L?????A??t???O'
2423
  , WareHouseFlg decimal(1,0) not null comment '????u??t???O'
2424
  , EntryDate datetime not null comment '?o?^???t'
2425
  , UpdateDate datetime not null comment '?X?V???t'
2426
  , constraint tranceportdailydata_PKC primary key (PersonCode,AttendanceDate)
2427
) comment '?o?????f?[?^' ;
2428

2429
create index TranceportDailyData_Index1
2430
  on tranceportdailydata(AttendanceDate);
2431

2432
-- ?H?????o???}?X?^
2433
drop table if exists typeexpensesmaster cascade;
2434

2435
create table typeexpensesmaster (
2436
  TypeCode decimal(5,0) unsigned not null comment '?H?????R?[?h'
2437
  , ExpensesPeriod smallint(6) not null comment '?????'
2438
  , NameCode decimal(5,0) unsigned not null comment '?o????R?[?h'
2439
  , ExpensesRaito decimal(4,2) not null comment '?o??'
2440
  , DeleteFlg decimal(1,0) not null comment '???t???O'
2441
  , EntryDate datetime not null comment '?o?^???t'
2442
  , UpdateDate datetime not null comment '?X?V???t'
2443
  , constraint typeexpensesmaster_PKC primary key (TypeCode,ExpensesPeriod,NameCode)
2444
) comment '?H?????o???}?X?^' ;
2445

2446
-- ?P??}?X?^
2447
drop table if exists unitmaster cascade;
2448

2449
create table unitmaster (
2450
  UnitKey decimal(5,0) unsigned not null comment '?P??L?['
2451
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2452
  , UnitName varchar(30) not null comment '?P?????'
2453
  , EntryDate datetime not null comment '?o?^???t'
2454
  , UpdateDate datetime not null comment '?X?V???t'
2455
  , constraint unitmaster_PKC primary key (UnitKey)
2456
) comment '?P??}?X?^' ;
2457

2458
create index UnitMaster_Index1
2459
  on unitmaster(DisplayOrder);
2460

2461
-- ????}?X?^
2462
drop table if exists vehiclemaster cascade;
2463

2464
create table vehiclemaster (
2465
  VehicleCode decimal(5,0) unsigned not null comment '????R?[?h'
2466
  , DisplayOrder decimal(5,0) unsigned not null comment '?\????'
2467
  , VehicleName varchar(100) not null comment '???????'
2468
  , RegistrationNumber varchar(30) comment '?o?^???'
2469
  , IdentificationNumber varchar(30) comment '?????'
2470
  , ModelCode varchar(30) comment '?^??'
2471
  , DepartmentCode decimal(5,0) unsigned not null comment '???????'
2472
  , VehicleScheduleFlg decimal(1,0) not null comment '????\??\???t???O'
2473
  , PurchaseDate date comment '?w????'
2474
  , PurchaseName varchar(30) comment '?w????'
2475
  , PurchaseContactPersons varchar(30) comment '?w????S????'
2476
  , PurchasePhone varchar(13) comment '?w????d?b???'
2477
  , LeaseDate date comment '???[?X?J?n??'
2478
  , LeaseDestination varchar(30) comment '???[?X??'
2479
  , LeaseContactPersons varchar(30) comment '???[?X??S????'
2480
  , LeasePhone varchar(13) comment '???[?X??d?b???'
2481
  , InsuranceCompany varchar(30) comment '?C???????'
2482
  , InsuranceContactPersons varchar(30) comment '?C???????S????'
2483
  , InsurancePhone varchar(13) comment '?C???????d?b???'
2484
  , Note varchar(300) comment '???l'
2485
  , EntryDate datetime comment '?o?^???t'
2486
  , UpdateDate datetime comment '?X?V???t'
2487
  , constraint vehiclemaster_PKC primary key (VehicleCode)
2488
) comment '????}?X?^' ;
2489

2490
-- ????L?^?f?[?^
2491
drop table if exists vehiclerecorddata cascade;
2492

2493
create table vehiclerecorddata (
2494
  VehicleCode decimal(5,0) unsigned not null comment '????R?[?h'
2495
  , DivisionCode decimal(2,0) unsigned not null comment '?f?[?^??'
2496
  , SeqNo decimal(2,0) not null comment '?}??'
2497
  , RecordDate date comment '???n??'
2498
  , Mileage mediumint(9) comment '???s????'
2499
  , Content varchar(100) comment '???e'
2500
  , PaymentCost decimal(10,0) comment '??p'
2501
  , EntryDate datetime not null comment '?o?^???t'
2502
  , UpdateDate datetime not null comment '?X?V???t'
2503
  , constraint vehiclerecorddata_PKC primary key (VehicleCode,DivisionCode,SeqNo)
2504
) comment '????L?^?f?[?^' ;
2505

2506
-- ????\??f?[?^
2507
drop table if exists vehiclescheduledata cascade;
2508

2509
create table vehiclescheduledata (
2510
  TargetDate date not null comment '????'
2511
  , VehicleCode decimal(5,0) unsigned not null comment '????R?[?h'
2512
  , MorningAfternoon decimal(1,0) not null comment '??O?E???'
2513
  , PersonCode decimal(8,0) unsigned not null comment '?S????R?[?h'
2514
  , TargetYear year(4) not null comment '?Y???N'
2515
  , TargetMonth tinyint(3) unsigned not null comment '?Y????'
2516
  , TargetDay year(4) not null comment '?Y????'
2517
  , EntryDate datetime not null comment '?o?^???t'
2518
  , UpdateDate datetime not null comment '?X?V???t'
2519
  , constraint vehiclescheduledata_PKC primary key (TargetDate,VehicleCode,MorningAfternoon)
2520
) comment '????\??f?[?^' ;
2521

2522
create index VehicleScheduleData_Index1
2523
  on vehiclescheduledata(TargetYear);
2524

2525
create index VehicleScheduleData_Index2
2526
  on vehiclescheduledata(TargetMonth);
2527

2528
create index VehicleScheduleData_Index3
2529
  on vehiclescheduledata(TargetDay);
2530

2531
-- ?N?}?X?^
2532
drop table if exists yearmaster cascade;
2533

2534
create table yearmaster (
2535
  years smallint(6) not null comment '?N'
2536
  , constraint yearmaster_PKC primary key (years)
2537
) comment '?N?}?X?^' ;
2538