h-you / branches / ddl / ProcessManagement.sql @ 198
履歴 | 表示 | アノテート | ダウンロード (118 KB)
1 |
-- Project Name : noname
|
---|---|
2 |
-- Date/Time : 2017/06/14 16:16:18
|
3 |
-- Author : Horiuchi
|
4 |
-- RDBMS Type : MySQL
|
5 |
-- Application : A5:SQL Mk-2
|
6 |
|
7 |
-- 担当者行動予定データ
|
8 |
drop index ActionScheduleData_Index1 on actionscheduledata; |
9 |
drop index ActionScheduleData_Index2 on actionscheduledata; |
10 |
drop index ActionScheduleData_Index3 on actionscheduledata; |
11 |
|
12 |
drop table if exists actionscheduledata cascade; |
13 |
|
14 |
create table actionscheduledata ( |
15 |
TargetDate date not null comment '対象日' |
16 |
, PersonCode decimal(8,0) not null comment '担当者コード' |
17 |
, ActionSchedule varchar(30) comment '行動予定' |
18 |
, TargetYear year(4) not null comment '該当年' |
19 |
, TargetMonth year(4) not null comment '該当月' |
20 |
, TargetDay year(4) not null comment '該当日' |
21 |
, EntryDate datetime not null comment '登録日付' |
22 |
, UpdateDate datetime not null comment '更新日付' |
23 |
, constraint actionscheduledata_PKC primary key (TargetDate,PersonCode) |
24 |
) comment '担当者行動予定データ' ; |
25 |
|
26 |
create index ActionScheduleData_Index1 |
27 |
on actionscheduledata(TargetYear);
|
28 |
|
29 |
create index ActionScheduleData_Index2 |
30 |
on actionscheduledata(TargetMonth);
|
31 |
|
32 |
create index ActionScheduleData_Index3 |
33 |
on actionscheduledata(TargetDay);
|
34 |
|
35 |
-- 承認経路マスタ
|
36 |
drop table if exists approvalmaster cascade; |
37 |
|
38 |
create table approvalmaster ( |
39 |
ApprovalCode decimal(3,0) unsigned not null comment '承認機能番号' |
40 |
, DepartmentCode decimal(5,0) unsigned not null comment '部署コード' |
41 |
, SeqNo decimal(2,0) not null comment '枝番' |
42 |
, DisplayOrder decimal(2,0) not null comment '表示順' |
43 |
, ApprovalPerson decimal(8,0) unsigned not null comment '承認者コード' |
44 |
, ApprovalAuthority decimal(1,0) not null comment '承認権限区分' |
45 |
, EntryDate datetime not null comment '登録日付' |
46 |
, UpdateDate datetime not null comment '更新日付' |
47 |
, constraint approvalmaster_PKC primary key (ApprovalCode,DepartmentCode,SeqNo) |
48 |
) comment '承認経路マスタ' ; |
49 |
|
50 |
-- 出勤日報データ
|
51 |
drop index AttendDaily_Index1 on attendancedailydata; |
52 |
drop index AttendDaily_Index2 on attendancedailydata; |
53 |
|
54 |
drop table if exists attendancedailydata cascade; |
55 |
|
56 |
create table attendancedailydata ( |
57 |
PersonCode decimal(8,0) unsigned not null comment '作成者コード' |
58 |
, AttendanceDate date not null comment '日報作成日' |
59 |
, SeqNo decimal(3,0) unsigned not null comment '明細行番号' |
60 |
, ActionResult varchar(30) not null comment '行動実績' |
61 |
, OvertimeHours decimal(4,1) not null comment '残業時間' |
62 |
, WorkingComment varchar(120) comment 'コメント' |
63 |
, EntryDate datetime not null comment '登録日付' |
64 |
, UpdateDate datetime not null comment '更新日付' |
65 |
, constraint attendancedailydata_PKC primary key (PersonCode,AttendanceDate,SeqNo) |
66 |
) comment '出勤日報データ' ; |
67 |
|
68 |
create index AttendDaily_Index1 |
69 |
on attendancedailydata(ActionResult);
|
70 |
|
71 |
create index AttendDaily_Index2 |
72 |
on attendancedailydata(AttendanceDate);
|
73 |
|
74 |
-- 出勤管理データ
|
75 |
drop table if exists attendancedata cascade; |
76 |
|
77 |
create table attendancedata ( |
78 |
PersonCode decimal(8,0) unsigned not null comment '作成者コード' |
79 |
, AttendanceMonth date not null comment '出勤管理年月' |
80 |
, LastDays decimal(2,0) unsigned not null comment '当月最終日' |
81 |
, AttendDayCount decimal(2,0) unsigned not null comment '出勤日数' |
82 |
, TotalOverTimes decimal(4,1) not null comment '残業時間数' |
83 |
, OrderDate date not null comment '申請日' |
84 |
, OrderNo decimal(2,0) unsigned not null comment '申請受付番号' |
85 |
, EntryDate datetime not null comment '登録日付' |
86 |
, UpdateDate datetime not null comment '更新日付' |
87 |
, constraint attendancedata_PKC primary key (PersonCode,AttendanceMonth) |
88 |
) comment '出勤管理データ' ; |
89 |
|
90 |
-- 銀行営業日マスタ
|
91 |
drop table if exists bankbusinessdaymaster cascade; |
92 |
|
93 |
create table bankbusinessdaymaster ( |
94 |
YEARMONTH decimal(6,0) default '0' not null comment '年月' |
95 |
, BANKBUSINESSDAY decimal(2,0) default '0' not null comment '銀行営業日' |
96 |
, NOTE varchar(120) comment '備考' |
97 |
, DELETEFLG decimal(1,0) comment '削除フラグ' |
98 |
, ENTRYDATE datetime comment '登録年月日' |
99 |
, UPDATEDATE datetime comment '更新年月日' |
100 |
, constraint bankbusinessdaymaster_PKC primary key (YEARMONTH,BANKBUSINESSDAY) |
101 |
) comment '銀行営業日マスタ' ; |
102 |
|
103 |
-- 業者請求データ
|
104 |
drop table if exists billingdata cascade; |
105 |
|
106 |
create table billingdata ( |
107 |
COMPANYCODE decimal(8,0) default '0' not null comment '協力会社コード' |
108 |
, TARGETDATE decimal(6,0) default '0' not null comment '対象年月' |
109 |
, SEQNO decimal(3,0) default '0' not null comment '連番' |
110 |
, BILLPRICE decimal(10,0) comment '請求金額' |
111 |
, ENTRYDATE datetime comment '登録年月日' |
112 |
, UPDATEDATE datetime comment '更新年月日' |
113 |
, constraint billingdata_PKC primary key (COMPANYCODE,TARGETDATE,SEQNO) |
114 |
) comment '業者請求データ' ; |
115 |
|
116 |
-- 業者請求明細データ
|
117 |
drop table if exists billingdatadetail cascade; |
118 |
|
119 |
create table billingdatadetail ( |
120 |
COMPANYCODE decimal(8,0) default '0' not null comment '協力会社コード' |
121 |
, TARGETDATE decimal(6,0) default '0' not null comment '対象年月' |
122 |
, SEQNO decimal(3,0) default '0' not null comment '連番' |
123 |
, LINECOUNT decimal(3,0) default '0' not null comment '行番号' |
124 |
, CONSTRUCTIONCODE decimal(10,0) comment '工事番号' |
125 |
, FIELDNAME varchar(120) comment '現場名' |
126 |
, BILLPRICE decimal(10,0) comment '請求金額' |
127 |
, HIGHWPRICE decimal(10,0) comment '高速代' |
128 |
, HARDWPRICE decimal(10,0) comment '金物代' |
129 |
, INDSWASTETAX decimal(10,0) comment '産廃税' |
130 |
, NOTE varchar(120) comment '備考' |
131 |
, ENTRYDATE datetime comment '登録年月日' |
132 |
, UPDATEDATE datetime comment '更新年月日' |
133 |
, constraint billingdatadetail_PKC primary key (COMPANYCODE,TARGETDATE,SEQNO,LINECOUNT) |
134 |
) comment '業者請求明細データ' ; |
135 |
|
136 |
-- 業者請求支払サマリーデータ
|
137 |
drop table if exists billingpaymentsummary cascade; |
138 |
|
139 |
create table billingpaymentsummary ( |
140 |
COMPANYCODE decimal(8,0) default '0' not null comment '協力会社コード' |
141 |
, TARGETDATE decimal(6,0) default '0' not null comment '対象年月' |
142 |
, CHARGEPAYMENTKIND decimal(1,0) default '0' not null comment '請求支払区分' |
143 |
, PAYDAY date comment '支払日' |
144 |
, BILLPRICESTOTAL decimal(10,0) comment '請求金額小計' |
145 |
, CONSUMPTIONTAXRATE decimal(6,3) comment '消費税率' |
146 |
, CONSUMPTIONTAXPRICE decimal(10,0) comment '消費税額' |
147 |
, HIGHWPRICESTOTAL decimal(10,0) comment '高速代小計' |
148 |
, HARDWPRICESTOTAL decimal(10,0) comment '金物代小計' |
149 |
, INDSWASTETAXSTOTAL decimal(10,0) comment '産廃税小計' |
150 |
, CNSTRPRICERATE decimal(6,3) comment '協力金比率' |
151 |
, CNSTRPRICESTOTAL decimal(10,0) comment '協力金小計' |
152 |
, BILLINGPRICETOTAL decimal(10,0) comment '請求金額合計' |
153 |
, ENTRYDATE datetime comment '登録年月日' |
154 |
, UPDATEDATE datetime comment '更新年月日' |
155 |
, constraint billingpaymentsummary_PKC primary key (COMPANYCODE,TARGETDATE,CHARGEPAYMENTKIND) |
156 |
) comment '業者請求支払サマリーデータ' ; |
157 |
|
158 |
-- 工事詳細台帳データ【退避用】
|
159 |
drop table if exists bk_constructionledger cascade; |
160 |
|
161 |
create table bk_constructionledger ( |
162 |
ConstructionCode decimal(10,0) unsigned not null comment '工事コード' |
163 |
, ConstructionPeriod decimal(4,0) unsigned not null comment '事業期' |
164 |
, CreatorCode decimal(8,0) comment '作成者コード' |
165 |
, CreatorName varchar(60) comment '作成者名' |
166 |
, CreateDate date not null comment '作成日' |
167 |
, ConstructionTimes decimal(5,2) not null comment '工期(単位・月)' |
168 |
, ConstructionStart date not null comment '契約工期開始' |
169 |
, ConstructionEnd date not null comment '契約工期完了' |
170 |
, OrdersDecisionPrice decimal(14,0) not null comment '税抜受注決定金額' |
171 |
, CompanyExpenses decimal(10,0) not null comment '会社経費合計' |
172 |
, DepartmentExpenses decimal(10,0) not null comment '部署経費合計' |
173 |
, SalesExpenses decimal(10,0) not null comment '営業経費合計' |
174 |
, TotalPayment decimal(10,0) not null comment '総支払額' |
175 |
, GrossProfit decimal(10,0) not null comment '粗利' |
176 |
, Allowance decimal(10,0) not null comment '給与' |
177 |
, NetProfit decimal(10,0) not null comment '純利益' |
178 |
, ComplateFlg decimal(1,0) not null comment '入力完了フラグ' |
179 |
, IntegrationFlg decimal(1,0) not null comment '受注金額積算フラグ' |
180 |
, EntryDate datetime not null comment '登録日付' |
181 |
, UpdateDate datetime not null comment '更新日付' |
182 |
, constraint bk_constructionledger_PKC primary key (ConstructionCode) |
183 |
) comment '工事詳細台帳データ【退避用】' ; |
184 |
|
185 |
-- 工事詳細台帳明細データ【退避用】
|
186 |
drop table if exists bk_constructionledgerdetail cascade; |
187 |
|
188 |
create table bk_constructionledgerdetail ( |
189 |
ConstructionCode decimal(10,0) unsigned not null comment '工事コード' |
190 |
, GroupCount decimal(2,0) unsigned not null comment 'グループ番号' |
191 |
, LineCount decimal(5,0) unsigned not null comment '行番号' |
192 |
, ComponentCode decimal(5,0) unsigned not null comment '構成キー' |
193 |
, ItemCode decimal(5,0) unsigned not null comment '工種キー' |
194 |
, FirstString varchar(120) comment '項目名称' |
195 |
, SecondString varchar(120) comment '工事内容' |
196 |
, CompanyType decimal(1,0) not null comment '協力会社コードタイプ' |
197 |
, CompanyCode decimal(8,0) not null comment '協力会社コード' |
198 |
, CompanyName varchar(120) comment '協力会社名称' |
199 |
, EstimatePrice decimal(12,0) not null comment '予算(見積)金額' |
200 |
, ExecutionAmount decimal(12,0) not null comment '実行金額' |
201 |
, AmountConfigRate decimal(5,2) not null comment '金額構成率' |
202 |
, PaymentBurden decimal(12,0) not null comment '支払補填額' |
203 |
, FixDataFlg decimal(1,0) not null comment '固定データフラグ' |
204 |
, IndependentFlg decimal(1,0) not null comment '独立データフラグ' |
205 |
, FluctuationFlg decimal(1,0) not null comment '増減データフラグ' |
206 |
, SalaryFlg decimal(1,0) not null comment '給与振分区分' |
207 |
, SalaryDays decimal(4,0) not null comment '給与振分日数' |
208 |
, OperatingFlg decimal(1,0) not null comment '担当中フラグ' |
209 |
, SourceCode decimal(10,0) unsigned not null comment '元工事番号' |
210 |
, JoinTitleFlg decimal(1,0) not null comment '工事名称タイトル' |
211 |
, SalaryOnRegist decimal(12,0) not null comment '登録時月額給与' |
212 |
, PurchaseOrderFlg decimal(2,0) not null comment '注文書発行フラグ' |
213 |
, EntryDate datetime not null comment '登録日付' |
214 |
, UpdateDate datetime not null comment '更新日付' |
215 |
, constraint bk_constructionledgerdetail_PKC primary key (ConstructionCode,GroupCount,LineCount) |
216 |
) comment '工事詳細台帳明細データ【退避用】' ; |
217 |
|
218 |
-- 工事詳細台帳実行データ【退避用】
|
219 |
drop table if exists bk_constructionledgerexcute cascade; |
220 |
|
221 |
create table bk_constructionledgerexcute ( |
222 |
ConstructionCode decimal(10,0) unsigned not null comment '工事コード' |
223 |
, GroupCount decimal(2,0) unsigned not null comment 'グループ番号' |
224 |
, LineCount decimal(5,0) unsigned not null comment '行番号' |
225 |
, ColumnCount decimal(3,0) not null comment '列番号' |
226 |
, PaymentAmount decimal(12,0) not null comment '支払金額' |
227 |
, TargetMonth date not null comment '対象年月' |
228 |
, EntryDate datetime not null comment '登録日付' |
229 |
, UpdateDate datetime not null comment '更新日付' |
230 |
, constraint bk_constructionledgerexcute_PKC primary key (ConstructionCode,GroupCount,LineCount,ColumnCount) |
231 |
) comment '工事詳細台帳実行データ【退避用】' ; |
232 |
|
233 |
-- 積算見積データ【退避用】
|
234 |
drop table if exists bk_estimatedata cascade; |
235 |
|
236 |
create table bk_estimatedata ( |
237 |
SaveDate datetime not null comment '退避日付' |
238 |
, ConstructionCode decimal(10,0) unsigned not null comment '工事コード' |
239 |
, LineCount decimal(3,0) unsigned not null comment '行番号' |
240 |
, ComponentCode decimal(5,0) unsigned not null comment '構成キー' |
241 |
, FixedItemCode varchar(1) comment '固定項目キー' |
242 |
, ItemName varchar(120) comment '作業名称' |
243 |
, SpecName varchar(120) comment '作業/品質・形状・寸法' |
244 |
, PriceValue decimal(14,0) not null comment '金額' |
245 |
, note varchar(60) comment '備考' |
246 |
, MyExpensesFlg decimal(1,0) not null comment '自社経費フラグ' |
247 |
, InputFlg decimal(1,0) not null comment '入力フラグ' |
248 |
, EntryDate datetime not null comment '登録日付' |
249 |
, UpdateDate datetime not null comment '更新日付' |
250 |
, constraint bk_estimatedata_PKC primary key (SaveDate,ConstructionCode,LineCount) |
251 |
) comment '積算見積データ【退避用】' ; |
252 |
|
253 |
-- 積算見積ページデータ【退避用】
|
254 |
drop table if exists bk_estimatedatabody cascade; |
255 |
|
256 |
create table bk_estimatedatabody ( |
257 |
SaveDate datetime not null comment '退避日付' |
258 |
, ConstructionCode decimal(10,0) unsigned not null comment '工事コード' |
259 |
, PageCount decimal(4,0) unsigned not null comment 'ページ番号' |
260 |
, Category decimal(1,0) not null comment 'ページ区分' |
261 |
, UnionComponentCode decimal(5,0) unsigned not null comment '所属構成キー' |
262 |
, ComponentCode decimal(5,0) unsigned not null comment '構成キー' |
263 |
, ItemCode decimal(5,0) unsigned not null comment '工種キー' |
264 |
, SelectComponent decimal(5,0) unsigned not null comment '選択構成キー' |
265 |
, PageTitle varchar(120) not null comment 'ページ表示名' |
266 |
, DetailLineCount decimal(3,0) unsigned not null comment '明細行番号' |
267 |
, EntryDate datetime not null comment '登録日付' |
268 |
, UpdateDate datetime not null comment '更新日付' |
269 |
, constraint bk_estimatedatabody_PKC primary key (SaveDate,ConstructionCode,PageCount) |
270 |
) comment '積算見積ページデータ【退避用】' ; |
271 |
|
272 |
-- 積算見積データ明細【退避用】
|
273 |
drop table if exists bk_estimatedatadetail cascade; |
274 |
|
275 |
create table bk_estimatedatadetail ( |
276 |
SaveDate datetime not null comment '退避日付' |
277 |
, ConstructionCode decimal(10,0) unsigned not null comment '工事コード' |
278 |
, PageCount decimal(4,0) unsigned not null comment 'ページ番号' |
279 |
, LineCount decimal(3,0) unsigned not null comment '行番号' |
280 |
, DataType decimal(1,0) not null comment 'データ種別' |
281 |
, ComponentCode decimal(5,0) unsigned not null comment '構成キー' |
282 |
, ItemCode decimal(5,0) unsigned not null comment '工種キー' |
283 |
, SpecCode decimal(5,0) unsigned not null comment '作業キー' |
284 |
, ItemName varchar(120) comment '作業名称' |
285 |
, SpecName varchar(120) comment '作業/品質・形状・寸法' |
286 |
, Unitcount decimal(8,2) not null comment '数量' |
287 |
, UnitName varchar(30) comment '単位名称' |
288 |
, UnitPrice decimal(9,2) not null comment '単価' |
289 |
, LineTotal decimal(12,0) not null comment '金額' |
290 |
, note varchar(60) comment '備考' |
291 |
, CompanyCode decimal(8,0) not null comment '協力会社コード' |
292 |
, MyExpensesFlg decimal(1,0) not null comment '自社経費フラグ' |
293 |
, InputFlg decimal(1,0) comment '入力フラグ' |
294 |
, EntryDate datetime not null comment '登録日付' |
295 |
, UpdateDate datetime not null comment '更新日付' |
296 |
, constraint bk_estimatedatadetail_PKC primary key (SaveDate,ConstructionCode,PageCount,LineCount) |
297 |
) comment '積算見積データ明細【退避用】' ; |
298 |
|
299 |
-- 法人格マスタ
|
300 |
drop index BusinessTypeMaster_Index1 on businesstypemaster; |
301 |
|
302 |
drop table if exists businesstypemaster cascade; |
303 |
|
304 |
create table businesstypemaster ( |
305 |
BusinessTypeCode decimal(5,0) unsigned not null comment '法人格コード' |
306 |
, DisplayOrder decimal(5,0) unsigned not null comment '表示順' |
307 |
, BusinessTypeName varchar(100) not null comment '業種名' |
308 |
, EntryDate datetime not null comment '登録日付' |
309 |
, UpdateDate datetime not null comment '更新日付' |
310 |
, constraint businesstypemaster_PKC primary key (BusinessTypeCode) |
311 |
) comment '法人格マスタ' ; |
312 |
|
313 |
create index BusinessTypeMaster_Index1 |
314 |
on businesstypemaster(DisplayOrder);
|
315 |
|
316 |
-- 共通費大項目マスタ
|
317 |
drop table if exists commoncostlarge cascade; |
318 |
|
319 |
create table commoncostlarge ( |
320 |
LargeCode decimal(5,0) unsigned not null comment '大項目キー' |
321 |
, DisplayOrder decimal(5,0) unsigned not null comment '表示順' |
322 |
, LargeName varchar(50) not null comment '大項目名称' |
323 |
, CommentText varchar(120) comment '説明書き' |
324 |
, DeleteFlg decimal(1,0) not null comment '削除フラグ' |
325 |
, EntryDate datetime not null comment '登録日付' |
326 |
, UpdateDate datetime not null comment '更新日付' |
327 |
, constraint commoncostlarge_PKC primary key (LargeCode) |
328 |
) comment '共通費大項目マスタ' ; |
329 |
|
330 |
-- 共通費工種関連マスタ
|
331 |
drop table if exists commoncostlinkms cascade; |
332 |
|
333 |
create table commoncostlinkms ( |
334 |
LargeCode decimal(5,0) unsigned not null comment '大項目キー' |
335 |
, MiddleCode decimal(5,0) unsigned not null comment '中項目キー' |
336 |
, ItemCode decimal(5,0) unsigned not null comment '工種キー' |
337 |
, EntryDate datetime comment '登録日付' |
338 |
, UpdateDate datetime comment '更新日付' |
339 |
, constraint commoncostlinkms_PKC primary key (LargeCode,MiddleCode,ItemCode) |
340 |
) comment '共通費工種関連マスタ' ; |
341 |
|
342 |
-- 共通費中項目マスタ
|
343 |
drop table if exists commoncostmiddle cascade; |
344 |
|
345 |
create table commoncostmiddle ( |
346 |
LargeCode decimal(5,0) unsigned not null comment '大項目キー' |
347 |
, MiddleCode decimal(5,0) unsigned not null comment '中項目キー' |
348 |
, DisplayOrder decimal(5,0) unsigned not null comment '表示順' |
349 |
, MiddleName varchar(50) not null comment '中項目名称' |
350 |
, CommentText varchar(120) comment '説明書き' |
351 |
, DeleteFlg decimal(1,0) not null comment '削除フラグ' |
352 |
, EntryDate datetime not null comment '登録日付' |
353 |
, UpdateDate datetime not null comment '更新日付' |
354 |
, constraint commoncostmiddle_PKC primary key (LargeCode,MiddleCode) |
355 |
) comment '共通費中項目マスタ' ; |
356 |
|
357 |
-- 共通費中項目キーマスタ
|
358 |
drop table if exists commoncostmiddlesearchword cascade; |
359 |
|
360 |
create table commoncostmiddlesearchword ( |
361 |
LargeCode decimal(5,0) unsigned not null comment '大項目キー' |
362 |
, MiddleCode decimal(5,0) unsigned not null comment '中項目キー' |
363 |
, SeqNo decimal(5,0) unsigned not null comment '順序' |
364 |
, SearchWord varchar(50) not null comment '検索項目' |
365 |
, EntryDate datetime not null comment '登録日付' |
366 |
, UpdateDate datetime not null comment '更新日付' |
367 |
, constraint commoncostmiddlesearchword_PKC primary key (LargeCode,MiddleCode,SeqNo) |
368 |
) comment '共通費中項目キーマスタ' ; |
369 |
|
370 |
-- 構成工種関連マスタ
|
371 |
drop index ComponentLinkMaster_Index1 on componentlinkmaster; |
372 |
drop index ComponentLinkMaster_Index2 on componentlinkmaster; |
373 |
|
374 |
drop table if exists componentlinkmaster cascade; |
375 |
|
376 |
create table componentlinkmaster ( |
377 |
ComponentCode decimal(5,0) unsigned not null comment '構成キー' |
378 |
, ItemCode decimal(5,0) unsigned not null comment '工種キー' |
379 |
, DisplayOrder decimal(5,0) unsigned comment '表示順' |
380 |
, EntryDate datetime not null comment '登録日付' |
381 |
, UpdateDate datetime not null comment '更新日付' |
382 |
, constraint componentlinkmaster_PKC primary key (ComponentCode,ItemCode) |
383 |
) comment '構成工種関連マスタ' ; |
384 |
|
385 |
create index ComponentLinkMaster_Index1 |
386 |
on componentlinkmaster(ComponentCode);
|
387 |
|
388 |
create index ComponentLinkMaster_Index2 |
389 |
on componentlinkmaster(ItemCode);
|
390 |
|
391 |
-- 構成マスタ
|
392 |
drop index ComponentMaster_Index1 on componentmaster; |
393 |
|
394 |
drop table if exists componentmaster cascade; |
395 |
|
396 |
create table componentmaster ( |
397 |
ComponentCode decimal(5,0) unsigned not null comment '構成キー' |
398 |
, DisplayOrder decimal(5,0) unsigned not null comment '表示順' |
399 |
, ComponentName varchar(120) not null comment '構成名称' |
400 |
, SubItemsFlg decimal(1,0) comment '下位項目フラグ' |
401 |
, DirectInputFlg decimal(1,0) comment '直接入力フラグ' |
402 |
, MyExpensesFlg decimal(1,0) comment '自社経費フラグ' |
403 |
, DeleteFlg decimal(1,0) not null comment '削除フラグ' |
404 |
, EntryDate datetime not null comment '登録日付' |
405 |
, UpdateDate datetime not null comment '更新日付' |
406 |
, constraint componentmaster_PKC primary key (ComponentCode) |
407 |
) comment '構成マスタ' ; |
408 |
|
409 |
create index ComponentMaster_Index1 |
410 |
on componentmaster(DisplayOrder);
|
411 |
|
412 |
-- 構成工事種別関連マスタ
|
413 |
drop index ComponentToTypeMaster_Index1 on componenttotypemaster; |
414 |
drop index ComponentToTypeMaster_Index2 on componenttotypemaster; |
415 |
|
416 |
drop table if exists componenttotypemaster cascade; |
417 |
|
418 |
create table componenttotypemaster ( |
419 |
ComponentCode decimal(5,0) unsigned not null comment '構成キー' |
420 |
, TypeCode decimal(5,0) unsigned not null comment '工事種別コード' |
421 |
, Dummy decimal(1,0) not null comment 'ダミー項目' |
422 |
, EntryDate datetime not null comment '登録日付' |
423 |
, UpdateDate datetime not null comment '更新日付' |
424 |
, constraint componenttotypemaster_PKC primary key (ComponentCode,TypeCode) |
425 |
) comment '構成工事種別関連マスタ' ; |
426 |
|
427 |
create index ComponentToTypeMaster_Index1 |
428 |
on componenttotypemaster(ComponentCode);
|
429 |
|
430 |
create index ComponentToTypeMaster_Index2 |
431 |
on componenttotypemaster(TypeCode);
|
432 |
|
433 |
-- 工事基本情報
|
434 |
drop index BaseInfo_Index1 on constructionbaseinfo; |
435 |
drop index BaseInfo_Index2 on constructionbaseinfo; |
436 |
drop index BaseInfo_Index3 on constructionbaseinfo; |
437 |
drop index BaseInfo_Index4 on constructionbaseinfo; |
438 |
drop index BaseInfo_Index5 on constructionbaseinfo; |
439 |
drop index BaseInfo_Index6 on constructionbaseinfo; |
440 |
|
441 |
drop table if exists constructionbaseinfo cascade; |
442 |
|
443 |
create table constructionbaseinfo ( |
444 |
ConstructionCode decimal(10,0) unsigned not null comment '工事コード' |
445 |
, TyingFlg decimal(1,0) not null comment '紐付データフラグ' |
446 |
, JoinFlg decimal(1,0) not null comment '結合契約工事フラグ' |
447 |
, ConstructionYear smallint(5) unsigned not null comment '工事年度' |
448 |
, ConstructionPeriod smallint(5) unsigned not null comment '工事期数' |
449 |
, RequestedDate date comment '依頼受け日' |
450 |
, EstimatesSubmitDeadline date comment '見積提出期限' |
451 |
, EstimatesSubmittedDate date comment '見積提出日' |
452 |
, ProvisionalOrderDate date comment '仮受注日' |
453 |
, OrderDate date comment '受注日' |
454 |
, OrderStartingDate date comment '開始予定日' |
455 |
, OrderCompletionDate date comment '完了予定日' |
456 |
, PreparationStartDate date comment '施工準備開始日' |
457 |
, ConstructionStartingDate date comment '施工開始日' |
458 |
, ConstructionCompletionDate date comment '施工完了日' |
459 |
, NonOrderDate date comment '非受注日' |
460 |
, OrdersDecisionPrice decimal(12,0) not null comment '税抜受注決定金額' |
461 |
, OrdersDecisionPriceInTax decimal(12,0) not null comment '税込受注決定金額' |
462 |
, SalesPersonCode decimal(8,0) comment '営業担当者名' |
463 |
, ConstructionPersonCode decimal(8,0) not null comment '工事担当者' |
464 |
, ConstrSubPersonCode decimal(8,0) not null comment '工事副担当者' |
465 |
, ConstructionInstructor decimal(8,0) not null comment '工事指導員' |
466 |
, TransferConstruction decimal(8,0) not null comment '工事移管先コード' |
467 |
, TransferConstructionDate date comment '工事移管日' |
468 |
, OrderersDivision decimal(5,0) not null comment '発注者区分' |
469 |
, OrderersCode decimal(5,0) unsigned not null comment '発注者コード' |
470 |
, EstimatesExpirationDate date comment '見積有効期限' |
471 |
, ConstructionPeriodStart date comment '契約工期開始日' |
472 |
, ConstructionPeriodEnd date comment '契約工期完了' |
473 |
, ConstructionPeriodStart2 date comment '契約工期開始(延長時)' |
474 |
, ConstructionPeriodEnd2 date comment '契約工期完了(延長時)' |
475 |
, StartDate date comment '工事開始日' |
476 |
, EndDate date comment '工事終了日' |
477 |
, PurchaseOrderMailingDate date comment '注文書郵送日' |
478 |
, PurchaseOrderReturnDate date comment '注文書返送日' |
479 |
, PurchaseOrderReturnCheckDate date comment '注文書返送確認日' |
480 |
, ConsumptionTaxFlg decimal(1,0) not null comment '消費税フラグ' |
481 |
, PrimeContractorFlg decimal(1,0) not null comment '元請フラグ' |
482 |
, SalesCostFlg decimal(1,0) not null comment '営業経費発生フラグ' |
483 |
, ConstructionStatusFlg decimal(2,0) not null comment '工事状態フラグ' |
484 |
, ConstructionType decimal(5,0) not null comment '工事種別コード' |
485 |
, EstimateType decimal(1,0) not null comment '見積種別' |
486 |
, BillingStartDate date not null comment '請求準備開始日' |
487 |
, BillingDate date not null comment '請求日' |
488 |
, BillingSplitFlg decimal(1,0) not null comment '請求回数フラグ' |
489 |
, BillingSendDate date comment '請求書郵送/手渡し日' |
490 |
, LedgerComplateDate date not null comment '工事詳細台帳入力完了日付' |
491 |
, EntryDate datetime not null comment '登録日付' |
492 |
, UpdateDate datetime not null comment '更新日付' |
493 |
, constraint constructionbaseinfo_PKC primary key (ConstructionCode) |
494 |
) comment '工事基本情報' ; |
495 |
|
496 |
create index BaseInfo_Index1 |
497 |
on constructionbaseinfo(ConstructionStatusFlg);
|
498 |
|
499 |
create index BaseInfo_Index2 |
500 |
on constructionbaseinfo(EstimateType);
|
501 |
|
502 |
create index BaseInfo_Index3 |
503 |
on constructionbaseinfo(SalesPersonCode);
|
504 |
|
505 |
create index BaseInfo_Index4 |
506 |
on constructionbaseinfo(ConstructionPersonCode);
|
507 |
|
508 |
create index BaseInfo_Index5 |
509 |
on constructionbaseinfo(ConstructionInstructor);
|
510 |
|
511 |
create index BaseInfo_Index6 |
512 |
on constructionbaseinfo(ConstructionPeriod);
|
513 |
|
514 |
-- 工事基本情報明細
|
515 |
drop index BaseInfoDetail_Idx1 on constructionbaseinfodetail; |
516 |
drop index BaseInfoDetail_Idx2 on constructionbaseinfodetail; |
517 |
|
518 |
drop table if exists constructionbaseinfodetail cascade; |
519 |
|
520 |
create table constructionbaseinfodetail ( |
521 |
ConstructionCode decimal(10,0) unsigned not null comment '工事コード' |
522 |
, DetailNo decimal(2,0) not null comment '明細番号' |
523 |
, DetailString varchar(120) comment '明細内容' |
524 |
, EntryDate datetime not null comment '登録日付' |
525 |
, UpdateDate datetime not null comment '更新日付' |
526 |
, constraint constructionbaseinfodetail_PKC primary key (ConstructionCode,DetailNo) |
527 |
) comment '工事基本情報明細' ; |
528 |
|
529 |
create index BaseInfoDetail_Idx1 |
530 |
on constructionbaseinfodetail(ConstructionCode);
|
531 |
|
532 |
create index BaseInfoDetail_Idx2 |
533 |
on constructionbaseinfodetail(DetailNo);
|
534 |
|
535 |
-- 工事施工予算データ
|
536 |
drop table if exists constructionbudget cascade; |
537 |
|
538 |
create table constructionbudget ( |
539 |
ConstructionCode decimal(10,0) unsigned not null comment '工事コード' |
540 |
, CreatorCode decimal(8,0) not null comment '作成者コード' |
541 |
, CreatorName varchar(60) comment '作成者名' |
542 |
, CreatorCosts decimal(11,0) not null comment '作成者給与' |
543 |
, AssistantCode decimal(8,0) not null comment '副担当者コード' |
544 |
, AssistantName varchar(60) comment '副担当者名' |
545 |
, AssistantCosts decimal(11,0) not null comment '副担当者給与' |
546 |
, InstructorCode decimal(8,0) not null comment '工事指導員コード' |
547 |
, InstructorName varchar(60) comment '工事指導員名' |
548 |
, InstructorCosts decimal(11,0) not null comment '工事指導員給与' |
549 |
, CreateDate date not null comment '作成日' |
550 |
, ConstructionTimes decimal(5,2) not null comment '工期(単位・月)' |
551 |
, ConstructionStart date not null comment '契約工期開始' |
552 |
, ConstructionEnd date not null comment '契約工期完了' |
553 |
, InstructorTimes decimal(5,2) not null comment '指導員稼働月数' |
554 |
, SalaryFlg decimal(1,0) not null comment '給与振分区分' |
555 |
, SalaryDays decimal(4,0) not null comment '振分日数' |
556 |
, A_SalaryFlg decimal(1,0) not null comment '副担当者給与振分区分' |
557 |
, A_SalaryDays decimal(4,0) not null comment '副担当者振分日数' |
558 |
, I_SalaryFlg decimal(1,0) not null comment '指導員給与振分区分' |
559 |
, I_SalaryDays decimal(4,0) not null comment '指導員振分日数' |
560 |
, EntryDate datetime not null comment '登録日付' |
561 |
, UpdateDate datetime not null comment '更新日付' |
562 |
, constraint constructionbudget_PKC primary key (ConstructionCode) |
563 |
) comment '工事施工予算データ' ; |
564 |
|
565 |
-- 工事施工予算データ明細
|
566 |
drop table if exists constructionbudgetdetail cascade; |
567 |
|
568 |
create table constructionbudgetdetail ( |
569 |
ConstructionCode decimal(10,0) unsigned not null comment '工事コード' |
570 |
, GroupCount decimal(2,0) unsigned not null comment 'グループ番号' |
571 |
, LineCount decimal(3,0) unsigned not null comment '行番号' |
572 |
, ComponentCode decimal(5,0) unsigned not null comment '構成キー' |
573 |
, ItemCode decimal(5,0) unsigned not null comment '工種キー' |
574 |
, FirstString varchar(120) comment '項目名称' |
575 |
, SecondString varchar(120) comment '工事内容' |
576 |
, CompanyType decimal(1,0) not null comment '協力会社コードタイプ' |
577 |
, CompanyCode decimal(8,0) not null comment '協力会社コード' |
578 |
, CompanyName varchar(120) comment '協力会社名称' |
579 |
, EstimatePrice decimal(12,0) not null comment '積算時見積金額' |
580 |
, NegotiationPrice decimal(12,0) not null comment '積算時交渉金額' |
581 |
, OrderDesiredAmount decimal(12,0) not null comment '発注希望金額' |
582 |
, ExecutionAmount decimal(12,0) not null comment '実行金額' |
583 |
, AmountConfigRate decimal(5,2) not null comment '金額構成率' |
584 |
, NegotiateFlg decimal(1,0) not null comment '協力業者交渉フラグ' |
585 |
, EntryDate datetime not null comment '登録日付' |
586 |
, UpdateDate datetime not null comment '更新日付' |
587 |
, constraint constructionbudgetdetail_PKC primary key (ConstructionCode,GroupCount,LineCount) |
588 |
) comment '工事施工予算データ明細' ; |
589 |
|
590 |
-- 工種マスタ
|
591 |
drop table if exists constructionitemmaster cascade; |
592 |
|
593 |
create table constructionitemmaster ( |
594 |
ItemCode decimal(5,0) unsigned not null comment '工種キー' |
595 |
, DisplayOrder decimal(5,0) unsigned not null comment '表示順' |
596 |
, ItemName varchar(120) not null comment '工種名称' |
597 |
, SubItemsFlg decimal(1,0) comment '下位項目フラグ' |
598 |
, MyExpensesFlg decimal(1,0) not null comment '自社経費フラグ' |
599 |
, DeleteFlg decimal(1,0) not null comment '削除フラグ' |
600 |
, EntryDate datetime not null comment '登録日付' |
601 |
, UpdateDate datetime not null comment '更新日付' |
602 |
, constraint constructionitemmaster_PKC primary key (ItemCode) |
603 |
) comment '工種マスタ' ; |
604 |
|
605 |
-- 工事詳細台帳データ
|
606 |
drop table if exists constructionledger cascade; |
607 |
|
608 |
create table constructionledger ( |
609 |
ConstructionCode decimal(10,0) unsigned not null comment '工事コード' |
610 |
, ConstructionPeriod decimal(4,0) unsigned not null comment '事業期' |
611 |
, CreatorCode decimal(8,0) comment '作成者コード' |
612 |
, CreatorName varchar(60) comment '作成者名' |
613 |
, CreateDate date not null comment '作成日' |
614 |
, ConstructionTimes decimal(5,2) not null comment '工期(単位・月)' |
615 |
, ConstructionStart date not null comment '契約工期開始' |
616 |
, ConstructionEnd date not null comment '契約工期完了' |
617 |
, OrdersDecisionPrice decimal(14,0) not null comment '税抜受注決定金額' |
618 |
, CompanyExpenses decimal(10,0) not null comment '会社経費合計' |
619 |
, DepartmentExpenses decimal(10,0) not null comment '部署経費合計' |
620 |
, SalesExpenses decimal(10,0) not null comment '営業経費合計' |
621 |
, TotalPayment decimal(10,0) not null comment '総支払額' |
622 |
, GrossProfit decimal(10,0) not null comment '粗利' |
623 |
, Allowance decimal(10,0) not null comment '給与' |
624 |
, NetProfit decimal(10,0) not null comment '純利益' |
625 |
, ComplateFlg decimal(1,0) not null comment '入力完了フラグ' |
626 |
, IntegrationFlg decimal(1,0) not null comment '受注金額積算フラグ' |
627 |
, EntryDate datetime not null comment '登録日付' |
628 |
, UpdateDate datetime not null comment '更新日付' |
629 |
, constraint constructionledger_PKC primary key (ConstructionCode) |
630 |
) comment '工事詳細台帳データ' ; |
631 |
|
632 |
-- 工事詳細台帳明細データ
|
633 |
drop index LedgerDetail_Index01 on constructionledgerdetail; |
634 |
drop index LedgerDetail_Index02 on constructionledgerdetail; |
635 |
drop index LedgerDetail_Index03 on constructionledgerdetail; |
636 |
|
637 |
drop table if exists constructionledgerdetail cascade; |
638 |
|
639 |
create table constructionledgerdetail ( |
640 |
ConstructionCode decimal(10,0) unsigned not null comment '工事コード' |
641 |
, GroupCount decimal(2,0) unsigned not null comment 'グループ番号' |
642 |
, LineCount decimal(3,0) unsigned not null comment '行番号' |
643 |
, ComponentCode decimal(5,0) unsigned not null comment '構成キー' |
644 |
, ItemCode decimal(5,0) unsigned not null comment '工種キー' |
645 |
, FirstString varchar(120) comment '項目名称' |
646 |
, SecondString varchar(120) comment '工事内容' |
647 |
, CompanyType decimal(1,0) not null comment '協力会社コードタイプ' |
648 |
, CompanyCode decimal(8,0) not null comment '協力会社コード' |
649 |
, CompanyName varchar(120) comment '協力会社名称' |
650 |
, EstimatePrice decimal(12,0) not null comment '予算(見積)金額' |
651 |
, ExecutionAmount decimal(12,0) not null comment '実行金額' |
652 |
, AmountConfigRate decimal(5,2) not null comment '金額構成率' |
653 |
, PaymentBurden decimal(12,0) not null comment '支払補填額' |
654 |
, FixDataFlg decimal(1,0) not null comment '固定データフラグ' |
655 |
, IndependentFlg decimal(1,0) not null comment '独立データフラグ' |
656 |
, FluctuationFlg decimal(1,0) not null comment '増減データフラグ' |
657 |
, SalaryFlg decimal(1,0) not null comment '給与振分区分' |
658 |
, SalaryDays decimal(4,0) not null comment '給与振分日数' |
659 |
, OperatingFlg decimal(1,0) not null comment '担当中フラグ' |
660 |
, SourceCode decimal(10,0) unsigned not null comment '元工事番号' |
661 |
, JoinTitleFlg decimal(1,0) not null comment '工事名称タイトル' |
662 |
, SalaryOnRegist decimal(12,0) not null comment '登録時月額給与' |
663 |
, PurchaseOrderFlg decimal(2,0) not null comment '注文書発行フラグ' |
664 |
, EntryDate datetime not null comment '登録日付' |
665 |
, UpdateDate datetime not null comment '更新日付' |
666 |
, constraint constructionledgerdetail_PKC primary key (ConstructionCode,GroupCount,LineCount) |
667 |
) comment '工事詳細台帳明細データ' ; |
668 |
|
669 |
create index LedgerDetail_Index01 |
670 |
on constructionledgerdetail(ConstructionCode);
|
671 |
|
672 |
create index LedgerDetail_Index02 |
673 |
on constructionledgerdetail(GroupCount);
|
674 |
|
675 |
create index LedgerDetail_Index03 |
676 |
on constructionledgerdetail(SourceCode);
|
677 |
|
678 |
-- 工事詳細台帳実行データ
|
679 |
drop index LedgerExcute_Index1 on constructionledgerexcute; |
680 |
|
681 |
drop table if exists constructionledgerexcute cascade; |
682 |
|
683 |
create table constructionledgerexcute ( |
684 |
ConstructionCode decimal(10,0) unsigned not null comment '工事コード' |
685 |
, GroupCount decimal(2,0) unsigned not null comment 'グループ番号' |
686 |
, LineCount decimal(3,0) unsigned not null comment '行番号' |
687 |
, ColumnCount decimal(3,0) not null comment '列番号' |
688 |
, PaymentAmount decimal(12,0) not null comment '支払金額' |
689 |
, TargetMonth date not null comment '対象年月' |
690 |
, EntryDate datetime not null comment '登録日付' |
691 |
, UpdateDate datetime not null comment '更新日付' |
692 |
, constraint constructionledgerexcute_PKC primary key (ConstructionCode,GroupCount,LineCount,ColumnCount) |
693 |
) comment '工事詳細台帳実行データ' ; |
694 |
|
695 |
create index LedgerExcute_Index1 |
696 |
on constructionledgerexcute(ConstructionCode,TargetMonth,GroupCount,LineCount);
|
697 |
|
698 |
-- 工事リンク情報
|
699 |
drop index ConstructionLink_Index1 on constructionlink; |
700 |
drop index ConstructionLink_Index2 on constructionlink; |
701 |
drop index ConstructionLink_Index3 on constructionlink; |
702 |
|
703 |
drop table if exists constructionlink cascade; |
704 |
|
705 |
create table constructionlink ( |
706 |
ConstructionCode decimal(10,0) unsigned not null comment '工事コード' |
707 |
, FluctuationCode decimal(10,0) not null comment '子工事番号' |
708 |
, LinkType decimal(1,0) not null comment 'リンク種別' |
709 |
, EntryDate datetime not null comment '登録日付' |
710 |
, UpdateDate datetime not null comment '更新日付' |
711 |
, constraint constructionlink_PKC primary key (ConstructionCode,FluctuationCode) |
712 |
) comment '工事リンク情報' ; |
713 |
|
714 |
create index ConstructionLink_Index1 |
715 |
on constructionlink(ConstructionCode);
|
716 |
|
717 |
create index ConstructionLink_Index2 |
718 |
on constructionlink(FluctuationCode);
|
719 |
|
720 |
create index ConstructionLink_Index3 |
721 |
on constructionlink(LinkType);
|
722 |
|
723 |
-- 工事資材情報
|
724 |
drop table if exists constructionmaterialinfo cascade; |
725 |
|
726 |
create table constructionmaterialinfo ( |
727 |
CONSTRUCTIONCODE int(10) unsigned default 0 not null comment '工事番号' |
728 |
, MATERIALITEMCODE smallint(5) unsigned default 0 not null comment '資材品目コード' |
729 |
, RENTCOUNT smallint(5) unsigned comment '貸出数' |
730 |
, REPAYCOUNT smallint(5) unsigned comment '返却数' |
731 |
, COMPLETEFLG tinyint(3) unsigned comment '完了フラグ' |
732 |
, ENTRYDATE datetime comment '登録日付' |
733 |
, UPDATEDATE datetime comment '更新日付' |
734 |
, constraint constructionmaterialinfo_PKC primary key (CONSTRUCTIONCODE,MATERIALITEMCODE) |
735 |
) comment '工事資材情報' ; |
736 |
|
737 |
-- 案件進捗日付データ
|
738 |
drop table if exists constructionprogressdate cascade; |
739 |
|
740 |
create table constructionprogressdate ( |
741 |
ConstructionCode decimal(10,0) not null comment '工事番号' |
742 |
, ConstructionStatusFlg decimal(2,0) not null comment '設定工事状態' |
743 |
, PreviousStatusFlg decimal(2,0) comment '変更前状態' |
744 |
, ChangeDate datetime not null comment '設定日付' |
745 |
, ChangePersonCode decimal(8,0) not null comment '設定担当者' |
746 |
, EntryDate datetime not null comment '登録日付' |
747 |
, UpdateDate datetime not null comment '更新日付' |
748 |
, constraint constructionprogressdate_PKC primary key (ConstructionCode,ConstructionStatusFlg) |
749 |
) comment '案件進捗日付データ' ; |
750 |
|
751 |
-- 作業マスタ
|
752 |
drop index ConstructionSpecMaster_Index1 on constructionspecmaster; |
753 |
|
754 |
drop table if exists constructionspecmaster cascade; |
755 |
|
756 |
create table constructionspecmaster ( |
757 |
ItemCode decimal(5,0) unsigned not null comment '工種キー' |
758 |
, SpecCode decimal(5,0) unsigned not null comment '作業キー' |
759 |
, DisplayOrder decimal(5,0) unsigned not null comment '表示順' |
760 |
, ItemName varchar(120) comment '作業名称' |
761 |
, SpecName varchar(120) comment '作業名称' |
762 |
, UnitName varchar(30) comment '単位名称' |
763 |
, UnitPrice decimal(9,2) not null comment '単価' |
764 |
, DeleteFlg decimal(1,0) not null comment '削除フラグ' |
765 |
, EntryDate datetime not null comment '登録日付' |
766 |
, UpdateDate datetime not null comment '更新日付' |
767 |
, constraint constructionspecmaster_PKC primary key (ItemCode,SpecCode) |
768 |
) comment '作業マスタ' ; |
769 |
|
770 |
create index ConstructionSpecMaster_Index1 |
771 |
on constructionspecmaster(DisplayOrder);
|
772 |
|
773 |
-- 作業単価マスタ
|
774 |
drop table if exists constructionspecunitprice cascade; |
775 |
|
776 |
create table constructionspecunitprice ( |
777 |
ComponentCode decimal(5,0) unsigned not null comment '構成キー' |
778 |
, ItemCode decimal(5,0) unsigned not null comment '工種キー' |
779 |
, SpecCode decimal(5,0) unsigned not null comment '作業キー' |
780 |
, ConstructionTypeCode mediumint(8) unsigned not null comment '工事種別コード' |
781 |
, UnitPrice decimal(9,2) not null comment '単価' |
782 |
, EntryDate datetime not null comment '登録日付' |
783 |
, UpdateDate datetime not null comment '更新日付' |
784 |
, constraint constructionspecunitprice_PKC primary key (ComponentCode,ItemCode,SpecCode,ConstructionTypeCode) |
785 |
) comment '作業単価マスタ' ; |
786 |
|
787 |
-- 工事種別マスタ
|
788 |
drop table if exists constructiontypemaster cascade; |
789 |
|
790 |
create table constructiontypemaster ( |
791 |
TypeCode decimal(5,0) unsigned not null comment '工事種別コード' |
792 |
, DisplayOrder decimal(5,0) unsigned not null comment '表示順' |
793 |
, NameString varchar(100) not null comment '名称' |
794 |
, PublicFlg decimal(1,0) not null comment '工事種別フラグ' |
795 |
, SecRank decimal(1,0) not null comment '保護区分ランク' |
796 |
, ExpensesLink decimal(1,0) not null comment '経費使用区分' |
797 |
, DeleteFlg decimal(1,0) not null comment '削除フラグ' |
798 |
, EntryDate datetime not null comment '登録日付' |
799 |
, UpdateDate datetime not null comment '更新日付' |
800 |
, constraint constructiontypemaster_PKC primary key (TypeCode) |
801 |
) comment '工事種別マスタ' ; |
802 |
|
803 |
-- 担当者毎経費データ
|
804 |
drop index CostDataOfPerson_Index1 on costdataofperson; |
805 |
drop index CostDataOfPerson_Index2 on costdataofperson; |
806 |
|
807 |
drop table if exists costdataofperson cascade; |
808 |
|
809 |
create table costdataofperson ( |
810 |
PersonCode decimal(8,0) unsigned not null comment '担当者コード' |
811 |
, ActionDate date not null comment '対象日付' |
812 |
, DataType decimal(1,0) not null comment 'データ区分' |
813 |
, DataAddCount decimal(5,0) unsigned not null comment 'データ追加番号' |
814 |
, TargetMonth varchar(7) not null comment '対象年月' |
815 |
, ConstructionCode decimal(10,0) unsigned comment '工事コード' |
816 |
, SuppliersCode decimal(5,0) unsigned not null comment '支払先コード' |
817 |
, SuppliersName varchar(120) comment '支払先名称' |
818 |
, PaymentContent varchar(60) comment '支払内容' |
819 |
, PaymentType decimal(1,0) not null comment '支払方法フラグ' |
820 |
, EntryPrice decimal(12,0) not null comment '金額(税抜)' |
821 |
, EntryPriceInTax decimal(12,0) not null comment '金額(税込)' |
822 |
, SlipNumber varchar(12) comment '伝票番号' |
823 |
, ComplateFlg decimal(1,0) not null comment '引込済みフラグ' |
824 |
, ApprovalFlg decimal(1,0) not null comment '承認フラグ' |
825 |
, EntryDate datetime not null comment '登録日付' |
826 |
, UpdateDate datetime not null comment '更新日付' |
827 |
, constraint costdataofperson_PKC primary key (PersonCode,ActionDate,DataType,DataAddCount) |
828 |
) comment '担当者毎経費データ' ; |
829 |
|
830 |
create index CostDataOfPerson_Index1 |
831 |
on costdataofperson(TargetMonth);
|
832 |
|
833 |
create index CostDataOfPerson_Index2 |
834 |
on costdataofperson(ConstructionCode);
|
835 |
|
836 |
-- 発注者登録申請データ
|
837 |
drop index CostomerRegist_Index1 on costomerregist; |
838 |
|
839 |
drop table if exists costomerregist cascade; |
840 |
|
841 |
create table costomerregist ( |
842 |
PersonCode decimal(8,0) unsigned not null comment '申請者番号' |
843 |
, CreateDate date not null comment '作成日' |
844 |
, SeqNo decimal(2,0) not null comment 'キー連番' |
845 |
, DataMode decimal(1,0) not null comment 'データ区分' |
846 |
, SourceCotegory decimal(5,0) unsigned not null comment '発注者区分' |
847 |
, SourceCode decimal(5,0) unsigned not null comment '発注者コード' |
848 |
, PetitionPeriod decimal(4,0) unsigned not null comment '事業期' |
849 |
, OrderFlg decimal(1,0) not null comment '法人団体・個人フラグ' |
850 |
, CorporateStatusName varchar(100) comment '法人格名称' |
851 |
, CorporateStatusPoint decimal(1,0) comment '法人格名称位置' |
852 |
, OrderersName1 varchar(60) not null comment '発注者名1' |
853 |
, OrderersName2 varchar(60) comment '発注者名2' |
854 |
, DepartmentName varchar(60) comment '部署名' |
855 |
, ChargePersonName varchar(60) comment '担当者名' |
856 |
, ZipCode varchar(8) comment '郵便番号' |
857 |
, Address1 varchar(60) comment '住所1' |
858 |
, Address2 varchar(60) comment '住所2' |
859 |
, Address3 varchar(60) comment '住所3' |
860 |
, PhoneNumber varchar(13) comment '電話番号' |
861 |
, FaxNumber varchar(13) comment 'FAX番号' |
862 |
, MailAddress varchar(257) comment 'メールアドレス' |
863 |
, Note varchar(300) comment '備考' |
864 |
, OrderCotegory decimal(5,0) unsigned not null comment '発注者区分' |
865 |
, OrderDate date not null comment '申請日' |
866 |
, OrderNo decimal(2,0) unsigned not null comment '申請受付番号' |
867 |
, EntryDate datetime not null comment '登録日付' |
868 |
, UpdateDate datetime not null comment '更新日付' |
869 |
, constraint costomerregist_PKC primary key (PersonCode,CreateDate,SeqNo) |
870 |
) comment '発注者登録申請データ' ; |
871 |
|
872 |
create index CostomerRegist_Index1 |
873 |
on costomerregist(PetitionPeriod);
|
874 |
|
875 |
-- 日報データ
|
876 |
drop index DailyDataConstruction_Index1 on dailydataconstruction; |
877 |
drop index DailyDataConstruction_Index2 on dailydataconstruction; |
878 |
drop index DailyDataConstruction_Index3 on dailydataconstruction; |
879 |
|
880 |
drop table if exists dailydataconstruction cascade; |
881 |
|
882 |
create table dailydataconstruction ( |
883 |
PersonCode decimal(8,0) unsigned not null comment '担当者コード' |
884 |
, DailyDataDate date not null comment '日報作成日' |
885 |
, ConstructionCode decimal(10,0) unsigned not null comment '工事コード' |
886 |
, Weather varchar(60) comment '天気' |
887 |
, EntryDate datetime not null comment '登録日付' |
888 |
, UpdateDate datetime not null comment '更新日付' |
889 |
, constraint dailydataconstruction_PKC primary key (PersonCode,DailyDataDate,ConstructionCode) |
890 |
) comment '日報データ' ; |
891 |
|
892 |
create index DailyDataConstruction_Index1 |
893 |
on dailydataconstruction(PersonCode);
|
894 |
|
895 |
create index DailyDataConstruction_Index2 |
896 |
on dailydataconstruction(DailyDataDate);
|
897 |
|
898 |
create index DailyDataConstruction_Index3 |
899 |
on dailydataconstruction(ConstructionCode);
|
900 |
|
901 |
-- 日報データ (明細)
|
902 |
drop index DailyDataDetail_Index on dailydatadetail; |
903 |
|
904 |
drop table if exists dailydatadetail cascade; |
905 |
|
906 |
create table dailydatadetail ( |
907 |
PersonCode decimal(8,0) unsigned not null comment '担当者コード' |
908 |
, DailyDataDate date not null comment '日報作成日' |
909 |
, ConstructionCode decimal(10,0) unsigned not null comment '工事コード' |
910 |
, SeqNo decimal(3,0) unsigned not null comment '明細行番号' |
911 |
, JobCategoryCode decimal(5,0) not null comment '職種キー' |
912 |
, CompanyCode decimal(8,0) not null comment '協力会社コード' |
913 |
, TodayHeadCount decimal(4,1) not null comment '当日人員数' |
914 |
, TotalHeadCount decimal(5,1) not null comment '累計人員数' |
915 |
, TodayWork varchar(100) comment '当日作業内容' |
916 |
, NextdayWork varchar(100) comment '翌日作業内容' |
917 |
, NextdayHeadCount decimal(4,1) not null comment '翌日人員数' |
918 |
, EntryDate datetime not null comment '登録日付' |
919 |
, UpdateDate datetime not null comment '更新日付' |
920 |
, constraint dailydatadetail_PKC primary key (PersonCode,DailyDataDate,ConstructionCode,SeqNo) |
921 |
) comment '日報データ (明細)' ; |
922 |
|
923 |
create index DailyDataDetail_Index |
924 |
on dailydatadetail(PersonCode,DailyDataDate,ConstructionCode);
|
925 |
|
926 |
-- 日報データ (現場巡回)
|
927 |
drop index DailyDataField_Index on dailydatafield; |
928 |
|
929 |
drop table if exists dailydatafield cascade; |
930 |
|
931 |
create table dailydatafield ( |
932 |
PersonCode decimal(8,0) unsigned not null comment '作成者コード' |
933 |
, DailyDataDate date not null comment '日報作成日' |
934 |
, ConstructionCode decimal(10,0) unsigned not null comment '工事コード' |
935 |
, SeqNo decimal(3,0) unsigned not null comment '明細行番号' |
936 |
, PatrolTime datetime not null comment '巡回時間' |
937 |
, ContentsText varchar(200) comment '内容' |
938 |
, EntryDate datetime not null comment '登録日付' |
939 |
, UpdateDate datetime not null comment '更新日付' |
940 |
, constraint dailydatafield_PKC primary key (PersonCode,DailyDataDate,ConstructionCode,SeqNo) |
941 |
) comment '日報データ (現場巡回)' ; |
942 |
|
943 |
create index DailyDataField_Index |
944 |
on dailydatafield(PersonCode,DailyDataDate,ConstructionCode);
|
945 |
|
946 |
-- 日報データ (資材)
|
947 |
drop index DailyDataMaterials_Index on dailydatamaterials; |
948 |
|
949 |
drop table if exists dailydatamaterials cascade; |
950 |
|
951 |
create table dailydatamaterials ( |
952 |
PersonCode decimal(8,0) unsigned not null comment '作成者コード' |
953 |
, DailyDataDate date not null comment '日報作成日' |
954 |
, ConstructionCode decimal(10,0) unsigned not null comment '工事コード' |
955 |
, SeqNo decimal(3,0) unsigned not null comment '明細行番号' |
956 |
, Materials varchar(100) comment '資材名' |
957 |
, Quantity varchar(100) comment '数量' |
958 |
, Production varchar(100) comment '制作会社' |
959 |
, Delivery varchar(100) comment '納入業者' |
960 |
, QualityControl varchar(100) comment '品質管理事項' |
961 |
, EntryDate datetime not null comment '登録日付' |
962 |
, UpdateDate datetime not null comment '更新日付' |
963 |
, constraint dailydatamaterials_PKC primary key (PersonCode,DailyDataDate,ConstructionCode,SeqNo) |
964 |
) comment '日報データ (資材)' ; |
965 |
|
966 |
create index DailyDataMaterials_Index |
967 |
on dailydatamaterials(PersonCode,DailyDataDate,ConstructionCode);
|
968 |
|
969 |
-- 日報データ (協力業者指示)
|
970 |
drop index DailyDataSubcontractors_Index on dailydatasubcontractors; |
971 |
|
972 |
drop table if exists dailydatasubcontractors cascade; |
973 |
|
974 |
create table dailydatasubcontractors ( |
975 |
PersonCode decimal(8,0) unsigned not null comment '作成者コード' |
976 |
, DailyDataDate date not null comment '日報作成日' |
977 |
, ConstructionCode decimal(10,0) unsigned not null comment '工事コード' |
978 |
, SeqNo decimal(3,0) unsigned not null comment '明細行番号' |
979 |
, Attendee varchar(100) comment '出席者' |
980 |
, ContentsText varchar(200) comment '内容' |
981 |
, EntryDate datetime not null comment '登録日付' |
982 |
, UpdateDate datetime not null comment '更新日付' |
983 |
, constraint dailydatasubcontractors_PKC primary key (PersonCode,DailyDataDate,ConstructionCode,SeqNo) |
984 |
) comment '日報データ (協力業者指示)' ; |
985 |
|
986 |
create index DailyDataSubcontractors_Index |
987 |
on dailydatasubcontractors(PersonCode,DailyDataDate,ConstructionCode);
|
988 |
|
989 |
-- 日報データ (車両)
|
990 |
drop index DailyDataVehicles_Index on dailydatavehicles; |
991 |
|
992 |
drop table if exists dailydatavehicles cascade; |
993 |
|
994 |
create table dailydatavehicles ( |
995 |
PersonCode decimal(8,0) unsigned not null comment '作成者コード' |
996 |
, DailyDataDate date not null comment '日報作成日' |
997 |
, ConstructionCode decimal(10,0) unsigned not null comment '工事コード' |
998 |
, SeqNo decimal(3,0) unsigned not null comment '明細行番号' |
999 |
, Model varchar(100) comment '機種' |
1000 |
, Performance varchar(100) comment '性能' |
1001 |
, Owner varchar(100) comment '所有会社' |
1002 |
, Driver varchar(100) comment '当日運転者' |
1003 |
, StartWorkingTime datetime not null comment '作業時間開始' |
1004 |
, EndWorkingTime datetime not null comment '作業時間終了' |
1005 |
, EntryDate datetime not null comment '登録日付' |
1006 |
, UpdateDate datetime not null comment '更新日付' |
1007 |
, constraint dailydatavehicles_PKC primary key (PersonCode,DailyDataDate,ConstructionCode,SeqNo) |
1008 |
) comment '日報データ (車両)' ; |
1009 |
|
1010 |
create index DailyDataVehicles_Index |
1011 |
on dailydatavehicles(PersonCode,DailyDataDate,ConstructionCode);
|
1012 |
|
1013 |
-- 日マスタ
|
1014 |
drop index day_Index1 on daymaster; |
1015 |
|
1016 |
drop table if exists daymaster cascade; |
1017 |
|
1018 |
create table daymaster ( |
1019 |
days smallint(6) not null comment '日' |
1020 |
) comment '日マスタ' ; |
1021 |
|
1022 |
create index day_Index1 |
1023 |
on daymaster(days);
|
1024 |
|
1025 |
-- 締日マスタ
|
1026 |
drop table if exists deadlinemaster cascade; |
1027 |
|
1028 |
create table deadlinemaster ( |
1029 |
LABOURKIND decimal(1,0) default '0' not null comment '手間業者区分' |
1030 |
, DEADLINE decimal(2,0) comment '締日' |
1031 |
, PAYDAY decimal(2,0) comment '支払日' |
1032 |
, NOTE varchar(120) comment '備考' |
1033 |
, DELETEFLG decimal(1,0) comment '削除フラグ' |
1034 |
, ENTRYDATE datetime comment '登録日付' |
1035 |
, UPDATEDATE datetime comment '更新日付' |
1036 |
, constraint deadlinemaster_PKC primary key (LABOURKIND) |
1037 |
) comment '締日マスタ' ; |
1038 |
|
1039 |
-- 部署経費率マスタ
|
1040 |
drop table if exists departmentexpensesmaster cascade; |
1041 |
|
1042 |
create table departmentexpensesmaster ( |
1043 |
DepartmentCode decimal(5,0) unsigned not null comment '部署コード' |
1044 |
, ExpensesPeriod smallint(6) not null comment '事業期' |
1045 |
, NameCode decimal(5,0) unsigned not null comment '経費名称コード' |
1046 |
, DisplayOrder decimal(5,0) unsigned not null comment '表示順' |
1047 |
, ExpensesRaito decimal(4,2) not null comment '経費率' |
1048 |
, DeleteFlg decimal(1,0) not null comment '削除フラグ' |
1049 |
, EntryDate datetime not null comment '登録日付' |
1050 |
, UpdateDate datetime not null comment '更新日付' |
1051 |
, constraint departmentexpensesmaster_PKC primary key (DepartmentCode,ExpensesPeriod,NameCode) |
1052 |
) comment '部署経費率マスタ' ; |
1053 |
|
1054 |
-- 部署マスタ
|
1055 |
drop index DepartmentMaster_index1 on departmentmaster; |
1056 |
|
1057 |
drop table if exists departmentmaster cascade; |
1058 |
|
1059 |
create table departmentmaster ( |
1060 |
DepartmentCode decimal(5,0) unsigned not null comment '部署コード' |
1061 |
, DisplayOrder decimal(5,0) unsigned not null comment '表示順' |
1062 |
, DepartmentString varchar(100) not null comment '部署名' |
1063 |
, ActionScheduleFlg decimal(1,0) not null comment '行動予定表示フラグ' |
1064 |
, StaffAssignFlg decimal(1,0) not null comment '人員配置表示フラグ' |
1065 |
, DeleteFlg decimal(1,0) not null comment '削除フラグ' |
1066 |
, EntryDate datetime not null comment '登録日付' |
1067 |
, UpdateDate datetime not null comment '更新日付' |
1068 |
, constraint departmentmaster_PKC primary key (DepartmentCode) |
1069 |
) comment '部署マスタ' ; |
1070 |
|
1071 |
create index DepartmentMaster_index1 |
1072 |
on departmentmaster(DisplayOrder);
|
1073 |
|
1074 |
-- 入金確認承認データ
|
1075 |
drop table if exists depositapprovalinfo cascade; |
1076 |
|
1077 |
create table depositapprovalinfo ( |
1078 |
ORDERERSDIVISION decimal(5,0) not null comment '発注者区分' |
1079 |
, ORDERERSCODE decimal(5,0) not null comment '発注者コード' |
1080 |
, TARGETDATE decimal(6,0) not null comment '対象年月' |
1081 |
, SEQNO decimal(3,0) not null comment '連番' |
1082 |
, LINECOUNT decimal(3,0) not null comment '行番号' |
1083 |
, APPROVALNO decimal(3,0) not null comment '承認順序' |
1084 |
, APPROVALPERSON decimal(8,0) comment '承認者コード' |
1085 |
, APPROVALPERSONNAME varchar(20) comment '承認者名' |
1086 |
, APPROVALAUTHORITY decimal(1,0) comment '承認権限区分' |
1087 |
, APPROVALDATE date comment '承認日付' |
1088 |
, ENTRYDATE datetime comment '登録日付' |
1089 |
, UPDATEDATE datetime comment '更新日付' |
1090 |
, constraint depositapprovalinfo_PKC primary key (ORDERERSDIVISION,ORDERERSCODE,TARGETDATE,SEQNO,LINECOUNT,APPROVALNO) |
1091 |
) comment '入金確認承認データ' ; |
1092 |
|
1093 |
-- 入金データ
|
1094 |
drop table if exists depositdata cascade; |
1095 |
|
1096 |
create table depositdata ( |
1097 |
ORDERERSDIVISION decimal(5,0) not null comment '発注者区分' |
1098 |
, ORDERERSCODE decimal(5,0) not null comment '発注者コード' |
1099 |
, TARGETDATE decimal(6,0) not null comment '対象年月' |
1100 |
, SEQNO decimal(3,0) not null comment '連番' |
1101 |
, BusinessPeriod decimal(4,0) comment '営業期' |
1102 |
, DEPOSITDATE date comment '入金日' |
1103 |
, DepositAmount decimal(12,0) comment '入金金額' |
1104 |
, DEPOSITAMOUNTCASH decimal(10,0) comment '入金金額(現金)' |
1105 |
, DEPOSITAMOUNTBILL decimal(10,0) comment '入金金額(手形)' |
1106 |
, DEPOSITPERSONCODE decimal(8,0) NOT NULL COMMENT '入金担当者コード' |
1107 |
, NOTE varchar(120) comment '備考' |
1108 |
, ENTRYDATE datetime comment '登録日付' |
1109 |
, UPDATEDATE datetime comment '更新日付' |
1110 |
, constraint depositdata_PKC primary key (ORDERERSDIVISION,ORDERERSCODE,TARGETDATE,SEQNO) |
1111 |
) comment '入金データ' ; |
1112 |
|
1113 |
-- 入金明細データ
|
1114 |
drop table if exists depositdatadetail cascade; |
1115 |
|
1116 |
create table depositdatadetail ( |
1117 |
ORDERERSDIVISION decimal(5,0) not null comment '発注者区分' |
1118 |
, ORDERERSCODE decimal(5,0) not null comment '発注者コード' |
1119 |
, TARGETDATE decimal(6,0) not null comment '対象年月' |
1120 |
, REQUESTNO decimal(10,0) not null comment '請求No' |
1121 |
, ORDERNO decimal(2,0) comment '受付番号' |
1122 |
, DEPOSITAMOUNT decimal(10,0) comment '入金金額' |
1123 |
, DISCOUNTAMOUNT decimal(10,0) comment '値引き金額' |
1124 |
, CNSTRPRICE decimal(10,0) comment '協力金' |
1125 |
, FEES decimal(10,0) comment '手数料' |
1126 |
, OTHERADJUSTMENTS decimal(10,0) comment 'その他' |
1127 |
, DIFFERENCEAMOUNT decimal(10,0) comment '差分' |
1128 |
, CONFIRMATIONPERSONCODE decimal(8,0) comment '確認担当者コード' |
1129 |
, CONFIRMATIONDATE date comment '担当者確認日付' |
1130 |
, CONFIRMATIONENDFLG decimal(1,0) comment '確認完了フラグ' |
1131 |
, NOTE varchar(120) comment '備考' |
1132 |
, ENTRYDATE datetime comment '登録日付' |
1133 |
, UPDATEDATE datetime comment '更新日付' |
1134 |
, constraint depositdatadetail_PKC primary key (ORDERERSDIVISION,ORDERERSCODE,TARGETDATE,REQUESTNO) |
1135 |
) comment '入金明細データ' ; |
1136 |
|
1137 |
-- 区分マスタ
|
1138 |
drop table if exists divisionmaster cascade; |
1139 |
|
1140 |
create table divisionmaster ( |
1141 |
DivisionCode decimal(5,0) unsigned not null comment '区分コード' |
1142 |
, NameCode decimal(5,0) unsigned not null comment '名称コード' |
1143 |
, DisplayOrder decimal(5,0) unsigned not null comment '表示順' |
1144 |
, NameString varchar(100) not null comment '名称' |
1145 |
, DeleteFlg decimal(1,0) not null comment '削除フラグ' |
1146 |
, EntryDate datetime not null comment '登録日付' |
1147 |
, UpdateDate datetime not null comment '更新日付' |
1148 |
, constraint divisionmaster_PKC primary key (DivisionCode,NameCode) |
1149 |
) comment '区分マスタ' ; |
1150 |
|
1151 |
-- 積算予算書データ
|
1152 |
drop table if exists estimatebudget cascade; |
1153 |
|
1154 |
create table estimatebudget ( |
1155 |
ConstructionCode decimal(10,0) unsigned not null comment '工事コード' |
1156 |
, ConstructionTime decimal(5,2) unsigned not null comment '工期' |
1157 |
, IntegratedCode decimal(8,0) not null comment '積算者' |
1158 |
, DataCreateDate datetime not null comment 'データ引込日' |
1159 |
, RetValue1 decimal(12,0) not null comment '予定価格' |
1160 |
, RetValue2 decimal(12,0) not null comment '直接工事費' |
1161 |
, RetValue3 decimal(12,0) not null comment '積み上げ共通仮設費' |
1162 |
, RetValue4 decimal(12,0) not null comment '積み上げ現場管理費' |
1163 |
, RetPercent decimal(5,2) not null comment '一般管理費率' |
1164 |
, EntryDate datetime not null comment '登録日付' |
1165 |
, UpdateDate datetime not null comment '更新日付' |
1166 |
, constraint estimatebudget_PKC primary key (ConstructionCode) |
1167 |
) comment '積算予算書データ' ; |
1168 |
|
1169 |
-- 積算予算内訳データ明細
|
1170 |
drop table if exists estimatebudgetdetail cascade; |
1171 |
|
1172 |
create table estimatebudgetdetail ( |
1173 |
ConstructionCode decimal(10,0) unsigned not null comment '工事コード' |
1174 |
, GroupCount decimal(2,0) unsigned not null comment 'グループ番号' |
1175 |
, LineCount decimal(3,0) unsigned not null comment '行番号' |
1176 |
, ComponentCode decimal(5,0) unsigned not null comment '構成キー' |
1177 |
, ItemCode decimal(5,0) unsigned comment '工種キー' |
1178 |
, CompanyCode decimal(8,0) not null comment '協力会社コード' |
1179 |
, FirstString varchar(120) comment '大項目名称' |
1180 |
, SecondString varchar(120) comment '工種名称・協力会社名' |
1181 |
, Content varchar(120) comment '内容' |
1182 |
, EstimatePrice decimal(12,0) not null comment '見積時金額' |
1183 |
, NegotiationPrice decimal(12,0) not null comment '交渉時金額' |
1184 |
, Notes varchar(120) comment '注意事項' |
1185 |
, EntryDate datetime not null comment '登録日付' |
1186 |
, UpdateDate datetime not null comment '更新日付' |
1187 |
, constraint estimatebudgetdetail_PKC primary key (ConstructionCode,GroupCount,LineCount) |
1188 |
) comment '積算予算内訳データ明細' ; |
1189 |
|
1190 |
-- 積算見積データ
|
1191 |
drop index EstimateData_Index1 on estimatedata; |
1192 |
|
1193 |
drop table if exists estimatedata cascade; |
1194 |
|
1195 |
create table estimatedata ( |
1196 |
ConstructionCode decimal(10,0) unsigned not null comment '工事コード' |
1197 |
, LineCount decimal(3,0) unsigned not null comment '行番号' |
1198 |
, ComponentCode decimal(5,0) unsigned not null comment '構成キー' |
1199 |
, FixedItemCode varchar(1) comment '固定項目キー' |
1200 |
, ItemName varchar(120) comment '作業名称' |
1201 |
, SpecName varchar(120) comment '作業/品質・形状・寸法' |
1202 |
, PriceValue decimal(14,0) not null comment '金額' |
1203 |
, note varchar(60) comment '備考' |
1204 |
, MyExpensesFlg decimal(1,0) not null comment '自社経費フラグ' |
1205 |
, InputFlg decimal(1,0) not null comment '入力フラグ' |
1206 |
, EntryDate datetime not null comment '登録日付' |
1207 |
, UpdateDate datetime not null comment '更新日付' |
1208 |
, constraint estimatedata_PKC primary key (ConstructionCode,LineCount) |
1209 |
) comment '積算見積データ' ; |
1210 |
|
1211 |
create index EstimateData_Index1 |
1212 |
on estimatedata(ConstructionCode,FixedItemCode);
|
1213 |
|
1214 |
-- 積算見積ページデータ
|
1215 |
drop index EstimateDataBody_Index1 on estimatedatabody; |
1216 |
|
1217 |
drop table if exists estimatedatabody cascade; |
1218 |
|
1219 |
create table estimatedatabody ( |
1220 |
ConstructionCode decimal(10,0) unsigned not null comment '工事コード' |
1221 |
, PageCount decimal(4,0) unsigned not null comment 'ページ番号' |
1222 |
, Category decimal(1,0) not null comment 'ページ区分' |
1223 |
, UnionComponentCode decimal(5,0) unsigned not null comment '所属構成キー' |
1224 |
, ComponentCode decimal(5,0) unsigned not null comment '構成キー' |
1225 |
, ItemCode decimal(5,0) unsigned not null comment '工種キー' |
1226 |
, SelectComponent decimal(5,0) unsigned not null comment '選択構成キー' |
1227 |
, PageTitle varchar(120) not null comment 'ページ表示名' |
1228 |
, DetailLineCount decimal(3,0) unsigned not null comment '明細行番号' |
1229 |
, EntryDate datetime not null comment '登録日付' |
1230 |
, UpdateDate datetime not null comment '更新日付' |
1231 |
, constraint estimatedatabody_PKC primary key (ConstructionCode,PageCount) |
1232 |
) comment '積算見積ページデータ' ; |
1233 |
|
1234 |
create index EstimateDataBody_Index1 |
1235 |
on estimatedatabody(ConstructionCode,ComponentCode,ItemCode);
|
1236 |
|
1237 |
-- 積算見積データ明細
|
1238 |
drop index EstimateDataDetail_Index1 on estimatedatadetail; |
1239 |
|
1240 |
drop table if exists estimatedatadetail cascade; |
1241 |
|
1242 |
create table estimatedatadetail ( |
1243 |
ConstructionCode decimal(10,0) unsigned not null comment '工事コード' |
1244 |
, PageCount decimal(4,0) unsigned not null comment 'ページ番号' |
1245 |
, LineCount decimal(3,0) unsigned not null comment '行番号' |
1246 |
, DataType decimal(1,0) not null comment 'データ種別' |
1247 |
, ComponentCode decimal(5,0) unsigned not null comment '構成キー' |
1248 |
, ItemCode decimal(5,0) unsigned not null comment '工種キー' |
1249 |
, SpecCode decimal(5,0) unsigned not null comment '作業キー' |
1250 |
, ItemName varchar(120) comment '作業名称' |
1251 |
, SpecName varchar(120) comment '作業/品質・形状・寸法' |
1252 |
, Unitcount decimal(8,2) not null comment '数量' |
1253 |
, UnitName varchar(30) comment '単位名称' |
1254 |
, UnitPrice decimal(9,2) not null comment '単価' |
1255 |
, LineTotal decimal(12,0) not null comment '金額' |
1256 |
, note varchar(60) comment '備考' |
1257 |
, CompanyCode decimal(8,0) not null comment '協力会社コード' |
1258 |
, MyExpensesFlg decimal(1,0) not null comment '自社経費フラグ' |
1259 |
, InputFlg decimal(1,0) comment '入力フラグ' |
1260 |
, EntryDate datetime not null comment '登録日付' |
1261 |
, UpdateDate datetime not null comment '更新日付' |
1262 |
, constraint estimatedatadetail_PKC primary key (ConstructionCode,PageCount,LineCount) |
1263 |
) comment '積算見積データ明細' ; |
1264 |
|
1265 |
create index EstimateDataDetail_Index1 |
1266 |
on estimatedatadetail(ConstructionCode,PageCount);
|
1267 |
|
1268 |
-- 経費率マスタ
|
1269 |
drop table if exists expensesmaster cascade; |
1270 |
|
1271 |
create table expensesmaster ( |
1272 |
DivisionCode smallint(6) not null comment '工事種別コード' |
1273 |
, NameCode smallint(6) not null comment '経費名称コード' |
1274 |
, DisplayOrder smallint(6) not null comment '表示順' |
1275 |
, ExpensesRatio decimal(4,2) not null comment '経費率' |
1276 |
, DeleteFlg decimal(1,0) not null comment '削除フラグ' |
1277 |
, EntryDate datetime not null comment '登録日付' |
1278 |
, UpdateDate datetime not null comment '更新日付' |
1279 |
, constraint expensesmaster_PKC primary key (DivisionCode,NameCode) |
1280 |
) comment '経費率マスタ' ; |
1281 |
|
1282 |
-- 会社休日マスタ
|
1283 |
drop index HolidayCalender_Index1 on holidaycalendermaster; |
1284 |
drop index HolidayCalenderMaster_Index2 on holidaycalendermaster; |
1285 |
drop index HolidayCalenderMaster_Index3 on holidaycalendermaster; |
1286 |
|
1287 |
drop table if exists holidaycalendermaster cascade; |
1288 |
|
1289 |
create table holidaycalendermaster ( |
1290 |
Holiday date not null comment '休日' |
1291 |
, BusinessYear smallint(5) unsigned not null comment '営業年度' |
1292 |
, TargetMonth tinyint(3) unsigned not null comment '該当月' |
1293 |
, TargetDay tinyint(3) unsigned not null comment '該当日' |
1294 |
, constraint holidaycalendermaster_PKC primary key (Holiday) |
1295 |
) comment '会社休日マスタ' ; |
1296 |
|
1297 |
create index HolidayCalender_Index1 |
1298 |
on holidaycalendermaster(BusinessYear);
|
1299 |
|
1300 |
create index HolidayCalenderMaster_Index2 |
1301 |
on holidaycalendermaster(TargetMonth);
|
1302 |
|
1303 |
create index HolidayCalenderMaster_Index3 |
1304 |
on holidaycalendermaster(TargetDay);
|
1305 |
|
1306 |
-- 入力時検索履歴
|
1307 |
drop index InputSearchLogData_Index1 on inputsearchlogdata; |
1308 |
|
1309 |
drop table if exists inputsearchlogdata cascade; |
1310 |
|
1311 |
create table inputsearchlogdata ( |
1312 |
ConstructionCode decimal(10,0) not null comment '工事コード' |
1313 |
, UsedProcessNo decimal(4,0) not null comment '使用機能番号' |
1314 |
, DisplayOrder decimal(4,0) unsigned not null comment '表示順' |
1315 |
, DataType decimal(1,0) not null comment 'データ種別' |
1316 |
, InputCode decimal(10,0) comment '入力コード' |
1317 |
, constraint inputsearchlogdata_PKC primary key (ConstructionCode,UsedProcessNo,DisplayOrder) |
1318 |
) comment '入力時検索履歴' ; |
1319 |
|
1320 |
create index InputSearchLogData_Index1 |
1321 |
on inputsearchlogdata(ConstructionCode,UsedProcessNo,InputCode);
|
1322 |
|
1323 |
-- 請求書データ
|
1324 |
drop table if exists invoicedata cascade; |
1325 |
|
1326 |
create table invoicedata ( |
1327 |
INVOICENO decimal(9,0) not null comment '請求書No' |
1328 |
, ORDERERSDIVISION decimal(5,0) not null comment '発注者区分' |
1329 |
, ORDERERSCODE decimal(5,0) not null comment '発注者コード' |
1330 |
, REQUESTMONTH decimal(6,0) not null comment '請求月' |
1331 |
, SEQNO decimal(2,0) not null comment '連番' |
1332 |
, CRETATEDATE date not null comment '作成日' |
1333 |
, REQUESTDATE date not null comment '請求日' |
1334 |
, REQUESTNAME varchar(120) comment '請求先名' |
1335 |
, TOTALAMOUNT decimal(10,0) comment '税込み合計金額' |
1336 |
, TAXAMOUNT decimal(10,0) comment '消費税金額' |
1337 |
, COMMENT1 varchar(60) comment 'コメント1' |
1338 |
, COMMENT2 varchar(60) comment 'コメント2' |
1339 |
, COMMENT3 varchar(60) not null comment 'コメント3' |
1340 |
, COMMENT4 varchar(60) not null comment 'コメント4' |
1341 |
, COMMENT5 varchar(60) not null comment 'コメント5' |
1342 |
, COMPLETEFLG decimal(1,0) default '0' not null comment '完了フラグ' |
1343 |
, ENTRYDATE datetime not null comment '登録年月日' |
1344 |
, UPDATEDATE datetime not null comment '更新年月日' |
1345 |
, constraint invoicedata_PKC primary key (INVOICENO) |
1346 |
) comment '請求書データ' ; |
1347 |
|
1348 |
alter table invoicedata add unique ORDERERSDIVISION (ORDERERSDIVISION,ORDERERSCODE,REQUESTMONTH,SEQNO) ; |
1349 |
|
1350 |
-- 資材情報
|
1351 |
drop table if exists materialinfo cascade; |
1352 |
|
1353 |
create table materialinfo ( |
1354 |
MATERIALITEMCODE smallint(5) unsigned default 0 not null comment '資材品目コード' |
1355 |
, MATERIALCOUNT smallint(5) unsigned comment '資材数' |
1356 |
, RENTCOUNT smallint(5) unsigned comment '貸出可能数' |
1357 |
, DELETEFLG smallint(5) unsigned comment '削除フラグ' |
1358 |
, ENTRYDATE datetime comment '登録日付' |
1359 |
, UPDATEDATE datetime comment '更新日付' |
1360 |
, constraint materialinfo_PKC primary key (MATERIALITEMCODE) |
1361 |
) comment '資材情報' ; |
1362 |
|
1363 |
-- 資材品目マスタ
|
1364 |
drop table if exists materialitemmaster cascade; |
1365 |
|
1366 |
create table materialitemmaster ( |
1367 |
MATERIALITEMCODE smallint(5) unsigned default 0 not null comment '資材品目コード' |
1368 |
, MATERIALKINDCODE smallint(5) unsigned comment '資材種類コード' |
1369 |
, MATERIALITEMNAME varchar(40) comment '資材品目名称' |
1370 |
, DISPLAYORDER smallint(5) unsigned comment '表示順' |
1371 |
, DELETEFLG tinyint(3) unsigned comment '削除フラグ' |
1372 |
, ENTRYDATE datetime comment '登録日付' |
1373 |
, UPDATEDATE datetime comment '更新日付' |
1374 |
, VERSIONNO decimal(8,0) default '0' not null comment 'バージョン番号' |
1375 |
, constraint materialitemmaster_PKC primary key (MATERIALITEMCODE) |
1376 |
) comment '資材品目マスタ' ; |
1377 |
|
1378 |
-- 資材種類マスタ
|
1379 |
drop table if exists materialkindmaster cascade; |
1380 |
|
1381 |
create table materialkindmaster ( |
1382 |
MATERIALKINDCODE smallint(5) unsigned default 0 not null comment '資材種類コード' |
1383 |
, MATERIALKINDNAME varchar(40) comment '資材種類名称' |
1384 |
, DISPLAYORDER smallint(5) unsigned comment '表示順' |
1385 |
, DELETEFLG tinyint(3) unsigned comment '削除フラグ' |
1386 |
, ENTRYDATE datetime comment '登録日付' |
1387 |
, UPDATEDATE datetime comment '更新日付' |
1388 |
, constraint materialkindmaster_PKC primary key (MATERIALKINDCODE) |
1389 |
) comment '資材種類マスタ' ; |
1390 |
|
1391 |
-- 資材履歴情報
|
1392 |
drop table if exists materialrecordinfo cascade; |
1393 |
|
1394 |
create table materialrecordinfo ( |
1395 |
MATERIALITEMCODE smallint(5) unsigned default 0 not null comment '資材品目コード' |
1396 |
, PROCESSDATE date default '0000-00-00' not null comment '処理年月日' |
1397 |
, SEQNO smallint(5) unsigned default 0 not null comment '連番' |
1398 |
, RECKIND tinyint(3) unsigned comment 'レコード区分' |
1399 |
, CONSTRUCTIONCODE int(10) unsigned comment '工事番号' |
1400 |
, PERSONCODE int(10) unsigned comment '担当者コード' |
1401 |
, MATERIALCOUNT smallint(5) unsigned comment '資材数' |
1402 |
, REPAYPLANDATE date comment '返却予定年月日' |
1403 |
, COMMENTTEXT varchar(80) comment 'コメント' |
1404 |
, ENTRYDATE datetime comment '登録日付' |
1405 |
, UPDATEDATE datetime comment '更新日付' |
1406 |
, constraint materialrecordinfo_PKC primary key (MATERIALITEMCODE,PROCESSDATE,SEQNO) |
1407 |
) comment '資材履歴情報' ; |
1408 |
|
1409 |
-- 掲示板メッセージ
|
1410 |
drop index MessageBoardData_Index1 on messageboarddata; |
1411 |
drop index MessageBoardData_Index2 on messageboarddata; |
1412 |
|
1413 |
drop table if exists messageboarddata cascade; |
1414 |
|
1415 |
create table messageboarddata ( |
1416 |
RecordNumber decimal(6,0) unsigned not null comment 'レコード番号' |
1417 |
, BranchNumber decimal(3,0) unsigned not null comment 'レコード枝番' |
1418 |
, FromCode decimal(8,0) unsigned not null comment '書込み者コード' |
1419 |
, FromName varchar(60) not null comment '書込み者' |
1420 |
, MessageTitile varchar(100) comment '伝言タイトル' |
1421 |
, MessageContent varchar(1333) not null comment '伝言内容' |
1422 |
, LinkType decimal(2,0) not null comment 'リンク動作タイプ' |
1423 |
, LinkMessage varchar(200) comment 'リンク文字列' |
1424 |
, LinkCode varchar(30) comment 'リンクキー' |
1425 |
, WritingDate datetime not null comment '書込み日時' |
1426 |
, PersonCode decimal(8,0) not null comment '書込み担当者コード' |
1427 |
, ShareFlag decimal(2,0) not null comment '管理者対象フラグ' |
1428 |
, MessageColor varchar(8) comment '文字色' |
1429 |
, BackColor varchar(8) comment 'バックカラー' |
1430 |
, MessageFlag decimal(1,0) not null comment 'メッセージフラグ' |
1431 |
, EntryDate datetime not null comment '登録日付' |
1432 |
, UpdateDate datetime not null comment '更新日付' |
1433 |
, constraint messageboarddata_PKC primary key (RecordNumber,BranchNumber) |
1434 |
) comment '掲示板メッセージ' ; |
1435 |
|
1436 |
create index MessageBoardData_Index1 |
1437 |
on messageboarddata(WritingDate);
|
1438 |
|
1439 |
create index MessageBoardData_Index2 |
1440 |
on messageboarddata(MessageFlag);
|
1441 |
|
1442 |
-- 掲示板対象者テーブル
|
1443 |
drop index MessageBoardTerget_Index1 on messageboardterget; |
1444 |
|
1445 |
drop table if exists messageboardterget cascade; |
1446 |
|
1447 |
create table messageboardterget ( |
1448 |
RecordNumber decimal(6,0) unsigned not null comment 'レコード番号' |
1449 |
, BranchNumber decimal(3,0) unsigned not null comment 'レコード枝番' |
1450 |
, SeqNum decimal(3,0) unsigned not null comment '順番' |
1451 |
, ToCode decimal(8,0) not null comment '対象者コード' |
1452 |
, ToName varchar(60) not null comment '対象者' |
1453 |
, EntryDate datetime not null comment '登録日付' |
1454 |
, UpdateDate datetime not null comment '更新日付' |
1455 |
, constraint messageboardterget_PKC primary key (RecordNumber,BranchNumber,SeqNum) |
1456 |
) comment '掲示板対象者テーブル' ; |
1457 |
|
1458 |
create index MessageBoardTerget_Index1 |
1459 |
on messageboardterget(RecordNumber,BranchNumber);
|
1460 |
|
1461 |
-- 掲示板メッセージ閲覧履歴
|
1462 |
drop table if exists messagebrowsinghistory cascade; |
1463 |
|
1464 |
create table messagebrowsinghistory ( |
1465 |
RecordNumber decimal(6,0) unsigned not null comment 'レコード番号' |
1466 |
, BranchNumber decimal(3,0) unsigned not null comment 'レコード枝番' |
1467 |
, SeqNum decimal(3,0) unsigned not null comment '順番' |
1468 |
, BrowsingCode decimal(8,0) not null comment '閲覧者コード' |
1469 |
, BrowsingDate datetime not null comment '閲覧日付' |
1470 |
, EntryDate datetime not null comment '登録日付' |
1471 |
, UpdateDate datetime not null comment '更新日付' |
1472 |
, constraint messagebrowsinghistory_PKC primary key (RecordNumber,BranchNumber,SeqNum) |
1473 |
) comment '掲示板メッセージ閲覧履歴' ; |
1474 |
|
1475 |
-- 月マスタ
|
1476 |
drop index month_Index1 on monthmaster; |
1477 |
|
1478 |
drop table if exists monthmaster cascade; |
1479 |
|
1480 |
create table monthmaster ( |
1481 |
month smallint(6) not null comment '月' |
1482 |
) comment '月マスタ' ; |
1483 |
|
1484 |
create index month_Index1 |
1485 |
on monthmaster(month);
|
1486 |
|
1487 |
-- 発注者マスタ
|
1488 |
drop table if exists orderersmaster cascade; |
1489 |
|
1490 |
create table orderersmaster ( |
1491 |
OrderCotegory decimal(5,0) unsigned not null comment '発注者区分' |
1492 |
, OrderersCode decimal(5,0) unsigned not null comment '発注者コード' |
1493 |
, DisplayOrder decimal(5,0) unsigned not null comment '表示順' |
1494 |
, OrderFlg decimal(1,0) not null comment '法人団体・個人フラグ' |
1495 |
, CorporateStatusName varchar(100) comment '法人格名称' |
1496 |
, CorporateStatusPoint decimal(1,0) comment '法人格名称位置' |
1497 |
, OrderersName1 varchar(60) not null comment '発注者名1' |
1498 |
, OrderersName2 varchar(60) comment '発注者名2' |
1499 |
, DepartmentName varchar(60) comment '部署名' |
1500 |
, ChargePersonName varchar(60) comment '担当者名' |
1501 |
, ZipCode varchar(8) comment '郵便番号' |
1502 |
, Address1 varchar(60) comment '住所1' |
1503 |
, Address2 varchar(60) comment '住所2' |
1504 |
, Address3 varchar(60) comment '住所3' |
1505 |
, PhoneNumber varchar(13) comment '電話番号' |
1506 |
, FaxNumber varchar(13) comment 'FAX番号' |
1507 |
, MailAddress varchar(257) comment 'メールアドレス' |
1508 |
, Note varchar(300) comment '備考' |
1509 |
, DeleteFlg decimal(1,0) not null comment '削除フラグ' |
1510 |
, EntryDate datetime not null comment '登録日付' |
1511 |
, UpdateDate datetime not null comment '更新日付' |
1512 |
, constraint orderersmaster_PKC primary key (OrderCotegory,OrderersCode) |
1513 |
) comment '発注者マスタ' ; |
1514 |
|
1515 |
-- 受注金額データ
|
1516 |
drop table if exists orderspricedata cascade; |
1517 |
|
1518 |
create table orderspricedata ( |
1519 |
ConstructionCode decimal(10,0) unsigned not null comment '工事コード' |
1520 |
, ChangeNo decimal(3,0) unsigned not null comment '変更番号' |
1521 |
, ChangeDate date not null comment '変更日' |
1522 |
, ChangePersonCode decimal(8,0) unsigned not null comment '変更者コード' |
1523 |
, ChangePersonName varchar(60) comment '変更者名' |
1524 |
, BeforeValue decimal(14,0) not null comment '変更前税抜受注金額' |
1525 |
, BeforeValueInTax decimal(14,0) not null comment '変更前税込受注金額' |
1526 |
, AfterValue decimal(14,0) not null comment '変更後税抜受注金額' |
1527 |
, AfterValueInTax decimal(14,0) not null comment '変更後税込受注金額' |
1528 |
, ChangeComment varchar(200) comment '変更理由' |
1529 |
, EntryDate datetime not null comment '登録日付' |
1530 |
, UpdateDate datetime not null comment '更新日付' |
1531 |
, constraint orderspricedata_PKC primary key (ConstructionCode,ChangeNo) |
1532 |
) comment '受注金額データ' ; |
1533 |
|
1534 |
-- 支払承認情報データ
|
1535 |
drop table if exists paymentapprovalinfo cascade; |
1536 |
|
1537 |
create table paymentapprovalinfo ( |
1538 |
COMPANYCODE decimal(8,0) default '0' not null comment '協力会社コード' |
1539 |
, TARGETDATE decimal(6,0) default '0' not null comment '対象年月' |
1540 |
, SEQNO decimal(3,0) default '0' not null comment '連番' |
1541 |
, LINECOUNT decimal(3,0) default '0' not null comment '行番号' |
1542 |
, APPROVALNO decimal(3,0) default '0' not null comment '承認順序' |
1543 |
, APPROVALPERSON decimal(8,0) comment '承認者コード' |
1544 |
, APPROVALPERSONNAME varchar(20) comment '承認者名' |
1545 |
, APPROVALAUTHORITY decimal(1,0) comment '承認権限区分' |
1546 |
, APPROVALDATE date comment '承認日付' |
1547 |
, ENTRYDATE datetime comment '登録日付' |
1548 |
, UPDATEDATE datetime comment '更新日付' |
1549 |
, constraint paymentapprovalinfo_PKC primary key (COMPANYCODE,TARGETDATE,SEQNO,LINECOUNT,APPROVALNO) |
1550 |
) comment '支払承認情報データ' ; |
1551 |
|
1552 |
-- 支払明細データ
|
1553 |
drop table if exists paymentdatadetail cascade; |
1554 |
|
1555 |
create table paymentdatadetail ( |
1556 |
COMPANYCODE decimal(8,0) default '0' not null comment '協力会社コード' |
1557 |
, TARGETDATE decimal(6,0) default '0' not null comment '対象年月' |
1558 |
, SEQNO decimal(3,0) default '0' not null comment '連番' |
1559 |
, LINECOUNT decimal(3,0) default '0' not null comment '行番号' |
1560 |
, BILLPRICE decimal(10,0) comment '請求金額' |
1561 |
, DISCOUNTPRICE decimal(10,0) comment '値引き金額' |
1562 |
, OFFSETPRICE decimal(10,0) comment '相殺金額' |
1563 |
, NEXTCOPRICE decimal(10,0) comment '次回繰越' |
1564 |
, HIGHWPRICE decimal(10,0) comment '高速代' |
1565 |
, HARDWPRICE decimal(10,0) comment '金物代' |
1566 |
, INDSWASTETAX decimal(10,0) comment '産廃税' |
1567 |
, CNSTRPRICE decimal(10,0) comment '協力金' |
1568 |
, CNSTRPRICEEXIST decimal(1,0) comment '協力金有無' |
1569 |
, APPROVALPERSONCODE decimal(8,0) comment '承認担当者コード' |
1570 |
, APPROVALDATE date comment '担当者承認日付' |
1571 |
, APPROVALENDFLG decimal(1,0) comment '承認完了フラグ' |
1572 |
, ENTRYDATE datetime comment '登録日付' |
1573 |
, UPDATEDATE datetime comment '更新日付' |
1574 |
, constraint paymentdatadetail_PKC primary key (COMPANYCODE,TARGETDATE,SEQNO,LINECOUNT) |
1575 |
) comment '支払明細データ' ; |
1576 |
|
1577 |
-- 担当者承認データ
|
1578 |
drop table if exists personapproval cascade; |
1579 |
|
1580 |
create table personapproval ( |
1581 |
PersonCode decimal(8,0) unsigned not null comment '担当者コード' |
1582 |
, ApprovalCode decimal(3,0) unsigned not null comment '承認機能番号' |
1583 |
, OrderDate date not null comment '受付日' |
1584 |
, OrderNo decimal(2,0) unsigned not null comment '受付番号' |
1585 |
, SeqNo decimal(2,0) not null comment '枝番' |
1586 |
, PersonCodeApproval decimal(8,0) unsigned not null comment '申請・承認者コード' |
1587 |
, PetitionApprovalDate datetime not null comment '申請・承認日付' |
1588 |
, ApprovalLimitDates datetime not null comment '承認希望日' |
1589 |
, ApprovalStatus decimal(1,0) not null comment '承認状態' |
1590 |
, InputComment varchar(300) comment 'コメント' |
1591 |
, EntryDate datetime not null comment '登録日付' |
1592 |
, UpdateDate datetime not null comment '更新日付' |
1593 |
, constraint personapproval_PKC primary key (PersonCode,ApprovalCode,OrderDate,OrderNo,SeqNo) |
1594 |
) comment '担当者承認データ' ; |
1595 |
|
1596 |
-- 担当者承認コメントデータ
|
1597 |
drop table if exists personapprovalcomment cascade; |
1598 |
|
1599 |
create table personapprovalcomment ( |
1600 |
PersonCode decimal(8,0) unsigned not null comment '担当者コード' |
1601 |
, ApprovalCode decimal(3,0) unsigned not null comment '承認機能番号' |
1602 |
, OrderDate date not null comment '受付日' |
1603 |
, OrderNo decimal(2,0) unsigned not null comment '受付番号' |
1604 |
, CommentNo decimal(2,0) not null comment 'コメント番号' |
1605 |
, ParentNo decimal(2,0) not null comment '親コメント番号' |
1606 |
, ApproValComment varchar(300) comment '指示・連絡コメント' |
1607 |
, EntryDate datetime not null comment '登録日付' |
1608 |
, UpdateDate datetime not null comment '更新日付' |
1609 |
, constraint personapprovalcomment_PKC primary key (PersonCode,ApprovalCode,OrderDate,OrderNo,CommentNo) |
1610 |
) comment '担当者承認コメントデータ' ; |
1611 |
|
1612 |
-- 担当者対象部署マスタ
|
1613 |
drop index PersonDepartmentMaster_Index1 on persondepartmentmaster; |
1614 |
drop index PersonDepartmentMaster_Index2 on persondepartmentmaster; |
1615 |
|
1616 |
drop table if exists persondepartmentmaster cascade; |
1617 |
|
1618 |
create table persondepartmentmaster ( |
1619 |
PersonCode decimal(8,0) unsigned not null comment '担当者コード' |
1620 |
, DepartmentCode decimal(5,0) unsigned not null comment '部署コード' |
1621 |
, AffiliationFlg decimal(1,0) not null comment '所属フラグ' |
1622 |
, EntryDate datetime not null comment '登録日付' |
1623 |
, UpdateDate datetime not null comment '更新日付' |
1624 |
, constraint persondepartmentmaster_PKC primary key (PersonCode,DepartmentCode) |
1625 |
) comment '担当者対象部署マスタ' ; |
1626 |
|
1627 |
create index PersonDepartmentMaster_Index1 |
1628 |
on persondepartmentmaster(PersonCode);
|
1629 |
|
1630 |
create index PersonDepartmentMaster_Index2 |
1631 |
on persondepartmentmaster(DepartmentCode);
|
1632 |
|
1633 |
-- 担当者マスタ
|
1634 |
drop index PersonInChargeMaster_Index1 on personinchargemaster; |
1635 |
drop index PersonInChargeMaster_Index2 on personinchargemaster; |
1636 |
|
1637 |
drop table if exists personinchargemaster cascade; |
1638 |
|
1639 |
create table personinchargemaster ( |
1640 |
PersonCode decimal(8,0) unsigned not null comment '担当者コード' |
1641 |
, DisplayOrder decimal(8,0) unsigned not null comment '表示順' |
1642 |
, PersonName varchar(60) not null comment '担当者名' |
1643 |
, StartDate date not null comment '使用開始年月日' |
1644 |
, EndDate date comment '使用終了年月日' |
1645 |
, PassWord varchar(16) comment 'パスワード' |
1646 |
, SecurityManagement decimal(1,0) not null comment '機密区分' |
1647 |
, SecCode decimal(2,0) unsigned not null comment '保護区分番号' |
1648 |
, MsgBackColor varchar(8) comment 'メッセージ背景色' |
1649 |
, DisplayString varchar(20) comment '表示・印刷名称' |
1650 |
, DepartmentCode decimal(5,0) unsigned comment '部署コード' |
1651 |
, MonthlySalary decimal(11,0) not null comment '月給金額' |
1652 |
, YearSalary decimal(12,0) not null comment '年俸金額' |
1653 |
, Qualification varchar(120) comment '資格入力欄' |
1654 |
, SealPrintName varchar(5) comment '印鑑表示名' |
1655 |
, EmployeeClassFlg decimal(1,0) not null comment '社員区分' |
1656 |
, LedgerFlg decimal(1,0) not null comment '台帳計算対象フラグ' |
1657 |
, DeleteFlg decimal(1,0) not null comment '削除フラグ' |
1658 |
, EntryDate datetime not null comment '登録日付' |
1659 |
, UpdateDate datetime not null comment '更新日付' |
1660 |
, constraint personinchargemaster_PKC primary key (PersonCode) |
1661 |
) comment '担当者マスタ' ; |
1662 |
|
1663 |
create index PersonInChargeMaster_Index1 |
1664 |
on personinchargemaster(StartDate);
|
1665 |
|
1666 |
create index PersonInChargeMaster_Index2 |
1667 |
on personinchargemaster(DepartmentCode);
|
1668 |
|
1669 |
-- 担当者給与マスタ
|
1670 |
drop index PersonSalaryMaster_Index1 on personsalarymaster; |
1671 |
drop index PersonSalaryMaster_Index2 on personsalarymaster; |
1672 |
|
1673 |
drop table if exists personsalarymaster cascade; |
1674 |
|
1675 |
create table personsalarymaster ( |
1676 |
PersonCode decimal(8,0) unsigned not null comment '担当者コード' |
1677 |
, StartDate date not null comment '使用開始年月日' |
1678 |
, MonthlySalary decimal(11,0) not null comment '月給金額' |
1679 |
, YearSalary decimal(12,0) not null comment '年俸金額' |
1680 |
, EntryDate datetime not null comment '登録日付' |
1681 |
, UpdateDate datetime not null comment '更新日付' |
1682 |
, constraint personsalarymaster_PKC primary key (PersonCode,StartDate) |
1683 |
) comment '担当者給与マスタ' ; |
1684 |
|
1685 |
create index PersonSalaryMaster_Index1 |
1686 |
on personsalarymaster(PersonCode);
|
1687 |
|
1688 |
create index PersonSalaryMaster_Index2 |
1689 |
on personsalarymaster(StartDate);
|
1690 |
|
1691 |
-- 指示事項データ
|
1692 |
drop table if exists pointingoutcomment cascade; |
1693 |
|
1694 |
create table pointingoutcomment ( |
1695 |
ConstructionCode decimal(10,0) not null comment '工事コード' |
1696 |
, ProcessNo smallint(6) not null comment '処理番号(画面番号)' |
1697 |
, SeqNo smallint(6) not null comment '順序' |
1698 |
, PageCount smallint(6) not null comment 'ページ番号' |
1699 |
, PersonCode decimal(8,0) not null comment '記入者コード' |
1700 |
, DrowColor varchar(8) comment '描画色' |
1701 |
, CommentMessage varchar(1000) comment 'メッセージ' |
1702 |
, StartPointX smallint(6) not null comment '指摘項目位置X' |
1703 |
, StartPointY smallint(6) not null comment '指摘項目位置Y' |
1704 |
, CurrentPointX smallint(6) not null comment '初期位置X' |
1705 |
, CurrentPointY smallint(6) not null comment '初期位置Y' |
1706 |
, CurrentWidth smallint(6) not null comment '表示サイズWidth' |
1707 |
, CurrentHeight smallint(6) not null comment '表示サイズHeigth' |
1708 |
, EntryDate datetime not null comment '登録日付' |
1709 |
, UpdateDate datetime not null comment '更新日付' |
1710 |
, constraint pointingoutcomment_PKC primary key (ConstructionCode,ProcessNo,SeqNo) |
1711 |
) comment '指示事項データ' ; |
1712 |
|
1713 |
-- 発注者打ち合わせ議事録データ
|
1714 |
drop table if exists proceedingsdata cascade; |
1715 |
|
1716 |
create table proceedingsdata ( |
1717 |
ConstructionCode decimal(10,0) unsigned not null comment '工事コード' |
1718 |
, ProceedingsDataDate date not null comment '議事録作成日' |
1719 |
, StartMeetingTime decimal(4,0) unsigned not null comment '会議時間開始' |
1720 |
, EndMeetingTime decimal(4,0) unsigned not null comment '会議時間終了' |
1721 |
, CreatorCode decimal(8,0) not null comment '作成者コード' |
1722 |
, PalceFlag decimal(1,0) not null comment '現地フラグ' |
1723 |
, MeetingPalce varchar(120) comment '打合せ場所' |
1724 |
, EntryDate datetime not null comment '登録日付' |
1725 |
, UpdateDate datetime not null comment '更新日付' |
1726 |
, constraint proceedingsdata_PKC primary key (ConstructionCode,ProceedingsDataDate,StartMeetingTime) |
1727 |
) comment '発注者打ち合わせ議事録データ' ; |
1728 |
|
1729 |
-- 発注者打ち合わせ議事録データ(出席者)
|
1730 |
drop table if exists proceedingsdataattend cascade; |
1731 |
|
1732 |
create table proceedingsdataattend ( |
1733 |
ConstructionCode decimal(10,0) unsigned not null comment '工事コード' |
1734 |
, ProceedingsDataDate date not null comment '議事録作成日' |
1735 |
, StartMeetingTime decimal(4,0) unsigned not null comment '会議時間開始' |
1736 |
, SeqNo decimal(3,0) unsigned not null comment '明細行番号' |
1737 |
, Department varchar(20) comment '出席者所属' |
1738 |
, AttendName varchar(10) comment '出席者氏名' |
1739 |
, EntryDate datetime not null comment '登録日付' |
1740 |
, UpdateDate datetime not null comment '更新日付' |
1741 |
, constraint proceedingsdataattend_PKC primary key (ConstructionCode,ProceedingsDataDate,StartMeetingTime,SeqNo) |
1742 |
) comment '発注者打ち合わせ議事録データ(出席者)' ; |
1743 |
|
1744 |
-- 発注者打ち合わせ議事録データ(出席者)
|
1745 |
drop table if exists proceedingsdataattendee cascade; |
1746 |
|
1747 |
create table proceedingsdataattendee ( |
1748 |
PersonCode decimal(8,0) not null comment '作成者コード' |
1749 |
, ProceedingsDataDate date not null comment '議事録作成日' |
1750 |
, ConstructionCode int(11) not null comment '工事番号' |
1751 |
, SeqNo smallint(6) not null comment 'データ行番号' |
1752 |
, Department varchar(100) comment '出席者所属' |
1753 |
, AttendeeName varchar(100) comment '出席者氏名' |
1754 |
, EntryDate datetime not null comment '登録年月日' |
1755 |
, UpdateDate datetime not null comment '更新年月日' |
1756 |
, constraint proceedingsdataattendee_PKC primary key (PersonCode,ProceedingsDataDate,ConstructionCode,SeqNo) |
1757 |
) comment '発注者打ち合わせ議事録データ(出席者)' ; |
1758 |
|
1759 |
-- 発注者打ち合わせ議事録データ(明細)
|
1760 |
drop table if exists proceedingsdatadetail cascade; |
1761 |
|
1762 |
create table proceedingsdatadetail ( |
1763 |
ConstructionCode decimal(10,0) unsigned not null comment '工事コード' |
1764 |
, ProceedingsDataDate date not null comment '議事録作成日' |
1765 |
, StartMeetingTime decimal(4,0) unsigned not null comment '会議時間開始' |
1766 |
, SeqNo decimal(3,0) unsigned not null comment '明細行番号' |
1767 |
, TitleNo varchar(5) comment '議題番号' |
1768 |
, Title varchar(20) comment '議題' |
1769 |
, ContentsText varchar(50) comment '内容' |
1770 |
, EntryDate datetime not null comment '登録日付' |
1771 |
, UpdateDate datetime not null comment '更新日付' |
1772 |
, constraint proceedingsdatadetail_PKC primary key (ConstructionCode,ProceedingsDataDate,StartMeetingTime,SeqNo) |
1773 |
) comment '発注者打ち合わせ議事録データ(明細)' ; |
1774 |
|
1775 |
-- 承認データ
|
1776 |
drop table if exists processapproval cascade; |
1777 |
|
1778 |
create table processapproval ( |
1779 |
ConstructionCode decimal(10,0) unsigned not null comment '工事コード' |
1780 |
, ApprovalCode decimal(3,0) unsigned not null comment '承認機能番号' |
1781 |
, OrderNo decimal(2,0) unsigned not null comment '受付番号' |
1782 |
, SeqNo decimal(2,0) not null comment '枝番' |
1783 |
, PersonCode decimal(8,0) unsigned not null comment '申請・承認者コード' |
1784 |
, PetitionApprovalDate datetime not null comment '申請・承認日付' |
1785 |
, ApprovalLimitDates datetime not null comment '承認希望日' |
1786 |
, ApprovalStatus decimal(1,0) not null comment '承認状態' |
1787 |
, InputComment varchar(300) comment 'コメント' |
1788 |
, EntryDate datetime not null comment '登録日付' |
1789 |
, UpdateDate datetime not null comment '更新日付' |
1790 |
, constraint processapproval_PKC primary key (ConstructionCode,ApprovalCode,OrderNo,SeqNo) |
1791 |
) comment '承認データ' ; |
1792 |
|
1793 |
-- 承認コメントデータ
|
1794 |
drop table if exists processapprovalcomment cascade; |
1795 |
|
1796 |
create table processapprovalcomment ( |
1797 |
ConstructionCode decimal(10,0) unsigned not null comment '工事コード' |
1798 |
, ApprovalCode decimal(3,0) unsigned not null comment '承認機能番号' |
1799 |
, OrderNo decimal(2,0) unsigned not null comment '受付番号' |
1800 |
, CommentNo decimal(2,0) not null comment 'コメント番号' |
1801 |
, ParentNo decimal(2,0) not null comment '親コメント番号' |
1802 |
, ApproValComment varchar(300) comment '指示・連絡コメント' |
1803 |
, EntryDate datetime not null comment '登録日付' |
1804 |
, UpdateDate datetime not null comment '更新日付' |
1805 |
, constraint processapprovalcomment_PKC primary key (ConstructionCode,ApprovalCode,OrderNo,CommentNo) |
1806 |
) comment '承認コメントデータ' ; |
1807 |
|
1808 |
-- 承認明細データ
|
1809 |
drop table if exists processapprovaldetail cascade; |
1810 |
|
1811 |
create table processapprovaldetail ( |
1812 |
ConstructionCode decimal(10,0) unsigned not null comment '工事コード' |
1813 |
, ApprovalCode decimal(3,0) unsigned not null comment '承認機能番号' |
1814 |
, OrderNo decimal(2,0) unsigned not null comment '受付番号' |
1815 |
, SerialNo decimal(2,0) unsigned not null comment '枝番' |
1816 |
, LinkCode decimal(10,0) not null comment 'リンク情報' |
1817 |
, EntryDate datetime not null comment '登録日付' |
1818 |
, UpdateDate datetime not null comment '更新日付' |
1819 |
, constraint processapprovaldetail_PKC primary key (ConstructionCode,ApprovalCode,OrderNo,SerialNo) |
1820 |
) comment '承認明細データ' ; |
1821 |
|
1822 |
-- 起動対象マスタ
|
1823 |
drop index ProcessExcuteMaster_Index1 on processexcutemaster; |
1824 |
drop index ProcessExcuteMaster_Index2 on processexcutemaster; |
1825 |
|
1826 |
drop table if exists processexcutemaster cascade; |
1827 |
|
1828 |
create table processexcutemaster ( |
1829 |
SecCode decimal(2,0) unsigned not null comment '保護区分番号' |
1830 |
, ExecCode decimal(4,0) unsigned not null comment '起動処理番号' |
1831 |
, EditFlg decimal(1,0) not null comment '編集フラグ' |
1832 |
, EntryDate datetime not null comment '登録日付' |
1833 |
, UpdateDate datetime not null comment '更新日付' |
1834 |
, constraint processexcutemaster_PKC primary key (SecCode,ExecCode) |
1835 |
) comment '起動対象マスタ' ; |
1836 |
|
1837 |
create index ProcessExcuteMaster_Index1 |
1838 |
on processexcutemaster(SecCode);
|
1839 |
|
1840 |
create index ProcessExcuteMaster_Index2 |
1841 |
on processexcutemaster(ExecCode);
|
1842 |
|
1843 |
-- 注文書データ
|
1844 |
drop table if exists purchaseorder cascade; |
1845 |
|
1846 |
create table purchaseorder ( |
1847 |
ConstructionCode decimal(10,0) unsigned not null comment '工事コード' |
1848 |
, SeqNo decimal(3,0) unsigned not null comment '注文書枝番' |
1849 |
, CompanyCode decimal(8,0) not null comment '協力会社コード' |
1850 |
, CreateDate date comment '作成日付' |
1851 |
, OrderPrice decimal(12,0) not null comment '発注金額' |
1852 |
, LastRowStringDate date not null comment '最終行表示日付' |
1853 |
, OrderSheetType decimal(1,0) not null comment '簡易・本式フラグ' |
1854 |
, PaymentTerms decimal(1,0) not null comment '支払い条件' |
1855 |
, CashRatio decimal(4,1) not null comment '現金割合(%)' |
1856 |
, BillPeriod decimal(4,0) not null comment '手形期間' |
1857 |
, PrePayments decimal(1,0) not null comment '前金払' |
1858 |
, PrePaymentsDays decimal(3,0) not null comment '前金払日数' |
1859 |
, PrePaymentsPrice decimal(12,0) not null comment '前金払金額' |
1860 |
, PartialPayment decimal(1,0) not null comment '部分払' |
1861 |
, PartialPaymentMounth decimal(2,0) unsigned not null comment '部分払締切月' |
1862 |
, PartialPaymentDay1 decimal(2,0) unsigned not null comment '部分払締切日' |
1863 |
, PartialPaymentDay2 decimal(2,0) unsigned not null comment '部分払支払日' |
1864 |
, PartialPaymentPrice decimal(12,0) not null comment '部分払金額' |
1865 |
, CompletionPayment decimal(1,0) not null comment '引渡し時の支払' |
1866 |
, CompletionPaymentDays decimal(3,0) unsigned not null comment '引渡し時の支払日数' |
1867 |
, CompletionPaymentPrice decimal(12,0) not null comment '引渡し時の支払金額' |
1868 |
, LeadEngineerCode decimal(8,0) comment '主任技術者コード' |
1869 |
, LeadEngineerName varchar(60) comment 'LeadEngineerName' |
1870 |
, SafetyOfficerCode decimal(8,0) comment '安全管理者コード' |
1871 |
, SafetyOfficerName varchar(60) comment '安全管理者名' |
1872 |
, WorkersCount decimal(3,0) unsigned comment '作業員数' |
1873 |
, PrintoutDate date not null comment '印刷年月日' |
1874 |
, EntryDate datetime not null comment '登録日付' |
1875 |
, UpdateDate datetime not null comment '更新日付' |
1876 |
, constraint purchaseorder_PKC primary key (ConstructionCode,SeqNo) |
1877 |
) comment '注文書データ' ; |
1878 |
|
1879 |
-- 注文書日付データ
|
1880 |
drop table if exists purchaseorderdate cascade; |
1881 |
|
1882 |
create table purchaseorderdate ( |
1883 |
ConstructionCode decimal(10,0) unsigned not null comment '工事コード' |
1884 |
, SeqNo decimal(3,0) unsigned not null comment '注文書枝番' |
1885 |
, CompanyCode decimal(8,0) not null comment '協力会社コード' |
1886 |
, SendDate date not null comment '注文書郵送日' |
1887 |
, ReturnDate date not null comment '注文書返送日' |
1888 |
, ReturnCheckDate date not null comment '注文書返送確認日' |
1889 |
, EntryDate datetime not null comment '登録日付' |
1890 |
, UpdateDate datetime not null comment '更新日付' |
1891 |
, constraint purchaseorderdate_PKC primary key (ConstructionCode,SeqNo) |
1892 |
) comment '注文書日付データ' ; |
1893 |
|
1894 |
-- 注文書明細データ
|
1895 |
drop index POrderDetail_Index1 on purchaseorderdetail; |
1896 |
|
1897 |
drop table if exists purchaseorderdetail cascade; |
1898 |
|
1899 |
create table purchaseorderdetail ( |
1900 |
ConstructionCode decimal(10,0) unsigned not null comment '工事コード' |
1901 |
, SeqNo decimal(3,0) unsigned not null comment '注文書枝番' |
1902 |
, GroupCount decimal(1,0) not null comment 'グループ番号' |
1903 |
, LineCount decimal(3,0) unsigned not null comment '行番号' |
1904 |
, ComponentCode decimal(5,0) unsigned not null comment '構成キー' |
1905 |
, ItemCode decimal(5,0) unsigned not null comment '工種キー' |
1906 |
, FirstString varchar(120) comment '工種・品名' |
1907 |
, SecondString varchar(120) comment '内容内訳' |
1908 |
, UnitCount decimal(8,2) not null comment '数量' |
1909 |
, UnitName varchar(30) comment '単位' |
1910 |
, UnitPrice decimal(10,0) not null comment '単価' |
1911 |
, OrdersLinePrice decimal(12,0) comment '金額' |
1912 |
, SourceCode decimal(10,0) unsigned not null comment '予算作成時工事番号' |
1913 |
, SourceLineCnt decimal(3,0) unsigned not null comment '注文書作成時台帳行番号' |
1914 |
, EntryDate datetime not null comment '登録日付' |
1915 |
, UpdateDate datetime not null comment '更新日付' |
1916 |
, constraint purchaseorderdetail_PKC primary key (ConstructionCode,SeqNo,GroupCount,LineCount) |
1917 |
) comment '注文書明細データ' ; |
1918 |
|
1919 |
create index POrderDetail_Index1 |
1920 |
on purchaseorderdetail(SourceCode);
|
1921 |
|
1922 |
-- 請求データ
|
1923 |
drop table if exists requestdata cascade; |
1924 |
|
1925 |
create table requestdata ( |
1926 |
REQUESTNO decimal(9,0) not null comment '請求No' |
1927 |
, MAINCONSTRUCTIONCODE decimal(10,0) not null comment '本工事番号' |
1928 |
, CONSTRUCTIONNAME varchar(120) not null comment '工事件名' |
1929 |
, CONTRACTAMOUNT decimal(10,0) not null comment '請負金額' |
1930 |
, PAIDAMOUNT decimal(10,0) not null comment '請求済金額' |
1931 |
, REQUESTAMOUNT0 decimal(10,0) not null comment '請求金額0' |
1932 |
, REQUESTAMOUNT1 decimal(10,0) not null comment '請求金額1' |
1933 |
, REQUESTAMOUNT2 decimal(10,0) comment '請求金額2' |
1934 |
, REQUESTAMOUNT3 decimal(10,0) comment '請求金額3' |
1935 |
, REQUESTAMOUNT4 decimal(10,0) comment '請求金額4' |
1936 |
, REQUESTAMOUNT5 decimal(10,0) comment '請求金額5' |
1937 |
, REQUESTAMOUNT6 decimal(10,0) comment '請求金額6' |
1938 |
, UNCLAIMEDAMOUNT decimal(10,0) not null comment '請求残金額' |
1939 |
, UNPAIDAMOUNT decimal(10,0) not null comment '未入金金額' |
1940 |
, TAXAMOUNT decimal(10,0) not null comment '消費税' |
1941 |
, NOTE varchar(120) not null comment '備考' |
1942 |
, ENTRYDATE datetime not null comment '登録年月日' |
1943 |
, UPDATEDATE datetime not null comment '更新年月日' |
1944 |
, constraint requestdata_PKC primary key (REQUESTNO,MAINCONSTRUCTIONCODE) |
1945 |
) comment '請求データ' ; |
1946 |
|
1947 |
-- 請求データ明細
|
1948 |
drop table if exists requestdatadetail cascade; |
1949 |
|
1950 |
create table requestdatadetail ( |
1951 |
REQUESTNO decimal(9,0) not null comment '請求No' |
1952 |
, MAINCONSTRUCTIONCODE decimal(10,0) not null comment '本工事番号' |
1953 |
, CONSTRUCTIONCODE decimal(10,0) not null comment '工事番号' |
1954 |
, CONSTRUCTIONKIND decimal(1,0) not null comment '工事区分' |
1955 |
, REQUESTAMOUNT decimal(10,0) not null comment '請求金額' |
1956 |
, TAXAMOUNT decimal(10,0) not null comment '消費税' |
1957 |
, ENTRYDATE datetime not null comment '登録年月日' |
1958 |
, UPDATEDATE datetime not null comment '更新年月日' |
1959 |
, constraint requestdatadetail_PKC primary key (REQUESTNO,MAINCONSTRUCTIONCODE,CONSTRUCTIONCODE,CONSTRUCTIONKIND) |
1960 |
) comment '請求データ明細' ; |
1961 |
|
1962 |
-- 請求ヘッダ
|
1963 |
drop table if exists requesthead cascade; |
1964 |
|
1965 |
create table requesthead ( |
1966 |
REQUESTNO decimal(9,0) not null comment '請求No' |
1967 |
, REQCONSTRUCTIONCODE decimal(10,0) not null comment '請求工事番号' |
1968 |
, ORDERNO decimal(2,0) not null comment '受付番号' |
1969 |
, REQUESTMONTH decimal(6,0) not null comment '請求月' |
1970 |
, ORDERERSDIVISION decimal(5,0) not null comment '発注者区分' |
1971 |
, ORDERERSCODE decimal(5,0) not null comment '発注者コード' |
1972 |
, ORDERERSNAME varchar(120) not null comment '発注者先名' |
1973 |
, REQCONSTRUCTIONNAME varchar(120) not null comment '請求工事件名' |
1974 |
, REQUESTTOTALAMOUNT decimal(10,0) not null comment '請求金額合計' |
1975 |
, REQUESTAMOUNT decimal(10,0) not null comment '請求金額' |
1976 |
, TAXAMOUNT decimal(10,0) not null comment '消費税' |
1977 |
, UNPAIDAMOUNT decimal(10,0) comment '未入金' |
1978 |
, NOTE varchar(120) comment '備考' |
1979 |
, ASSIGNEDFLG decimal(1,0) comment '割当済フラグ' |
1980 |
, INVOICENO decimal(9,0) not null comment '請求書No' |
1981 |
, ENTRYDATE datetime not null comment '登録年月日' |
1982 |
, UPDATEDATE datetime not null comment '更新年月日' |
1983 |
, constraint requesthead_PKC primary key (REQUESTNO) |
1984 |
) comment '請求ヘッダ' ; |
1985 |
|
1986 |
alter table requesthead add unique REQCONSTRUCTIONCODE (REQCONSTRUCTIONCODE,ORDERNO) ; |
1987 |
|
1988 |
-- 請求書日付データ
|
1989 |
drop table if exists requestorderdate cascade; |
1990 |
|
1991 |
create table requestorderdate ( |
1992 |
ConstructionCode decimal(10,0) unsigned not null comment '工事コード' |
1993 |
, RequestNo decimal(9,0) not null comment '請求No' |
1994 |
, SendDate date not null comment '請求書発給郵送日' |
1995 |
, PaymentDate date not null comment '入金日' |
1996 |
, EntryDate datetime not null comment '登録日付' |
1997 |
, UpdateDate datetime not null comment '更新日付' |
1998 |
) comment '請求書日付データ' ; |
1999 |
|
2000 |
-- 売上グラフデータ
|
2001 |
drop index SalesGraphData_Idx1 on salesgraphdata; |
2002 |
drop index SalesGraphData_idx2 on salesgraphdata; |
2003 |
|
2004 |
drop table if exists salesgraphdata cascade; |
2005 |
|
2006 |
create table salesgraphdata ( |
2007 |
GraphDataCode decimal(8,0) not null comment 'グラフデータコード' |
2008 |
, ConstructionPeriod decimal(4,0) unsigned not null comment '事業期' |
2009 |
, SalesDataDays date not null comment '売上年月' |
2010 |
, DisplayOrder decimal(8,0) unsigned not null comment '表示順' |
2011 |
, DataName varchar(100) not null comment 'データ表示名称' |
2012 |
, SalesAmount decimal(10,0) not null comment '売上データ' |
2013 |
, AdministrativeExpense decimal(10,0) not null comment '販管・部署経費' |
2014 |
, GrossProfit decimal(10,0) not null comment '粗利益' |
2015 |
, NetIncome decimal(10,0) not null comment '純利益(損益)' |
2016 |
, EntryDate datetime not null comment '登録日付' |
2017 |
, UpdateDate datetime not null comment '更新日付' |
2018 |
, constraint salesgraphdata_PKC primary key (GraphDataCode,ConstructionPeriod,SalesDataDays) |
2019 |
) comment '売上グラフデータ' ; |
2020 |
|
2021 |
create index SalesGraphData_Idx1 |
2022 |
on salesgraphdata(DisplayOrder);
|
2023 |
|
2024 |
create index SalesGraphData_idx2 |
2025 |
on salesgraphdata(ConstructionPeriod);
|
2026 |
|
2027 |
-- 保護区分マスタ
|
2028 |
drop index SecurityMaster_Index1 on securitymaster; |
2029 |
drop index SecurityMaster_Index2 on securitymaster; |
2030 |
drop index SecurityMaster_Index3 on securitymaster; |
2031 |
|
2032 |
drop table if exists securitymaster cascade; |
2033 |
|
2034 |
create table securitymaster ( |
2035 |
SecCode decimal(2,0) unsigned not null comment '保護区分番号' |
2036 |
, DisplayOrder decimal(2,0) not null comment '表示順' |
2037 |
, SecName varchar(60) not null comment '保護区分名称' |
2038 |
, SecRank decimal(1,0) not null comment '保護区分ランク' |
2039 |
, SecRange decimal(1,0) not null comment '保護区分範囲' |
2040 |
, GeneralAffairs decimal(1,0) not null comment '総務業務フラグ' |
2041 |
, SelectBackColor varchar(8) not null comment '選択背景色' |
2042 |
, EntryDate datetime not null comment '登録日付' |
2043 |
, UpdateDate datetime not null comment '更新日付' |
2044 |
, constraint securitymaster_PKC primary key (SecCode) |
2045 |
) comment '保護区分マスタ' ; |
2046 |
|
2047 |
create index SecurityMaster_Index1 |
2048 |
on securitymaster(DisplayOrder);
|
2049 |
|
2050 |
create index SecurityMaster_Index2 |
2051 |
on securitymaster(SecRank);
|
2052 |
|
2053 |
create index SecurityMaster_Index3 |
2054 |
on securitymaster(SecRange);
|
2055 |
|
2056 |
-- 協力業者施工工種登録申請データ
|
2057 |
drop table if exists subconstrjobitemregist cascade; |
2058 |
|
2059 |
create table subconstrjobitemregist ( |
2060 |
PersonCode decimal(8,0) unsigned not null comment '申請者番号' |
2061 |
, CreateDate date not null comment '作成日' |
2062 |
, SeqNo decimal(2,0) unsigned not null comment '申請連番' |
2063 |
, DisplayOrder decimal(8,0) unsigned not null comment '表示順' |
2064 |
, ItemCode decimal(5,0) unsigned not null comment '工種キー' |
2065 |
, EntryDate datetime not null comment '登録日付' |
2066 |
, UpdateDate datetime not null comment '更新日付' |
2067 |
, constraint subconstrjobitemregist_PKC primary key (PersonCode,CreateDate,SeqNo,DisplayOrder) |
2068 |
) comment '協力業者施工工種登録申請データ' ; |
2069 |
|
2070 |
-- 協力業者職種リンク登録申請データ
|
2071 |
drop table if exists subconstrjoblinkregist cascade; |
2072 |
|
2073 |
create table subconstrjoblinkregist ( |
2074 |
PersonCode decimal(8,0) unsigned not null comment '申請者番号' |
2075 |
, CreateDate date not null comment '作成日' |
2076 |
, SeqNo decimal(2,0) unsigned not null comment '申請連番' |
2077 |
, DisplayOrder decimal(8,0) unsigned not null comment '表示順' |
2078 |
, JobCategoryCode decimal(5,0) not null comment '職種キー' |
2079 |
, EntryDate datetime not null comment '登録日付' |
2080 |
, UpdateDate datetime not null comment '更新日付' |
2081 |
, constraint subconstrjoblinkregist_PKC primary key (PersonCode,CreateDate,SeqNo,DisplayOrder) |
2082 |
) comment '協力業者職種リンク登録申請データ' ; |
2083 |
|
2084 |
-- 協力業者登録申請データ
|
2085 |
drop table if exists subconstrregist cascade; |
2086 |
|
2087 |
create table subconstrregist ( |
2088 |
PersonCode decimal(8,0) unsigned not null comment '申請者番号' |
2089 |
, CreateDate date not null comment '作成日' |
2090 |
, SeqNo decimal(2,0) unsigned not null comment '申請連番' |
2091 |
, DataMode decimal(1,0) comment 'データ区分' |
2092 |
, SourceCode decimal(8,0) not null comment '協力会社コード' |
2093 |
, PetitionPeriod decimal(4,0) unsigned not null comment '申請年度' |
2094 |
, CorporateStatusName varchar(40) comment '法人格名称' |
2095 |
, CorporateStatusPoint decimal(1,0) not null comment '法人格名称位置' |
2096 |
, CompanyName varchar(100) not null comment '協力会社名' |
2097 |
, CEOPositionName varchar(60) comment '代表者役職名' |
2098 |
, CEOName varchar(60) comment '代表者氏名' |
2099 |
, ContactPersonName varchar(60) comment '担当者氏名' |
2100 |
, ZipCode varchar(8) comment '郵便番号' |
2101 |
, Address1 varchar(60) comment '住所1' |
2102 |
, Address2 varchar(60) comment '住所2' |
2103 |
, Address3 varchar(60) comment '住所3' |
2104 |
, CellPhoneNumber varchar(13) comment '携帯電話番号' |
2105 |
, MailAddress varchar(257) comment 'メールアドレス' |
2106 |
, PhoneNumber varchar(13) comment '電話番号' |
2107 |
, FaxNumber varchar(13) comment 'FAX番号' |
2108 |
, JapaneseSyllabary varchar(2) comment '50音読み' |
2109 |
, StartDate date not null comment '取引開始年月日' |
2110 |
, Note varchar(300) comment '備考' |
2111 |
, labourKind decimal(1,0) not null comment '支払い通常・手間区分' |
2112 |
, OrderDate date comment '申請日' |
2113 |
, OrderNo decimal(2,0) unsigned not null comment '申請受付番号' |
2114 |
, EntryDate datetime not null comment '登録日付' |
2115 |
, UpdateDate datetime not null comment '更新日付' |
2116 |
, constraint subconstrregist_PKC primary key (PersonCode,CreateDate,SeqNo) |
2117 |
) comment '協力業者登録申請データ' ; |
2118 |
|
2119 |
-- 協力会社工種マスタ
|
2120 |
drop table if exists subcontractoritemmaster cascade; |
2121 |
|
2122 |
create table subcontractoritemmaster ( |
2123 |
ItemCode decimal(5,0) unsigned not null comment '工種キー' |
2124 |
, DisplayOrder decimal(5,0) unsigned not null comment '表示順' |
2125 |
, ItemName varchar(120) not null comment '工種名称' |
2126 |
, DeleteFlg decimal(1,0) not null comment '削除フラグ' |
2127 |
, EntryDate datetime not null comment '登録日付' |
2128 |
, UpdateDate datetime not null comment '更新日付' |
2129 |
, constraint subcontractoritemmaster_PKC primary key (ItemCode) |
2130 |
) comment '協力会社工種マスタ' ; |
2131 |
|
2132 |
-- 協力会社職種マスタ
|
2133 |
drop table if exists subcontractorjobcategory cascade; |
2134 |
|
2135 |
create table subcontractorjobcategory ( |
2136 |
JobCategoryCode decimal(5,0) not null comment '職種キー' |
2137 |
, DisplayOrder decimal(5,0) unsigned not null comment '表示順' |
2138 |
, JobCategoryName varchar(120) not null comment '職種名称' |
2139 |
, DeleteFlg decimal(1,0) not null comment '削除フラグ' |
2140 |
, EntryDate datetime not null comment '登録日付' |
2141 |
, UpdateDate datetime not null comment '更新日付' |
2142 |
, constraint subcontractorjobcategory_PKC primary key (JobCategoryCode) |
2143 |
) comment '協力会社職種マスタ' ; |
2144 |
|
2145 |
-- 協力会社施工工種データ
|
2146 |
drop index SubContractorJobItem_Index1 on subcontractorjobitem; |
2147 |
drop index SubContractorJobItem_Index2 on subcontractorjobitem; |
2148 |
|
2149 |
drop table if exists subcontractorjobitem cascade; |
2150 |
|
2151 |
create table subcontractorjobitem ( |
2152 |
CompanyCode decimal(8,0) not null comment '協力会社コード' |
2153 |
, ItemCode decimal(5,0) unsigned not null comment '工種キー' |
2154 |
, DisplayOrder decimal(5,0) unsigned not null comment '表示順' |
2155 |
, EntryDate datetime not null comment '登録日付' |
2156 |
, UpdateDate datetime not null comment '更新日付' |
2157 |
, constraint subcontractorjobitem_PKC primary key (CompanyCode,ItemCode) |
2158 |
) comment '協力会社施工工種データ' ; |
2159 |
|
2160 |
create index SubContractorJobItem_Index1 |
2161 |
on subcontractorjobitem(CompanyCode);
|
2162 |
|
2163 |
create index SubContractorJobItem_Index2 |
2164 |
on subcontractorjobitem(ItemCode);
|
2165 |
|
2166 |
-- 協力会社職種リンクマスタ
|
2167 |
drop index SubContractorJobLink_Index1 on subcontractorjoblink; |
2168 |
drop index SubContractorJobLink_Index2 on subcontractorjoblink; |
2169 |
|
2170 |
drop table if exists subcontractorjoblink cascade; |
2171 |
|
2172 |
create table subcontractorjoblink ( |
2173 |
CompanyCode decimal(8,0) not null comment '協力会社コード' |
2174 |
, JobCategoryCode decimal(5,0) not null comment '職種キー' |
2175 |
, DisplayOrder decimal(5,0) unsigned not null comment '表示順' |
2176 |
, EntryDate datetime not null comment '登録日付' |
2177 |
, UpdateDate datetime not null comment '更新日付' |
2178 |
, constraint subcontractorjoblink_PKC primary key (CompanyCode,JobCategoryCode) |
2179 |
) comment '協力会社職種リンクマスタ' ; |
2180 |
|
2181 |
create index SubContractorJobLink_Index1 |
2182 |
on subcontractorjoblink(CompanyCode);
|
2183 |
|
2184 |
create index SubContractorJobLink_Index2 |
2185 |
on subcontractorjoblink(JobCategoryCode);
|
2186 |
|
2187 |
-- 協力会社マスタ
|
2188 |
drop index SubContractorMaster_Index1 on subcontractormaster; |
2189 |
|
2190 |
drop table if exists subcontractormaster cascade; |
2191 |
|
2192 |
create table subcontractormaster ( |
2193 |
CompanyCode decimal(8,0) not null comment '協力会社コード' |
2194 |
, DisplayOrder decimal(8,0) unsigned not null comment '表示順' |
2195 |
, CorporateStatusName varchar(40) comment '法人格名称' |
2196 |
, CorporateStatusPoint decimal(1,0) not null comment '法人格名称位置' |
2197 |
, CompanyName varchar(100) not null comment '協力会社名' |
2198 |
, CEOPositionName varchar(60) comment '代表者役職名' |
2199 |
, CEOName varchar(60) comment '代表者氏名' |
2200 |
, ContactPersonName varchar(60) comment '担当者氏名' |
2201 |
, ZipCode varchar(8) comment '郵便番号' |
2202 |
, Address1 varchar(60) comment '住所1' |
2203 |
, Address2 varchar(60) comment '住所2' |
2204 |
, Address3 varchar(60) comment '住所3' |
2205 |
, CellPhoneNumber varchar(13) comment '携帯電話番号' |
2206 |
, MailAddress varchar(257) comment 'メールアドレス' |
2207 |
, PhoneNumber varchar(13) comment '電話番号' |
2208 |
, FaxNumber varchar(13) comment 'FAX番号' |
2209 |
, JapaneseSyllabary varchar(2) comment '50音読み' |
2210 |
, StartDate date not null comment '取引開始年月日' |
2211 |
, Note varchar(300) comment '備考' |
2212 |
, labourKind decimal(1,0) not null comment '支払い通常・手間区分' |
2213 |
, DeleteFlg decimal(1,0) default '0' not null comment '削除フラグ' |
2214 |
, EntryDate datetime not null comment '登録日付' |
2215 |
, UpdateDate datetime not null comment '更新日付' |
2216 |
, constraint subcontractormaster_PKC primary key (CompanyCode) |
2217 |
) comment '協力会社マスタ' ; |
2218 |
|
2219 |
create index SubContractorMaster_Index1 |
2220 |
on subcontractormaster(JapaneseSyllabary);
|
2221 |
|
2222 |
-- 仕入先マスタ
|
2223 |
drop table if exists suppliersmaster cascade; |
2224 |
|
2225 |
create table suppliersmaster ( |
2226 |
SuppliersCode decimal(5,0) unsigned not null comment '仕入先コード' |
2227 |
, DisplayOrder decimal(5,0) unsigned not null comment '表示順' |
2228 |
, SuppliersName1 varchar(60) not null comment '仕入先名1' |
2229 |
, SuppliersName2 varchar(60) comment '仕入先名2' |
2230 |
, ZipCode varchar(8) comment '郵便番号' |
2231 |
, Address1 varchar(60) comment '住所1' |
2232 |
, Address2 varchar(60) comment '住所2' |
2233 |
, Address3 varchar(60) comment '住所3' |
2234 |
, PhoneNumber varchar(13) comment '電話番号' |
2235 |
, FaxNumber varchar(13) comment 'FAX番号' |
2236 |
, Note varchar(300) comment '備考' |
2237 |
, DeleteFlg decimal(1,0) not null comment '削除フラグ' |
2238 |
, EntryDate datetime not null comment '登録日付' |
2239 |
, UpdateDate datetime not null comment '更新日付' |
2240 |
, constraint suppliersmaster_PKC primary key (SuppliersCode) |
2241 |
) comment '仕入先マスタ' ; |
2242 |
|
2243 |
-- システム起動確認データ
|
2244 |
drop table if exists systemexecute cascade; |
2245 |
|
2246 |
create table systemexecute ( |
2247 |
PrimaryCode tinyint(4) not null comment 'キー項目' |
2248 |
, TargetDate date not null comment '起動日付' |
2249 |
, SystemVersion int(11) not null comment '本体・環境バージョン' |
2250 |
, UpDateCopyVersion int(11) not null comment 'コピーバージョン' |
2251 |
, EntryDate datetime not null comment '登録日付' |
2252 |
, UpdateDate datetime not null comment '更新日付' |
2253 |
, constraint systemexecute_PKC primary key (PrimaryCode) |
2254 |
) comment 'システム起動確認データ' ; |
2255 |
|
2256 |
-- 管理マスタ
|
2257 |
drop table if exists systemmaster cascade; |
2258 |
|
2259 |
create table systemmaster ( |
2260 |
SystemCode decimal(3,0) unsigned not null comment '会社コード' |
2261 |
, CompanyName1 varchar(60) not null comment '会社名1' |
2262 |
, CompanyName2 varchar(60) comment '会社名2' |
2263 |
, CEOName varchar(60) not null comment '代表者氏名' |
2264 |
, CEOPositionName varchar(60) comment '代表者役職名' |
2265 |
, ZipCode varchar(8) not null comment '郵便番号' |
2266 |
, Address1 varchar(60) not null comment '住所1' |
2267 |
, Address2 varchar(60) comment '住所2' |
2268 |
, Address3 varchar(60) comment '住所3' |
2269 |
, PhoneNumber varchar(13) not null comment '電話番号' |
2270 |
, FaxNumber varchar(13) comment 'FAX番号' |
2271 |
, HomePageURL varchar(120) comment 'ホームページURL' |
2272 |
, ConstructionExpenses decimal(4,2) not null comment '工事部経費' |
2273 |
, OfficeExpenses decimal(4,2) not null comment '事務所経費' |
2274 |
, OperatingExpenses decimal(4,2) not null comment '営業経費' |
2275 |
, ConsumptionTax decimal(4,2) not null comment '消費税' |
2276 |
, CooperationRate decimal(4,2) not null comment '協力金比率' |
2277 |
, StatutoryWelfareRate decimal(4,2) not null comment '法定福利費比率' |
2278 |
, ExcelSavePath varchar(120) comment 'Excel保存パス' |
2279 |
, BusinessPeriod smallint(6) not null comment '現在営業期数' |
2280 |
, ConstructionYear smallint(6) not null comment '現在工事年度' |
2281 |
, BusinessBeginningDate varchar(5) not null comment '営業期期首日' |
2282 |
, ConstructionBeginningDate varchar(5) not null comment '工事年度期首日' |
2283 |
, ConstructionNoBase decimal(1,0) not null comment '工事番号基準値' |
2284 |
, SloganString1 varchar(100) comment '標語1' |
2285 |
, SloganString2 varchar(100) comment '標語2' |
2286 |
, SloganString3 varchar(100) comment '標語3' |
2287 |
, EntryDate datetime not null comment '登録日付' |
2288 |
, UpdateDate datetime not null comment '更新日付' |
2289 |
, constraint systemmaster_PKC primary key (SystemCode) |
2290 |
) comment '管理マスタ' ; |
2291 |
|
2292 |
-- 期限マスタ
|
2293 |
drop index TermMaster_Index1 on termmaster; |
2294 |
|
2295 |
drop table if exists termmaster cascade; |
2296 |
|
2297 |
create table termmaster ( |
2298 |
ConstructionStatusFlg decimal(2,0) not null comment '工事状態フラグ' |
2299 |
, FieldNo decimal(2,0) not null comment 'チェック対象フィールド番号' |
2300 |
, SeqNo decimal(2,0) not null comment '枝番' |
2301 |
, DisplayOrder decimal(2,0) not null comment '表示順' |
2302 |
, CheckSchdule decimal(1,0) not null comment 'チェックタイミング' |
2303 |
, TermDays decimal(3,0) not null comment '経過日' |
2304 |
, SendTitile varchar(100) comment 'タイトル' |
2305 |
, SendMessage varchar(100) comment 'メッセージ' |
2306 |
, BackColor varchar(8) comment '背景色' |
2307 |
, ForeColor varchar(8) comment '文字色' |
2308 |
, EntryDate datetime not null comment '登録日付' |
2309 |
, UpdateDate datetime not null comment '更新日付' |
2310 |
, constraint termmaster_PKC primary key (ConstructionStatusFlg,FieldNo,SeqNo) |
2311 |
) comment '期限マスタ' ; |
2312 |
|
2313 |
create index TermMaster_Index1 |
2314 |
on termmaster(DisplayOrder);
|
2315 |
|
2316 |
-- 出勤交通費データ
|
2317 |
drop index TranceportDailyData_Index1 on tranceportdailydata; |
2318 |
|
2319 |
drop table if exists tranceportdailydata cascade; |
2320 |
|
2321 |
create table tranceportdailydata ( |
2322 |
PersonCode decimal(8,0) unsigned not null comment '作成者コード' |
2323 |
, AttendanceDate date not null comment '日報作成日' |
2324 |
, StartDistance decimal(7,1) not null comment '当日出発キロ数' |
2325 |
, ComplateDistance decimal(7,1) not null comment '当日終了キロ数' |
2326 |
, TotalDistance decimal(6,1) not null comment '当日合計キロ数' |
2327 |
, OfficeGoFlg decimal(1,0) not null comment '事務所出勤フラグ' |
2328 |
, OfficeOutFlg decimal(1,0) not null comment '事務所帰宅フラグ' |
2329 |
, TrancePayGoFlg decimal(1,0) not null comment '有料通勤出勤フラグ' |
2330 |
, TrancePayOutFlg decimal(1,0) not null comment '有料通勤帰宅フラグ' |
2331 |
, WareHouseFlg decimal(1,0) not null comment '資材置場フラグ' |
2332 |
, EntryDate datetime not null comment '登録日付' |
2333 |
, UpdateDate datetime not null comment '更新日付' |
2334 |
, constraint tranceportdailydata_PKC primary key (PersonCode,AttendanceDate) |
2335 |
) comment '出勤交通費データ' ; |
2336 |
|
2337 |
create index TranceportDailyData_Index1 |
2338 |
on tranceportdailydata(AttendanceDate);
|
2339 |
|
2340 |
-- 工事種別経費率マスタ
|
2341 |
drop table if exists typeexpensesmaster cascade; |
2342 |
|
2343 |
create table typeexpensesmaster ( |
2344 |
TypeCode decimal(5,0) unsigned not null comment '工事種別コード' |
2345 |
, ExpensesPeriod smallint(6) not null comment '事業期' |
2346 |
, NameCode decimal(5,0) unsigned not null comment '経費名称コード' |
2347 |
, ExpensesRaito decimal(4,2) not null comment '経費率' |
2348 |
, DeleteFlg decimal(1,0) not null comment '削除フラグ' |
2349 |
, EntryDate datetime not null comment '登録日付' |
2350 |
, UpdateDate datetime not null comment '更新日付' |
2351 |
, constraint typeexpensesmaster_PKC primary key (TypeCode,ExpensesPeriod,NameCode) |
2352 |
) comment '工事種別経費率マスタ' ; |
2353 |
|
2354 |
-- 単位マスタ
|
2355 |
drop index UnitMaster_Index1 on unitmaster; |
2356 |
|
2357 |
drop table if exists unitmaster cascade; |
2358 |
|
2359 |
create table unitmaster ( |
2360 |
UnitKey decimal(5,0) unsigned not null comment '単位キー' |
2361 |
, DisplayOrder decimal(5,0) unsigned not null comment '表示順' |
2362 |
, UnitName varchar(30) not null comment '単位名称' |
2363 |
, EntryDate datetime not null comment '登録日付' |
2364 |
, UpdateDate datetime not null comment '更新日付' |
2365 |
, constraint unitmaster_PKC primary key (UnitKey) |
2366 |
) comment '単位マスタ' ; |
2367 |
|
2368 |
create index UnitMaster_Index1 |
2369 |
on unitmaster(DisplayOrder);
|
2370 |
|
2371 |
-- 車両マスタ
|
2372 |
drop table if exists vehiclemaster cascade; |
2373 |
|
2374 |
create table vehiclemaster ( |
2375 |
VehicleCode decimal(5,0) unsigned not null comment '車両コード' |
2376 |
, DisplayOrder decimal(5,0) unsigned not null comment '表示順' |
2377 |
, VehicleName varchar(100) not null comment '車両名称' |
2378 |
, RegistrationNumber varchar(30) comment '登録番号' |
2379 |
, IdentificationNumber varchar(30) comment '車体番号' |
2380 |
, ModelCode varchar(30) comment '型式' |
2381 |
, DepartmentCode decimal(5,0) unsigned not null comment '管理部署' |
2382 |
, VehicleScheduleFlg decimal(1,0) not null comment '車両予約表示フラグ' |
2383 |
, PurchaseDate date comment '購入日' |
2384 |
, PurchaseName varchar(30) comment '購入先' |
2385 |
, PurchaseContactPersons varchar(30) comment '購入先担当者' |
2386 |
, PurchasePhone varchar(13) comment '購入先電話番号' |
2387 |
, LeaseDate date comment 'リース開始日' |
2388 |
, LeaseDestination varchar(30) comment 'リース先' |
2389 |
, LeaseContactPersons varchar(30) comment 'リース先担当者' |
2390 |
, LeasePhone varchar(13) comment 'リース先電話番号' |
2391 |
, InsuranceCompany varchar(30) comment '任意保険会社' |
2392 |
, InsuranceContactPersons varchar(30) comment '任意保険会社担当者' |
2393 |
, InsurancePhone varchar(13) comment '任意保険会社電話番号' |
2394 |
, Note varchar(300) comment '備考' |
2395 |
, EntryDate datetime comment '登録日付' |
2396 |
, UpdateDate datetime comment '更新日付' |
2397 |
, constraint vehiclemaster_PKC primary key (VehicleCode) |
2398 |
) comment '車両マスタ' ; |
2399 |
|
2400 |
-- 車両記録データ
|
2401 |
drop table if exists vehiclerecorddata cascade; |
2402 |
|
2403 |
create table vehiclerecorddata ( |
2404 |
VehicleCode decimal(5,0) unsigned not null comment '車両コード' |
2405 |
, DivisionCode decimal(2,0) unsigned not null comment 'データ区分' |
2406 |
, SeqNo decimal(2,0) not null comment '枝番' |
2407 |
, RecordDate date comment '実地日' |
2408 |
, Mileage mediumint(9) comment '走行距離' |
2409 |
, Content varchar(100) comment '内容' |
2410 |
, PaymentCost decimal(10,0) comment '費用' |
2411 |
, EntryDate datetime not null comment '登録日付' |
2412 |
, UpdateDate datetime not null comment '更新日付' |
2413 |
, constraint vehiclerecorddata_PKC primary key (VehicleCode,DivisionCode,SeqNo) |
2414 |
) comment '車両記録データ' ; |
2415 |
|
2416 |
-- 車両予約データ
|
2417 |
drop index VehicleScheduleData_Index1 on vehiclescheduledata; |
2418 |
drop index VehicleScheduleData_Index2 on vehiclescheduledata; |
2419 |
drop index VehicleScheduleData_Index3 on vehiclescheduledata; |
2420 |
|
2421 |
drop table if exists vehiclescheduledata cascade; |
2422 |
|
2423 |
create table vehiclescheduledata ( |
2424 |
TargetDate date not null comment '対象日' |
2425 |
, VehicleCode decimal(5,0) unsigned not null comment '車両コード' |
2426 |
, MorningAfternoon decimal(1,0) not null comment '午前・午後' |
2427 |
, PersonCode decimal(8,0) unsigned not null comment '担当者コード' |
2428 |
, TargetYear year(4) not null comment '該当年' |
2429 |
, TargetMonth tinyint(3) unsigned not null comment '該当月' |
2430 |
, TargetDay year(4) not null comment '該当日' |
2431 |
, EntryDate datetime not null comment '登録日付' |
2432 |
, UpdateDate datetime not null comment '更新日付' |
2433 |
, constraint vehiclescheduledata_PKC primary key (TargetDate,VehicleCode,MorningAfternoon) |
2434 |
) comment '車両予約データ' ; |
2435 |
|
2436 |
create index VehicleScheduleData_Index1 |
2437 |
on vehiclescheduledata(TargetYear);
|
2438 |
|
2439 |
create index VehicleScheduleData_Index2 |
2440 |
on vehiclescheduledata(TargetMonth);
|
2441 |
|
2442 |
create index VehicleScheduleData_Index3 |
2443 |
on vehiclescheduledata(TargetDay);
|
2444 |
|
2445 |
-- 年マスタ
|
2446 |
drop index year_Index1 on yearmaster; |
2447 |
|
2448 |
drop table if exists yearmaster cascade; |
2449 |
|
2450 |
create table yearmaster ( |
2451 |
years smallint(6) not null comment '年' |
2452 |
) comment '年マスタ' ; |
2453 |
|
2454 |
create index year_Index1 |
2455 |
on yearmaster(years);
|