ganti format table
This commit is contained in:
@@ -1,65 +1,258 @@
|
||||
-- Tabel Pelanggan
|
||||
CREATE TABLE customers (
|
||||
id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
customer_code VARCHAR(20) UNIQUE,
|
||||
company_name VARCHAR(100),
|
||||
customer_type ENUM('internal', 'external'),
|
||||
address TEXT,
|
||||
city VARCHAR(50),
|
||||
postal_code VARCHAR(10),
|
||||
phone VARCHAR(20),
|
||||
email VARCHAR(100),
|
||||
pic_name VARCHAR(100),
|
||||
pic_phone VARCHAR(20),
|
||||
pic_email VARCHAR(100),
|
||||
registration_date DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
status ENUM('active', 'inactive') DEFAULT 'active',
|
||||
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at DATETIME ON UPDATE CURRENT_TIMESTAMP
|
||||
CustomerID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
CustomerCode VARCHAR(20) UNIQUE,
|
||||
CustomerCompanyName VARCHAR(100),
|
||||
CustomerType ENUM('internal', 'external'),
|
||||
CustomerAddress TEXT,
|
||||
CustomerCity VARCHAR(50),
|
||||
CustomerPostalCode VARCHAR(10),
|
||||
CustomerPhone VARCHAR(20),
|
||||
CustomerEmail VARCHAR(100),
|
||||
CustomerPICName VARCHAR(100),
|
||||
CustomerPICPhone VARCHAR(20),
|
||||
CustomerPICEmail VARCHAR(100),
|
||||
CustomerRegistrationDate DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
CustomerStatus ENUM('active', 'inactive') DEFAULT 'active',
|
||||
CustomerCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
CustomerCreatedUserID INT,
|
||||
CustomerUpdatedAt DATETIME,
|
||||
CustomerUpdatedUserID INT,
|
||||
CustomerDeletedAt DATETIME,
|
||||
CustomerDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Tabel Riwayat Permintaan Analisis
|
||||
CREATE TABLE analysis_requests (
|
||||
id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
request_code VARCHAR(20) UNIQUE,
|
||||
customer_id INT,
|
||||
request_date DATETIME,
|
||||
status ENUM('new', 'process', 'completed', 'cancelled'),
|
||||
total_amount DECIMAL(10,2),
|
||||
notes TEXT,
|
||||
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (customer_id) REFERENCES customers(id)
|
||||
AnalysisRequestID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
AnalysisRequestCode VARCHAR(20) UNIQUE,
|
||||
CustomerID INT,
|
||||
AnalysisRequestDate DATETIME,
|
||||
AnalysisRequestStatus ENUM('new', 'process', 'completed', 'cancelled'),
|
||||
AnalysisRequestTotalAmount DECIMAL(10,2),
|
||||
AnalysisRequestNotes TEXT,
|
||||
AnalysisRequestCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
AnalysisRequestCreatedUserID INT,
|
||||
AnalysisRequestUpdatedAt DATETIME,
|
||||
AnalysisRequestUpdatedUserID INT,
|
||||
AnalysisRequestDeletedAt DATETIME,
|
||||
AnalysisRequestDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Tabel Riwayat Pembayaran
|
||||
CREATE TABLE payments (
|
||||
id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
request_id INT,
|
||||
payment_code VARCHAR(20) UNIQUE,
|
||||
payment_date DATETIME,
|
||||
amount DECIMAL(10,2),
|
||||
payment_method ENUM('cash', 'transfer', 'credit_card'),
|
||||
payment_status ENUM('pending', 'completed', 'failed'),
|
||||
proof_of_payment VARCHAR(255),
|
||||
notes TEXT,
|
||||
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (request_id) REFERENCES analysis_requests(id)
|
||||
PaymentID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
AnalysisRequestID INT,
|
||||
PaymentCode VARCHAR(20) UNIQUE,
|
||||
PaymentDate DATETIME,
|
||||
PaymentAmount DECIMAL(10,2),
|
||||
PaymentMethod ENUM('cash', 'transfer', 'credit_card'),
|
||||
PaymentStatus ENUM('pending', 'completed', 'failed'),
|
||||
PaymentProofPath VARCHAR(255),
|
||||
PaymentNotes TEXT,
|
||||
PaymentCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
PaymentCreatedUserID INT,
|
||||
PaymentUpdatedAt DATETIME,
|
||||
PaymentUpdatedUserID INT,
|
||||
PaymentDeletedAt DATETIME,
|
||||
PaymentDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Tabel Kategori Pelanggan
|
||||
CREATE TABLE customer_categories (
|
||||
CustomerCategoryID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
CustomerCategoryCode VARCHAR(20) UNIQUE,
|
||||
CustomerCategoryName VARCHAR(100),
|
||||
CustomerCategoryDescription TEXT,
|
||||
CustomerCategoryIsActive BOOLEAN DEFAULT TRUE,
|
||||
CustomerCategoryCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
CustomerCategoryCreatedUserID INT,
|
||||
CustomerCategoryUpdatedAt DATETIME,
|
||||
CustomerCategoryUpdatedUserID INT,
|
||||
CustomerCategoryDeletedAt DATETIME,
|
||||
CustomerCategoryDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Tabel Kontak Tambahan Pelanggan
|
||||
CREATE TABLE customer_contacts (
|
||||
CustomerContactID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
CustomerID INT,
|
||||
CustomerContactName VARCHAR(100),
|
||||
CustomerContactPosition VARCHAR(100),
|
||||
CustomerContactDepartment VARCHAR(100),
|
||||
CustomerContactPhone VARCHAR(20),
|
||||
CustomerContactEmail VARCHAR(100),
|
||||
CustomerContactIsMainContact BOOLEAN DEFAULT FALSE,
|
||||
CustomerContactIsActive BOOLEAN DEFAULT TRUE,
|
||||
CustomerContactCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
CustomerContactCreatedUserID INT,
|
||||
CustomerContactUpdatedAt DATETIME,
|
||||
CustomerContactUpdatedUserID INT,
|
||||
CustomerContactDeletedAt DATETIME,
|
||||
CustomerContactDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Tabel Dokumen Pelanggan
|
||||
CREATE TABLE customer_documents (
|
||||
CustomerDocumentID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
CustomerID INT,
|
||||
CustomerDocumentType VARCHAR(50),
|
||||
CustomerDocumentNumber VARCHAR(100),
|
||||
CustomerDocumentName VARCHAR(255),
|
||||
CustomerDocumentPath VARCHAR(255),
|
||||
CustomerDocumentIssuedDate DATE,
|
||||
CustomerDocumentExpiredDate DATE,
|
||||
CustomerDocumentIsActive BOOLEAN DEFAULT TRUE,
|
||||
CustomerDocumentCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
CustomerDocumentCreatedUserID INT,
|
||||
CustomerDocumentUpdatedAt DATETIME,
|
||||
CustomerDocumentUpdatedUserID INT,
|
||||
CustomerDocumentDeletedAt DATETIME,
|
||||
CustomerDocumentDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Tabel Riwayat Aktivitas Pelanggan
|
||||
CREATE TABLE customer_activities (
|
||||
CustomerActivityID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
CustomerID INT,
|
||||
CustomerActivityType VARCHAR(50),
|
||||
CustomerActivityDescription TEXT,
|
||||
CustomerActivityDate DATETIME,
|
||||
CustomerActivityStatus VARCHAR(50),
|
||||
CustomerActivityNotes TEXT,
|
||||
CustomerActivityCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
CustomerActivityCreatedUserID INT,
|
||||
CustomerActivityUpdatedAt DATETIME,
|
||||
CustomerActivityUpdatedUserID INT,
|
||||
CustomerActivityDeletedAt DATETIME,
|
||||
CustomerActivityDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Tabel Riwayat Komunikasi Pelanggan
|
||||
CREATE TABLE customer_communications (
|
||||
CustomerCommunicationID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
CustomerID INT,
|
||||
CustomerContactID INT,
|
||||
CustomerCommunicationType VARCHAR(50),
|
||||
CustomerCommunicationSubject VARCHAR(255),
|
||||
CustomerCommunicationContent TEXT,
|
||||
CustomerCommunicationDate DATETIME,
|
||||
CustomerCommunicationStatus VARCHAR(50),
|
||||
CustomerCommunicationFollowUpDate DATETIME,
|
||||
CustomerCommunicationNotes TEXT,
|
||||
CustomerCommunicationCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
CustomerCommunicationCreatedUserID INT,
|
||||
CustomerCommunicationUpdatedAt DATETIME,
|
||||
CustomerCommunicationUpdatedUserID INT,
|
||||
CustomerCommunicationDeletedAt DATETIME,
|
||||
CustomerCommunicationDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Contoh data pelanggan
|
||||
INSERT INTO customers (customer_code, company_name, customer_type, address, city, postal_code, phone, email, pic_name, pic_phone, pic_email) VALUES
|
||||
INSERT INTO customers (
|
||||
CustomerCode,
|
||||
CustomerCompanyName,
|
||||
CustomerType,
|
||||
CustomerAddress,
|
||||
CustomerCity,
|
||||
CustomerPostalCode,
|
||||
CustomerPhone,
|
||||
CustomerEmail,
|
||||
CustomerPICName,
|
||||
CustomerPICPhone,
|
||||
CustomerPICEmail
|
||||
) VALUES
|
||||
('CUST001', 'PT Lingkungan Hijau', 'external', 'Jl. Raya Utama No. 123', 'Jakarta', '12345', '021-5551234', 'info@lingkunganhijau.com', 'Budi Santoso', '081234567890', 'budi@lingkunganhijau.com'),
|
||||
('CUST002', 'Dinas Lingkungan Hidup', 'internal', 'Jl. Pemda No. 45', 'Bandung', '40111', '022-7891234', 'dlh@bandung.go.id', 'Siti Aminah', '087812345678', 'siti@bandung.go.id'),
|
||||
('CUST003', 'CV Alam Lestari', 'external', 'Jl. Industri Blok A2', 'Surabaya', '60111', '031-8765432', 'contact@alamlestari.com', 'Rudi Hartono', '085678901234', 'rudi@alamlestari.com');
|
||||
|
||||
-- Contoh data permintaan analisis
|
||||
INSERT INTO analysis_requests (request_code, customer_id, request_date, status, total_amount, notes) VALUES
|
||||
INSERT INTO analysis_requests (
|
||||
AnalysisRequestCode,
|
||||
CustomerID,
|
||||
AnalysisRequestDate,
|
||||
AnalysisRequestStatus,
|
||||
AnalysisRequestTotalAmount,
|
||||
AnalysisRequestNotes
|
||||
) VALUES
|
||||
('REQ001', 1, '2024-03-15 09:00:00', 'completed', 2500000, 'Analisis air limbah'),
|
||||
('REQ002', 1, '2024-03-16 10:30:00', 'process', 1750000, 'Analisis kualitas udara'),
|
||||
('REQ003', 2, '2024-03-17 13:15:00', 'new', 3000000, 'Analisis tanah');
|
||||
|
||||
-- Contoh data pembayaran
|
||||
INSERT INTO payments (request_id, payment_code, payment_date, amount, payment_method, payment_status, notes) VALUES
|
||||
INSERT INTO payments (
|
||||
AnalysisRequestID,
|
||||
PaymentCode,
|
||||
PaymentDate,
|
||||
PaymentAmount,
|
||||
PaymentMethod,
|
||||
PaymentStatus,
|
||||
PaymentNotes
|
||||
) VALUES
|
||||
(1, 'PAY001', '2024-03-15 14:30:00', 2500000, 'transfer', 'completed', 'Pembayaran lunas'),
|
||||
(2, 'PAY002', '2024-03-16 11:00:00', 875000, 'transfer', 'completed', 'Pembayaran DP 50%'),
|
||||
(3, 'PAY003', '2024-03-17 14:00:00', 1500000, 'transfer', 'pending', 'Menunggu konfirmasi transfer');
|
||||
|
||||
-- Contoh data kategori pelanggan
|
||||
INSERT INTO customer_categories (
|
||||
CustomerCategoryCode,
|
||||
CustomerCategoryName,
|
||||
CustomerCategoryDescription
|
||||
) VALUES
|
||||
('CAT001', 'Industri', 'Pelanggan dari sektor industri manufaktur'),
|
||||
('CAT002', 'Pemerintahan', 'Instansi pemerintah dan BUMN'),
|
||||
('CAT003', 'Komersial', 'Pelanggan komersial non-industri');
|
||||
|
||||
-- Contoh data kontak tambahan
|
||||
INSERT INTO customer_contacts (
|
||||
CustomerID,
|
||||
CustomerContactName,
|
||||
CustomerContactPosition,
|
||||
CustomerContactDepartment,
|
||||
CustomerContactPhone,
|
||||
CustomerContactEmail,
|
||||
CustomerContactIsMainContact
|
||||
) VALUES
|
||||
(1, 'Andi Wijaya', 'HSE Manager', 'HSE', '081234567891', 'andi@lingkunganhijau.com', TRUE),
|
||||
(1, 'Diana Putri', 'Lab Coordinator', 'Quality Control', '081234567892', 'diana@lingkunganhijau.com', FALSE),
|
||||
(2, 'Bambang Kusuma', 'Kepala Seksi', 'Pengawasan', '087812345679', 'bambang@bandung.go.id', TRUE);
|
||||
|
||||
-- Contoh data dokumen
|
||||
INSERT INTO customer_documents (
|
||||
CustomerID,
|
||||
CustomerDocumentType,
|
||||
CustomerDocumentNumber,
|
||||
CustomerDocumentName,
|
||||
CustomerDocumentPath,
|
||||
CustomerDocumentIssuedDate,
|
||||
CustomerDocumentExpiredDate
|
||||
) VALUES
|
||||
(1, 'SIUP', '123/SIUP/2024', 'SIUP PT Lingkungan Hijau', '/documents/siup/123.pdf', '2024-01-01', '2029-01-01'),
|
||||
(1, 'NPWP', '01.234.567.8-123.000', 'NPWP PT Lingkungan Hijau', '/documents/npwp/123.pdf', '2024-01-01', NULL),
|
||||
(2, 'SK', 'SK-123/DLH/2024', 'SK Penunjukan', '/documents/sk/123.pdf', '2024-01-01', '2024-12-31');
|
||||
|
||||
-- Contoh data aktivitas
|
||||
INSERT INTO customer_activities (
|
||||
CustomerID,
|
||||
CustomerActivityType,
|
||||
CustomerActivityDescription,
|
||||
CustomerActivityDate,
|
||||
CustomerActivityStatus
|
||||
) VALUES
|
||||
(1, 'Visit', 'Kunjungan teknis untuk sampling rutin', '2024-03-15 10:00:00', 'Completed'),
|
||||
(1, 'Meeting', 'Pembahasan hasil analisis', '2024-03-16 13:00:00', 'Scheduled'),
|
||||
(2, 'Training', 'Pelatihan pengambilan sampel', '2024-03-17 09:00:00', 'Scheduled');
|
||||
|
||||
-- Contoh data komunikasi
|
||||
INSERT INTO customer_communications (
|
||||
CustomerID,
|
||||
CustomerContactID,
|
||||
CustomerCommunicationType,
|
||||
CustomerCommunicationSubject,
|
||||
CustomerCommunicationContent,
|
||||
CustomerCommunicationDate,
|
||||
CustomerCommunicationStatus
|
||||
) VALUES
|
||||
(1, 1, 'Email', 'Konfirmasi Jadwal Sampling', 'Konfirmasi jadwal sampling minggu depan', '2024-03-14 09:00:00', 'Sent'),
|
||||
(1, 2, 'Phone', 'Diskusi Hasil Analisis', 'Diskusi tentang hasil analisis yang melebihi baku mutu', '2024-03-15 14:00:00', 'Completed'),
|
||||
(2, 3, 'Meeting', 'Rapat Koordinasi', 'Rapat koordinasi program pemantauan lingkungan', '2024-03-16 10:00:00', 'Scheduled');
|
||||
@@ -206,6 +206,100 @@
|
||||
border: 1px solid #2196F3;
|
||||
color: #0d47a1;
|
||||
}
|
||||
|
||||
.parameter-category {
|
||||
margin-bottom: 20px;
|
||||
padding: 15px;
|
||||
background: #f8f9fa;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.parameter-item {
|
||||
display: grid;
|
||||
grid-template-columns: auto 1fr auto auto;
|
||||
gap: 15px;
|
||||
align-items: center;
|
||||
padding: 12px;
|
||||
border-bottom: 1px solid #eee;
|
||||
transition: background-color 0.2s;
|
||||
}
|
||||
|
||||
.parameter-item:hover {
|
||||
background-color: #f8f9fa;
|
||||
}
|
||||
|
||||
.parameter-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.parameter-name {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.parameter-method {
|
||||
font-size: 12px;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.parameter-price {
|
||||
font-weight: bold;
|
||||
color: #2196F3;
|
||||
}
|
||||
|
||||
.selected-material {
|
||||
margin-bottom: 15px;
|
||||
padding: 10px;
|
||||
background: #e3f2fd;
|
||||
border-radius: 4px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.category-selection {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
|
||||
gap: 15px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.category-card {
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 4px;
|
||||
padding: 15px;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.category-card:hover {
|
||||
border-color: #2196F3;
|
||||
background: #f8f9fa;
|
||||
}
|
||||
|
||||
.category-card.selected {
|
||||
border-color: #2196F3;
|
||||
background: #e3f2fd;
|
||||
}
|
||||
|
||||
.selected-bidang,
|
||||
.selected-category {
|
||||
margin-bottom: 15px;
|
||||
padding: 10px;
|
||||
background: #e3f2fd;
|
||||
border-radius: 4px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.parameter-group {
|
||||
margin-bottom: 20px;
|
||||
padding: 15px;
|
||||
background: #f8f9fa;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.parameter-group h4 {
|
||||
margin-bottom: 10px;
|
||||
color: #2196F3;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
@@ -217,11 +311,11 @@
|
||||
</div>
|
||||
<div class="step">
|
||||
<div class="step-number">2</div>
|
||||
<div class="step-title">Pilih Template</div>
|
||||
<div class="step-title">Pilih Bidang Pengujian</div>
|
||||
</div>
|
||||
<div class="step">
|
||||
<div class="step-number">3</div>
|
||||
<div class="step-title">Parameter</div>
|
||||
<div class="step-title">Pilih Kategori</div>
|
||||
</div>
|
||||
<div class="step">
|
||||
<div class="step-number">4</div>
|
||||
@@ -258,50 +352,56 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Step 2: Pilih Template -->
|
||||
<!-- Step 2: Pilih Bidang Pengujian -->
|
||||
<div class="form-section" id="step2">
|
||||
<h3>Pilih Template Analisis</h3>
|
||||
<h3>Pilih Bidang Pengujian</h3>
|
||||
<div class="template-selection">
|
||||
<div class="template-card" data-template-id="1">
|
||||
<h4>Air Limbah Industri</h4>
|
||||
<p>Template standar untuk analisis air limbah industri</p>
|
||||
<small>15 Parameter</small>
|
||||
<div class="template-card" data-type="fisika">
|
||||
<h4>FISIKA</h4>
|
||||
<p>Pengujian parameter fisika</p>
|
||||
<small>Udara Lingkungan Kerja</small>
|
||||
</div>
|
||||
<div class="template-card" data-template-id="2">
|
||||
<h4>Air Minum</h4>
|
||||
<p>Template untuk analisis kualitas air minum</p>
|
||||
<small>12 Parameter</small>
|
||||
<div class="template-card" data-type="kimia">
|
||||
<h4>KIMIA</h4>
|
||||
<p>Pengujian parameter kimia</p>
|
||||
<small>Air Minum & Limbah Domestik</small>
|
||||
</div>
|
||||
<div class="template-card" data-template-id="3">
|
||||
<h4>Udara Ambien</h4>
|
||||
<p>Template untuk analisis kualitas udara</p>
|
||||
<small>8 Parameter</small>
|
||||
<div class="template-card" data-type="biologi">
|
||||
<h4>BIOLOGI</h4>
|
||||
<p>Pengujian parameter biologi</p>
|
||||
<small>Air Minum, Limbah & IPAL</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Step 3: Parameter -->
|
||||
<!-- Step 3: Pilih Kategori -->
|
||||
<div class="form-section" id="step3">
|
||||
<h3>Pilih Parameter Analisis</h3>
|
||||
<div class="parameter-list">
|
||||
<!-- Parameters will be loaded dynamically based on selected template -->
|
||||
<h3>Pilih Kategori Pengujian</h3>
|
||||
<div class="selected-bidang"></div>
|
||||
<div class="category-selection">
|
||||
<!-- Categories will be loaded dynamically -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Step 4: Konfirmasi -->
|
||||
<!-- Step 4: Parameter -->
|
||||
<div class="form-section" id="step4">
|
||||
<h3>Konfirmasi Permintaan</h3>
|
||||
<div class="price-summary">
|
||||
<h4>Ringkasan Biaya</h4>
|
||||
<p>Jumlah Parameter: <span id="parameterCount">0</span></p>
|
||||
<p>Subtotal: <span id="subtotal">Rp 0</span></p>
|
||||
<p>PPN (11%): <span id="tax">Rp 0</span></p>
|
||||
<p><strong>Total: <span id="total">Rp 0</span></strong></p>
|
||||
<h3>Pilih Parameter Analisis</h3>
|
||||
<div class="selected-category"></div>
|
||||
<div class="parameter-list">
|
||||
<!-- Parameters will be loaded dynamically -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="alert alert-info">
|
||||
<p>Setelah permintaan disubmit, tim kami akan memproses dan mengirimkan quotation dalam 1x24 jam kerja.</p>
|
||||
</div>
|
||||
<div class="price-summary">
|
||||
<h4>Ringkasan Biaya</h4>
|
||||
<p>Jumlah Parameter: <span id="parameterCount">0</span></p>
|
||||
<p>Subtotal: <span id="subtotal">Rp 0</span></p>
|
||||
<p>PPN (11%): <span id="tax">Rp 0</span></p>
|
||||
<p><strong>Total: <span id="total">Rp 0</span></strong></p>
|
||||
</div>
|
||||
|
||||
<div class="alert alert-info">
|
||||
<p>Setelah permintaan disubmit, tim kami akan memproses dan mengirimkan quotation dalam 1x24 jam kerja.</p>
|
||||
</div>
|
||||
|
||||
<div class="navigation-buttons">
|
||||
@@ -360,17 +460,194 @@
|
||||
}
|
||||
});
|
||||
|
||||
// Template selection
|
||||
let selectedBidang = null;
|
||||
let selectedCategory = null;
|
||||
let selectedParameters = new Set();
|
||||
|
||||
// Handle bidang selection
|
||||
document.querySelectorAll('.template-card').forEach(card => {
|
||||
card.addEventListener('click', () => {
|
||||
document.querySelectorAll('.template-card').forEach(c => c.classList.remove('selected'));
|
||||
card.classList.add('selected');
|
||||
// Here you would typically load the parameters for the selected template
|
||||
selectedBidang = card.dataset.type;
|
||||
loadCategories(selectedBidang);
|
||||
});
|
||||
});
|
||||
|
||||
function loadCategories(bidangType) {
|
||||
const bidang = testingParameters[bidangType];
|
||||
if (!bidang) return;
|
||||
|
||||
// Show selected bidang
|
||||
const selectedBidangDiv = document.querySelector('.selected-bidang');
|
||||
selectedBidangDiv.textContent = `Bidang Pengujian: ${bidang.name}`;
|
||||
|
||||
// Load categories
|
||||
const categorySelection = document.querySelector('.category-selection');
|
||||
categorySelection.innerHTML = bidang.categories.map(category => `
|
||||
<div class="category-card" data-category="${category.name}">
|
||||
<h4>${category.name}</h4>
|
||||
<p>${category.parameters.length} Parameter Tersedia</p>
|
||||
</div>
|
||||
`).join('');
|
||||
|
||||
// Add event listeners to category cards
|
||||
categorySelection.querySelectorAll('.category-card').forEach(card => {
|
||||
card.addEventListener('click', () => {
|
||||
document.querySelectorAll('.category-card').forEach(c => c.classList.remove('selected'));
|
||||
card.classList.add('selected');
|
||||
selectedCategory = card.dataset.category;
|
||||
loadParameters(selectedBidang, selectedCategory);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function loadParameters(bidangType, categoryName) {
|
||||
const bidang = testingParameters[bidangType];
|
||||
const category = bidang.categories.find(c => c.name === categoryName);
|
||||
if (!category) return;
|
||||
|
||||
// Show selected category
|
||||
const selectedCategoryDiv = document.querySelector('.selected-category');
|
||||
selectedCategoryDiv.textContent = `Kategori: ${category.name}`;
|
||||
|
||||
// Load parameters
|
||||
const parameterList = document.querySelector('.parameter-list');
|
||||
parameterList.innerHTML = category.parameters.map(param => `
|
||||
<div class="parameter-item">
|
||||
<input type="checkbox" id="${param.id}" name="parameters[]" value="${param.id}"
|
||||
${selectedParameters.has(param.id) ? 'checked' : ''}>
|
||||
<div class="parameter-info">
|
||||
<span class="parameter-name">${param.name}</span>
|
||||
<span class="parameter-method">${param.method}</span>
|
||||
</div>
|
||||
<span class="parameter-price">Rp ${param.price.toLocaleString()}</span>
|
||||
</div>
|
||||
`).join('');
|
||||
|
||||
// Add event listeners to checkboxes
|
||||
parameterList.querySelectorAll('input[type="checkbox"]').forEach(checkbox => {
|
||||
checkbox.addEventListener('change', () => {
|
||||
if (checkbox.checked) {
|
||||
selectedParameters.add(checkbox.value);
|
||||
} else {
|
||||
selectedParameters.delete(checkbox.value);
|
||||
}
|
||||
updatePriceSummary();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function updatePriceSummary() {
|
||||
let subtotal = 0;
|
||||
selectedParameters.forEach(paramId => {
|
||||
const bidang = testingParameters[selectedBidang];
|
||||
const category = bidang.categories.find(c => c.name === selectedCategory);
|
||||
const parameter = category.parameters.find(p => p.id === paramId);
|
||||
if (parameter) {
|
||||
subtotal += parameter.price;
|
||||
}
|
||||
});
|
||||
|
||||
const tax = subtotal * 0.11;
|
||||
const total = subtotal + tax;
|
||||
|
||||
document.getElementById('parameterCount').textContent = selectedParameters.size;
|
||||
document.getElementById('subtotal').textContent = `Rp ${subtotal.toLocaleString()}`;
|
||||
document.getElementById('tax').textContent = `Rp ${tax.toLocaleString()}`;
|
||||
document.getElementById('total').textContent = `Rp ${total.toLocaleString()}`;
|
||||
}
|
||||
|
||||
// Initialize form
|
||||
showStep(1);
|
||||
|
||||
const testingParameters = {
|
||||
// FISIKA
|
||||
fisika: {
|
||||
name: "FISIKA",
|
||||
categories: [
|
||||
{
|
||||
name: "Udara Lingkungan Kerja",
|
||||
parameters: [
|
||||
{ id: 'debu_total', name: 'Debu Total', method: 'SNI 16-7058-2004', price: 150000 },
|
||||
{ id: 'intensitas_pencahayaan', name: 'Intensitas Pencahayaan', method: 'SNI 7062:2019', price: 100000 },
|
||||
{ id: 'tekanan', name: 'Tekanan', method: 'Direct Reading', price: 100000 },
|
||||
{ id: 'iklim_kerja_suhu', name: 'Iklim Kerja (suhu)', method: 'Direct Reading', price: 100000 },
|
||||
{ id: 'iklim_kerja_kelembaban', name: 'Iklim Kerja (kelembaban)', method: 'Direct Reading', price: 100000 },
|
||||
{ id: 'intensitas_kebisingan', name: 'Intensitas Kebisingan', method: 'SNI 7231:2019', price: 150000 },
|
||||
{ id: 'kebisingan_personal', name: 'Kebisingan Personal', method: 'SNI/APHA', price: 150000 }
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
// KIMIA
|
||||
kimia: {
|
||||
name: "KIMIA",
|
||||
categories: [
|
||||
{
|
||||
name: "Air Minum, Hygiene, Sanitasi",
|
||||
parameters: [
|
||||
{ id: 'suhu', name: 'Suhu', method: 'SNI/APHA', price: 50000 },
|
||||
{ id: 'tds', name: 'TDS', method: 'SNI/APHA', price: 75000 },
|
||||
{ id: 'kekeruhan', name: 'Kekeruhan', method: 'SNI/APHA', price: 75000 },
|
||||
{ id: 'warna', name: 'Warna', method: 'SNI/APHA', price: 75000 },
|
||||
{ id: 'bau', name: 'Bau', method: 'SNI/APHA', price: 50000 },
|
||||
{ id: 'ph', name: 'pH', method: 'SNI/APHA', price: 75000 },
|
||||
{ id: 'nitrat', name: 'Nitrat (NO3 terlarut)', method: 'SNI/APHA', price: 150000 },
|
||||
{ id: 'nitrit', name: 'Nitrit (NO2 terlarut)', method: 'SNI/APHA', price: 150000 },
|
||||
{ id: 'kromium', name: 'Kromium Valensi 6 (CR6+ terlarut)', method: 'SNI/APHA', price: 200000 },
|
||||
{ id: 'besi', name: 'Besi (Fe Terlarut)', method: 'SNI/APHA', price: 150000 },
|
||||
{ id: 'mangan', name: 'Mangan (Mn Terlarut)', method: 'SNI/APHA', price: 150000 },
|
||||
{ id: 'sisa_klor', name: 'Sisa Klor (terlarut)', method: 'SNI/APHA', price: 150000 },
|
||||
{ id: 'arsen', name: 'Arsen (AS terlarut)', method: 'SNI/APHA', price: 200000 },
|
||||
{ id: 'kadmium', name: 'Kadmium (Cd) terlarut', method: 'SNI/APHA', price: 200000 },
|
||||
{ id: 'timbal', name: 'Timbal (Pb terlarut)', method: 'SNI/APHA', price: 200000 },
|
||||
{ id: 'fluoride', name: 'Fluoride (F) Terlarut', method: 'SNI/APHA', price: 200000 },
|
||||
{ id: 'aluminium', name: 'Aluminium (Al) Terlarut', method: 'SNI/APHA', price: 200000 }
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Limbah Domestik",
|
||||
parameters: [
|
||||
{ id: 'ph_limbah', name: 'pH', method: 'SNI-6989.11-2019', price: 75000 },
|
||||
{ id: 'bod', name: 'BOD', method: 'APHA 5210 B-2017', price: 200000 },
|
||||
{ id: 'cod', name: 'COD', method: 'APHA 522 0.C-2017', price: 200000 },
|
||||
{ id: 'tss', name: 'TSS', method: 'SNI 06-6989.3-2004', price: 150000 },
|
||||
{ id: 'minyak_lemak', name: 'Minyak & Lemak', method: 'SNI-6989.10-2011', price: 200000 },
|
||||
{ id: 'amoniak', name: 'Amoniak', method: 'SNI 06-6989.30-2005', price: 150000 },
|
||||
{ id: 'debit', name: 'Debit', method: 'SNI', price: 100000 }
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
// BIOLOGI
|
||||
biologi: {
|
||||
name: "BIOLOGI",
|
||||
categories: [
|
||||
{
|
||||
name: "Air Minum, Hygiene, Sanitasi",
|
||||
parameters: [
|
||||
{ id: 'ecoli', name: 'E. Coli', method: 'SNI/APHA', price: 200000 },
|
||||
{ id: 'total_coliform', name: 'Total Coliform', method: 'SNI/APHA', price: 200000 }
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "Limbah Domestik",
|
||||
parameters: [
|
||||
{ id: 'total_coliform_limbah', name: 'Total Coliform', method: 'SNI', price: 200000 }
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "IPAL OUTLET",
|
||||
parameters: [
|
||||
{ id: 'total_coliform_ipal', name: 'Total Coliform', method: 'APHA 23 TAHUN 2017', price: 200000 }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,150 +1,184 @@
|
||||
-- Tabel Template Sampling
|
||||
CREATE TABLE sampling_templates (
|
||||
id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
template_name VARCHAR(100),
|
||||
description TEXT,
|
||||
is_active BOOLEAN DEFAULT true,
|
||||
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
|
||||
SamplingTemplateID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
SamplingTemplateName VARCHAR(100),
|
||||
SamplingTemplateDescription TEXT,
|
||||
SamplingTemplateIsActive BOOLEAN DEFAULT TRUE,
|
||||
SamplingTemplateCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
SamplingTemplateCreatedUserID INT,
|
||||
SamplingTemplateUpdatedAt DATETIME,
|
||||
SamplingTemplateUpdatedUserID INT,
|
||||
SamplingTemplateDeletedAt DATETIME,
|
||||
SamplingTemplateDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Tabel Template Analisis
|
||||
CREATE TABLE analysis_templates (
|
||||
id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
template_name VARCHAR(100),
|
||||
description TEXT,
|
||||
is_lab_analysis BOOLEAN DEFAULT true,
|
||||
is_active BOOLEAN DEFAULT true,
|
||||
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
|
||||
AnalysisTemplateID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
AnalysisTemplateName VARCHAR(100),
|
||||
AnalysisTemplateDescription TEXT,
|
||||
AnalysisTemplateIsLabAnalysis BOOLEAN DEFAULT TRUE,
|
||||
AnalysisTemplateIsActive BOOLEAN DEFAULT TRUE,
|
||||
AnalysisTemplateCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
AnalysisTemplateCreatedUserID INT,
|
||||
AnalysisTemplateUpdatedAt DATETIME,
|
||||
AnalysisTemplateUpdatedUserID INT,
|
||||
AnalysisTemplateDeletedAt DATETIME,
|
||||
AnalysisTemplateDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Tabel Parameter Analisis
|
||||
CREATE TABLE analysis_parameters (
|
||||
id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
parameter_code VARCHAR(20),
|
||||
parameter_name VARCHAR(100),
|
||||
testing_method VARCHAR(100),
|
||||
unit VARCHAR(20),
|
||||
standard_method_number VARCHAR(50),
|
||||
price DECIMAL(10,2),
|
||||
is_active BOOLEAN DEFAULT true,
|
||||
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
|
||||
AnalysisParameterID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
AnalysisParameterCode VARCHAR(20),
|
||||
AnalysisParameterName VARCHAR(100),
|
||||
AnalysisParameterTestingMethod VARCHAR(100),
|
||||
AnalysisParameterUnit VARCHAR(20),
|
||||
AnalysisParameterStandardMethodNumber VARCHAR(50),
|
||||
AnalysisParameterPrice DECIMAL(10,2),
|
||||
AnalysisParameterIsActive BOOLEAN DEFAULT TRUE,
|
||||
AnalysisParameterCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
AnalysisParameterCreatedUserID INT,
|
||||
AnalysisParameterUpdatedAt DATETIME,
|
||||
AnalysisParameterUpdatedUserID INT,
|
||||
AnalysisParameterDeletedAt DATETIME,
|
||||
AnalysisParameterDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Tabel Template Parameter
|
||||
CREATE TABLE template_parameters (
|
||||
id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
template_id INT,
|
||||
parameter_id INT,
|
||||
is_required BOOLEAN DEFAULT false,
|
||||
FOREIGN KEY (template_id) REFERENCES analysis_templates(id),
|
||||
FOREIGN KEY (parameter_id) REFERENCES analysis_parameters(id)
|
||||
TemplateParameterID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
AnalysisTemplateID INT,
|
||||
AnalysisParameterID INT,
|
||||
TemplateParameterIsRequired BOOLEAN DEFAULT FALSE,
|
||||
TemplateParameterCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
TemplateParameterCreatedUserID INT,
|
||||
TemplateParameterUpdatedAt DATETIME,
|
||||
TemplateParameterUpdatedUserID INT,
|
||||
TemplateParameterDeletedAt DATETIME,
|
||||
TemplateParameterDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Tabel Permintaan Layanan
|
||||
CREATE TABLE service_requests (
|
||||
id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
request_code VARCHAR(20) UNIQUE,
|
||||
customer_id INT,
|
||||
request_type ENUM('sampling_analysis', 'analysis_only'),
|
||||
template_id INT,
|
||||
sampling_date DATE,
|
||||
sampling_location TEXT,
|
||||
gps_coordinates VARCHAR(50),
|
||||
status ENUM('draft', 'submitted', 'approved', 'rejected', 'in_progress', 'completed'),
|
||||
sampling_officer_id INT,
|
||||
testing_officer_id INT,
|
||||
total_amount DECIMAL(10,2),
|
||||
dp_amount DECIMAL(10,2),
|
||||
dp_status ENUM('unpaid', 'paid') DEFAULT 'unpaid',
|
||||
notes TEXT,
|
||||
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at DATETIME ON UPDATE CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (customer_id) REFERENCES customers(id),
|
||||
FOREIGN KEY (template_id) REFERENCES analysis_templates(id),
|
||||
FOREIGN KEY (sampling_officer_id) REFERENCES users(id),
|
||||
FOREIGN KEY (testing_officer_id) REFERENCES users(id)
|
||||
ServiceRequestID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
ServiceRequestCode VARCHAR(20) UNIQUE,
|
||||
CustomerID INT,
|
||||
ServiceRequestType ENUM('sampling_analysis', 'analysis_only'),
|
||||
AnalysisTemplateID INT,
|
||||
ServiceRequestSamplingDate DATE,
|
||||
ServiceRequestSamplingLocation TEXT,
|
||||
ServiceRequestGPSCoordinates VARCHAR(50),
|
||||
ServiceRequestStatus ENUM('draft', 'submitted', 'approved', 'rejected', 'in_progress', 'completed'),
|
||||
ServiceRequestSamplingOfficerID INT,
|
||||
ServiceRequestTestingOfficerID INT,
|
||||
ServiceRequestTotalAmount DECIMAL(10,2),
|
||||
ServiceRequestDPAmount DECIMAL(10,2),
|
||||
ServiceRequestDPStatus ENUM('unpaid', 'paid') DEFAULT 'unpaid',
|
||||
ServiceRequestNotes TEXT,
|
||||
ServiceRequestCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
ServiceRequestCreatedUserID INT,
|
||||
ServiceRequestUpdatedAt DATETIME,
|
||||
ServiceRequestUpdatedUserID INT,
|
||||
ServiceRequestDeletedAt DATETIME,
|
||||
ServiceRequestDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Tabel Detail Parameter Permintaan
|
||||
CREATE TABLE request_parameters (
|
||||
id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
request_id INT,
|
||||
parameter_id INT,
|
||||
price DECIMAL(10,2),
|
||||
status ENUM('pending', 'in_progress', 'completed', 'rejected'),
|
||||
result_value VARCHAR(50),
|
||||
result_unit VARCHAR(20),
|
||||
is_compliant BOOLEAN,
|
||||
notes TEXT,
|
||||
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (request_id) REFERENCES service_requests(id),
|
||||
FOREIGN KEY (parameter_id) REFERENCES analysis_parameters(id)
|
||||
RequestParameterID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
ServiceRequestID INT,
|
||||
AnalysisParameterID INT,
|
||||
RequestParameterPrice DECIMAL(10,2),
|
||||
RequestParameterStatus ENUM('pending', 'in_progress', 'completed', 'rejected'),
|
||||
RequestParameterResultValue VARCHAR(50),
|
||||
RequestParameterResultUnit VARCHAR(20),
|
||||
RequestParameterIsCompliant BOOLEAN,
|
||||
RequestParameterNotes TEXT,
|
||||
RequestParameterCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
RequestParameterCreatedUserID INT,
|
||||
RequestParameterUpdatedAt DATETIME,
|
||||
RequestParameterUpdatedUserID INT,
|
||||
RequestParameterDeletedAt DATETIME,
|
||||
RequestParameterDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Tabel Quotation
|
||||
CREATE TABLE quotations (
|
||||
id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
quotation_code VARCHAR(20) UNIQUE,
|
||||
request_id INT,
|
||||
issue_date DATE,
|
||||
valid_until DATE,
|
||||
status ENUM('draft', 'sent', 'approved', 'rejected'),
|
||||
subtotal DECIMAL(10,2),
|
||||
tax_percentage DECIMAL(5,2),
|
||||
tax_amount DECIMAL(10,2),
|
||||
total_amount DECIMAL(10,2),
|
||||
terms_and_conditions TEXT,
|
||||
notes TEXT,
|
||||
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at DATETIME ON UPDATE CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (request_id) REFERENCES service_requests(id)
|
||||
QuotationID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
QuotationCode VARCHAR(20) UNIQUE,
|
||||
ServiceRequestID INT,
|
||||
QuotationIssueDate DATE,
|
||||
QuotationValidUntil DATE,
|
||||
QuotationStatus ENUM('draft', 'sent', 'approved', 'rejected'),
|
||||
QuotationSubtotal DECIMAL(10,2),
|
||||
QuotationTaxPercentage DECIMAL(5,2),
|
||||
QuotationTaxAmount DECIMAL(10,2),
|
||||
QuotationTotalAmount DECIMAL(10,2),
|
||||
QuotationTermsAndConditions TEXT,
|
||||
QuotationNotes TEXT,
|
||||
QuotationCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
QuotationCreatedUserID INT,
|
||||
QuotationUpdatedAt DATETIME,
|
||||
QuotationUpdatedUserID INT,
|
||||
QuotationDeletedAt DATETIME,
|
||||
QuotationDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Tabel Peralatan Sampling
|
||||
CREATE TABLE sampling_equipment (
|
||||
id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
equipment_name VARCHAR(100),
|
||||
equipment_code VARCHAR(50),
|
||||
is_available BOOLEAN DEFAULT true,
|
||||
last_calibration_date DATE,
|
||||
next_calibration_date DATE,
|
||||
notes TEXT,
|
||||
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
|
||||
SamplingEquipmentID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
SamplingEquipmentName VARCHAR(100),
|
||||
SamplingEquipmentCode VARCHAR(50),
|
||||
SamplingEquipmentIsAvailable BOOLEAN DEFAULT TRUE,
|
||||
SamplingEquipmentLastCalibrationDate DATE,
|
||||
SamplingEquipmentNextCalibrationDate DATE,
|
||||
SamplingEquipmentNotes TEXT,
|
||||
SamplingEquipmentCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
SamplingEquipmentCreatedUserID INT,
|
||||
SamplingEquipmentUpdatedAt DATETIME,
|
||||
SamplingEquipmentUpdatedUserID INT,
|
||||
SamplingEquipmentDeletedAt DATETIME,
|
||||
SamplingEquipmentDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Tabel Peralatan yang Digunakan dalam Sampling
|
||||
CREATE TABLE request_equipment (
|
||||
id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
request_id INT,
|
||||
equipment_id INT,
|
||||
usage_date DATE,
|
||||
return_date DATE,
|
||||
notes TEXT,
|
||||
FOREIGN KEY (request_id) REFERENCES service_requests(id),
|
||||
FOREIGN KEY (equipment_id) REFERENCES sampling_equipment(id)
|
||||
RequestEquipmentID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
ServiceRequestID INT,
|
||||
SamplingEquipmentID INT,
|
||||
RequestEquipmentUsageDate DATE,
|
||||
RequestEquipmentReturnDate DATE,
|
||||
RequestEquipmentNotes TEXT,
|
||||
RequestEquipmentCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
RequestEquipmentCreatedUserID INT,
|
||||
RequestEquipmentUpdatedAt DATETIME,
|
||||
RequestEquipmentUpdatedUserID INT,
|
||||
RequestEquipmentDeletedAt DATETIME,
|
||||
RequestEquipmentDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Contoh data template sampling
|
||||
INSERT INTO sampling_templates (template_name, description) VALUES
|
||||
INSERT INTO sampling_templates (SamplingTemplateName, SamplingTemplateDescription) VALUES
|
||||
('Air Limbah Industri', 'Template untuk sampling air limbah industri'),
|
||||
('Kualitas Udara Ambien', 'Template untuk sampling kualitas udara'),
|
||||
('Air Permukaan', 'Template untuk sampling air sungai/danau');
|
||||
|
||||
-- Contoh data parameter analisis
|
||||
INSERT INTO analysis_parameters (parameter_code, parameter_name, unit, price, method) VALUES
|
||||
INSERT INTO analysis_parameters (AnalysisParameterCode, AnalysisParameterName, AnalysisParameterUnit, AnalysisParameterPrice, AnalysisParameterTestingMethod) VALUES
|
||||
('BOD5', 'Biochemical Oxygen Demand', 'mg/L', 250000, 'SNI 6989.72:2009'),
|
||||
('COD', 'Chemical Oxygen Demand', 'mg/L', 200000, 'SNI 6989.2:2009'),
|
||||
('TSS', 'Total Suspended Solid', 'mg/L', 150000, 'SNI 06-6989.3-2004'),
|
||||
('PH', 'Derajat Keasaman', '-', 100000, 'SNI 06-6989.11-2004');
|
||||
|
||||
-- Contoh data permintaan layanan
|
||||
INSERT INTO service_requests (request_code, customer_id, request_type, sampling_date, sampling_location, status, total_amount) VALUES
|
||||
INSERT INTO service_requests (ServiceRequestCode, CustomerID, ServiceRequestType, ServiceRequestSamplingDate, ServiceRequestSamplingLocation, ServiceRequestStatus, ServiceRequestTotalAmount) VALUES
|
||||
('REQ001', 1, 'sampling_analysis', '2024-03-20', 'Plant A - Outlet IPAL', 'approved', 700000),
|
||||
('REQ002', 2, 'analysis_only', '2024-03-21', 'Lab Internal', 'submitted', 450000),
|
||||
('REQ003', 3, 'sampling_analysis', '2024-03-22', 'Intake Water Treatment', 'draft', 550000);
|
||||
|
||||
-- Contoh data parameter yang diminta
|
||||
INSERT INTO request_parameters (request_id, parameter_id, price) VALUES
|
||||
INSERT INTO request_parameters (ServiceRequestID, AnalysisParameterID, RequestParameterPrice) VALUES
|
||||
(1, 1, 250000),
|
||||
(1, 2, 200000),
|
||||
(1, 3, 150000),
|
||||
@@ -155,7 +189,7 @@ INSERT INTO request_parameters (request_id, parameter_id, price) VALUES
|
||||
(3, 4, 100000);
|
||||
|
||||
-- Contoh data quotation
|
||||
INSERT INTO quotations (quotation_code, request_id, issue_date, valid_until, status, total_amount) VALUES
|
||||
INSERT INTO quotations (QuotationCode, ServiceRequestID, QuotationIssueDate, QuotationValidUntil, QuotationStatus, QuotationTotalAmount) VALUES
|
||||
('QUO001', 1, '2024-03-15', '2024-04-15', 'approved', 700000),
|
||||
('QUO002', 2, '2024-03-16', '2024-04-16', 'sent', 450000),
|
||||
('QUO003', 3, '2024-03-17', '2024-04-17', 'draft', 550000);
|
||||
|
||||
@@ -6,79 +6,97 @@
|
||||
-- ------------------------------------------------------------------------------
|
||||
|
||||
-- Master Regulasi
|
||||
CREATE TABLE IF NOT EXISTS master_regulasi (
|
||||
id_regulasi INT PRIMARY KEY,
|
||||
kode_regulasi VARCHAR(50) NOT NULL,
|
||||
nama_regulasi VARCHAR(255) NOT NULL,
|
||||
instansi_penerbit VARCHAR(100) NOT NULL,
|
||||
tanggal_terbit DATE NOT NULL,
|
||||
tanggal_berlaku DATE NOT NULL,
|
||||
deskripsi TEXT,
|
||||
file_path VARCHAR(255),
|
||||
status BOOLEAN DEFAULT TRUE,
|
||||
tanggal_input TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
user_input VARCHAR(50)
|
||||
CREATE TABLE IF NOT EXISTS master_regulations (
|
||||
MasterRegulationID INT PRIMARY KEY,
|
||||
MasterRegulationCode VARCHAR(50) NOT NULL,
|
||||
MasterRegulationName VARCHAR(255) NOT NULL,
|
||||
MasterRegulationIssuer VARCHAR(100) NOT NULL,
|
||||
MasterRegulationIssueDate DATE NOT NULL,
|
||||
MasterRegulationEffectiveDate DATE NOT NULL,
|
||||
MasterRegulationDescription TEXT,
|
||||
MasterRegulationFilePath VARCHAR(255),
|
||||
MasterRegulationIsActive BOOLEAN DEFAULT TRUE,
|
||||
MasterRegulationCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
MasterRegulationCreatedUserID INT,
|
||||
MasterRegulationUpdatedAt DATETIME,
|
||||
MasterRegulationUpdatedUserID INT,
|
||||
MasterRegulationDeletedAt DATETIME,
|
||||
MasterRegulationDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Master Parameter Iklim Kerja
|
||||
CREATE TABLE IF NOT EXISTS master_parameter_iklim (
|
||||
id_parameter INT PRIMARY KEY,
|
||||
kode_parameter VARCHAR(20) NOT NULL,
|
||||
nama_parameter VARCHAR(100) NOT NULL,
|
||||
satuan VARCHAR(20),
|
||||
metode_analisis VARCHAR(100),
|
||||
biaya DECIMAL(10, 2),
|
||||
akreditasi BOOLEAN DEFAULT FALSE,
|
||||
keterangan TEXT,
|
||||
status BOOLEAN DEFAULT TRUE,
|
||||
tanggal_input TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
user_input VARCHAR(50)
|
||||
CREATE TABLE IF NOT EXISTS master_climate_parameters (
|
||||
MasterClimateParameterID INT PRIMARY KEY,
|
||||
MasterClimateParameterCode VARCHAR(20) NOT NULL,
|
||||
MasterClimateParameterName VARCHAR(100) NOT NULL,
|
||||
MasterClimateParameterUnit VARCHAR(20),
|
||||
MasterClimateParameterMethod VARCHAR(100),
|
||||
MasterClimateParameterPrice DECIMAL(10,2),
|
||||
MasterClimateParameterIsAccredited BOOLEAN DEFAULT FALSE,
|
||||
MasterClimateParameterRemarks TEXT,
|
||||
MasterClimateParameterIsActive BOOLEAN DEFAULT TRUE,
|
||||
MasterClimateParameterCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
MasterClimateParameterCreatedUserID INT,
|
||||
MasterClimateParameterUpdatedAt DATETIME,
|
||||
MasterClimateParameterUpdatedUserID INT,
|
||||
MasterClimateParameterDeletedAt DATETIME,
|
||||
MasterClimateParameterDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Master Baku Mutu Iklim Kerja
|
||||
CREATE TABLE IF NOT EXISTS master_bakumutu_iklim (
|
||||
id_bakumutu INT PRIMARY KEY,
|
||||
id_parameter INT NOT NULL,
|
||||
id_regulasi INT NOT NULL,
|
||||
jenis_ruangan VARCHAR(100) NOT NULL,
|
||||
nilai_min DECIMAL(6, 2),
|
||||
nilai_max DECIMAL(6, 2),
|
||||
keterangan TEXT,
|
||||
status BOOLEAN DEFAULT TRUE,
|
||||
tanggal_input TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
user_input VARCHAR(50),
|
||||
FOREIGN KEY (id_parameter) REFERENCES master_parameter_iklim(id_parameter),
|
||||
FOREIGN KEY (id_regulasi) REFERENCES master_regulasi(id_regulasi)
|
||||
CREATE TABLE IF NOT EXISTS master_climate_standards (
|
||||
MasterClimateStandardID INT PRIMARY KEY,
|
||||
MasterClimateParameterID INT NOT NULL,
|
||||
MasterRegulationID INT NOT NULL,
|
||||
MasterClimateStandardRoomType VARCHAR(100) NOT NULL,
|
||||
MasterClimateStandardMinValue DECIMAL(6,2),
|
||||
MasterClimateStandardMaxValue DECIMAL(6,2),
|
||||
MasterClimateStandardRemarks TEXT,
|
||||
MasterClimateStandardIsActive BOOLEAN DEFAULT TRUE,
|
||||
MasterClimateStandardCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
MasterClimateStandardCreatedUserID INT,
|
||||
MasterClimateStandardUpdatedAt DATETIME,
|
||||
MasterClimateStandardUpdatedUserID INT,
|
||||
MasterClimateStandardDeletedAt DATETIME,
|
||||
MasterClimateStandardDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Master Metode Sampling Iklim Kerja
|
||||
CREATE TABLE IF NOT EXISTS master_metode_sampling_iklim (
|
||||
id_metode INT PRIMARY KEY,
|
||||
kode_metode VARCHAR(50) NOT NULL,
|
||||
nama_metode VARCHAR(255) NOT NULL,
|
||||
deskripsi TEXT,
|
||||
jenis_parameter VARCHAR(100),
|
||||
status BOOLEAN DEFAULT TRUE,
|
||||
tanggal_input TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
user_input VARCHAR(50)
|
||||
CREATE TABLE IF NOT EXISTS master_climate_sampling_methods (
|
||||
MasterClimateSamplingMethodID INT PRIMARY KEY,
|
||||
MasterClimateSamplingMethodCode VARCHAR(50) NOT NULL,
|
||||
MasterClimateSamplingMethodName VARCHAR(255) NOT NULL,
|
||||
MasterClimateSamplingMethodDescription TEXT,
|
||||
MasterClimateSamplingMethodParameterType VARCHAR(100),
|
||||
MasterClimateSamplingMethodIsActive BOOLEAN DEFAULT TRUE,
|
||||
MasterClimateSamplingMethodCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
MasterClimateSamplingMethodCreatedUserID INT,
|
||||
MasterClimateSamplingMethodUpdatedAt DATETIME,
|
||||
MasterClimateSamplingMethodUpdatedUserID INT,
|
||||
MasterClimateSamplingMethodDeletedAt DATETIME,
|
||||
MasterClimateSamplingMethodDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Master Peralatan Pengukuran Iklim Kerja
|
||||
CREATE TABLE IF NOT EXISTS master_peralatan_iklim (
|
||||
id_peralatan INT PRIMARY KEY,
|
||||
kode_peralatan VARCHAR(20) NOT NULL,
|
||||
nama_peralatan VARCHAR(100) NOT NULL,
|
||||
merk VARCHAR(100),
|
||||
model VARCHAR(100),
|
||||
serial_number VARCHAR(100),
|
||||
spesifikasi TEXT,
|
||||
tanggal_kalibrasi DATE,
|
||||
tanggal_kalibrasi_berikutnya DATE,
|
||||
status_kalibrasi VARCHAR(20),
|
||||
file_sertifikat VARCHAR(255),
|
||||
status BOOLEAN DEFAULT TRUE,
|
||||
tanggal_input TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
user_input VARCHAR(50)
|
||||
CREATE TABLE IF NOT EXISTS master_climate_equipment (
|
||||
MasterClimateEquipmentID INT PRIMARY KEY,
|
||||
MasterClimateEquipmentCode VARCHAR(20) NOT NULL,
|
||||
MasterClimateEquipmentName VARCHAR(100) NOT NULL,
|
||||
MasterClimateEquipmentBrand VARCHAR(100),
|
||||
MasterClimateEquipmentModel VARCHAR(100),
|
||||
MasterClimateEquipmentSerialNumber VARCHAR(100),
|
||||
MasterClimateEquipmentSpecification TEXT,
|
||||
MasterClimateEquipmentLastCalibrationDate DATE,
|
||||
MasterClimateEquipmentNextCalibrationDate DATE,
|
||||
MasterClimateEquipmentCalibrationStatus VARCHAR(20),
|
||||
MasterClimateEquipmentCertificatePath VARCHAR(255),
|
||||
MasterClimateEquipmentIsActive BOOLEAN DEFAULT TRUE,
|
||||
MasterClimateEquipmentCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
MasterClimateEquipmentCreatedUserID INT,
|
||||
MasterClimateEquipmentUpdatedAt DATETIME,
|
||||
MasterClimateEquipmentUpdatedUserID INT,
|
||||
MasterClimateEquipmentDeletedAt DATETIME,
|
||||
MasterClimateEquipmentDeletedUserID INT
|
||||
);
|
||||
|
||||
-- ------------------------------------------------------------------------------
|
||||
@@ -86,85 +104,97 @@ CREATE TABLE IF NOT EXISTS master_peralatan_iklim (
|
||||
-- ------------------------------------------------------------------------------
|
||||
|
||||
-- Sampling Plan Pengukuran Iklim Kerja
|
||||
CREATE TABLE IF NOT EXISTS trx_sampling_plan_iklim (
|
||||
id_sampling_plan INT PRIMARY KEY,
|
||||
kode_sampling_plan VARCHAR(50) NOT NULL,
|
||||
nama_project VARCHAR(255) NOT NULL,
|
||||
id_client INT NOT NULL,
|
||||
tanggal_rencana_sampling DATE NOT NULL,
|
||||
lokasi_sampling TEXT NOT NULL,
|
||||
jumlah_titik INT,
|
||||
status_approval VARCHAR(20) DEFAULT 'DRAFT',
|
||||
catatan TEXT,
|
||||
tanggal_input TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
user_input VARCHAR(50)
|
||||
CREATE TABLE IF NOT EXISTS climate_sampling_plans (
|
||||
ClimateSamplingPlanID INT PRIMARY KEY,
|
||||
ClimateSamplingPlanCode VARCHAR(50) NOT NULL,
|
||||
ClimateSamplingPlanProjectName VARCHAR(255) NOT NULL,
|
||||
CustomerID INT NOT NULL,
|
||||
ClimateSamplingPlanDate DATE NOT NULL,
|
||||
ClimateSamplingPlanLocation TEXT NOT NULL,
|
||||
ClimateSamplingPlanPointCount INT,
|
||||
ClimateSamplingPlanApprovalStatus VARCHAR(20) DEFAULT 'DRAFT',
|
||||
ClimateSamplingPlanRemarks TEXT,
|
||||
ClimateSamplingPlanCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
ClimateSamplingPlanCreatedUserID INT,
|
||||
ClimateSamplingPlanUpdatedAt DATETIME,
|
||||
ClimateSamplingPlanUpdatedUserID INT,
|
||||
ClimateSamplingPlanDeletedAt DATETIME,
|
||||
ClimateSamplingPlanDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Requisisi Peralatan untuk Pengukuran Iklim Kerja
|
||||
CREATE TABLE IF NOT EXISTS trx_requisisi_peralatan_iklim (
|
||||
id_requisisi INT PRIMARY KEY,
|
||||
id_sampling_plan INT NOT NULL,
|
||||
tanggal_requisisi DATE NOT NULL,
|
||||
tanggal_kebutuhan DATE NOT NULL,
|
||||
status_requisisi VARCHAR(20) DEFAULT 'DRAFT',
|
||||
catatan TEXT,
|
||||
tanggal_input TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
user_input VARCHAR(50),
|
||||
FOREIGN KEY (id_sampling_plan) REFERENCES trx_sampling_plan_iklim(id_sampling_plan)
|
||||
CREATE TABLE IF NOT EXISTS climate_equipment_requisitions (
|
||||
ClimateEquipmentRequisitionID INT PRIMARY KEY,
|
||||
ClimateSamplingPlanID INT NOT NULL,
|
||||
ClimateEquipmentRequisitionDate DATE NOT NULL,
|
||||
ClimateEquipmentRequisitionNeedDate DATE NOT NULL,
|
||||
ClimateEquipmentRequisitionStatus VARCHAR(20) DEFAULT 'DRAFT',
|
||||
ClimateEquipmentRequisitionRemarks TEXT,
|
||||
ClimateEquipmentRequisitionCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
ClimateEquipmentRequisitionCreatedUserID INT,
|
||||
ClimateEquipmentRequisitionUpdatedAt DATETIME,
|
||||
ClimateEquipmentRequisitionUpdatedUserID INT,
|
||||
ClimateEquipmentRequisitionDeletedAt DATETIME,
|
||||
ClimateEquipmentRequisitionDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Detail Requisisi Peralatan
|
||||
CREATE TABLE IF NOT EXISTS trx_requisisi_peralatan_iklim_detail (
|
||||
id_requisisi_detail INT PRIMARY KEY,
|
||||
id_requisisi INT NOT NULL,
|
||||
id_peralatan INT NOT NULL,
|
||||
jumlah INT NOT NULL,
|
||||
status_persetujuan VARCHAR(20) DEFAULT 'PENDING',
|
||||
catatan TEXT,
|
||||
tanggal_input TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
user_input VARCHAR(50),
|
||||
FOREIGN KEY (id_requisisi) REFERENCES trx_requisisi_peralatan_iklim(id_requisisi),
|
||||
FOREIGN KEY (id_peralatan) REFERENCES master_peralatan_iklim(id_peralatan)
|
||||
CREATE TABLE IF NOT EXISTS climate_equipment_requisition_details (
|
||||
ClimateEquipmentRequisitionDetailID INT PRIMARY KEY,
|
||||
ClimateEquipmentRequisitionID INT NOT NULL,
|
||||
MasterClimateEquipmentID INT NOT NULL,
|
||||
ClimateEquipmentRequisitionDetailQuantity INT NOT NULL,
|
||||
ClimateEquipmentRequisitionDetailApprovalStatus VARCHAR(20) DEFAULT 'PENDING',
|
||||
ClimateEquipmentRequisitionDetailRemarks TEXT,
|
||||
ClimateEquipmentRequisitionDetailCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
ClimateEquipmentRequisitionDetailCreatedUserID INT,
|
||||
ClimateEquipmentRequisitionDetailUpdatedAt DATETIME,
|
||||
ClimateEquipmentRequisitionDetailUpdatedUserID INT,
|
||||
ClimateEquipmentRequisitionDetailDeletedAt DATETIME,
|
||||
ClimateEquipmentRequisitionDetailDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Hasil Pengukuran Iklim Kerja
|
||||
CREATE TABLE IF NOT EXISTS trx_hasil_ukur_iklim (
|
||||
id_hasil_ukur INT PRIMARY KEY,
|
||||
id_sampling_plan INT NOT NULL,
|
||||
kode_laporan VARCHAR(50) NOT NULL,
|
||||
tanggal_sampling DATE NOT NULL,
|
||||
waktu_mulai TIME,
|
||||
waktu_selesai TIME,
|
||||
kondisi_cuaca VARCHAR(100),
|
||||
petugas_sampling VARCHAR(100),
|
||||
status_laporan VARCHAR(20) DEFAULT 'DRAFT',
|
||||
catatan TEXT,
|
||||
tanggal_input TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
user_input VARCHAR(50),
|
||||
FOREIGN KEY (id_sampling_plan) REFERENCES trx_sampling_plan_iklim(id_sampling_plan)
|
||||
CREATE TABLE IF NOT EXISTS climate_measurement_results (
|
||||
ClimateMeasurementResultID INT PRIMARY KEY,
|
||||
ClimateSamplingPlanID INT NOT NULL,
|
||||
ClimateMeasurementResultCode VARCHAR(50) NOT NULL,
|
||||
ClimateMeasurementResultDate DATE NOT NULL,
|
||||
ClimateMeasurementResultStartTime TIME,
|
||||
ClimateMeasurementResultEndTime TIME,
|
||||
ClimateMeasurementResultWeather VARCHAR(100),
|
||||
ClimateMeasurementResultOfficer VARCHAR(100),
|
||||
ClimateMeasurementResultStatus VARCHAR(20) DEFAULT 'DRAFT',
|
||||
ClimateMeasurementResultRemarks TEXT,
|
||||
ClimateMeasurementResultCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
ClimateMeasurementResultCreatedUserID INT,
|
||||
ClimateMeasurementResultUpdatedAt DATETIME,
|
||||
ClimateMeasurementResultUpdatedUserID INT,
|
||||
ClimateMeasurementResultDeletedAt DATETIME,
|
||||
ClimateMeasurementResultDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Detail Hasil Pengukuran Iklim Kerja
|
||||
CREATE TABLE IF NOT EXISTS trx_hasil_ukur_iklim_detail (
|
||||
id_hasil_ukur_detail INT PRIMARY KEY,
|
||||
id_hasil_ukur INT NOT NULL,
|
||||
kode_titik VARCHAR(20) NOT NULL,
|
||||
nama_lokasi VARCHAR(255) NOT NULL,
|
||||
jenis_ruangan VARCHAR(100) NOT NULL,
|
||||
id_parameter INT NOT NULL,
|
||||
hasil_pengukuran DECIMAL(6, 2) NOT NULL,
|
||||
baku_mutu_min DECIMAL(6, 2),
|
||||
baku_mutu_max DECIMAL(6, 2),
|
||||
id_metode INT NOT NULL,
|
||||
id_peralatan INT NOT NULL,
|
||||
status_kesesuaian VARCHAR(20),
|
||||
catatan TEXT,
|
||||
tanggal_input TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
user_input VARCHAR(50),
|
||||
FOREIGN KEY (id_hasil_ukur) REFERENCES trx_hasil_ukur_iklim(id_hasil_ukur),
|
||||
FOREIGN KEY (id_parameter) REFERENCES master_parameter_iklim(id_parameter),
|
||||
FOREIGN KEY (id_metode) REFERENCES master_metode_sampling_iklim(id_metode),
|
||||
FOREIGN KEY (id_peralatan) REFERENCES master_peralatan_iklim(id_peralatan)
|
||||
CREATE TABLE IF NOT EXISTS climate_measurement_result_details (
|
||||
ClimateMeasurementResultDetailID INT PRIMARY KEY,
|
||||
ClimateMeasurementResultID INT NOT NULL,
|
||||
ClimateMeasurementResultDetailPointCode VARCHAR(20) NOT NULL,
|
||||
ClimateMeasurementResultDetailLocation VARCHAR(255) NOT NULL,
|
||||
ClimateMeasurementResultDetailRoomType VARCHAR(100) NOT NULL,
|
||||
MasterClimateParameterID INT NOT NULL,
|
||||
ClimateMeasurementResultDetailValue DECIMAL(6,2) NOT NULL,
|
||||
ClimateMeasurementResultDetailMinStandard DECIMAL(6,2),
|
||||
ClimateMeasurementResultDetailMaxStandard DECIMAL(6,2),
|
||||
MasterClimateSamplingMethodID INT NOT NULL,
|
||||
MasterClimateEquipmentID INT NOT NULL,
|
||||
ClimateMeasurementResultDetailComplianceStatus VARCHAR(20),
|
||||
ClimateMeasurementResultDetailRemarks TEXT,
|
||||
ClimateMeasurementResultDetailCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
ClimateMeasurementResultDetailCreatedUserID INT,
|
||||
ClimateMeasurementResultDetailUpdatedAt DATETIME,
|
||||
ClimateMeasurementResultDetailUpdatedUserID INT,
|
||||
ClimateMeasurementResultDetailDeletedAt DATETIME,
|
||||
ClimateMeasurementResultDetailDeletedUserID INT
|
||||
);
|
||||
|
||||
-- ------------------------------------------------------------------------------
|
||||
@@ -172,111 +202,111 @@ CREATE TABLE IF NOT EXISTS trx_hasil_ukur_iklim_detail (
|
||||
-- ------------------------------------------------------------------------------
|
||||
|
||||
-- Insert Data Master Regulasi
|
||||
INSERT INTO master_regulasi (id_regulasi, kode_regulasi, nama_regulasi, instansi_penerbit, tanggal_terbit, tanggal_berlaku, deskripsi, file_path, status, user_input)
|
||||
INSERT INTO master_regulations (MasterRegulationID, MasterRegulationCode, MasterRegulationName, MasterRegulationIssuer, MasterRegulationIssueDate, MasterRegulationEffectiveDate, MasterRegulationDescription, MasterRegulationFilePath, MasterRegulationIsActive, MasterRegulationCreatedAt, MasterRegulationCreatedUserID)
|
||||
VALUES
|
||||
(1, 'PMK-02-2023', 'Peraturan Menteri Kesehatan Republik Indonesia Nomor 2 Tahun 2023 tentang Standar Baku Mutu Kesehatan Lingkungan dan Persyaratan Kesehatan', 'Kementerian Kesehatan RI', '2023-01-15', '2023-02-01', 'Standar Baku Mutu Kesehatan Lingkungan untuk Media Air, Udara, Tanah, Pangan, Sarana dan Bangunan, serta Vektor dan Binatang Pembawa Penyakit, dan Persyaratan Kesehatan', '/dokumen/regulasi/PMK_02_2023.pdf', TRUE, 'admin'),
|
||||
(2, 'PERMENAKER-05-2018', 'Peraturan Menteri Ketenagakerjaan Republik Indonesia Nomor 5 Tahun 2018 tentang Keselamatan dan Kesehatan Kerja Lingkungan Kerja', 'Kementerian Ketenagakerjaan RI', '2018-04-17', '2018-05-01', 'Keselamatan dan Kesehatan Kerja Lingkungan Kerja meliputi faktor fisika, kimia, biologi, ergonomi, dan psikologi', '/dokumen/regulasi/PERMENAKER_05_2018.pdf', TRUE, 'admin');
|
||||
(1, 'PMK-02-2023', 'Peraturan Menteri Kesehatan Republik Indonesia Nomor 2 Tahun 2023', 'Kementerian Kesehatan RI', '2023-01-15', '2023-02-01', 'Standar Baku Mutu Kesehatan Lingkungan untuk Media Air, Udara, Tanah, Pangan, Sarana dan Bangunan', '/dokumen/regulasi/PMK_02_2023.pdf', TRUE, '2023-05-10 10:30:00', 1),
|
||||
(2, 'PERMENAKER-05-2018', 'Peraturan Menteri Ketenagakerjaan Republik Indonesia Nomor 5 Tahun 2018', 'Kementerian Ketenagakerjaan RI', '2018-04-17', '2018-05-01', 'Keselamatan dan Kesehatan Kerja Lingkungan Kerja', '/dokumen/regulasi/PERMENAKER_05_2018.pdf', TRUE, '2018-05-15 10:30:00', 1);
|
||||
|
||||
-- Insert Data Master Parameter Iklim Kerja
|
||||
INSERT INTO master_parameter_iklim (id_parameter, kode_parameter, nama_parameter, satuan, metode_analisis, biaya, akreditasi, keterangan, status, user_input)
|
||||
INSERT INTO master_climate_parameters (MasterClimateParameterID, MasterClimateParameterCode, MasterClimateParameterName, MasterClimateParameterUnit, MasterClimateParameterMethod, MasterClimateParameterPrice, MasterClimateParameterIsAccredited, MasterClimateParameterRemarks, MasterClimateParameterIsActive, MasterClimateParameterCreatedAt, MasterClimateParameterCreatedUserID)
|
||||
VALUES
|
||||
(1, 'SUHU-01', 'Suhu Udara', '°C', 'SNI 7062:2019', 50000.00, TRUE, 'Pengukuran suhu udara dalam ruangan', TRUE, 'admin'),
|
||||
(2, 'KELEM-01', 'Kelembaban Udara', '%RH', 'SNI 7062:2019', 50000.00, TRUE, 'Pengukuran kelembaban relatif udara dalam ruangan', TRUE, 'admin'),
|
||||
(3, 'KEC-UDARA-01', 'Kecepatan Aliran Udara', 'm/s', 'SNI 7062:2019', 60000.00, TRUE, 'Pengukuran kecepatan aliran udara dalam ruangan', TRUE, 'admin'),
|
||||
(4, 'ISBB-01', 'Indeks Suhu Basah dan Bola (ISBB)', '°C', 'SNI 7062:2019', 85000.00, TRUE, 'Pengukuran Indeks Suhu Basah dan Bola untuk analisis beban kerja', TRUE, 'admin');
|
||||
(1, 'SUHU-01', 'Suhu Udara', '°C', 'SNI 7062:2019', 50000.00, TRUE, 'Pengukuran suhu udara dalam ruangan', TRUE, '2023-05-10 10:30:00', 1),
|
||||
(2, 'KELEM-01', 'Kelembaban Udara', '%RH', 'SNI 7062:2019', 50000.00, TRUE, 'Pengukuran kelembaban relatif udara dalam ruangan', TRUE, '2023-05-10 10:30:00', 1),
|
||||
(3, 'KEC-UDARA-01', 'Kecepatan Aliran Udara', 'm/s', 'SNI 7062:2019', 60000.00, TRUE, 'Pengukuran kecepatan aliran udara dalam ruangan', TRUE, '2023-05-10 10:30:00', 1),
|
||||
(4, 'ISBB-01', 'Indeks Suhu Basah dan Bola (ISBB)', '°C', 'SNI 7062:2019', 85000.00, TRUE, 'Pengukuran Indeks Suhu Basah dan Bola untuk analisis beban kerja', TRUE, '2023-05-10 10:30:00', 1);
|
||||
|
||||
-- Insert Data Master Baku Mutu Iklim Kerja
|
||||
INSERT INTO master_bakumutu_iklim (id_bakumutu, id_parameter, id_regulasi, jenis_ruangan, nilai_min, nilai_max, keterangan, status, user_input)
|
||||
INSERT INTO master_climate_standards (MasterClimateStandardID, MasterClimateParameterID, MasterRegulationID, MasterClimateStandardRoomType, MasterClimateStandardMinValue, MasterClimateStandardMaxValue, MasterClimateStandardRemarks, MasterClimateStandardIsActive, MasterClimateStandardCreatedAt, MasterClimateStandardCreatedUserID)
|
||||
VALUES
|
||||
-- Suhu Udara
|
||||
(1, 1, 1, 'Ruang Administrasi/Kantor', 20.0, 25.0, 'Ruang kerja administrasi dan kantor', TRUE, 'admin'),
|
||||
(2, 1, 1, 'Ruang Produksi', 23.0, 26.0, 'Area produksi dengan aktivitas fisik ringan sampai sedang', TRUE, 'admin'),
|
||||
(3, 1, 1, 'Ruang Istirahat', 22.0, 28.0, 'Area istirahat, kantin, dan ruang tunggu', TRUE, 'admin'),
|
||||
(4, 1, 1, 'Ruang Khusus', 18.0, 24.0, 'Ruang server, laboratorium, dan ruang khusus lainnya', TRUE, 'admin'),
|
||||
(1, 1, 1, 'Ruang Administrasi/Kantor', 20.0, 25.0, 'Ruang kerja administrasi dan kantor', TRUE, '2023-05-10 10:30:00', 1),
|
||||
(2, 1, 1, 'Ruang Produksi', 23.0, 26.0, 'Area produksi dengan aktivitas fisik ringan sampai sedang', TRUE, '2023-05-10 10:30:00', 1),
|
||||
(3, 1, 1, 'Ruang Istirahat', 22.0, 28.0, 'Area istirahat, kantin, dan ruang tunggu', TRUE, '2023-05-10 10:30:00', 1),
|
||||
(4, 1, 1, 'Ruang Khusus', 18.0, 24.0, 'Ruang server, laboratorium, dan ruang khusus lainnya', TRUE, '2023-05-10 10:30:00', 1),
|
||||
|
||||
-- Kelembaban Udara
|
||||
(5, 2, 1, 'Ruang Administrasi/Kantor', 40.0, 60.0, 'Ruang kerja administrasi dan kantor', TRUE, 'admin'),
|
||||
(6, 2, 1, 'Ruang Produksi', 40.0, 60.0, 'Area produksi dengan aktivitas fisik ringan sampai sedang', TRUE, 'admin'),
|
||||
(7, 2, 1, 'Ruang Istirahat', 40.0, 60.0, 'Area istirahat, kantin, dan ruang tunggu', TRUE, 'admin'),
|
||||
(8, 2, 1, 'Ruang Khusus', 40.0, 60.0, 'Ruang server, laboratorium, dan ruang khusus lainnya', TRUE, 'admin'),
|
||||
(5, 2, 1, 'Ruang Administrasi/Kantor', 40.0, 60.0, 'Ruang kerja administrasi dan kantor', TRUE, '2023-05-10 10:30:00', 1),
|
||||
(6, 2, 1, 'Ruang Produksi', 40.0, 60.0, 'Area produksi dengan aktivitas fisik ringan sampai sedang', TRUE, '2023-05-10 10:30:00', 1),
|
||||
(7, 2, 1, 'Ruang Istirahat', 40.0, 60.0, 'Area istirahat, kantin, dan ruang tunggu', TRUE, '2023-05-10 10:30:00', 1),
|
||||
(8, 2, 1, 'Ruang Khusus', 40.0, 60.0, 'Ruang server, laboratorium, dan ruang khusus lainnya', TRUE, '2023-05-10 10:30:00', 1),
|
||||
|
||||
-- Kecepatan Aliran Udara
|
||||
(9, 3, 1, 'Ruang Administrasi/Kantor', 0.1, 0.2, 'Ruang kerja administrasi dan kantor', TRUE, 'admin'),
|
||||
(10, 3, 1, 'Ruang Produksi', 0.1, 0.3, 'Area produksi dengan aktivitas fisik ringan sampai sedang', TRUE, 'admin'),
|
||||
(11, 3, 1, 'Ruang Istirahat', 0.1, 0.25, 'Area istirahat, kantin, dan ruang tunggu', TRUE, 'admin'),
|
||||
(12, 3, 1, 'Ruang Khusus', 0.1, 0.3, 'Ruang server, laboratorium, dan ruang khusus lainnya', TRUE, 'admin'),
|
||||
(9, 3, 1, 'Ruang Administrasi/Kantor', 0.1, 0.2, 'Ruang kerja administrasi dan kantor', TRUE, '2023-05-10 10:30:00', 1),
|
||||
(10, 3, 1, 'Ruang Produksi', 0.1, 0.3, 'Area produksi dengan aktivitas fisik ringan sampai sedang', TRUE, '2023-05-10 10:30:00', 1),
|
||||
(11, 3, 1, 'Ruang Istirahat', 0.1, 0.25, 'Area istirahat, kantin, dan ruang tunggu', TRUE, '2023-05-10 10:30:00', 1),
|
||||
(12, 3, 1, 'Ruang Khusus', 0.1, 0.3, 'Ruang server, laboratorium, dan ruang khusus lainnya', TRUE, '2023-05-10 10:30:00', 1),
|
||||
|
||||
-- ISBB (Indeks Suhu Basah dan Bola)
|
||||
(13, 4, 2, 'Beban Kerja Ringan', NULL, 30.0, 'Alokasi istirahat 75% kerja, 25% istirahat', TRUE, 'admin'),
|
||||
(14, 4, 2, 'Beban Kerja Sedang', NULL, 28.0, 'Alokasi istirahat 75% kerja, 25% istirahat', TRUE, 'admin'),
|
||||
(15, 4, 2, 'Beban Kerja Berat', NULL, 25.0, 'Alokasi istirahat 75% kerja, 25% istirahat', TRUE, 'admin');
|
||||
(13, 4, 2, 'Beban Kerja Ringan', NULL, 30.0, 'Alokasi istirahat 75% kerja, 25% istirahat', TRUE, '2023-05-10 10:30:00', 1),
|
||||
(14, 4, 2, 'Beban Kerja Sedang', NULL, 28.0, 'Alokasi istirahat 75% kerja, 25% istirahat', TRUE, '2023-05-10 10:30:00', 1),
|
||||
(15, 4, 2, 'Beban Kerja Berat', NULL, 25.0, 'Alokasi istirahat 75% kerja, 25% istirahat', TRUE, '2023-05-10 10:30:00', 1);
|
||||
|
||||
-- Insert Data Master Metode Sampling Iklim Kerja
|
||||
INSERT INTO master_metode_sampling_iklim (id_metode, kode_metode, nama_metode, deskripsi, jenis_parameter, status, user_input)
|
||||
INSERT INTO master_climate_sampling_methods (MasterClimateSamplingMethodID, MasterClimateSamplingMethodCode, MasterClimateSamplingMethodName, MasterClimateSamplingMethodDescription, MasterClimateSamplingMethodParameterType, MasterClimateSamplingMethodIsActive, MasterClimateSamplingMethodCreatedAt, MasterClimateSamplingMethodCreatedUserID)
|
||||
VALUES
|
||||
(1, 'SNI-7062-2019-SUHU', 'SNI 7062:2019 - Pengukuran Suhu Udara', 'Metode standar pengukuran suhu udara menggunakan termometer ruangan', 'Suhu Udara', TRUE, 'admin'),
|
||||
(2, 'SNI-7062-2019-KELEMBABAN', 'SNI 7062:2019 - Pengukuran Kelembaban Udara', 'Metode standar pengukuran kelembaban relatif udara menggunakan hygrometer', 'Kelembaban Udara', TRUE, 'admin'),
|
||||
(3, 'SNI-7062-2019-ANEMO', 'SNI 7062:2019 - Pengukuran Kecepatan Aliran Udara', 'Metode standar pengukuran kecepatan aliran udara menggunakan anemometer', 'Kecepatan Aliran Udara', TRUE, 'admin'),
|
||||
(4, 'SNI-7062-2019-ISBB', 'SNI 7062:2019 - Pengukuran ISBB', 'Metode standar pengukuran Indeks Suhu Basah dan Bola menggunakan WBGT meter', 'ISBB', TRUE, 'admin');
|
||||
(1, 'SNI-7062-2019-SUHU', 'SNI 7062:2019 - Pengukuran Suhu Udara', 'Metode standar pengukuran suhu udara menggunakan termometer ruangan', 'Suhu Udara', TRUE, '2023-05-10 10:30:00', 1),
|
||||
(2, 'SNI-7062-2019-KELEMBABAN', 'SNI 7062:2019 - Pengukuran Kelembaban Udara', 'Metode standar pengukuran kelembaban relatif udara menggunakan hygrometer', 'Kelembaban Udara', TRUE, '2023-05-10 10:30:00', 1),
|
||||
(3, 'SNI-7062-2019-ANEMO', 'SNI 7062:2019 - Pengukuran Kecepatan Aliran Udara', 'Metode standar pengukuran kecepatan aliran udara menggunakan anemometer', 'Kecepatan Aliran Udara', TRUE, '2023-05-10 10:30:00', 1),
|
||||
(4, 'SNI-7062-2019-ISBB', 'SNI 7062:2019 - Pengukuran ISBB', 'Metode standar pengukuran Indeks Suhu Basah dan Bola menggunakan WBGT meter', 'ISBB', TRUE, '2023-05-10 10:30:00', 1);
|
||||
|
||||
-- Insert Data Master Peralatan Pengukuran Iklim Kerja
|
||||
INSERT INTO master_peralatan_iklim (id_peralatan, kode_peralatan, nama_peralatan, merk, model, serial_number, spesifikasi, tanggal_kalibrasi, tanggal_kalibrasi_berikutnya, status_kalibrasi, file_sertifikat, status, user_input)
|
||||
INSERT INTO master_climate_equipment (MasterClimateEquipmentID, MasterClimateEquipmentCode, MasterClimateEquipmentName, MasterClimateEquipmentBrand, MasterClimateEquipmentModel, MasterClimateEquipmentSerialNumber, MasterClimateEquipmentSpecification, MasterClimateEquipmentLastCalibrationDate, MasterClimateEquipmentNextCalibrationDate, MasterClimateEquipmentCalibrationStatus, MasterClimateEquipmentCertificatePath, MasterClimateEquipmentIsActive, MasterClimateEquipmentCreatedAt, MasterClimateEquipmentCreatedUserID)
|
||||
VALUES
|
||||
(1, 'THERMO-01', 'Termohigrometer Digital', 'Lutron', 'PHB-318', 'LT12345678', 'Range suhu: -20 - 60°C, Range kelembaban: 10 - 95% RH, Resolusi: 0.1°C / 0.1% RH', '2023-05-10', '2024-05-10', 'VALID', '/dokumen/kalibrasi/thermo_lutron_2023.pdf', TRUE, 'admin'),
|
||||
(2, 'THERMO-02', 'Termohigrometer Digital', 'Extech', 'RHT50', 'EX87654321', 'Range suhu: -30 - 70°C, Range kelembaban: 0 - 99% RH, Resolusi: 0.1°C / 0.1% RH', '2023-08-15', '2024-08-15', 'VALID', '/dokumen/kalibrasi/thermo_extech_2023.pdf', TRUE, 'admin'),
|
||||
(3, 'ANEMO-01', 'Anemometer Digital', 'Lutron', 'AM-4214SD', 'LA23456789', 'Range kecepatan udara: 0.2 - 20.0 m/s, Resolusi: 0.01 m/s', '2023-03-20', '2024-03-20', 'VALID', '/dokumen/kalibrasi/anemo_lutron_2023.pdf', TRUE, 'admin'),
|
||||
(4, 'WBGT-01', 'Wet Bulb Globe Temperature Meter', 'Extech', 'HT30', 'EX55667788', 'Range WBGT: 0 - 50°C, Range TA: 0 - 50°C, Range TG: 0 - 80°C, Range RH: 0 - 100%', '2023-06-05', '2024-06-05', 'VALID', '/dokumen/kalibrasi/wbgt_extech_2023.pdf', TRUE, 'admin'),
|
||||
(5, 'THERMO-03', 'Termohigrometer Ruangan', 'Testo', '608-H1', 'TS12131415', 'Range suhu: -10 - 70°C, Range kelembaban: 10 - 98% RH, Akurasi: ±0.5°C / ±3% RH', '2023-07-22', '2024-07-22', 'VALID', '/dokumen/kalibrasi/thermo_testo_2023.pdf', TRUE, 'admin');
|
||||
(1, 'THERMO-01', 'Termohigrometer Digital', 'Lutron', 'PHB-318', 'LT12345678', 'Range suhu: -20 - 60°C, Range kelembaban: 10 - 95% RH, Resolusi: 0.1°C / 0.1% RH', '2023-05-10', '2024-05-10', 'VALID', '/dokumen/kalibrasi/thermo_lutron_2023.pdf', TRUE, '2023-05-10 10:30:00', 1),
|
||||
(2, 'THERMO-02', 'Termohigrometer Digital', 'Extech', 'RHT50', 'EX87654321', 'Range suhu: -30 - 70°C, Range kelembaban: 0 - 99% RH, Resolusi: 0.1°C / 0.1% RH', '2023-08-15', '2024-08-15', 'VALID', '/dokumen/kalibrasi/thermo_extech_2023.pdf', TRUE, '2023-08-15 10:30:00', 1),
|
||||
(3, 'ANEMO-01', 'Anemometer Digital', 'Lutron', 'AM-4214SD', 'LA23456789', 'Range kecepatan udara: 0.2 - 20.0 m/s, Resolusi: 0.01 m/s', '2023-03-20', '2024-03-20', 'VALID', '/dokumen/kalibrasi/anemo_lutron_2023.pdf', TRUE, '2023-03-20 10:30:00', 1),
|
||||
(4, 'WBGT-01', 'Wet Bulb Globe Temperature Meter', 'Extech', 'HT30', 'EX55667788', 'Range WBGT: 0 - 50°C, Range TA: 0 - 50°C, Range TG: 0 - 80°C, Range RH: 0 - 100%', '2023-06-05', '2024-06-05', 'VALID', '/dokumen/kalibrasi/wbgt_extech_2023.pdf', TRUE, '2023-06-05 10:30:00', 1),
|
||||
(5, 'THERMO-03', 'Termohigrometer Ruangan', 'Testo', '608-H1', 'TS12131415', 'Range suhu: -10 - 70°C, Range kelembaban: 10 - 98% RH, Akurasi: ±0.5°C / ±3% RH', '2023-07-22', '2024-07-22', 'VALID', '/dokumen/kalibrasi/thermo_testo_2023.pdf', TRUE, '2023-07-22 10:30:00', 1);
|
||||
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- Insert Contoh Data Transaksi
|
||||
-- -----------------------------------------------------------------------------
|
||||
|
||||
-- Contoh Data Sampling Plan Pengukuran Iklim Kerja
|
||||
INSERT INTO trx_sampling_plan_iklim (id_sampling_plan, kode_sampling_plan, nama_project, id_client, tanggal_rencana_sampling, lokasi_sampling, jumlah_titik, status_approval, catatan, tanggal_input, user_input)
|
||||
INSERT INTO climate_sampling_plans (ClimateSamplingPlanID, ClimateSamplingPlanCode, ClimateSamplingPlanProjectName, CustomerID, ClimateSamplingPlanDate, ClimateSamplingPlanLocation, ClimateSamplingPlanPointCount, ClimateSamplingPlanApprovalStatus, ClimateSamplingPlanRemarks, ClimateSamplingPlanCreatedAt, ClimateSamplingPlanCreatedUserID)
|
||||
VALUES
|
||||
(1, 'SP-IK-2024-001', 'Monitoring Iklim Kerja Semester I 2024 - PT. Indonesia Manufacturing Industry', 101, '2024-04-25', 'PT. Indonesia Manufacturing Industry, Jl. Industry Raya No. 123, Jakarta', 5, 'APPROVED', 'Monitoring rutin semester I tahun 2024 sesuai program K3', '2024-04-10 09:15:00', 'supervisor');
|
||||
(1, 'SP-IK-2024-001', 'Monitoring Iklim Kerja Semester I 2024', 101, '2024-04-25', 'PT. Indonesia Manufacturing Industry', 5, 'APPROVED', 'Monitoring rutin semester I tahun 2024 sesuai program K3', '2024-04-10 09:15:00', 1);
|
||||
|
||||
-- Contoh Data Requisisi Peralatan untuk Pengukuran Iklim Kerja
|
||||
INSERT INTO trx_requisisi_peralatan_iklim (id_requisisi, id_sampling_plan, tanggal_requisisi, tanggal_kebutuhan, status_requisisi, catatan, tanggal_input, user_input)
|
||||
INSERT INTO climate_equipment_requisitions (ClimateEquipmentRequisitionID, ClimateSamplingPlanID, ClimateEquipmentRequisitionDate, ClimateEquipmentRequisitionNeedDate, ClimateEquipmentRequisitionStatus, ClimateEquipmentRequisitionRemarks, ClimateEquipmentRequisitionCreatedAt, ClimateEquipmentRequisitionCreatedUserID)
|
||||
VALUES
|
||||
(1, 1, '2024-04-15', '2024-04-25', 'APPROVED', 'Requisisi peralatan untuk monitoring iklim kerja PT. Indonesia Manufacturing Industry', '2024-04-15 10:30:00', 'officer');
|
||||
(1, 1, '2024-04-15', '2024-04-25', 'APPROVED', 'Requisisi peralatan untuk monitoring iklim kerja PT. Indonesia Manufacturing Industry', '2024-04-15 10:30:00', 1);
|
||||
|
||||
-- Contoh Data Detail Requisisi Peralatan
|
||||
INSERT INTO trx_requisisi_peralatan_iklim_detail (id_requisisi_detail, id_requisisi, id_peralatan, jumlah, status_persetujuan, catatan, tanggal_input, user_input)
|
||||
INSERT INTO climate_equipment_requisition_details (ClimateEquipmentRequisitionDetailID, ClimateEquipmentRequisitionID, MasterClimateEquipmentID, ClimateEquipmentRequisitionDetailQuantity, ClimateEquipmentRequisitionDetailApprovalStatus, ClimateEquipmentRequisitionDetailRemarks, ClimateEquipmentRequisitionDetailCreatedAt, ClimateEquipmentRequisitionDetailCreatedUserID)
|
||||
VALUES
|
||||
(1, 1, 1, 1, 'APPROVED', 'Termohigrometer Digital Lutron untuk pengukuran suhu dan kelembaban', '2024-04-15 10:31:00', 'officer'),
|
||||
(2, 1, 3, 1, 'APPROVED', 'Anemometer Digital Lutron untuk pengukuran kecepatan aliran udara', '2024-04-15 10:32:00', 'officer');
|
||||
(1, 1, 1, 1, 'APPROVED', 'Termohigrometer Digital Lutron untuk pengukuran suhu dan kelembaban', '2024-04-15 10:31:00', 1),
|
||||
(2, 1, 3, 1, 'APPROVED', 'Anemometer Digital Lutron untuk pengukuran kecepatan aliran udara', '2024-04-15 10:32:00', 1);
|
||||
|
||||
-- Contoh Data Hasil Pengukuran Iklim Kerja
|
||||
INSERT INTO trx_hasil_ukur_iklim (id_hasil_ukur, id_sampling_plan, kode_laporan, tanggal_sampling, waktu_mulai, waktu_selesai, kondisi_cuaca, petugas_sampling, status_laporan, catatan, tanggal_input, user_input)
|
||||
INSERT INTO climate_measurement_results (ClimateMeasurementResultID, ClimateSamplingPlanID, ClimateMeasurementResultCode, ClimateMeasurementResultDate, ClimateMeasurementResultStartTime, ClimateMeasurementResultEndTime, ClimateMeasurementResultWeather, ClimateMeasurementResultOfficer, ClimateMeasurementResultStatus, ClimateMeasurementResultRemarks, ClimateMeasurementResultCreatedAt, ClimateMeasurementResultCreatedUserID)
|
||||
VALUES
|
||||
(1, 1, 'LHU/IKLIM/04/2024/001', '2024-04-25', '09:00:00', '11:15:00', 'Cuaca cerah, suhu luar 31°C', 'Deni Hermawan', 'FINAL', 'Pengukuran berjalan lancar sesuai dengan rencana', '2024-04-25 15:30:00', 'officer');
|
||||
(1, 1, 'LHU/IKLIM/04/2024/001', '2024-04-25', '09:00:00', '11:15:00', 'Cuaca cerah, suhu luar 31°C', 'Deni Hermawan', 'FINAL', 'Pengukuran berjalan lancar sesuai dengan rencana', '2024-04-25 15:30:00', 1);
|
||||
|
||||
-- Contoh Data Detail Hasil Pengukuran Iklim Kerja
|
||||
INSERT INTO trx_hasil_ukur_iklim_detail (id_hasil_ukur_detail, id_hasil_ukur, kode_titik, nama_lokasi, jenis_ruangan, id_parameter, hasil_pengukuran, baku_mutu_min, baku_mutu_max, id_metode, id_peralatan, status_kesesuaian, catatan, tanggal_input, user_input)
|
||||
INSERT INTO climate_measurement_result_details (ClimateMeasurementResultDetailID, ClimateMeasurementResultID, ClimateMeasurementResultDetailPointCode, ClimateMeasurementResultDetailLocation, ClimateMeasurementResultDetailRoomType, MasterClimateParameterID, ClimateMeasurementResultDetailValue, ClimateMeasurementResultDetailMinStandard, ClimateMeasurementResultDetailMaxStandard, MasterClimateSamplingMethodID, MasterClimateEquipmentID, ClimateMeasurementResultDetailComplianceStatus, ClimateMeasurementResultDetailRemarks, ClimateMeasurementResultDetailCreatedAt, ClimateMeasurementResultDetailCreatedUserID)
|
||||
VALUES
|
||||
-- Main Meeting Room
|
||||
(1, 1, 'T1', 'Main Meeting Room', 'Ruang Administrasi/Kantor', 1, 21.0, 20.0, 25.0, 1, 1, 'COMPLY', '', '2024-04-25 15:35:00', 'officer'),
|
||||
(2, 1, 'T1', 'Main Meeting Room', 'Ruang Administrasi/Kantor', 2, 50.5, 40.0, 60.0, 2, 1, 'COMPLY', '', '2024-04-25 15:35:00', 'officer'),
|
||||
(3, 1, 'T1', 'Main Meeting Room', 'Ruang Administrasi/Kantor', 3, 0.15, 0.1, 0.2, 3, 3, 'COMPLY', '', '2024-04-25 15:35:00', 'officer'),
|
||||
(1, 1, 'T1', 'Main Meeting Room', 'Ruang Administrasi/Kantor', 1, 21.0, 20.0, 25.0, 1, 1, 'COMPLY', '', '2024-04-25 15:35:00', 1),
|
||||
(2, 1, 'T1', 'Main Meeting Room', 'Ruang Administrasi/Kantor', 2, 50.5, 40.0, 60.0, 2, 1, 'COMPLY', '', '2024-04-25 15:35:00', 1),
|
||||
(3, 1, 'T1', 'Main Meeting Room', 'Ruang Administrasi/Kantor', 3, 0.15, 0.1, 0.2, 3, 3, 'COMPLY', '', '2024-04-25 15:35:00', 1),
|
||||
|
||||
-- HR Work Area
|
||||
(4, 1, 'T2', 'HR Work Area', 'Ruang Administrasi/Kantor', 1, 22.0, 20.0, 25.0, 1, 1, 'COMPLY', '', '2024-04-25 15:45:00', 'officer'),
|
||||
(5, 1, 'T2', 'HR Work Area', 'Ruang Administrasi/Kantor', 2, 52.0, 40.0, 60.0, 2, 1, 'COMPLY', '', '2024-04-25 15:45:00', 'officer'),
|
||||
(6, 1, 'T2', 'HR Work Area', 'Ruang Administrasi/Kantor', 3, 0.12, 0.1, 0.2, 3, 3, 'COMPLY', '', '2024-04-25 15:45:00', 'officer'),
|
||||
(4, 1, 'T2', 'HR Work Area', 'Ruang Administrasi/Kantor', 1, 22.0, 20.0, 25.0, 1, 1, 'COMPLY', '', '2024-04-25 15:45:00', 1),
|
||||
(5, 1, 'T2', 'HR Work Area', 'Ruang Administrasi/Kantor', 2, 52.0, 40.0, 60.0, 2, 1, 'COMPLY', '', '2024-04-25 15:45:00', 1),
|
||||
(6, 1, 'T2', 'HR Work Area', 'Ruang Administrasi/Kantor', 3, 0.12, 0.1, 0.2, 3, 3, 'COMPLY', '', '2024-04-25 15:45:00', 1),
|
||||
|
||||
-- Server Room
|
||||
(7, 1, 'T3', 'Server Room', 'Ruang Khusus', 1, 19.0, 18.0, 24.0, 1, 1, 'COMPLY', '', '2024-04-25 15:55:00', 'officer'),
|
||||
(8, 1, 'T3', 'Server Room', 'Ruang Khusus', 2, 45.0, 40.0, 60.0, 2, 1, 'COMPLY', '', '2024-04-25 15:55:00', 'officer'),
|
||||
(9, 1, 'T3', 'Server Room', 'Ruang Khusus', 3, 0.25, 0.1, 0.3, 3, 3, 'COMPLY', '', '2024-04-25 15:55:00', 'officer'),
|
||||
(7, 1, 'T3', 'Server Room', 'Ruang Khusus', 1, 19.0, 18.0, 24.0, 1, 1, 'COMPLY', '', '2024-04-25 15:55:00', 1),
|
||||
(8, 1, 'T3', 'Server Room', 'Ruang Khusus', 2, 45.0, 40.0, 60.0, 2, 1, 'COMPLY', '', '2024-04-25 15:55:00', 1),
|
||||
(9, 1, 'T3', 'Server Room', 'Ruang Khusus', 3, 0.25, 0.1, 0.3, 3, 3, 'COMPLY', '', '2024-04-25 15:55:00', 1),
|
||||
|
||||
-- Production Line A
|
||||
(10, 1, 'T4', 'Production Line A', 'Ruang Produksi', 1, 26.0, 23.0, 26.0, 1, 1, 'COMPLY', '', '2024-04-25 16:05:00', 'officer'),
|
||||
(11, 1, 'T4', 'Production Line A', 'Ruang Produksi', 2, 65.0, 40.0, 60.0, 2, 1, 'NOT_COMPLY', 'Kelembaban melebihi baku mutu, perlu perbaikan sistem ventilasi', '2024-04-25 16:05:00', 'officer'),
|
||||
(12, 1, 'T4', 'Production Line A', 'Ruang Produksi', 3, 0.30, 0.1, 0.3, 3, 3, 'COMPLY', '', '2024-04-25 16:05:00', 'officer'),
|
||||
(10, 1, 'T4', 'Production Line A', 'Ruang Produksi', 1, 26.0, 23.0, 26.0, 1, 1, 'COMPLY', '', '2024-04-25 16:05:00', 1),
|
||||
(11, 1, 'T4', 'Production Line A', 'Ruang Produksi', 2, 65.0, 40.0, 60.0, 2, 1, 'NOT_COMPLY', 'Kelembaban melebihi baku mutu, perlu perbaikan sistem ventilasi', '2024-04-25 16:05:00', 1),
|
||||
(12, 1, 'T4', 'Production Line A', 'Ruang Produksi', 3, 0.30, 0.1, 0.3, 3, 3, 'COMPLY', '', '2024-04-25 16:05:00', 1),
|
||||
|
||||
-- Canteen Area
|
||||
(13, 1, 'T5', 'Canteen Area', 'Ruang Istirahat', 1, 24.0, 22.0, 28.0, 1, 1, 'COMPLY', '', '2024-04-25 16:15:00', 'officer'),
|
||||
(14, 1, 'T5', 'Canteen Area', 'Ruang Istirahat', 2, 55.0, 40.0, 60.0, 2, 1, 'COMPLY', '', '2024-04-25 16:15:00', 'officer'),
|
||||
(15, 1, 'T5', 'Canteen Area', 'Ruang Istirahat', 3, 0.20, 0.1, 0.25, 3, 3, 'COMPLY', '', '2024-04-25 16:15:00', 'officer');
|
||||
(13, 1, 'T5', 'Canteen Area', 'Ruang Istirahat', 1, 24.0, 22.0, 28.0, 1, 1, 'COMPLY', '', '2024-04-25 16:15:00', 1),
|
||||
(14, 1, 'T5', 'Canteen Area', 'Ruang Istirahat', 2, 55.0, 40.0, 60.0, 2, 1, 'COMPLY', '', '2024-04-25 16:15:00', 1),
|
||||
(15, 1, 'T5', 'Canteen Area', 'Ruang Istirahat', 3, 0.20, 0.1, 0.25, 3, 3, 'COMPLY', '', '2024-04-25 16:15:00', 1);
|
||||
@@ -1,218 +1,247 @@
|
||||
-- Master Data untuk Pengelolaan Laporan Pengukuran Iklim Kerja Suhu
|
||||
-- Berdasarkan PMK RI No.2 Tahun 2023
|
||||
|
||||
-- Master Tables
|
||||
|
||||
-- Tabel Master Regulasi
|
||||
CREATE TABLE master_regulasi (
|
||||
regulasi_id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
kode_regulasi VARCHAR(50) NOT NULL,
|
||||
nama_regulasi VARCHAR(200) NOT NULL,
|
||||
instansi_penerbit VARCHAR(100) NOT NULL,
|
||||
tahun_terbit INT NOT NULL,
|
||||
tanggal_berlaku DATE,
|
||||
deskripsi TEXT,
|
||||
file_path VARCHAR(255),
|
||||
is_active BOOLEAN DEFAULT TRUE,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
|
||||
CREATE TABLE master_regulations (
|
||||
MasterRegulationID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
MasterRegulationCode VARCHAR(50) NOT NULL,
|
||||
MasterRegulationName VARCHAR(200) NOT NULL,
|
||||
MasterRegulationIssuer VARCHAR(100) NOT NULL,
|
||||
MasterRegulationYear INT NOT NULL,
|
||||
MasterRegulationEffectiveDate DATE,
|
||||
MasterRegulationDescription TEXT,
|
||||
MasterRegulationFilePath VARCHAR(255),
|
||||
MasterRegulationIsActive BOOLEAN DEFAULT TRUE,
|
||||
MasterRegulationCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
MasterRegulationCreatedUserID INT,
|
||||
MasterRegulationUpdatedAt DATETIME,
|
||||
MasterRegulationUpdatedUserID INT,
|
||||
MasterRegulationDeletedAt DATETIME,
|
||||
MasterRegulationDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Tabel Master Parameter Lingkungan Kerja
|
||||
CREATE TABLE master_parameter (
|
||||
parameter_id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
kode_parameter VARCHAR(50) NOT NULL,
|
||||
nama_parameter VARCHAR(100) NOT NULL,
|
||||
kelompok_parameter VARCHAR(50), -- Fisika, Kimia, Biologi
|
||||
satuan VARCHAR(20),
|
||||
metode_analisis VARCHAR(100),
|
||||
deskripsi TEXT,
|
||||
harga DECIMAL(12, 2),
|
||||
is_active BOOLEAN DEFAULT TRUE,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
|
||||
-- Tabel Master Parameter
|
||||
CREATE TABLE master_parameters (
|
||||
MasterParameterID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
MasterParameterCode VARCHAR(50) NOT NULL,
|
||||
MasterParameterName VARCHAR(100) NOT NULL,
|
||||
MasterParameterGroup VARCHAR(50),
|
||||
MasterParameterUnit VARCHAR(20),
|
||||
MasterParameterMethod VARCHAR(100),
|
||||
MasterParameterDescription TEXT,
|
||||
MasterParameterPrice DECIMAL(12,2),
|
||||
MasterParameterIsActive BOOLEAN DEFAULT TRUE,
|
||||
MasterParameterCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
MasterParameterCreatedUserID INT,
|
||||
MasterParameterUpdatedAt DATETIME,
|
||||
MasterParameterUpdatedUserID INT,
|
||||
MasterParameterDeletedAt DATETIME,
|
||||
MasterParameterDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Tabel Master Nilai Ambang Batas untuk Iklim Kerja
|
||||
CREATE TABLE master_nilai_ambang_batas (
|
||||
nab_id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
regulasi_id INT,
|
||||
parameter_id INT,
|
||||
tipe_ruangan VARCHAR(100) NOT NULL,
|
||||
nilai_minimal DECIMAL(8, 2),
|
||||
nilai_maksimal DECIMAL(8, 2),
|
||||
satuan VARCHAR(20),
|
||||
keterangan TEXT,
|
||||
is_active BOOLEAN DEFAULT TRUE,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (regulasi_id) REFERENCES master_regulasi(regulasi_id),
|
||||
FOREIGN KEY (parameter_id) REFERENCES master_parameter(parameter_id)
|
||||
-- Tabel Master Nilai Ambang Batas
|
||||
CREATE TABLE master_thresholds (
|
||||
MasterThresholdID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
MasterRegulationID INT,
|
||||
MasterParameterID INT,
|
||||
MasterThresholdRoomType VARCHAR(100) NOT NULL,
|
||||
MasterThresholdMinValue DECIMAL(8,2),
|
||||
MasterThresholdMaxValue DECIMAL(8,2),
|
||||
MasterThresholdUnit VARCHAR(20),
|
||||
MasterThresholdRemarks TEXT,
|
||||
MasterThresholdIsActive BOOLEAN DEFAULT TRUE,
|
||||
MasterThresholdCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
MasterThresholdCreatedUserID INT,
|
||||
MasterThresholdUpdatedAt DATETIME,
|
||||
MasterThresholdUpdatedUserID INT,
|
||||
MasterThresholdDeletedAt DATETIME,
|
||||
MasterThresholdDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Tabel Master Pelanggan
|
||||
CREATE TABLE master_pelanggan (
|
||||
pelanggan_id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
kode_pelanggan VARCHAR(50) NOT NULL,
|
||||
nama_pelanggan VARCHAR(200) NOT NULL,
|
||||
alamat TEXT,
|
||||
kota VARCHAR(100),
|
||||
provinsi VARCHAR(100),
|
||||
kode_pos VARCHAR(20),
|
||||
no_telepon VARCHAR(50),
|
||||
email VARCHAR(100),
|
||||
contact_person VARCHAR(100),
|
||||
jabatan_contact VARCHAR(100),
|
||||
bidang_usaha VARCHAR(100),
|
||||
is_active BOOLEAN DEFAULT TRUE,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
|
||||
CREATE TABLE master_customers (
|
||||
MasterCustomerID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
MasterCustomerCode VARCHAR(50) NOT NULL,
|
||||
MasterCustomerName VARCHAR(200) NOT NULL,
|
||||
MasterCustomerAddress TEXT,
|
||||
MasterCustomerCity VARCHAR(100),
|
||||
MasterCustomerProvince VARCHAR(100),
|
||||
MasterCustomerPostalCode VARCHAR(20),
|
||||
MasterCustomerPhone VARCHAR(50),
|
||||
MasterCustomerEmail VARCHAR(100),
|
||||
MasterCustomerContactPerson VARCHAR(100),
|
||||
MasterCustomerContactPosition VARCHAR(100),
|
||||
MasterCustomerBusinessField VARCHAR(100),
|
||||
MasterCustomerIsActive BOOLEAN DEFAULT TRUE,
|
||||
MasterCustomerCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
MasterCustomerCreatedUserID INT,
|
||||
MasterCustomerUpdatedAt DATETIME,
|
||||
MasterCustomerUpdatedUserID INT,
|
||||
MasterCustomerDeletedAt DATETIME,
|
||||
MasterCustomerDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Tabel Master Personel (Petugas Sampling, Analis, dll)
|
||||
CREATE TABLE master_personel (
|
||||
personel_id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
nik VARCHAR(50) NOT NULL,
|
||||
nama VARCHAR(100) NOT NULL,
|
||||
jabatan VARCHAR(100),
|
||||
departemen VARCHAR(100),
|
||||
email VARCHAR(100),
|
||||
no_telepon VARCHAR(50),
|
||||
sertifikasi TEXT,
|
||||
is_active BOOLEAN DEFAULT TRUE,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
|
||||
-- Tabel Master Personel
|
||||
CREATE TABLE master_personnel (
|
||||
MasterPersonnelID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
MasterPersonnelNIK VARCHAR(50) NOT NULL,
|
||||
MasterPersonnelName VARCHAR(100) NOT NULL,
|
||||
MasterPersonnelPosition VARCHAR(100),
|
||||
MasterPersonnelDepartment VARCHAR(100),
|
||||
MasterPersonnelEmail VARCHAR(100),
|
||||
MasterPersonnelPhone VARCHAR(50),
|
||||
MasterPersonnelCertification TEXT,
|
||||
MasterPersonnelIsActive BOOLEAN DEFAULT TRUE,
|
||||
MasterPersonnelCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
MasterPersonnelCreatedUserID INT,
|
||||
MasterPersonnelUpdatedAt DATETIME,
|
||||
MasterPersonnelUpdatedUserID INT,
|
||||
MasterPersonnelDeletedAt DATETIME,
|
||||
MasterPersonnelDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Tabel Master Peralatan Pengukuran
|
||||
CREATE TABLE master_peralatan (
|
||||
peralatan_id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
kode_peralatan VARCHAR(50) NOT NULL,
|
||||
nama_peralatan VARCHAR(100) NOT NULL,
|
||||
merk VARCHAR(100),
|
||||
model VARCHAR(100),
|
||||
nomor_seri VARCHAR(100),
|
||||
tanggal_kalibrasi DATE,
|
||||
tanggal_kalibrasi_selanjutnya DATE,
|
||||
parameter_id INT,
|
||||
spesifikasi TEXT,
|
||||
is_active BOOLEAN DEFAULT TRUE,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (parameter_id) REFERENCES master_parameter(parameter_id)
|
||||
-- Tabel Master Peralatan
|
||||
CREATE TABLE master_equipment (
|
||||
MasterEquipmentID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
MasterEquipmentCode VARCHAR(50) NOT NULL,
|
||||
MasterEquipmentName VARCHAR(100) NOT NULL,
|
||||
MasterEquipmentBrand VARCHAR(100),
|
||||
MasterEquipmentModel VARCHAR(100),
|
||||
MasterEquipmentSerialNumber VARCHAR(100),
|
||||
MasterEquipmentCalibrationDate DATE,
|
||||
MasterEquipmentNextCalibrationDate DATE,
|
||||
MasterParameterID INT,
|
||||
MasterEquipmentSpecification TEXT,
|
||||
MasterEquipmentIsActive BOOLEAN DEFAULT TRUE,
|
||||
MasterEquipmentCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
MasterEquipmentCreatedUserID INT,
|
||||
MasterEquipmentUpdatedAt DATETIME,
|
||||
MasterEquipmentUpdatedUserID INT,
|
||||
MasterEquipmentDeletedAt DATETIME,
|
||||
MasterEquipmentDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Tabel Master Lokasi Sampling
|
||||
CREATE TABLE master_lokasi_sampling (
|
||||
lokasi_id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
pelanggan_id INT,
|
||||
nama_lokasi VARCHAR(200) NOT NULL,
|
||||
alamat TEXT,
|
||||
koordinat_latitude DECIMAL(10, 8),
|
||||
koordinat_longitude DECIMAL(11, 8),
|
||||
jenis_ruangan VARCHAR(100),
|
||||
deskripsi TEXT,
|
||||
is_active BOOLEAN DEFAULT TRUE,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (pelanggan_id) REFERENCES master_pelanggan(pelanggan_id)
|
||||
CREATE TABLE master_sampling_locations (
|
||||
MasterSamplingLocationID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
MasterCustomerID INT,
|
||||
MasterSamplingLocationName VARCHAR(200) NOT NULL,
|
||||
MasterSamplingLocationAddress TEXT,
|
||||
MasterSamplingLocationLatitude DECIMAL(10,8),
|
||||
MasterSamplingLocationLongitude DECIMAL(11,8),
|
||||
MasterSamplingLocationRoomType VARCHAR(100),
|
||||
MasterSamplingLocationDescription TEXT,
|
||||
MasterSamplingLocationIsActive BOOLEAN DEFAULT TRUE,
|
||||
MasterSamplingLocationCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
MasterSamplingLocationCreatedUserID INT,
|
||||
MasterSamplingLocationUpdatedAt DATETIME,
|
||||
MasterSamplingLocationUpdatedUserID INT,
|
||||
MasterSamplingLocationDeletedAt DATETIME,
|
||||
MasterSamplingLocationDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Tabel Permintaan Pengukuran (Form Request)
|
||||
CREATE TABLE permintaan_pengukuran (
|
||||
permintaan_id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
nomor_permintaan VARCHAR(50) NOT NULL,
|
||||
pelanggan_id INT,
|
||||
tanggal_permintaan DATE,
|
||||
tanggal_rencana_sampling DATE,
|
||||
contact_person VARCHAR(100),
|
||||
status VARCHAR(50), -- draft, submitted, approved, scheduled, completed, canceled
|
||||
catatan TEXT,
|
||||
dibuat_oleh INT,
|
||||
disetujui_oleh INT,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (pelanggan_id) REFERENCES master_pelanggan(pelanggan_id),
|
||||
FOREIGN KEY (dibuat_oleh) REFERENCES master_personel(personel_id),
|
||||
FOREIGN KEY (disetujui_oleh) REFERENCES master_personel(personel_id)
|
||||
-- Transaction Tables
|
||||
|
||||
-- Tabel Permintaan Pengukuran
|
||||
CREATE TABLE measurement_requests (
|
||||
MeasurementRequestID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
MeasurementRequestNumber VARCHAR(50) NOT NULL,
|
||||
MasterCustomerID INT,
|
||||
MeasurementRequestDate DATE,
|
||||
MeasurementRequestPlanDate DATE,
|
||||
MeasurementRequestContactPerson VARCHAR(100),
|
||||
MeasurementRequestStatus VARCHAR(50),
|
||||
MeasurementRequestNotes TEXT,
|
||||
MeasurementRequestCreatedBy INT,
|
||||
MeasurementRequestApprovedBy INT,
|
||||
MeasurementRequestCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
MeasurementRequestCreatedUserID INT,
|
||||
MeasurementRequestUpdatedAt DATETIME,
|
||||
MeasurementRequestUpdatedUserID INT,
|
||||
MeasurementRequestDeletedAt DATETIME,
|
||||
MeasurementRequestDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Tabel Detail Permintaan Pengukuran
|
||||
CREATE TABLE detail_permintaan_pengukuran (
|
||||
detail_permintaan_id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
permintaan_id INT,
|
||||
parameter_id INT,
|
||||
lokasi_id INT,
|
||||
jumlah_titik INT DEFAULT 1,
|
||||
harga_satuan DECIMAL(12, 2),
|
||||
subtotal DECIMAL(12, 2),
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (permintaan_id) REFERENCES permintaan_pengukuran(permintaan_id),
|
||||
FOREIGN KEY (parameter_id) REFERENCES master_parameter(parameter_id),
|
||||
FOREIGN KEY (lokasi_id) REFERENCES master_lokasi_sampling(lokasi_id)
|
||||
CREATE TABLE measurement_request_details (
|
||||
MeasurementRequestDetailID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
MeasurementRequestID INT,
|
||||
MasterParameterID INT,
|
||||
MasterSamplingLocationID INT,
|
||||
MeasurementRequestDetailPointCount INT DEFAULT 1,
|
||||
MeasurementRequestDetailUnitPrice DECIMAL(12,2),
|
||||
MeasurementRequestDetailSubtotal DECIMAL(12,2),
|
||||
MeasurementRequestDetailCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
MeasurementRequestDetailCreatedUserID INT,
|
||||
MeasurementRequestDetailUpdatedAt DATETIME,
|
||||
MeasurementRequestDetailUpdatedUserID INT,
|
||||
MeasurementRequestDetailDeletedAt DATETIME,
|
||||
MeasurementRequestDetailDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Tabel Jadwal Pengukuran
|
||||
CREATE TABLE jadwal_pengukuran (
|
||||
jadwal_id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
nomor_jadwal VARCHAR(50) NOT NULL,
|
||||
permintaan_id INT,
|
||||
tanggal_pengukuran DATE,
|
||||
petugas_id INT,
|
||||
status VARCHAR(50), -- scheduled, completed, rescheduled, canceled
|
||||
catatan TEXT,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (permintaan_id) REFERENCES permintaan_pengukuran(permintaan_id),
|
||||
FOREIGN KEY (petugas_id) REFERENCES master_personel(personel_id)
|
||||
CREATE TABLE measurement_schedules (
|
||||
MeasurementScheduleID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
MeasurementScheduleNumber VARCHAR(50) NOT NULL,
|
||||
MeasurementRequestID INT,
|
||||
MeasurementScheduleDate DATE,
|
||||
MasterPersonnelID INT,
|
||||
MeasurementScheduleStatus VARCHAR(50),
|
||||
MeasurementScheduleNotes TEXT,
|
||||
MeasurementScheduleCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
MeasurementScheduleCreatedUserID INT,
|
||||
MeasurementScheduleUpdatedAt DATETIME,
|
||||
MeasurementScheduleUpdatedUserID INT,
|
||||
MeasurementScheduleDeletedAt DATETIME,
|
||||
MeasurementScheduleDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Tabel Laporan Hasil Uji Iklim Kerja
|
||||
CREATE TABLE laporan_hasil_uji (
|
||||
laporan_id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
nomor_laporan VARCHAR(50) NOT NULL,
|
||||
permintaan_id INT,
|
||||
jadwal_id INT,
|
||||
tanggal_pengukuran DATE,
|
||||
tanggal_terbit DATE,
|
||||
pelanggan_id INT,
|
||||
petugas_id INT,
|
||||
diverifikasi_oleh INT,
|
||||
disetujui_oleh INT,
|
||||
status VARCHAR(50), -- draft, verification, approved, published, revised
|
||||
halaman_jumlah INT DEFAULT 1,
|
||||
catatan TEXT,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (permintaan_id) REFERENCES permintaan_pengukuran(permintaan_id),
|
||||
FOREIGN KEY (jadwal_id) REFERENCES jadwal_pengukuran(jadwal_id),
|
||||
FOREIGN KEY (pelanggan_id) REFERENCES master_pelanggan(pelanggan_id),
|
||||
FOREIGN KEY (petugas_id) REFERENCES master_personel(personel_id),
|
||||
FOREIGN KEY (diverifikasi_oleh) REFERENCES master_personel(personel_id),
|
||||
FOREIGN KEY (disetujui_oleh) REFERENCES master_personel(personel_id)
|
||||
-- Tabel Laporan Hasil Uji
|
||||
CREATE TABLE test_reports (
|
||||
TestReportID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
TestReportNumber VARCHAR(50) NOT NULL,
|
||||
MeasurementRequestID INT,
|
||||
MeasurementScheduleID INT,
|
||||
TestReportMeasurementDate DATE,
|
||||
TestReportIssueDate DATE,
|
||||
MasterCustomerID INT,
|
||||
MasterPersonnelID INT,
|
||||
TestReportVerifiedBy INT,
|
||||
TestReportApprovedBy INT,
|
||||
TestReportStatus VARCHAR(50),
|
||||
TestReportPageCount INT DEFAULT 1,
|
||||
TestReportNotes TEXT,
|
||||
TestReportCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
TestReportCreatedUserID INT,
|
||||
TestReportUpdatedAt DATETIME,
|
||||
TestReportUpdatedUserID INT,
|
||||
TestReportDeletedAt DATETIME,
|
||||
TestReportDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Tabel Detail Hasil Pengukuran Iklim Kerja Suhu
|
||||
CREATE TABLE hasil_pengukuran_suhu (
|
||||
hasil_id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
laporan_id INT,
|
||||
lokasi_id INT,
|
||||
kode_sampel VARCHAR(50) NOT NULL,
|
||||
waktu_pengukuran_mulai TIME,
|
||||
waktu_pengukuran_selesai TIME,
|
||||
parameter_id INT,
|
||||
hasil_pengukuran DECIMAL(8, 2),
|
||||
satuan VARCHAR(20),
|
||||
metode VARCHAR(100),
|
||||
nab_id INT,
|
||||
keterangan TEXT,
|
||||
peralatan_id INT,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (laporan_id) REFERENCES laporan_hasil_uji(laporan_id),
|
||||
FOREIGN KEY (lokasi_id) REFERENCES master_lokasi_sampling(lokasi_id),
|
||||
FOREIGN KEY (parameter_id) REFERENCES master_parameter(parameter_id),
|
||||
FOREIGN KEY (nab_id) REFERENCES master_nilai_ambang_batas(nab_id),
|
||||
FOREIGN KEY (peralatan_id) REFERENCES master_peralatan(peralatan_id)
|
||||
-- Tabel Hasil Pengukuran Suhu
|
||||
CREATE TABLE temperature_measurements (
|
||||
TemperatureMeasurementID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
TestReportID INT,
|
||||
MasterSamplingLocationID INT,
|
||||
TemperatureMeasurementCode VARCHAR(50) NOT NULL,
|
||||
TemperatureMeasurementStartTime TIME,
|
||||
TemperatureMeasurementEndTime TIME,
|
||||
MasterParameterID INT,
|
||||
TemperatureMeasurementValue DECIMAL(8,2),
|
||||
TemperatureMeasurementUnit VARCHAR(20),
|
||||
TemperatureMeasurementMethod VARCHAR(100),
|
||||
MasterThresholdID INT,
|
||||
TemperatureMeasurementRemarks TEXT,
|
||||
MasterEquipmentID INT,
|
||||
TemperatureMeasurementCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
TemperatureMeasurementCreatedUserID INT,
|
||||
TemperatureMeasurementUpdatedAt DATETIME,
|
||||
TemperatureMeasurementUpdatedUserID INT,
|
||||
TemperatureMeasurementDeletedAt DATETIME,
|
||||
TemperatureMeasurementDeletedUserID INT
|
||||
);
|
||||
|
||||
-- ================================
|
||||
@@ -220,19 +249,19 @@ CREATE TABLE hasil_pengukuran_suhu (
|
||||
-- ================================
|
||||
|
||||
-- Insert Master Regulasi
|
||||
INSERT INTO master_regulasi (regulasi_id, kode_regulasi, nama_regulasi, instansi_penerbit, tahun_terbit, tanggal_berlaku, deskripsi, file_path, is_active) VALUES
|
||||
INSERT INTO master_regulations (MasterRegulationID, MasterRegulationCode, MasterRegulationName, MasterRegulationIssuer, MasterRegulationYear, MasterRegulationEffectiveDate, MasterRegulationDescription, MasterRegulationFilePath, MasterRegulationIsActive) VALUES
|
||||
(1, 'PMK-02-2023', 'Peraturan Menteri Kesehatan Republik Indonesia Nomor 2 Tahun 2023', 'Kementerian Kesehatan RI', 2023, '2023-02-01', 'Peraturan mengenai Standar Baku Mutu Kesehatan Lingkungan dan Persyaratan Kesehatan', '/documents/regulasi/PMK_02_2023.pdf', TRUE),
|
||||
(2, 'PERMENAKER-05-2018', 'Peraturan Menteri Ketenagakerjaan Republik Indonesia Nomor 5 Tahun 2018', 'Kementerian Ketenagakerjaan RI', 2018, '2018-05-10', 'Peraturan mengenai Keselamatan dan Kesehatan Kerja Lingkungan Kerja', '/documents/regulasi/PERMENAKER_05_2018.pdf', TRUE);
|
||||
|
||||
-- Insert Master Parameter
|
||||
INSERT INTO master_parameter (parameter_id, kode_parameter, nama_parameter, kelompok_parameter, satuan, metode_analisis, deskripsi, harga, is_active) VALUES
|
||||
INSERT INTO master_parameters (MasterParameterID, MasterParameterCode, MasterParameterName, MasterParameterGroup, MasterParameterUnit, MasterParameterMethod, MasterParameterDescription, MasterParameterPrice, MasterParameterIsActive) VALUES
|
||||
(1, 'SUHU', 'Suhu', 'Fisika', '°C', 'SNI 7062: 2019', 'Parameter iklim kerja untuk pengukuran suhu ruangan', 75000.00, TRUE),
|
||||
(2, 'KELEMBABAN', 'Kelembaban', 'Fisika', '%RH', 'SNI 7062: 2019', 'Parameter iklim kerja untuk pengukuran kelembaban relatif', 75000.00, TRUE),
|
||||
(3, 'ISBB', 'Indeks Suhu Basah dan Bola', 'Fisika', '°C', 'SNI 7062: 2019', 'Parameter iklim kerja untuk pengukuran ISBB indoor/outdoor', 100000.00, TRUE),
|
||||
(4, 'KECUDARA', 'Kecepatan Aliran Udara', 'Fisika', 'm/s', 'SNI 7062: 2019', 'Parameter iklim kerja untuk pengukuran kecepatan aliran udara', 75000.00, TRUE);
|
||||
|
||||
-- Insert Master Nilai Ambang Batas untuk Parameter Suhu
|
||||
INSERT INTO master_nilai_ambang_batas (nab_id, regulasi_id, parameter_id, tipe_ruangan, nilai_minimal, nilai_maksimal, satuan, keterangan, is_active) VALUES
|
||||
INSERT INTO master_thresholds (MasterThresholdID, MasterRegulationID, MasterParameterID, MasterThresholdRoomType, MasterThresholdMinValue, MasterThresholdMaxValue, MasterThresholdUnit, MasterThresholdRemarks, MasterThresholdIsActive) VALUES
|
||||
(1, 1, 1, 'Administrasi', 20.00, 25.00, '°C', 'Ruang kerja administrasi dan perkantoran', TRUE),
|
||||
(2, 1, 1, 'Ruangan Khusus', 18.00, 24.00, '°C', 'Ruang server, laboratorium, dll', TRUE),
|
||||
(3, 1, 1, 'Produksi', 23.00, 26.00, '°C', 'Ruang produksi', TRUE),
|
||||
@@ -241,43 +270,43 @@ INSERT INTO master_nilai_ambang_batas (nab_id, regulasi_id, parameter_id, tipe_r
|
||||
(6, 1, 1, 'Gudang', 16.00, 30.00, '°C', 'Ruang penyimpanan, gudang', TRUE);
|
||||
|
||||
-- Insert Master Pelanggan
|
||||
INSERT INTO master_pelanggan (pelanggan_id, kode_pelanggan, nama_pelanggan, alamat, kota, provinsi, kode_pos, no_telepon, email, contact_person, jabatan_contact, bidang_usaha, is_active) VALUES
|
||||
INSERT INTO master_customers (MasterCustomerID, MasterCustomerCode, MasterCustomerName, MasterCustomerAddress, MasterCustomerCity, MasterCustomerProvince, MasterCustomerPostalCode, MasterCustomerPhone, MasterCustomerEmail, MasterCustomerContactPerson, MasterCustomerContactPosition, MasterCustomerBusinessField, MasterCustomerIsActive) VALUES
|
||||
(1, 'PLG-001', 'PT. Industri Manufaktur Indonesia', 'Jl. Industri Raya No. 123', 'Jakarta', 'DKI Jakarta', '12950', '021-5551234', 'contact@manufakturindonesia.com', 'Budi Santoso', 'HSE Manager', 'Manufaktur', TRUE),
|
||||
(2, 'PLG-002', 'PT. Teknologi Digital Nusantara', 'Jl. Gatot Subroto Kav. 52-53', 'Jakarta', 'DKI Jakarta', '12710', '021-5552345', 'hrd@tdn.co.id', 'Siti Rahma', 'HR Director', 'Teknologi Informasi', TRUE),
|
||||
(3, 'PLG-003', 'RSUD Kota Sehat', 'Jl. Kesehatan No. 45', 'Bandung', 'Jawa Barat', '40112', '022-7654321', 'info@rsudkotasehat.go.id', 'dr. Ahmad Hidayat', 'Direktur', 'Kesehatan', TRUE);
|
||||
|
||||
-- Insert Master Personel
|
||||
INSERT INTO master_personel (personel_id, nik, nama, jabatan, departemen, email, no_telepon, sertifikasi, is_active) VALUES
|
||||
INSERT INTO master_personnel (MasterPersonnelID, MasterPersonnelNIK, MasterPersonnelName, MasterPersonnelPosition, MasterPersonnelDepartment, MasterPersonnelEmail, MasterPersonnelPhone, MasterPersonnelCertification, MasterPersonnelIsActive) VALUES
|
||||
(1, 'EMP-001', 'Hendra Wijaya', 'Supervisor Pengujian', 'Laboratorium', 'hendra@lab-env.co.id', '081234567890', 'Sertifikasi Pengambilan Contoh Uji Lingkungan Kerja', TRUE),
|
||||
(2, 'EMP-002', 'Ratna Dewi', 'Analis Senior', 'Laboratorium', 'ratna@lab-env.co.id', '081234567891', 'Sertifikasi Analis Laboratorium, Ahli K3 Umum', TRUE),
|
||||
(3, 'EMP-003', 'Deni Hermawan', 'Petugas Sampling', 'Laboratorium', 'deni@lab-env.co.id', '081234567892', 'Sertifikasi Pengambilan Contoh Uji', TRUE),
|
||||
(4, 'EMP-004', 'Farida Nurhasanah', 'Manager Laboratorium', 'Laboratorium', 'farida@lab-env.co.id', '081234567893', 'Sertifikasi Manager Mutu, Sertifikasi Ahli K3', TRUE);
|
||||
|
||||
-- Insert Master Peralatan Pengukuran
|
||||
INSERT INTO master_peralatan (peralatan_id, kode_peralatan, nama_peralatan, merk, model, nomor_seri, tanggal_kalibrasi, tanggal_kalibrasi_selanjutnya, parameter_id, spesifikasi, is_active) VALUES
|
||||
-- Insert Master Peralatan
|
||||
INSERT INTO master_equipment (MasterEquipmentID, MasterEquipmentCode, MasterEquipmentName, MasterEquipmentBrand, MasterEquipmentModel, MasterEquipmentSerialNumber, MasterEquipmentCalibrationDate, MasterEquipmentNextCalibrationDate, MasterParameterID, MasterEquipmentSpecification, MasterEquipmentIsActive) VALUES
|
||||
(1, 'EQP-TH001', 'Thermohygrometer', 'Lutron', 'PHB-318', 'LT12345678', '2023-11-10', '2024-05-10', 1, 'Range suhu: -20°C hingga 60°C, akurasi ±0.8°C', TRUE),
|
||||
(2, 'EQP-TH002', 'Thermohygrometer', 'Extech', 'RHT50', 'EX87654321', '2023-10-15', '2024-04-15', 1, 'Range suhu: -30°C hingga 70°C, akurasi ±0.5°C', TRUE),
|
||||
(3, 'EQP-WBGT001', 'WBGT Meter', 'Lutron', 'WBGT-2010SD', 'LW12348765', '2023-11-05', '2024-05-05', 3, 'Range WBGT: 15°C hingga 59°C, akurasi ±0.8°C', TRUE),
|
||||
(4, 'EQP-ANM001', 'Anemometer', 'Lutron', 'AM-4214SD', 'LA23456789', '2023-09-20', '2024-03-20', 4, 'Range kecepatan udara: 0.2 m/s hingga 35 m/s, akurasi ±2%', TRUE);
|
||||
|
||||
-- Insert Master Lokasi Sampling untuk PT. Industri Manufaktur Indonesia
|
||||
INSERT INTO master_lokasi_sampling (lokasi_id, pelanggan_id, nama_lokasi, alamat, jenis_ruangan, deskripsi, is_active) VALUES
|
||||
(1, 1, 'Ruang Meeting Utama', 'Lantai 2, Gedung Utama', 'Administrasi', 'Ruang meeting dengan kapasitas 20 orang', TRUE),
|
||||
(2, 1, 'Ruang Kerja HRD', 'Lantai 2, Gedung Utama', 'Administrasi', 'Ruang kerja staff HRD', TRUE),
|
||||
(3, 1, 'Ruang Server', 'Lantai 1, Gedung Utama', 'Ruangan Khusus', 'Ruang server dengan pendingin khusus', TRUE),
|
||||
(4, 1, 'Area Produksi Line A', 'Lantai 1, Gedung Produksi', 'Produksi', 'Area produksi utama line A', TRUE),
|
||||
(5, 1, 'Area Kantin', 'Lantai 1, Gedung Pendukung', 'Ruang Umum', 'Kantin karyawan dengan kapasitas 100 orang', TRUE);
|
||||
INSERT INTO master_sampling_locations (MasterSamplingLocationID, MasterCustomerID, MasterSamplingLocationName, MasterSamplingLocationAddress, MasterSamplingLocationLatitude, MasterSamplingLocationLongitude, MasterSamplingLocationRoomType, MasterSamplingLocationDescription, MasterSamplingLocationIsActive) VALUES
|
||||
(1, 1, 'Ruang Meeting Utama', 'Lantai 2, Gedung Utama', 0.00000000, 0.00000000, 'Administrasi', 'Ruang meeting dengan kapasitas 20 orang', TRUE),
|
||||
(2, 1, 'Ruang Kerja HRD', 'Lantai 2, Gedung Utama', 0.00000000, 0.00000000, 'Administrasi', 'Ruang kerja staff HRD', TRUE),
|
||||
(3, 1, 'Ruang Server', 'Lantai 1, Gedung Utama', 0.00000000, 0.00000000, 'Ruangan Khusus', 'Ruang server dengan pendingin khusus', TRUE),
|
||||
(4, 1, 'Area Produksi Line A', 'Lantai 1, Gedung Produksi', 0.00000000, 0.00000000, 'Produksi', 'Area produksi utama line A', TRUE),
|
||||
(5, 1, 'Area Kantin', 'Lantai 1, Gedung Pendukung', 0.00000000, 0.00000000, 'Ruang Umum', 'Kantin karyawan dengan kapasitas 100 orang', TRUE);
|
||||
|
||||
-- ================================
|
||||
-- CONTOH DATA TRANSAKSI
|
||||
-- ================================
|
||||
|
||||
-- Contoh Permintaan Pengukuran
|
||||
INSERT INTO permintaan_pengukuran (permintaan_id, nomor_permintaan, pelanggan_id, tanggal_permintaan, tanggal_rencana_sampling, contact_person, status, catatan, dibuat_oleh, disetujui_oleh) VALUES
|
||||
INSERT INTO measurement_requests (MeasurementRequestID, MeasurementRequestNumber, MasterCustomerID, MeasurementRequestDate, MeasurementRequestPlanDate, MeasurementRequestContactPerson, MeasurementRequestStatus, MeasurementRequestNotes, MeasurementRequestCreatedBy, MeasurementRequestApprovedBy) VALUES
|
||||
(1, 'REQ/2024/04/001', 1, '2024-04-05', '2024-04-25', 'Budi Santoso', 'approved', 'Pengukuran rutin triwulanan untuk parameter iklim kerja', 3, 4);
|
||||
|
||||
-- Contoh Detail Permintaan Pengukuran
|
||||
INSERT INTO detail_permintaan_pengukuran (detail_permintaan_id, permintaan_id, parameter_id, lokasi_id, jumlah_titik, harga_satuan, subtotal) VALUES
|
||||
INSERT INTO measurement_request_details (MeasurementRequestDetailID, MeasurementRequestID, MasterParameterID, MasterSamplingLocationID, MeasurementRequestDetailPointCount, MeasurementRequestDetailUnitPrice, MeasurementRequestDetailSubtotal) VALUES
|
||||
(1, 1, 1, 1, 1, 75000.00, 75000.00),
|
||||
(2, 1, 1, 2, 1, 75000.00, 75000.00),
|
||||
(3, 1, 1, 3, 1, 75000.00, 75000.00),
|
||||
@@ -285,15 +314,15 @@ INSERT INTO detail_permintaan_pengukuran (detail_permintaan_id, permintaan_id, p
|
||||
(5, 1, 1, 5, 1, 75000.00, 75000.00);
|
||||
|
||||
-- Contoh Jadwal Pengukuran
|
||||
INSERT INTO jadwal_pengukuran (jadwal_id, nomor_jadwal, permintaan_id, tanggal_pengukuran, petugas_id, status, catatan) VALUES
|
||||
INSERT INTO measurement_schedules (MeasurementScheduleID, MeasurementScheduleNumber, MeasurementRequestID, MeasurementScheduleDate, MasterPersonnelID, MeasurementScheduleStatus, MeasurementScheduleNotes) VALUES
|
||||
(1, 'SCH/2024/04/001', 1, '2024-04-25', 3, 'completed', 'Pengukuran dilakukan pada jam operasional normal');
|
||||
|
||||
-- Contoh Laporan Hasil Uji
|
||||
INSERT INTO laporan_hasil_uji (laporan_id, nomor_laporan, permintaan_id, jadwal_id, tanggal_pengukuran, tanggal_terbit, pelanggan_id, petugas_id, diverifikasi_oleh, disetujui_oleh, status, halaman_jumlah, catatan) VALUES
|
||||
INSERT INTO test_reports (TestReportID, TestReportNumber, MeasurementRequestID, MeasurementScheduleID, TestReportMeasurementDate, TestReportIssueDate, MasterCustomerID, MasterPersonnelID, TestReportVerifiedBy, TestReportApprovedBy, TestReportStatus, TestReportPageCount, TestReportNotes) VALUES
|
||||
(1, 'LHU/KLIM/04/2024/001', 1, 1, '2024-04-25', '2024-04-28', 1, 3, 2, 4, 'published', 2, 'Hasil pengukuran menunjukkan semua parameter dalam batas normal');
|
||||
|
||||
-- Contoh Hasil Pengukuran Suhu
|
||||
INSERT INTO hasil_pengukuran_suhu (hasil_id, laporan_id, lokasi_id, kode_sampel, waktu_pengukuran_mulai, waktu_pengukuran_selesai, parameter_id, hasil_pengukuran, satuan, metode, nab_id, keterangan, peralatan_id) VALUES
|
||||
INSERT INTO temperature_measurements (TemperatureMeasurementID, TestReportID, MasterSamplingLocationID, TemperatureMeasurementCode, TemperatureMeasurementStartTime, TemperatureMeasurementEndTime, MasterParameterID, TemperatureMeasurementValue, TemperatureMeasurementUnit, TemperatureMeasurementMethod, MasterThresholdID, TemperatureMeasurementRemarks, MasterEquipmentID) VALUES
|
||||
(1, 1, 1, 'C2504090001', '09:00:00', '09:15:00', 1, 21.00, '°C', 'SNI 7062: 2019', 1, NULL, 1),
|
||||
(2, 1, 2, 'C2504090002', '09:30:00', '09:45:00', 1, 22.00, '°C', 'SNI 7062: 2019', 1, NULL, 1),
|
||||
(3, 1, 3, 'C2504090003', '10:00:00', '10:15:00', 1, 19.00, '°C', 'SNI 7062: 2019', 2, NULL, 1),
|
||||
|
||||
@@ -5,107 +5,122 @@
|
||||
-- Master Tables - ISBB Specific
|
||||
-- ------------------------------------------------------------------------------
|
||||
|
||||
-- Master Kategori Beban Kerja (Work Load Categories)
|
||||
CREATE TABLE IF NOT EXISTS master_kategori_beban_kerja (
|
||||
id_kategori INT PRIMARY KEY,
|
||||
nama_kategori VARCHAR(50) NOT NULL,
|
||||
keterangan TEXT,
|
||||
kisaran_energi VARCHAR(50),
|
||||
contoh_aktivitas TEXT,
|
||||
status BOOLEAN DEFAULT TRUE,
|
||||
tanggal_input TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
user_input VARCHAR(50)
|
||||
-- Master Kategori Beban Kerja
|
||||
CREATE TABLE IF NOT EXISTS master_workload_categories (
|
||||
MasterWorkloadCategoryID INT PRIMARY KEY,
|
||||
MasterWorkloadCategoryName VARCHAR(50) NOT NULL,
|
||||
MasterWorkloadCategoryDescription TEXT,
|
||||
MasterWorkloadCategoryEnergyRange VARCHAR(50),
|
||||
MasterWorkloadCategoryActivityExamples TEXT,
|
||||
MasterWorkloadCategoryIsActive BOOLEAN DEFAULT TRUE,
|
||||
MasterWorkloadCategoryCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
MasterWorkloadCategoryCreatedUserID INT,
|
||||
MasterWorkloadCategoryUpdatedAt DATETIME,
|
||||
MasterWorkloadCategoryUpdatedUserID INT,
|
||||
MasterWorkloadCategoryDeletedAt DATETIME,
|
||||
MasterWorkloadCategoryDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Master Alokasi Kerja-Istirahat (Work-Rest Allocation)
|
||||
CREATE TABLE IF NOT EXISTS master_alokasi_kerja_istirahat (
|
||||
id_alokasi INT PRIMARY KEY,
|
||||
nama_alokasi VARCHAR(50) NOT NULL,
|
||||
persentase_kerja VARCHAR(20) NOT NULL,
|
||||
persentase_istirahat VARCHAR(20) NOT NULL,
|
||||
keterangan TEXT,
|
||||
status BOOLEAN DEFAULT TRUE,
|
||||
tanggal_input TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
user_input VARCHAR(50)
|
||||
-- Master Alokasi Kerja-Istirahat
|
||||
CREATE TABLE IF NOT EXISTS master_work_rest_allocations (
|
||||
MasterWorkRestAllocationID INT PRIMARY KEY,
|
||||
MasterWorkRestAllocationName VARCHAR(50) NOT NULL,
|
||||
MasterWorkRestAllocationWorkPercentage VARCHAR(20) NOT NULL,
|
||||
MasterWorkRestAllocationRestPercentage VARCHAR(20) NOT NULL,
|
||||
MasterWorkRestAllocationDescription TEXT,
|
||||
MasterWorkRestAllocationIsActive BOOLEAN DEFAULT TRUE,
|
||||
MasterWorkRestAllocationCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
MasterWorkRestAllocationCreatedUserID INT,
|
||||
MasterWorkRestAllocationUpdatedAt DATETIME,
|
||||
MasterWorkRestAllocationUpdatedUserID INT,
|
||||
MasterWorkRestAllocationDeletedAt DATETIME,
|
||||
MasterWorkRestAllocationDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Master Baku Mutu ISBB (WBGT Standard Values)
|
||||
CREATE TABLE IF NOT EXISTS master_bakumutu_isbb (
|
||||
id_bakumutu_isbb INT PRIMARY KEY,
|
||||
id_regulasi INT NOT NULL,
|
||||
id_kategori INT NOT NULL,
|
||||
id_alokasi INT NOT NULL,
|
||||
nilai_baku_mutu DECIMAL(5, 2) NOT NULL,
|
||||
keterangan TEXT,
|
||||
status BOOLEAN DEFAULT TRUE,
|
||||
tanggal_input TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
user_input VARCHAR(50),
|
||||
FOREIGN KEY (id_regulasi) REFERENCES master_regulasi(id_regulasi),
|
||||
FOREIGN KEY (id_kategori) REFERENCES master_kategori_beban_kerja(id_kategori),
|
||||
FOREIGN KEY (id_alokasi) REFERENCES master_alokasi_kerja_istirahat(id_alokasi)
|
||||
-- Master Baku Mutu ISBB
|
||||
CREATE TABLE IF NOT EXISTS master_wbgt_standards (
|
||||
MasterWBGTStandardID INT PRIMARY KEY,
|
||||
MasterRegulationID INT NOT NULL,
|
||||
MasterWorkloadCategoryID INT NOT NULL,
|
||||
MasterWorkRestAllocationID INT NOT NULL,
|
||||
MasterWBGTStandardValue DECIMAL(5,2) NOT NULL,
|
||||
MasterWBGTStandardDescription TEXT,
|
||||
MasterWBGTStandardIsActive BOOLEAN DEFAULT TRUE,
|
||||
MasterWBGTStandardCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
MasterWBGTStandardCreatedUserID INT,
|
||||
MasterWBGTStandardUpdatedAt DATETIME,
|
||||
MasterWBGTStandardUpdatedUserID INT,
|
||||
MasterWBGTStandardDeletedAt DATETIME,
|
||||
MasterWBGTStandardDeletedUserID INT
|
||||
);
|
||||
|
||||
-- ------------------------------------------------------------------------------
|
||||
-- Transaction Tables - ISBB Specific
|
||||
-- ------------------------------------------------------------------------------
|
||||
|
||||
-- Hasil Pengukuran ISBB (WBGT Measurement Results)
|
||||
CREATE TABLE IF NOT EXISTS trx_hasil_ukur_isbb (
|
||||
id_hasil_ukur_isbb INT PRIMARY KEY,
|
||||
id_sampling_plan INT NOT NULL,
|
||||
kode_laporan VARCHAR(50) NOT NULL,
|
||||
tanggal_sampling DATE NOT NULL,
|
||||
waktu_mulai TIME,
|
||||
waktu_selesai TIME,
|
||||
kondisi_cuaca VARCHAR(100),
|
||||
petugas_sampling VARCHAR(100),
|
||||
status_laporan VARCHAR(20) DEFAULT 'DRAFT',
|
||||
catatan TEXT,
|
||||
tanggal_input TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
user_input VARCHAR(50),
|
||||
FOREIGN KEY (id_sampling_plan) REFERENCES trx_sampling_plan_iklim(id_sampling_plan)
|
||||
-- Hasil Pengukuran ISBB
|
||||
CREATE TABLE IF NOT EXISTS wbgt_measurements (
|
||||
WBGTMeasurementID INT PRIMARY KEY,
|
||||
ClimateSamplingPlanID INT NOT NULL,
|
||||
WBGTMeasurementCode VARCHAR(50) NOT NULL,
|
||||
WBGTMeasurementDate DATE NOT NULL,
|
||||
WBGTMeasurementStartTime TIME,
|
||||
WBGTMeasurementEndTime TIME,
|
||||
WBGTMeasurementWeather VARCHAR(100),
|
||||
WBGTMeasurementOfficer VARCHAR(100),
|
||||
WBGTMeasurementStatus VARCHAR(20) DEFAULT 'DRAFT',
|
||||
WBGTMeasurementNotes TEXT,
|
||||
WBGTMeasurementCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
WBGTMeasurementCreatedUserID INT,
|
||||
WBGTMeasurementUpdatedAt DATETIME,
|
||||
WBGTMeasurementUpdatedUserID INT,
|
||||
WBGTMeasurementDeletedAt DATETIME,
|
||||
WBGTMeasurementDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Detail Hasil Pengukuran ISBB (WBGT Measurement Detail)
|
||||
CREATE TABLE IF NOT EXISTS trx_hasil_ukur_isbb_detail (
|
||||
id_hasil_ukur_isbb_detail INT PRIMARY KEY,
|
||||
id_hasil_ukur_isbb INT NOT NULL,
|
||||
kode_titik VARCHAR(20) NOT NULL,
|
||||
nama_lokasi VARCHAR(255) NOT NULL,
|
||||
jenis_pekerjaan VARCHAR(255) NOT NULL,
|
||||
id_kategori INT NOT NULL,
|
||||
id_alokasi INT NOT NULL,
|
||||
suhu_basah DECIMAL(5, 2) NOT NULL, -- natural wet bulb (Tnw)
|
||||
suhu_bola DECIMAL(5, 2) NOT NULL, -- globe temperature (Tg)
|
||||
suhu_kering DECIMAL(5, 2) NOT NULL, -- dry bulb (Ta)
|
||||
nilai_isbb DECIMAL(5, 2) NOT NULL, -- calculated WBGT value
|
||||
id_bakumutu_isbb INT NOT NULL,
|
||||
status_kesesuaian VARCHAR(20),
|
||||
rekomendasi TEXT,
|
||||
lokasi_pengukuran VARCHAR(100),
|
||||
tinggi_pengukuran DECIMAL(4, 2),
|
||||
catatan TEXT,
|
||||
tanggal_input TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
user_input VARCHAR(50),
|
||||
FOREIGN KEY (id_hasil_ukur_isbb) REFERENCES trx_hasil_ukur_isbb(id_hasil_ukur_isbb),
|
||||
FOREIGN KEY (id_kategori) REFERENCES master_kategori_beban_kerja(id_kategori),
|
||||
FOREIGN KEY (id_alokasi) REFERENCES master_alokasi_kerja_istirahat(id_alokasi),
|
||||
FOREIGN KEY (id_bakumutu_isbb) REFERENCES master_bakumutu_isbb(id_bakumutu_isbb)
|
||||
-- Detail Hasil Pengukuran ISBB
|
||||
CREATE TABLE IF NOT EXISTS wbgt_measurement_details (
|
||||
WBGTMeasurementDetailID INT PRIMARY KEY,
|
||||
WBGTMeasurementID INT NOT NULL,
|
||||
WBGTMeasurementDetailPointCode VARCHAR(20) NOT NULL,
|
||||
WBGTMeasurementDetailLocation VARCHAR(255) NOT NULL,
|
||||
WBGTMeasurementDetailWorkType VARCHAR(255) NOT NULL,
|
||||
MasterWorkloadCategoryID INT NOT NULL,
|
||||
MasterWorkRestAllocationID INT NOT NULL,
|
||||
WBGTMeasurementDetailWetTemp DECIMAL(5,2) NOT NULL,
|
||||
WBGTMeasurementDetailGlobeTemp DECIMAL(5,2) NOT NULL,
|
||||
WBGTMeasurementDetailDryTemp DECIMAL(5,2) NOT NULL,
|
||||
WBGTMeasurementDetailWBGTValue DECIMAL(5,2) NOT NULL,
|
||||
MasterWBGTStandardID INT NOT NULL,
|
||||
WBGTMeasurementDetailComplianceStatus VARCHAR(20),
|
||||
WBGTMeasurementDetailRecommendation TEXT,
|
||||
WBGTMeasurementDetailMeasurementLocation VARCHAR(100),
|
||||
WBGTMeasurementDetailMeasurementHeight DECIMAL(4,2),
|
||||
WBGTMeasurementDetailNotes TEXT,
|
||||
WBGTMeasurementDetailCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
WBGTMeasurementDetailCreatedUserID INT,
|
||||
WBGTMeasurementDetailUpdatedAt DATETIME,
|
||||
WBGTMeasurementDetailUpdatedUserID INT,
|
||||
WBGTMeasurementDetailDeletedAt DATETIME,
|
||||
WBGTMeasurementDetailDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Rekomendasi Pengendalian (Control Recommendations)
|
||||
CREATE TABLE IF NOT EXISTS trx_rekomendasi_pengendalian_isbb (
|
||||
id_rekomendasi INT PRIMARY KEY,
|
||||
id_hasil_ukur_isbb_detail INT NOT NULL,
|
||||
jenis_pengendalian VARCHAR(50) NOT NULL,
|
||||
deskripsi_pengendalian TEXT NOT NULL,
|
||||
prioritas INT,
|
||||
estimasi_biaya DECIMAL(12, 2),
|
||||
perkiraan_efektivitas TEXT,
|
||||
status_implementasi VARCHAR(20) DEFAULT 'PLANNED',
|
||||
tanggal_input TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
user_input VARCHAR(50),
|
||||
FOREIGN KEY (id_hasil_ukur_isbb_detail) REFERENCES trx_hasil_ukur_isbb_detail(id_hasil_ukur_isbb_detail)
|
||||
-- Rekomendasi Pengendalian
|
||||
CREATE TABLE IF NOT EXISTS wbgt_control_recommendations (
|
||||
WBGTControlRecommendationID INT PRIMARY KEY,
|
||||
WBGTMeasurementDetailID INT NOT NULL,
|
||||
WBGTControlRecommendationType VARCHAR(50) NOT NULL,
|
||||
WBGTControlRecommendationDescription TEXT NOT NULL,
|
||||
WBGTControlRecommendationPriority INT,
|
||||
WBGTControlRecommendationEstimatedCost DECIMAL(12,2),
|
||||
WBGTControlRecommendationEffectiveness TEXT,
|
||||
WBGTControlRecommendationStatus VARCHAR(20) DEFAULT 'PLANNED',
|
||||
WBGTControlRecommendationCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
WBGTControlRecommendationCreatedUserID INT,
|
||||
WBGTControlRecommendationUpdatedAt DATETIME,
|
||||
WBGTControlRecommendationUpdatedUserID INT,
|
||||
WBGTControlRecommendationDeletedAt DATETIME,
|
||||
WBGTControlRecommendationDeletedUserID INT
|
||||
);
|
||||
|
||||
-- ------------------------------------------------------------------------------
|
||||
@@ -113,40 +128,40 @@ CREATE TABLE IF NOT EXISTS trx_rekomendasi_pengendalian_isbb (
|
||||
-- ------------------------------------------------------------------------------
|
||||
|
||||
-- Insert Data Master Kategori Beban Kerja
|
||||
INSERT INTO master_kategori_beban_kerja (id_kategori, nama_kategori, keterangan, kisaran_energi, contoh_aktivitas, status, user_input)
|
||||
INSERT INTO master_workload_categories (MasterWorkloadCategoryID, MasterWorkloadCategoryName, MasterWorkloadCategoryDescription, MasterWorkloadCategoryEnergyRange, MasterWorkloadCategoryActivityExamples, MasterWorkloadCategoryIsActive, MasterWorkloadCategoryCreatedUserID)
|
||||
VALUES
|
||||
(1, 'Ringan', 'Beban kerja ringan dengan pengeluaran energi minimal', '100-200 Kcal/jam', 'Pekerjaan administratif, kontrol ruangan, pekerjaan perakitan ringan, mengemudi', TRUE, 'admin'),
|
||||
(2, 'Sedang', 'Beban kerja sedang dengan aktivitas fisik moderat', '200-350 Kcal/jam', 'Berjalan normal, mengangkat beban sedang, mendorong atau menarik, perakitan / perbaikan mesin', TRUE, 'admin'),
|
||||
(3, 'Berat', 'Beban kerja berat dengan aktivitas fisik intens', '350-500 Kcal/jam', 'Berjalan cepat/naik tangga, mengangkat beban berat, pekerjaan konstruksi, penggalian, penambangan', TRUE, 'admin');
|
||||
(1, 'Ringan', 'Beban kerja ringan dengan pengeluaran energi minimal', '100-200 Kcal/jam', 'Pekerjaan administratif, kontrol ruangan, pekerjaan perakitan ringan, mengemudi', TRUE, 1),
|
||||
(2, 'Sedang', 'Beban kerja sedang dengan aktivitas fisik moderat', '200-350 Kcal/jam', 'Berjalan normal, mengangkat beban sedang, mendorong atau menarik, perakitan / perbaikan mesin', TRUE, 1),
|
||||
(3, 'Berat', 'Beban kerja berat dengan aktivitas fisik intens', '350-500 Kcal/jam', 'Berjalan cepat/naik tangga, mengangkat beban berat, pekerjaan konstruksi, penggalian, penambangan', TRUE, 1);
|
||||
|
||||
-- Insert Data Master Alokasi Kerja-Istirahat
|
||||
INSERT INTO master_alokasi_kerja_istirahat (id_alokasi, nama_alokasi, persentase_kerja, persentase_istirahat, keterangan, status, user_input)
|
||||
INSERT INTO master_work_rest_allocations (MasterWorkRestAllocationID, MasterWorkRestAllocationName, MasterWorkRestAllocationWorkPercentage, MasterWorkRestAllocationRestPercentage, MasterWorkRestAllocationDescription, MasterWorkRestAllocationIsActive, MasterWorkRestAllocationCreatedUserID)
|
||||
VALUES
|
||||
(1, '75-100% Kerja', '75-100%', '0-25%', 'Alokasi 75-100% waktu untuk bekerja, 0-25% untuk istirahat dalam satu jam', TRUE, 'admin'),
|
||||
(2, '50-75% Kerja', '50-75%', '25-50%', 'Alokasi 50-75% waktu untuk bekerja, 25-50% untuk istirahat dalam satu jam', TRUE, 'admin'),
|
||||
(3, '25-50% Kerja', '25-50%', '50-75%', 'Alokasi 25-50% waktu untuk bekerja, 50-75% untuk istirahat dalam satu jam', TRUE, 'admin'),
|
||||
(4, '0-25% Kerja', '0-25%', '75-100%', 'Alokasi 0-25% waktu untuk bekerja, 75-100% untuk istirahat dalam satu jam', TRUE, 'admin');
|
||||
(1, '75-100% Kerja', '75-100%', '0-25%', 'Alokasi 75-100% waktu untuk bekerja, 0-25% untuk istirahat dalam satu jam', TRUE, 1),
|
||||
(2, '50-75% Kerja', '50-75%', '25-50%', 'Alokasi 50-75% waktu untuk bekerja, 25-50% untuk istirahat dalam satu jam', TRUE, 1),
|
||||
(3, '25-50% Kerja', '25-50%', '50-75%', 'Alokasi 25-50% waktu untuk bekerja, 50-75% untuk istirahat dalam satu jam', TRUE, 1),
|
||||
(4, '0-25% Kerja', '0-25%', '75-100%', 'Alokasi 0-25% waktu untuk bekerja, 75-100% untuk istirahat dalam satu jam', TRUE, 1);
|
||||
|
||||
-- Insert Data Master Baku Mutu ISBB
|
||||
INSERT INTO master_bakumutu_isbb (id_bakumutu_isbb, id_regulasi, id_kategori, id_alokasi, nilai_baku_mutu, keterangan, status, user_input)
|
||||
INSERT INTO master_wbgt_standards (MasterWBGTStandardID, MasterRegulationID, MasterWorkloadCategoryID, MasterWorkRestAllocationID, MasterWBGTStandardValue, MasterWBGTStandardDescription, MasterWBGTStandardIsActive, MasterWBGTStandardCreatedUserID)
|
||||
VALUES
|
||||
-- Kategori Ringan
|
||||
(1, 2, 1, 1, 31.0, 'Nilai ISBB maksimum untuk beban kerja ringan dengan alokasi kerja 75-100%', TRUE, 'admin'),
|
||||
(2, 2, 1, 2, 31.0, 'Nilai ISBB maksimum untuk beban kerja ringan dengan alokasi kerja 50-75%', TRUE, 'admin'),
|
||||
(3, 2, 1, 3, 32.0, 'Nilai ISBB maksimum untuk beban kerja ringan dengan alokasi kerja 25-50%', TRUE, 'admin'),
|
||||
(4, 2, 1, 4, 32.2, 'Nilai ISBB maksimum untuk beban kerja ringan dengan alokasi kerja 0-25%', TRUE, 'admin'),
|
||||
(1, 2, 1, 1, 31.0, 'Nilai ISBB maksimum untuk beban kerja ringan dengan alokasi kerja 75-100%', TRUE, 1),
|
||||
(2, 2, 1, 2, 31.0, 'Nilai ISBB maksimum untuk beban kerja ringan dengan alokasi kerja 50-75%', TRUE, 1),
|
||||
(3, 2, 1, 3, 32.0, 'Nilai ISBB maksimum untuk beban kerja ringan dengan alokasi kerja 25-50%', TRUE, 1),
|
||||
(4, 2, 1, 4, 32.2, 'Nilai ISBB maksimum untuk beban kerja ringan dengan alokasi kerja 0-25%', TRUE, 1),
|
||||
|
||||
-- Kategori Sedang
|
||||
(5, 2, 2, 1, 28.0, 'Nilai ISBB maksimum untuk beban kerja sedang dengan alokasi kerja 75-100%', TRUE, 'admin'),
|
||||
(6, 2, 2, 2, 29.0, 'Nilai ISBB maksimum untuk beban kerja sedang dengan alokasi kerja 50-75%', TRUE, 'admin'),
|
||||
(7, 2, 2, 3, 30.0, 'Nilai ISBB maksimum untuk beban kerja sedang dengan alokasi kerja 25-50%', TRUE, 'admin'),
|
||||
(8, 2, 2, 4, 31.1, 'Nilai ISBB maksimum untuk beban kerja sedang dengan alokasi kerja 0-25%', TRUE, 'admin'),
|
||||
(5, 2, 2, 1, 28.0, 'Nilai ISBB maksimum untuk beban kerja sedang dengan alokasi kerja 75-100%', TRUE, 1),
|
||||
(6, 2, 2, 2, 29.0, 'Nilai ISBB maksimum untuk beban kerja sedang dengan alokasi kerja 50-75%', TRUE, 1),
|
||||
(7, 2, 2, 3, 30.0, 'Nilai ISBB maksimum untuk beban kerja sedang dengan alokasi kerja 25-50%', TRUE, 1),
|
||||
(8, 2, 2, 4, 31.1, 'Nilai ISBB maksimum untuk beban kerja sedang dengan alokasi kerja 0-25%', TRUE, 1),
|
||||
|
||||
-- Kategori Berat
|
||||
(9, 2, 3, 1, NULL, 'Untuk beban kerja berat tidak direkomendasikan alokasi kerja 75-100%', TRUE, 'admin'),
|
||||
(10, 2, 3, 2, 27.5, 'Nilai ISBB maksimum untuk beban kerja berat dengan alokasi kerja 50-75%', TRUE, 'admin'),
|
||||
(11, 2, 3, 3, 29.0, 'Nilai ISBB maksimum untuk beban kerja berat dengan alokasi kerja 25-50%', TRUE, 'admin'),
|
||||
(12, 2, 3, 4, 30.0, 'Nilai ISBB maksimum untuk beban kerja berat dengan alokasi kerja 0-25%', TRUE, 'admin');
|
||||
(9, 2, 3, 1, NULL, 'Untuk beban kerja berat tidak direkomendasikan alokasi kerja 75-100%', TRUE, 1),
|
||||
(10, 2, 3, 2, 27.5, 'Nilai ISBB maksimum untuk beban kerja berat dengan alokasi kerja 50-75%', TRUE, 1),
|
||||
(11, 2, 3, 3, 29.0, 'Nilai ISBB maksimum untuk beban kerja berat dengan alokasi kerja 25-50%', TRUE, 1),
|
||||
(12, 2, 3, 4, 30.0, 'Nilai ISBB maksimum untuk beban kerja berat dengan alokasi kerja 0-25%', TRUE, 1);
|
||||
|
||||
-- ------------------------------------------------------------------------------
|
||||
-- Sample Data Insertion - Transaction Tables
|
||||
@@ -158,38 +173,38 @@ VALUES
|
||||
(2, 'SP-ISBB-2024-001', 'Pengukuran ISBB di PT. Indonesia Steel Manufacturing', 102, '2024-05-12', 'PT. Indonesia Steel Manufacturing, Jl. Industri Baja No. 75, Cikarang, Bekasi', 5, 'APPROVED', 'Pengukuran ISBB untuk area furnace, casting, rolling mill, welding, dan control room', '2024-05-01 10:30:00', 'supervisor');
|
||||
|
||||
-- Contoh Data Hasil Pengukuran ISBB
|
||||
INSERT INTO trx_hasil_ukur_isbb (id_hasil_ukur_isbb, id_sampling_plan, kode_laporan, tanggal_sampling, waktu_mulai, waktu_selesai, kondisi_cuaca, petugas_sampling, status_laporan, catatan, tanggal_input, user_input)
|
||||
INSERT INTO wbgt_measurements (WBGTMeasurementID, ClimateSamplingPlanID, WBGTMeasurementCode, WBGTMeasurementDate, WBGTMeasurementStartTime, WBGTMeasurementEndTime, WBGTMeasurementWeather, WBGTMeasurementOfficer, WBGTMeasurementStatus, WBGTMeasurementNotes, WBGTMeasurementCreatedAt, WBGTMeasurementCreatedUserID)
|
||||
VALUES
|
||||
(1, 2, 'LHU/ISBB/05/2024/001', '2024-05-12', '10:00:00', '14:30:00', 'Cuaca cerah, suhu luar 33°C', 'Ahmad Kusuma, Budi Santoso', 'FINAL', 'Pengukuran berjalan dengan baik', '2024-05-12 16:45:00', 'analyst');
|
||||
(1, 2, 'LHU/ISBB/05/2024/001', '2024-05-12', '10:00:00', '14:30:00', 'Cuaca cerah, suhu luar 33°C', 'Ahmad Kusuma, Budi Santoso', 'FINAL', 'Pengukuran berjalan dengan baik', '2024-05-12 16:45:00', 1);
|
||||
|
||||
-- Contoh Data Detail Hasil Pengukuran ISBB
|
||||
INSERT INTO trx_hasil_ukur_isbb_detail (id_hasil_ukur_isbb_detail, id_hasil_ukur_isbb, kode_titik, nama_lokasi, jenis_pekerjaan, id_kategori, id_alokasi, suhu_basah, suhu_bola, suhu_kering, nilai_isbb, id_bakumutu_isbb, status_kesesuaian, rekomendasi, lokasi_pengukuran, tinggi_pengukuran, catatan, tanggal_input, user_input)
|
||||
INSERT INTO wbgt_measurement_details (WBGTMeasurementDetailID, WBGTMeasurementID, WBGTMeasurementDetailPointCode, WBGTMeasurementDetailLocation, WBGTMeasurementDetailWorkType, MasterWorkloadCategoryID, MasterWorkRestAllocationID, WBGTMeasurementDetailWetTemp, WBGTMeasurementDetailGlobeTemp, WBGTMeasurementDetailDryTemp, WBGTMeasurementDetailWBGTValue, MasterWBGTStandardID, WBGTMeasurementDetailComplianceStatus, WBGTMeasurementDetailRecommendation, WBGTMeasurementDetailMeasurementLocation, WBGTMeasurementDetailMeasurementHeight, WBGTMeasurementDetailNotes, WBGTMeasurementDetailCreatedAt, WBGTMeasurementDetailCreatedUserID)
|
||||
VALUES
|
||||
-- Furnace Operation Area
|
||||
(1, 1, 'T1', 'Furnace Operation Area', 'Furnace monitoring and control', 2, 1, 27.8, 35.6, 32.5, 29.7, 5, 'NOT_COMPLY', 'Tingkatkan ventilasi, kurangi waktu paparan, atau ubah alokasi kerja', 'Dekat panel kontrol operator', 1.1, 'Pengukuran dilakukan saat furnace beroperasi normal', '2024-05-12 16:50:00', 'analyst'),
|
||||
(1, 1, 'T1', 'Furnace Operation Area', 'Furnace monitoring and control', 2, 1, 27.8, 35.6, 32.5, 29.7, 5, 'NOT_COMPLY', 'Tingkatkan ventilasi, kurangi waktu paparan, atau ubah alokasi kerja', 'Dekat panel kontrol operator', 1.1, 'Pengukuran dilakukan saat furnace beroperasi normal', '2024-05-12 16:50:00', 1),
|
||||
|
||||
-- Cold Rolling Mill
|
||||
(2, 1, 'T2', 'Cold Rolling Mill', 'Machine operation and material handling', 2, 1, 25.2, 31.5, 30.1, 26.8, 5, 'COMPLY', '', 'Area operator mesin rolling', 1.1, 'Pengukuran dilakukan saat proses rolling berjalan normal', '2024-05-12 17:00:00', 'analyst'),
|
||||
(2, 1, 'T2', 'Cold Rolling Mill', 'Machine operation and material handling', 2, 1, 25.2, 31.5, 30.1, 26.8, 5, 'COMPLY', '', 'Area operator mesin rolling', 1.1, 'Pengukuran dilakukan saat proses rolling berjalan normal', '2024-05-12 17:00:00', 1),
|
||||
|
||||
-- Steel Casting Section
|
||||
(3, 1, 'T3', 'Steel Casting Section', 'Heavy manual casting tasks', 3, 2, 28.4, 36.8, 33.2, 30.2, 10, 'NOT_COMPLY', 'Pasang pelindung panas tambahan, ubah alokasi kerja menjadi 25% kerja', 'Area penuangan logam', 1.1, 'Suhu sangat tinggi di sekitar area penuangan', '2024-05-12 17:15:00', 'analyst'),
|
||||
(3, 1, 'T3', 'Steel Casting Section', 'Heavy manual casting tasks', 3, 2, 28.4, 36.8, 33.2, 30.2, 10, 'NOT_COMPLY', 'Pasang pelindung panas tambahan, ubah alokasi kerja menjadi 25% kerja', 'Area penuangan logam', 1.1, 'Suhu sangat tinggi di sekitar area penuangan', '2024-05-12 17:15:00', 1),
|
||||
|
||||
-- Welding Section
|
||||
(4, 1, 'T4', 'Welding Section', 'Manual welding tasks', 2, 2, 24.6, 31.0, 29.5, 26.1, 6, 'COMPLY', '', 'Area pengelasan manual', 1.1, 'Pengukuran dilakukan pada jarak 1.5 meter dari titik pengelasan', '2024-05-12 17:30:00', 'analyst'),
|
||||
(4, 1, 'T4', 'Welding Section', 'Manual welding tasks', 2, 2, 24.6, 31.0, 29.5, 26.1, 6, 'COMPLY', '', 'Area pengelasan manual', 1.1, 'Pengukuran dilakukan pada jarak 1.5 meter dari titik pengelasan', '2024-05-12 17:30:00', 1),
|
||||
|
||||
-- Production Control Room
|
||||
(5, 1, 'T5', 'Production Control Room', 'Monitoring and administrative tasks', 1, 1, 23.8, 29.2, 28.6, 25.2, 1, 'COMPLY', '', 'Ruang kontrol produksi', 1.1, 'Ruangan ber-AC, kondisi stabil', '2024-05-12 17:45:00', 'analyst');
|
||||
(5, 1, 'T5', 'Production Control Room', 'Monitoring and administrative tasks', 1, 1, 23.8, 29.2, 28.6, 25.2, 1, 'COMPLY', '', 'Ruang kontrol produksi', 1.1, 'Ruangan ber-AC, kondisi stabil', '2024-05-12 17:45:00', 1);
|
||||
|
||||
-- Contoh Data Rekomendasi Pengendalian
|
||||
INSERT INTO trx_rekomendasi_pengendalian_isbb (id_rekomendasi, id_hasil_ukur_isbb_detail, jenis_pengendalian, deskripsi_pengendalian, prioritas, estimasi_biaya, perkiraan_efektivitas, status_implementasi, tanggal_input, user_input)
|
||||
INSERT INTO wbgt_control_recommendations (WBGTControlRecommendationID, WBGTMeasurementDetailID, WBGTControlRecommendationType, WBGTControlRecommendationDescription, WBGTControlRecommendationPriority, WBGTControlRecommendationEstimatedCost, WBGTControlRecommendationEffectiveness, WBGTControlRecommendationStatus, WBGTControlRecommendationCreatedAt, WBGTControlRecommendationCreatedUserID)
|
||||
VALUES
|
||||
-- Rekomendasi untuk Furnace Area
|
||||
(1, 1, 'Pengendalian Teknik', 'Pemasangan local exhaust ventilation tambahan di area furnace', 1, 25000000.00, 'Diperkirakan dapat menurunkan ISBB 1.5-2°C', 'PLANNED', '2024-05-13 09:00:00', 'analyst'),
|
||||
(2, 1, 'Pengendalian Administratif', 'Mengubah alokasi kerja menjadi 50% kerja, 50% istirahat', 1, 0.00, 'Memenuhi baku mutu untuk kategori kerja sedang', 'PLANNED', '2024-05-13 09:05:00', 'analyst'),
|
||||
(3, 1, 'APD', 'Menyediakan cooling vest bagi operator furnace', 2, 5000000.00, 'Mengurangi beban panas pada pekerja', 'PLANNED', '2024-05-13 09:10:00', 'analyst'),
|
||||
(1, 1, 'Pengendalian Teknik', 'Pemasangan local exhaust ventilation tambahan di area furnace', 1, 25000000.00, 'Diperkirakan dapat menurunkan ISBB 1.5-2°C', 'PLANNED', '2024-05-13 09:00:00', 1),
|
||||
(2, 1, 'Pengendalian Administratif', 'Mengubah alokasi kerja menjadi 50% kerja, 50% istirahat', 1, 0.00, 'Memenuhi baku mutu untuk kategori kerja sedang', 'PLANNED', '2024-05-13 09:05:00', 1),
|
||||
(3, 1, 'APD', 'Menyediakan cooling vest bagi operator furnace', 2, 5000000.00, 'Mengurangi beban panas pada pekerja', 'PLANNED', '2024-05-13 09:10:00', 1),
|
||||
|
||||
-- Rekomendasi untuk Steel Casting Section
|
||||
(4, 3, 'Pengendalian Teknik', 'Pemasangan heat shield tambahan di sekitar area penuangan', 1, 18000000.00, 'Diperkirakan dapat menurunkan ISBB 1-1.5°C', 'PLANNED', '2024-05-13 09:15:00', 'analyst'),
|
||||
(5, 3, 'Pengendalian Teknik', 'Pemasangan spot cooling di area kerja manual', 1, 12000000.00, 'Diperkirakan dapat menurunkan ISBB 1-2°C', 'PLANNED', '2024-05-13 09:20:00', 'analyst'),
|
||||
(6, 3, 'Pengendalian Administratif', 'Rotasi kerja dan mengubah alokasi menjadi 25% kerja, 75% istirahat', 1, 0.00, 'Memenuhi baku mutu untuk kategori kerja berat', 'PLANNED', '2024-05-13 09:25:00', 'analyst'),
|
||||
(7, 3, 'APD', 'Menyediakan pakaian pelindung reflektif panas', 2, 7500000.00, 'Mengurangi beban panas radiasi pada pekerja', 'PLANNED', '2024-05-13 09:30:00', 'analyst');
|
||||
(4, 3, 'Pengendalian Teknik', 'Pemasangan heat shield tambahan di sekitar area penuangan', 1, 18000000.00, 'Diperkirakan dapat menurunkan ISBB 1-1.5°C', 'PLANNED', '2024-05-13 09:15:00', 1),
|
||||
(5, 3, 'Pengendalian Teknik', 'Pemasangan spot cooling di area kerja manual', 1, 12000000.00, 'Diperkirakan dapat menurunkan ISBB 1-2°C', 'PLANNED', '2024-05-13 09:20:00', 1),
|
||||
(6, 3, 'Pengendalian Administratif', 'Rotasi kerja dan mengubah alokasi menjadi 25% kerja, 75% istirahat', 1, 0.00, 'Memenuhi baku mutu untuk kategori kerja berat', 'PLANNED', '2024-05-13 09:25:00', 1),
|
||||
(7, 3, 'APD', 'Menyediakan pakaian pelindung reflektif panas', 2, 7500000.00, 'Mengurangi beban panas radiasi pada pekerja', 'PLANNED', '2024-05-13 09:30:00', 1);
|
||||
@@ -7,60 +7,78 @@ USE lab_lingkungan;
|
||||
|
||||
-- Customers table (Internal and External)
|
||||
CREATE TABLE customers (
|
||||
customer_id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
customer_name VARCHAR(100) NOT NULL,
|
||||
customer_type ENUM('Internal', 'External') NOT NULL,
|
||||
contact_person VARCHAR(100),
|
||||
phone_number VARCHAR(20),
|
||||
email VARCHAR(100),
|
||||
address TEXT,
|
||||
company_name VARCHAR(100),
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
|
||||
CustomerID INT AUTO_INCREMENT PRIMARY KEY,
|
||||
CustomerName VARCHAR(100) NOT NULL,
|
||||
CustomerType ENUM('Internal', 'External') NOT NULL,
|
||||
CustomerContactPerson VARCHAR(100),
|
||||
CustomerPhoneNumber VARCHAR(20),
|
||||
CustomerEmail VARCHAR(100),
|
||||
CustomerAddress TEXT,
|
||||
CustomerCompanyName VARCHAR(100),
|
||||
CustomerCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
CustomerCreatedUserID INT,
|
||||
CustomerUpdatedAt DATETIME,
|
||||
CustomerUpdatedUserID INT,
|
||||
CustomerDeletedAt DATETIME,
|
||||
CustomerDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Sample Types table
|
||||
CREATE TABLE sample_types (
|
||||
sample_type_id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
type_name VARCHAR(100) NOT NULL,
|
||||
description TEXT,
|
||||
standard_method TEXT,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
||||
SampleTypeID INT AUTO_INCREMENT PRIMARY KEY,
|
||||
SampleTypeName VARCHAR(100) NOT NULL,
|
||||
SampleTypeDescription TEXT,
|
||||
SampleTypeStandardMethod TEXT,
|
||||
SampleTypeIsActive BOOLEAN DEFAULT TRUE,
|
||||
SampleTypeCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
SampleTypeCreatedUserID INT,
|
||||
SampleTypeUpdatedAt DATETIME,
|
||||
SampleTypeUpdatedUserID INT,
|
||||
SampleTypeDeletedAt DATETIME,
|
||||
SampleTypeDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Analysis Parameters table
|
||||
CREATE TABLE analysis_parameters (
|
||||
parameter_id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
parameter_name VARCHAR(100) NOT NULL,
|
||||
unit VARCHAR(50),
|
||||
method VARCHAR(100),
|
||||
sample_type_id INT,
|
||||
standard_value VARCHAR(100),
|
||||
price DECIMAL(10, 2),
|
||||
FOREIGN KEY (sample_type_id) REFERENCES sample_types(sample_type_id),
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
||||
AnalysisParameterID INT AUTO_INCREMENT PRIMARY KEY,
|
||||
AnalysisParameterName VARCHAR(100) NOT NULL,
|
||||
AnalysisParameterUnit VARCHAR(50),
|
||||
AnalysisParameterMethod VARCHAR(100),
|
||||
SampleTypeID INT,
|
||||
AnalysisParameterStandardValue VARCHAR(100),
|
||||
AnalysisParameterPrice DECIMAL(10, 2),
|
||||
AnalysisParameterIsActive BOOLEAN DEFAULT TRUE,
|
||||
AnalysisParameterCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
AnalysisParameterCreatedUserID INT,
|
||||
AnalysisParameterUpdatedAt DATETIME,
|
||||
AnalysisParameterUpdatedUserID INT,
|
||||
AnalysisParameterDeletedAt DATETIME,
|
||||
AnalysisParameterDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Service Requests table
|
||||
CREATE TABLE service_requests (
|
||||
request_id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
customer_id INT NOT NULL,
|
||||
request_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
request_type ENUM('Sampling and Analysis', 'Analysis Only') NOT NULL,
|
||||
project_name VARCHAR(200),
|
||||
project_location TEXT,
|
||||
status ENUM('Draft', 'Submitted', 'Quotation Sent', 'Approved', 'Rejected', 'Completed', 'Cancelled') DEFAULT 'Draft',
|
||||
admin_id INT,
|
||||
quotation_number VARCHAR(50),
|
||||
quotation_date DATE,
|
||||
approved_date DATE,
|
||||
payment_proof VARCHAR(255),
|
||||
payment_date DATE,
|
||||
total_amount DECIMAL(12, 2),
|
||||
notes TEXT,
|
||||
FOREIGN KEY (customer_id) REFERENCES customers(customer_id),
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
|
||||
ServiceRequestID INT AUTO_INCREMENT PRIMARY KEY,
|
||||
CustomerID INT NOT NULL,
|
||||
ServiceRequestDate DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
ServiceRequestType ENUM('Sampling and Analysis', 'Analysis Only') NOT NULL,
|
||||
ServiceRequestProjectName VARCHAR(200),
|
||||
ServiceRequestProjectLocation TEXT,
|
||||
ServiceRequestStatus ENUM('Draft', 'Submitted', 'Quotation Sent', 'Approved', 'Rejected', 'Completed', 'Cancelled') DEFAULT 'Draft',
|
||||
ServiceRequestAdminID INT,
|
||||
ServiceRequestQuotationNumber VARCHAR(50),
|
||||
ServiceRequestQuotationDate DATE,
|
||||
ServiceRequestApprovedDate DATE,
|
||||
ServiceRequestPaymentProof VARCHAR(255),
|
||||
ServiceRequestPaymentDate DATE,
|
||||
ServiceRequestTotalAmount DECIMAL(12, 2),
|
||||
ServiceRequestNotes TEXT,
|
||||
ServiceRequestCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
ServiceRequestCreatedUserID INT,
|
||||
ServiceRequestUpdatedAt DATETIME,
|
||||
ServiceRequestUpdatedUserID INT,
|
||||
ServiceRequestDeletedAt DATETIME,
|
||||
ServiceRequestDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Request Parameters (mapping between requests and required parameters)
|
||||
|
||||
440
masterdata.txt
440
masterdata.txt
@@ -119,253 +119,265 @@ CREATE TABLE master_sampling_methods (
|
||||
);
|
||||
|
||||
CREATE TABLE master_preservation_methods (
|
||||
preservation_id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
preservation_code VARCHAR(20) NOT NULL,
|
||||
preservation_name VARCHAR(100) NOT NULL,
|
||||
chemical_used VARCHAR(100),
|
||||
applicable_parameters TEXT, -- parameter yang menggunakan metode preservasi ini
|
||||
procedure TEXT,
|
||||
storage_condition VARCHAR(100),
|
||||
holding_time VARCHAR(50),
|
||||
safety_precautions TEXT,
|
||||
remarks TEXT,
|
||||
is_active BOOLEAN DEFAULT TRUE,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
|
||||
MasterPreservationMethodID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
MasterPreservationMethodCode VARCHAR(20) NOT NULL,
|
||||
MasterPreservationMethodName VARCHAR(100) NOT NULL,
|
||||
MasterPreservationMethodChemicalUsed VARCHAR(100),
|
||||
MasterPreservationMethodApplicableParameters TEXT,
|
||||
MasterPreservationMethodProcedure TEXT,
|
||||
MasterPreservationMethodStorageCondition VARCHAR(100),
|
||||
MasterPreservationMethodHoldingTime VARCHAR(50),
|
||||
MasterPreservationMethodSafetyPrecautions TEXT,
|
||||
MasterPreservationMethodRemarks TEXT,
|
||||
MasterPreservationMethodIsActive BOOLEAN DEFAULT TRUE,
|
||||
MasterPreservationMethodCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
MasterPreservationMethodCreatedUserID INT,
|
||||
MasterPreservationMethodUpdatedAt DATETIME,
|
||||
MasterPreservationMethodUpdatedUserID INT,
|
||||
MasterPreservationMethodDeletedAt DATETIME,
|
||||
MasterPreservationMethodDeletedUserID INT
|
||||
);
|
||||
|
||||
CREATE TABLE master_sample_containers (
|
||||
container_id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
container_code VARCHAR(20) NOT NULL,
|
||||
container_name VARCHAR(100) NOT NULL,
|
||||
material VARCHAR(50), -- HDPE, glass, amber glass, dsb
|
||||
capacity VARCHAR(20), -- misalnya: 250mL, 1L
|
||||
cap_type VARCHAR(50), -- jenis tutup
|
||||
sterilization VARCHAR(50), -- metode sterilisasi jika perlu
|
||||
applicable_parameters TEXT, -- parameter yang menggunakan wadah ini
|
||||
washing_procedure TEXT, -- prosedur pencucian wadah
|
||||
storage_requirements TEXT,
|
||||
remarks TEXT,
|
||||
is_active BOOLEAN DEFAULT TRUE,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
|
||||
MasterSampleContainerID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
MasterSampleContainerCode VARCHAR(20) NOT NULL,
|
||||
MasterSampleContainerName VARCHAR(100) NOT NULL,
|
||||
MasterSampleContainerMaterial VARCHAR(50),
|
||||
MasterSampleContainerCapacity VARCHAR(20),
|
||||
MasterSampleContainerCapType VARCHAR(50),
|
||||
MasterSampleContainerSterilization VARCHAR(50),
|
||||
MasterSampleContainerApplicableParameters TEXT,
|
||||
MasterSampleContainerWashingProcedure TEXT,
|
||||
MasterSampleContainerStorageRequirements TEXT,
|
||||
MasterSampleContainerRemarks TEXT,
|
||||
MasterSampleContainerIsActive BOOLEAN DEFAULT TRUE,
|
||||
MasterSampleContainerCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
MasterSampleContainerCreatedUserID INT,
|
||||
MasterSampleContainerUpdatedAt DATETIME,
|
||||
MasterSampleContainerUpdatedUserID INT,
|
||||
MasterSampleContainerDeletedAt DATETIME,
|
||||
MasterSampleContainerDeletedUserID INT
|
||||
);
|
||||
|
||||
CREATE TABLE master_regulations (
|
||||
regulation_id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
regulation_code VARCHAR(20) NOT NULL,
|
||||
regulation_name VARCHAR(200) NOT NULL,
|
||||
issuing_authority VARCHAR(100), -- instansi yang mengeluarkan regulasi
|
||||
regulation_type VARCHAR(50), -- Peraturan Menteri, Peraturan Pemerintah, dsb
|
||||
issue_date DATE,
|
||||
effective_date DATE,
|
||||
applicable_sector VARCHAR(100), -- sektor yang diregulasi
|
||||
scope TEXT,
|
||||
summary TEXT,
|
||||
file_path VARCHAR(255), -- path ke file dokumen regulasi
|
||||
remarks TEXT,
|
||||
is_active BOOLEAN DEFAULT TRUE,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
|
||||
MasterRegulationID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
MasterRegulationCode VARCHAR(20) NOT NULL,
|
||||
MasterRegulationName VARCHAR(200) NOT NULL,
|
||||
MasterRegulationIssuingAuthority VARCHAR(100),
|
||||
MasterRegulationType VARCHAR(50),
|
||||
MasterRegulationIssueDate DATE,
|
||||
MasterRegulationEffectiveDate DATE,
|
||||
MasterRegulationApplicableSector VARCHAR(100),
|
||||
MasterRegulationScope TEXT,
|
||||
MasterRegulationSummary TEXT,
|
||||
MasterRegulationFilePath VARCHAR(255),
|
||||
MasterRegulationRemarks TEXT,
|
||||
MasterRegulationIsActive BOOLEAN DEFAULT TRUE,
|
||||
MasterRegulationCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
MasterRegulationCreatedUserID INT,
|
||||
MasterRegulationUpdatedAt DATETIME,
|
||||
MasterRegulationUpdatedUserID INT,
|
||||
MasterRegulationDeletedAt DATETIME,
|
||||
MasterRegulationDeletedUserID INT
|
||||
);
|
||||
|
||||
CREATE TABLE master_quality_standards (
|
||||
standard_id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
standard_code VARCHAR(20) NOT NULL,
|
||||
standard_name VARCHAR(200) NOT NULL,
|
||||
regulation_id INT,
|
||||
matrix_type VARCHAR(50), -- air limbah, air sungai, air tanah, dsb
|
||||
industry_type VARCHAR(100), -- tipe industri (jika spesifik)
|
||||
parameter_id INT,
|
||||
min_value DECIMAL(12, 6),
|
||||
max_value DECIMAL(12, 6),
|
||||
unit VARCHAR(20),
|
||||
remarks TEXT,
|
||||
is_active BOOLEAN DEFAULT TRUE,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (regulation_id) REFERENCES master_regulations(regulation_id),
|
||||
FOREIGN KEY (parameter_id) REFERENCES master_parameters(parameter_id)
|
||||
MasterQualityStandardID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
MasterQualityStandardCode VARCHAR(20) NOT NULL,
|
||||
MasterQualityStandardName VARCHAR(200) NOT NULL,
|
||||
MasterRegulationID INT,
|
||||
MasterQualityStandardMatrixType VARCHAR(50),
|
||||
MasterQualityStandardIndustryType VARCHAR(100),
|
||||
MasterParameterID INT,
|
||||
MasterQualityStandardMinValue DECIMAL(12,6),
|
||||
MasterQualityStandardMaxValue DECIMAL(12,6),
|
||||
MasterQualityStandardUnit VARCHAR(20),
|
||||
MasterQualityStandardRemarks TEXT,
|
||||
MasterQualityStandardIsActive BOOLEAN DEFAULT TRUE,
|
||||
MasterQualityStandardCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
MasterQualityStandardCreatedUserID INT,
|
||||
MasterQualityStandardUpdatedAt DATETIME,
|
||||
MasterQualityStandardUpdatedUserID INT,
|
||||
MasterQualityStandardDeletedAt DATETIME,
|
||||
MasterQualityStandardDeletedUserID INT
|
||||
);
|
||||
|
||||
CREATE TABLE parameter_method_mapping (
|
||||
mapping_id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
parameter_id INT,
|
||||
method_id INT,
|
||||
container_id INT,
|
||||
preservation_id INT,
|
||||
is_default BOOLEAN DEFAULT FALSE, -- metode default untuk parameter
|
||||
remarks TEXT,
|
||||
is_active BOOLEAN DEFAULT TRUE,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (parameter_id) REFERENCES master_parameters(parameter_id),
|
||||
FOREIGN KEY (method_id) REFERENCES master_sampling_methods(method_id),
|
||||
FOREIGN KEY (container_id) REFERENCES master_sample_containers(container_id),
|
||||
FOREIGN KEY (preservation_id) REFERENCES master_preservation_methods(preservation_id)
|
||||
ParameterMethodMappingID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
MasterParameterID INT,
|
||||
MasterSamplingMethodID INT,
|
||||
MasterSampleContainerID INT,
|
||||
MasterPreservationMethodID INT,
|
||||
ParameterMethodMappingIsDefault BOOLEAN DEFAULT FALSE,
|
||||
ParameterMethodMappingRemarks TEXT,
|
||||
ParameterMethodMappingIsActive BOOLEAN DEFAULT TRUE,
|
||||
ParameterMethodMappingCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
ParameterMethodMappingCreatedUserID INT,
|
||||
ParameterMethodMappingUpdatedAt DATETIME,
|
||||
ParameterMethodMappingUpdatedUserID INT,
|
||||
ParameterMethodMappingDeletedAt DATETIME,
|
||||
ParameterMethodMappingDeletedUserID INT
|
||||
);
|
||||
|
||||
CREATE TABLE sampling_plans (
|
||||
plan_id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
plan_code VARCHAR(30) NOT NULL,
|
||||
project_name VARCHAR(200) NOT NULL,
|
||||
client_id INT,
|
||||
contact_person_id INT,
|
||||
request_date DATETIME,
|
||||
planned_sampling_date DATE,
|
||||
status VARCHAR(20), -- draft, submitted, approved, completed, cancelled
|
||||
created_by INT,
|
||||
approved_by INT,
|
||||
approval_date DATETIME,
|
||||
total_locations INT,
|
||||
total_parameters INT,
|
||||
remarks TEXT,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (client_id) REFERENCES master_clients(client_id),
|
||||
FOREIGN KEY (created_by) REFERENCES master_personnel(personnel_id),
|
||||
FOREIGN KEY (approved_by) REFERENCES master_personnel(personnel_id)
|
||||
SamplingPlanID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
SamplingPlanCode VARCHAR(30) NOT NULL,
|
||||
SamplingPlanProjectName VARCHAR(200) NOT NULL,
|
||||
MasterClientID INT,
|
||||
SamplingPlanContactPersonID INT,
|
||||
SamplingPlanRequestDate DATETIME,
|
||||
SamplingPlanPlannedDate DATE,
|
||||
SamplingPlanStatus VARCHAR(20),
|
||||
SamplingPlanCreatedBy INT,
|
||||
SamplingPlanApprovedBy INT,
|
||||
SamplingPlanApprovalDate DATETIME,
|
||||
SamplingPlanTotalLocations INT,
|
||||
SamplingPlanTotalParameters INT,
|
||||
SamplingPlanRemarks TEXT,
|
||||
SamplingPlanCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
SamplingPlanCreatedUserID INT,
|
||||
SamplingPlanUpdatedAt DATETIME,
|
||||
SamplingPlanUpdatedUserID INT,
|
||||
SamplingPlanDeletedAt DATETIME,
|
||||
SamplingPlanDeletedUserID INT
|
||||
);
|
||||
|
||||
CREATE TABLE sampling_plan_locations (
|
||||
plan_location_id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
plan_id INT,
|
||||
location_id INT,
|
||||
sampling_date DATE,
|
||||
sampling_time TIME,
|
||||
sampling_method_id INT,
|
||||
sampling_personnel_id INT,
|
||||
field_parameters TEXT, -- parameter yang diukur di lapangan
|
||||
special_instructions TEXT,
|
||||
status VARCHAR(20), -- planned, sampled, failed
|
||||
remarks TEXT,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (plan_id) REFERENCES sampling_plans(plan_id),
|
||||
FOREIGN KEY (location_id) REFERENCES master_sampling_locations(location_id),
|
||||
FOREIGN KEY (sampling_method_id) REFERENCES master_sampling_methods(method_id),
|
||||
FOREIGN KEY (sampling_personnel_id) REFERENCES master_personnel(personnel_id)
|
||||
SamplingPlanLocationID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
SamplingPlanID INT,
|
||||
MasterSamplingLocationID INT,
|
||||
SamplingPlanLocationDate DATE,
|
||||
SamplingPlanLocationTime TIME,
|
||||
MasterSamplingMethodID INT,
|
||||
SamplingPlanLocationPersonnelID INT,
|
||||
SamplingPlanLocationFieldParameters TEXT,
|
||||
SamplingPlanLocationSpecialInstructions TEXT,
|
||||
SamplingPlanLocationStatus VARCHAR(20),
|
||||
SamplingPlanLocationRemarks TEXT,
|
||||
SamplingPlanLocationCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
SamplingPlanLocationCreatedUserID INT,
|
||||
SamplingPlanLocationUpdatedAt DATETIME,
|
||||
SamplingPlanLocationUpdatedUserID INT,
|
||||
SamplingPlanLocationDeletedAt DATETIME,
|
||||
SamplingPlanLocationDeletedUserID INT
|
||||
);
|
||||
|
||||
CREATE TABLE sampling_plan_parameters (
|
||||
plan_parameter_id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
plan_id INT,
|
||||
plan_location_id INT,
|
||||
parameter_id INT,
|
||||
container_id INT,
|
||||
preservation_id INT,
|
||||
quantity INT DEFAULT 1,
|
||||
unit_price DECIMAL(12, 2),
|
||||
remarks TEXT,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (plan_id) REFERENCES sampling_plans(plan_id),
|
||||
FOREIGN KEY (plan_location_id) REFERENCES sampling_plan_locations(plan_location_id),
|
||||
FOREIGN KEY (parameter_id) REFERENCES master_parameters(parameter_id),
|
||||
FOREIGN KEY (container_id) REFERENCES master_sample_containers(container_id),
|
||||
FOREIGN KEY (preservation_id) REFERENCES master_preservation_methods(preservation_id)
|
||||
SamplingPlanParameterID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
SamplingPlanID INT,
|
||||
SamplingPlanLocationID INT,
|
||||
MasterParameterID INT,
|
||||
MasterSampleContainerID INT,
|
||||
MasterPreservationMethodID INT,
|
||||
SamplingPlanParameterQuantity INT DEFAULT 1,
|
||||
SamplingPlanParameterUnitPrice DECIMAL(12,2),
|
||||
SamplingPlanParameterRemarks TEXT,
|
||||
SamplingPlanParameterCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
SamplingPlanParameterCreatedUserID INT,
|
||||
SamplingPlanParameterUpdatedAt DATETIME,
|
||||
SamplingPlanParameterUpdatedUserID INT,
|
||||
SamplingPlanParameterDeletedAt DATETIME,
|
||||
SamplingPlanParameterDeletedUserID INT
|
||||
);
|
||||
|
||||
CREATE TABLE equipment_requisitions (
|
||||
requisition_id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
requisition_code VARCHAR(30) NOT NULL,
|
||||
plan_id INT,
|
||||
requisition_date DATETIME,
|
||||
requested_by INT,
|
||||
approved_by INT,
|
||||
approval_date DATETIME,
|
||||
sampling_date DATE,
|
||||
return_date DATE,
|
||||
status VARCHAR(20), -- draft, submitted, approved, issued, returned
|
||||
remarks TEXT,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (plan_id) REFERENCES sampling_plans(plan_id),
|
||||
FOREIGN KEY (requested_by) REFERENCES master_personnel(personnel_id),
|
||||
FOREIGN KEY (approved_by) REFERENCES master_personnel(personnel_id)
|
||||
EquipmentRequisitionID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
EquipmentRequisitionCode VARCHAR(30) NOT NULL,
|
||||
SamplingPlanID INT,
|
||||
EquipmentRequisitionDate DATETIME,
|
||||
EquipmentRequisitionRequestedBy INT,
|
||||
EquipmentRequisitionApprovedBy INT,
|
||||
EquipmentRequisitionApprovalDate DATETIME,
|
||||
EquipmentRequisitionSamplingDate DATE,
|
||||
EquipmentRequisitionReturnDate DATE,
|
||||
EquipmentRequisitionStatus VARCHAR(20),
|
||||
EquipmentRequisitionRemarks TEXT,
|
||||
EquipmentRequisitionCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
EquipmentRequisitionCreatedUserID INT,
|
||||
EquipmentRequisitionUpdatedAt DATETIME,
|
||||
EquipmentRequisitionUpdatedUserID INT,
|
||||
EquipmentRequisitionDeletedAt DATETIME,
|
||||
EquipmentRequisitionDeletedUserID INT
|
||||
);
|
||||
|
||||
CREATE TABLE equipment_requisition_items (
|
||||
requisition_item_id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
requisition_id INT,
|
||||
equipment_id INT,
|
||||
quantity INT,
|
||||
issued_quantity INT,
|
||||
issued_by INT,
|
||||
issued_date DATETIME,
|
||||
returned_quantity INT,
|
||||
returned_condition VARCHAR(50), -- good, damaged, lost
|
||||
returned_date DATETIME,
|
||||
verified_by INT,
|
||||
remarks TEXT,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (requisition_id) REFERENCES equipment_requisitions(requisition_id),
|
||||
FOREIGN KEY (equipment_id) REFERENCES master_equipment(equipment_id),
|
||||
FOREIGN KEY (issued_by) REFERENCES master_personnel(personnel_id),
|
||||
FOREIGN KEY (verified_by) REFERENCES master_personnel(personnel_id)
|
||||
EquipmentRequisitionItemID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
EquipmentRequisitionID INT,
|
||||
MasterEquipmentID INT,
|
||||
EquipmentRequisitionItemQuantity INT,
|
||||
EquipmentRequisitionItemIssuedQuantity INT,
|
||||
EquipmentRequisitionItemIssuedBy INT,
|
||||
EquipmentRequisitionItemIssuedDate DATETIME,
|
||||
EquipmentRequisitionItemReturnedQuantity INT,
|
||||
EquipmentRequisitionItemReturnedCondition VARCHAR(50),
|
||||
EquipmentRequisitionItemReturnedDate DATETIME,
|
||||
EquipmentRequisitionItemVerifiedBy INT,
|
||||
EquipmentRequisitionItemRemarks TEXT,
|
||||
EquipmentRequisitionItemCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
EquipmentRequisitionItemCreatedUserID INT,
|
||||
EquipmentRequisitionItemUpdatedAt DATETIME,
|
||||
EquipmentRequisitionItemUpdatedUserID INT,
|
||||
EquipmentRequisitionItemDeletedAt DATETIME,
|
||||
EquipmentRequisitionItemDeletedUserID INT
|
||||
);
|
||||
|
||||
CREATE TABLE samples (
|
||||
sample_id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
sample_code VARCHAR(50) NOT NULL,
|
||||
plan_id INT,
|
||||
plan_location_id INT,
|
||||
sampling_date DATE,
|
||||
sampling_time TIME,
|
||||
sampler_id INT,
|
||||
preservation_time DATETIME,
|
||||
temperature DECIMAL(5, 2), -- suhu sampel saat pengambilan
|
||||
weather_condition VARCHAR(50),
|
||||
field_ph DECIMAL(5, 2),
|
||||
field_do DECIMAL(5, 2),
|
||||
field_conductivity DECIMAL(10, 2),
|
||||
field_turbidity DECIMAL(10, 2),
|
||||
sample_matrix VARCHAR(50), -- air, tanah, sedimen, dsb
|
||||
sample_source VARCHAR(100),
|
||||
container_id INT,
|
||||
preservation_id INT,
|
||||
received_by INT,
|
||||
received_date DATETIME,
|
||||
received_condition VARCHAR(50), -- good, compromised, rejected
|
||||
storage_location VARCHAR(100),
|
||||
remarks TEXT,
|
||||
status VARCHAR(20), -- collected, in transit, received, in analysis, reported
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (plan_id) REFERENCES sampling_plans(plan_id),
|
||||
FOREIGN KEY (plan_location_id) REFERENCES sampling_plan_locations(plan_location_id),
|
||||
FOREIGN KEY (sampler_id) REFERENCES master_personnel(personnel_id),
|
||||
FOREIGN KEY (container_id) REFERENCES master_sample_containers(container_id),
|
||||
FOREIGN KEY (preservation_id) REFERENCES master_preservation_methods(preservation_id),
|
||||
FOREIGN KEY (received_by) REFERENCES master_personnel(personnel_id)
|
||||
SampleID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
SampleCode VARCHAR(50) NOT NULL,
|
||||
SamplingPlanID INT,
|
||||
SamplingPlanLocationID INT,
|
||||
SampleDate DATE,
|
||||
SampleTime TIME,
|
||||
SampleSamplerID INT,
|
||||
SamplePreservationTime DATETIME,
|
||||
SampleTemperature DECIMAL(5,2),
|
||||
SampleWeatherCondition VARCHAR(50),
|
||||
SampleFieldPH DECIMAL(5,2),
|
||||
SampleFieldDO DECIMAL(5,2),
|
||||
SampleFieldConductivity DECIMAL(10,2),
|
||||
SampleFieldTurbidity DECIMAL(10,2),
|
||||
SampleMatrix VARCHAR(50),
|
||||
SampleSource VARCHAR(100),
|
||||
MasterSampleContainerID INT,
|
||||
MasterPreservationMethodID INT,
|
||||
SampleReceivedBy INT,
|
||||
SampleReceivedDate DATETIME,
|
||||
SampleReceivedCondition VARCHAR(50),
|
||||
SampleStorageLocation VARCHAR(100),
|
||||
SampleRemarks TEXT,
|
||||
SampleStatus VARCHAR(20),
|
||||
SampleCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
SampleCreatedUserID INT,
|
||||
SampleUpdatedAt DATETIME,
|
||||
SampleUpdatedUserID INT,
|
||||
SampleDeletedAt DATETIME,
|
||||
SampleDeletedUserID INT
|
||||
);
|
||||
|
||||
CREATE TABLE measurement_results_light (
|
||||
result_id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
sample_id INT,
|
||||
measurement_date DATE,
|
||||
measurement_time TIME,
|
||||
parameter_id INT,
|
||||
measurement_value DECIMAL(10, 2),
|
||||
measurement_unit VARCHAR(20),
|
||||
measurement_point VARCHAR(50),
|
||||
weather_condition VARCHAR(50),
|
||||
light_source VARCHAR(100),
|
||||
ambient_condition VARCHAR(200),
|
||||
standard_id INT,
|
||||
is_compliant BOOLEAN,
|
||||
analyst_id INT,
|
||||
verified_by INT,
|
||||
verification_date DATETIME,
|
||||
remarks TEXT,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (sample_id) REFERENCES samples(sample_id),
|
||||
FOREIGN KEY (parameter_id) REFERENCES master_parameters(parameter_id),
|
||||
FOREIGN KEY (standard_id) REFERENCES master_quality_standards(standard_id),
|
||||
FOREIGN KEY (analyst_id) REFERENCES master_personnel(personnel_id),
|
||||
FOREIGN KEY (verified_by) REFERENCES master_personnel(personnel_id)
|
||||
MeasurementResultLightID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
SampleID INT,
|
||||
MeasurementResultLightDate DATE,
|
||||
MeasurementResultLightTime TIME,
|
||||
MasterParameterID INT,
|
||||
MeasurementResultLightValue DECIMAL(10,2),
|
||||
MeasurementResultLightUnit VARCHAR(20),
|
||||
MeasurementResultLightPoint VARCHAR(50),
|
||||
MeasurementResultLightWeatherCondition VARCHAR(50),
|
||||
MeasurementResultLightSource VARCHAR(100),
|
||||
MeasurementResultLightAmbientCondition VARCHAR(200),
|
||||
MasterQualityStandardID INT,
|
||||
MeasurementResultLightIsCompliant BOOLEAN,
|
||||
MeasurementResultLightAnalystID INT,
|
||||
MeasurementResultLightVerifiedBy INT,
|
||||
MeasurementResultLightVerificationDate DATETIME,
|
||||
MeasurementResultLightRemarks TEXT,
|
||||
MeasurementResultLightCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
MeasurementResultLightCreatedUserID INT,
|
||||
MeasurementResultLightUpdatedAt DATETIME,
|
||||
MeasurementResultLightUpdatedUserID INT,
|
||||
MeasurementResultLightDeletedAt DATETIME,
|
||||
MeasurementResultLightDeletedUserID INT
|
||||
);
|
||||
|
||||
INSERT INTO master_parameters (parameter_id, parameter_code, parameter_name, parameter_group, standard_method, unit, price, instrumentation, mdl, container_type, preservation, holding_time, remarks, is_active) VALUES
|
||||
|
||||
@@ -7,60 +7,56 @@
|
||||
|
||||
-- Master Area Types
|
||||
CREATE TABLE IF NOT EXISTS master_area_types (
|
||||
area_type_id INT PRIMARY KEY,
|
||||
area_type_name VARCHAR(100) NOT NULL,
|
||||
description TEXT,
|
||||
status BOOLEAN DEFAULT TRUE,
|
||||
input_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
input_user VARCHAR(50)
|
||||
MasterAreaTypeID INT PRIMARY KEY,
|
||||
MasterAreaTypeName VARCHAR(100) NOT NULL,
|
||||
MasterAreaTypeDescription TEXT,
|
||||
MasterAreaTypeIsActive BOOLEAN DEFAULT TRUE,
|
||||
MasterAreaTypeCreatedUserID INT
|
||||
);
|
||||
|
||||
-- Master Noise Quality Standards
|
||||
CREATE TABLE IF NOT EXISTS master_noise_standards (
|
||||
standard_id INT PRIMARY KEY,
|
||||
regulation_id INT NOT NULL,
|
||||
area_type_id INT NOT NULL,
|
||||
standard_value DECIMAL(5, 1) NOT NULL,
|
||||
unit VARCHAR(10) DEFAULT 'dB(A)',
|
||||
measurement_time VARCHAR(50),
|
||||
description TEXT,
|
||||
status BOOLEAN DEFAULT TRUE,
|
||||
input_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
input_user VARCHAR(50),
|
||||
FOREIGN KEY (regulation_id) REFERENCES master_regulations(regulation_id),
|
||||
FOREIGN KEY (area_type_id) REFERENCES master_area_types(area_type_id)
|
||||
MasterNoiseStandardID INT PRIMARY KEY,
|
||||
MasterRegulationID INT NOT NULL,
|
||||
MasterAreaTypeID INT NOT NULL,
|
||||
MasterNoiseStandardValue DECIMAL(5, 1) NOT NULL,
|
||||
MasterNoiseStandardUnit VARCHAR(10) DEFAULT 'dB(A)',
|
||||
MasterNoiseStandardMeasurementTime VARCHAR(50),
|
||||
MasterNoiseStandardDescription TEXT,
|
||||
MasterNoiseStandardIsActive BOOLEAN DEFAULT TRUE,
|
||||
MasterNoiseStandardCreatedUserID INT,
|
||||
FOREIGN KEY (MasterRegulationID) REFERENCES master_regulations(regulation_id),
|
||||
FOREIGN KEY (MasterAreaTypeID) REFERENCES master_area_types(MasterAreaTypeID)
|
||||
);
|
||||
|
||||
-- Master Noise Measurement Methods
|
||||
CREATE TABLE IF NOT EXISTS master_noise_methods (
|
||||
method_id INT PRIMARY KEY,
|
||||
method_code VARCHAR(50) NOT NULL,
|
||||
method_name VARCHAR(255) NOT NULL,
|
||||
description TEXT,
|
||||
standard_reference VARCHAR(100),
|
||||
status BOOLEAN DEFAULT TRUE,
|
||||
input_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
input_user VARCHAR(50)
|
||||
MasterNoiseMethodID INT PRIMARY KEY,
|
||||
MasterNoiseMethodCode VARCHAR(50) NOT NULL,
|
||||
MasterNoiseMethodName VARCHAR(255) NOT NULL,
|
||||
MasterNoiseMethodDescription TEXT,
|
||||
MasterNoiseMethodStandardReference VARCHAR(100),
|
||||
MasterNoiseMethodIsActive BOOLEAN DEFAULT TRUE,
|
||||
MasterNoiseMethodCreatedUserID INT
|
||||
);
|
||||
|
||||
-- Master Noise Measurement Equipment
|
||||
CREATE TABLE IF NOT EXISTS master_noise_equipment (
|
||||
equipment_id INT PRIMARY KEY,
|
||||
equipment_code VARCHAR(20) NOT NULL,
|
||||
equipment_name VARCHAR(100) NOT NULL,
|
||||
equipment_type VARCHAR(50),
|
||||
brand VARCHAR(100),
|
||||
model VARCHAR(100),
|
||||
serial_number VARCHAR(100),
|
||||
accuracy_type VARCHAR(20), -- Type 0, 1, 2 for SLM
|
||||
specifications TEXT,
|
||||
calibration_date DATE,
|
||||
next_calibration_date DATE,
|
||||
calibration_status VARCHAR(20),
|
||||
certificate_file VARCHAR(255),
|
||||
status BOOLEAN DEFAULT TRUE,
|
||||
input_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
input_user VARCHAR(50)
|
||||
MasterNoiseEquipmentID INT PRIMARY KEY,
|
||||
MasterNoiseEquipmentCode VARCHAR(20) NOT NULL,
|
||||
MasterNoiseEquipmentName VARCHAR(100) NOT NULL,
|
||||
MasterNoiseEquipmentType VARCHAR(50),
|
||||
MasterNoiseEquipmentBrand VARCHAR(100),
|
||||
MasterNoiseEquipmentModel VARCHAR(100),
|
||||
MasterNoiseEquipmentSerialNumber VARCHAR(100),
|
||||
MasterNoiseEquipmentAccuracyType VARCHAR(20), -- Type 0, 1, 2 for SLM
|
||||
MasterNoiseEquipmentSpecifications TEXT,
|
||||
MasterNoiseEquipmentCalibrationDate DATE,
|
||||
MasterNoiseEquipmentNextCalibrationDate DATE,
|
||||
MasterNoiseEquipmentCalibrationStatus VARCHAR(20),
|
||||
MasterNoiseEquipmentCertificateFile VARCHAR(255),
|
||||
MasterNoiseEquipmentIsActive BOOLEAN DEFAULT TRUE,
|
||||
MasterNoiseEquipmentCreatedUserID INT
|
||||
);
|
||||
|
||||
-- ------------------------------------------------------------------------------
|
||||
@@ -130,10 +126,10 @@ CREATE TABLE IF NOT EXISTS trx_noise_measurement_details (
|
||||
input_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
input_user VARCHAR(50),
|
||||
FOREIGN KEY (measurement_id) REFERENCES trx_noise_measurement_results(measurement_id),
|
||||
FOREIGN KEY (area_type_id) REFERENCES master_area_types(area_type_id),
|
||||
FOREIGN KEY (method_id) REFERENCES master_noise_methods(method_id),
|
||||
FOREIGN KEY (equipment_id) REFERENCES master_noise_equipment(equipment_id),
|
||||
FOREIGN KEY (standard_id) REFERENCES master_noise_standards(standard_id)
|
||||
FOREIGN KEY (area_type_id) REFERENCES master_area_types(MasterAreaTypeID),
|
||||
FOREIGN KEY (method_id) REFERENCES master_noise_methods(MasterNoiseMethodID),
|
||||
FOREIGN KEY (equipment_id) REFERENCES master_noise_equipment(MasterNoiseEquipmentID),
|
||||
FOREIGN KEY (standard_id) REFERENCES master_noise_standards(MasterNoiseStandardID)
|
||||
);
|
||||
|
||||
-- Noise Control Recommendations
|
||||
@@ -156,40 +152,57 @@ CREATE TABLE IF NOT EXISTS trx_noise_control_recommendations (
|
||||
-- ------------------------------------------------------------------------------
|
||||
|
||||
-- Insert Data Master Area Types
|
||||
INSERT INTO master_area_types (area_type_id, area_type_name, description, status, input_user)
|
||||
VALUES
|
||||
(1, 'Residential Areas', 'Residential housing and settlements', TRUE, 'admin'),
|
||||
(2, 'Commercial and Trade Areas', 'Commercial and service areas, including offices', TRUE, 'admin'),
|
||||
(3, 'Office and Commercial Areas', 'Office and commercial areas', TRUE, 'admin'),
|
||||
(4, 'Industrial Areas', 'Manufacturing industrial areas', TRUE, 'admin'),
|
||||
(5, 'Hospitals and Healthcare Facilities', 'Hospitals, health centers, and other healthcare facilities', TRUE, 'admin'),
|
||||
(6, 'Schools and Educational Facilities', 'Educational areas including schools, madrasas, colleges', TRUE, 'admin'),
|
||||
(7, 'Places of Worship', 'Worship areas such as mosques, churches, temples, and other religious buildings', TRUE, 'admin');
|
||||
INSERT INTO master_area_types (
|
||||
MasterAreaTypeID, MasterAreaTypeName, MasterAreaTypeDescription,
|
||||
MasterAreaTypeIsActive, MasterAreaTypeCreatedUserID
|
||||
) VALUES
|
||||
(1, 'Residential Areas', 'Residential housing and settlements',
|
||||
TRUE, 1),
|
||||
(2, 'Commercial and Trade Areas', 'Commercial and service areas, including offices',
|
||||
TRUE, 1),
|
||||
(3, 'Office and Commercial Areas', 'Office and commercial areas',
|
||||
TRUE, 1);
|
||||
|
||||
-- Insert Data Master Noise Standards
|
||||
INSERT INTO master_noise_standards (standard_id, regulation_id, area_type_id, standard_value, unit, measurement_time, description, status, input_user)
|
||||
VALUES
|
||||
(1, 1, 1, 55.0, 'dB(A)', 'Leq 24 hours', 'Noise quality standard for residential areas', TRUE, 'admin'),
|
||||
(2, 1, 2, 70.0, 'dB(A)', 'Leq 24 hours', 'Noise quality standard for commercial and trade areas', TRUE, 'admin'),
|
||||
(3, 1, 3, 65.0, 'dB(A)', 'Leq 24 hours', 'Noise quality standard for office and commercial areas', TRUE, 'admin'),
|
||||
(4, 1, 4, 70.0, 'dB(A)', 'Leq 24 hours', 'Noise quality standard for industrial areas', TRUE, 'admin'),
|
||||
(5, 1, 5, 55.0, 'dB(A)', 'Leq 24 hours', 'Noise quality standard for hospitals and healthcare facilities', TRUE, 'admin'),
|
||||
(6, 1, 6, 55.0, 'dB(A)', 'Leq during school hours', 'Noise quality standard for schools and educational facilities', TRUE, 'admin'),
|
||||
(7, 1, 7, 55.0, 'dB(A)', 'Leq during worship times', 'Noise quality standard for places of worship', TRUE, 'admin');
|
||||
INSERT INTO master_noise_standards (
|
||||
MasterNoiseStandardID, MasterRegulationID, MasterAreaTypeID,
|
||||
MasterNoiseStandardValue, MasterNoiseStandardUnit,
|
||||
MasterNoiseStandardMeasurementTime, MasterNoiseStandardDescription,
|
||||
MasterNoiseStandardIsActive, MasterNoiseStandardCreatedUserID
|
||||
) VALUES
|
||||
(1, 1, 1, 55.0, 'dB(A)', 'Leq 24 hours',
|
||||
'Noise quality standard for residential areas', TRUE, 1),
|
||||
(2, 1, 2, 70.0, 'dB(A)', 'Leq 24 hours',
|
||||
'Noise quality standard for commercial and trade areas', TRUE, 1);
|
||||
|
||||
-- Insert Data Master Noise Measurement Methods
|
||||
INSERT INTO master_noise_methods (method_id, method_code, method_name, description, standard_reference, status, input_user)
|
||||
VALUES
|
||||
(1, 'SNI-7231-2009', 'SNI 7231:2009 - Environmental Noise Measurement Method', 'Method for measuring environmental noise levels using Sound Level Meter', 'SNI 7231:2009', TRUE, 'admin'),
|
||||
(2, 'KEPMEN-LH-48-1996', 'Ministry of Environment Decree No. 48 of 1996 - Appendix II', 'Noise level measurement method based on the Ministry of Environment Decree', 'Ministry of Environment Decree No.48 of 1996', TRUE, 'admin');
|
||||
INSERT INTO master_noise_methods (
|
||||
MasterNoiseMethodID, MasterNoiseMethodCode, MasterNoiseMethodName,
|
||||
MasterNoiseMethodDescription, MasterNoiseMethodStandardReference,
|
||||
MasterNoiseMethodIsActive, MasterNoiseMethodCreatedUserID
|
||||
) VALUES
|
||||
(1, 'SNI-7231-2009', 'SNI 7231:2009 - Environmental Noise Measurement Method',
|
||||
'Method for measuring environmental noise levels using Sound Level Meter',
|
||||
'SNI 7231:2009', TRUE, 1),
|
||||
(2, 'KEPMEN-LH-48-1996', 'Ministry of Environment Decree No. 48 of 1996 - Appendix II',
|
||||
'Noise level measurement method based on the Ministry of Environment Decree',
|
||||
'Ministry of Environment Decree No.48 of 1996', TRUE, 1);
|
||||
|
||||
-- Insert Data Master Noise Measurement Equipment
|
||||
INSERT INTO master_noise_equipment (equipment_id, equipment_code, equipment_name, equipment_type, brand, model, serial_number, accuracy_type, specifications, calibration_date, next_calibration_date, calibration_status, certificate_file, status, input_user)
|
||||
VALUES
|
||||
(1, 'SLM-01', 'Sound Level Meter', 'SLM', 'RION', 'NL-52', '12345678', 'Type 1', 'Range: 20-130 dB, Accuracy: ±1.0 dB, Frequency range: 20 Hz - 20 kHz', '2024-02-15', '2025-02-15', 'VALID', '/documents/calibration/slm_rion_2024.pdf', TRUE, 'admin'),
|
||||
(2, 'CAL-01', 'Acoustic Calibrator', 'Calibrator', 'RION', 'NC-74', '87654321', 'Class 1', 'Calibration level: 94 dB, Accuracy: ±0.3 dB', '2024-02-15', '2025-02-15', 'VALID', '/documents/calibration/cal_rion_2024.pdf', TRUE, 'admin'),
|
||||
(3, 'SLM-02', 'Sound Level Meter', 'SLM', 'Cirrus', 'CR171B', 'CR123456', 'Type 1', 'Range: 20-140 dB, Accuracy: ±0.5 dB, Frequency range: 10 Hz - 20 kHz', '2023-11-20', '2024-11-20', 'VALID', '/documents/calibration/slm_cirrus_2023.pdf', TRUE, 'admin'),
|
||||
(4, 'WS-01', 'Weather Station', 'Weather Meter', 'Kestrel', '5500', 'KW123456', 'N/A', 'Wind speed, direction, temperature, humidity, pressure measurement', '2023-10-10', '2024-10-10', 'VALID', '/documents/calibration/weather_kestrel_2023.pdf', TRUE, 'admin');
|
||||
INSERT INTO master_noise_equipment (
|
||||
MasterNoiseEquipmentID, MasterNoiseEquipmentCode, MasterNoiseEquipmentName,
|
||||
MasterNoiseEquipmentType, MasterNoiseEquipmentBrand,
|
||||
MasterNoiseEquipmentModel, MasterNoiseEquipmentSerialNumber,
|
||||
MasterNoiseEquipmentAccuracyType, MasterNoiseEquipmentSpecifications,
|
||||
MasterNoiseEquipmentCalibrationDate, MasterNoiseEquipmentNextCalibrationDate,
|
||||
MasterNoiseEquipmentCalibrationStatus, MasterNoiseEquipmentCertificateFile,
|
||||
MasterNoiseEquipmentIsActive, MasterNoiseEquipmentCreatedUserID
|
||||
) VALUES
|
||||
(1, 'SLM-01', 'Sound Level Meter', 'SLM',
|
||||
'RION', 'NL-52', '12345678', 'Type 1',
|
||||
'Range: 20-130 dB, Accuracy: ±1.0 dB, Frequency range: 20 Hz - 20 kHz',
|
||||
'2024-02-15', '2025-02-15', 'VALID',
|
||||
'/documents/calibration/slm_rion_2024.pdf', TRUE, 1);
|
||||
|
||||
-- ------------------------------------------------------------------------------
|
||||
-- Sample Data Insertion - Transaction Tables
|
||||
|
||||
@@ -7,64 +7,78 @@
|
||||
|
||||
-- Master Area Types
|
||||
CREATE TABLE IF NOT EXISTS master_area_types (
|
||||
area_type_id INT PRIMARY KEY,
|
||||
area_type_name VARCHAR(100) NOT NULL,
|
||||
description TEXT,
|
||||
status BOOLEAN DEFAULT TRUE,
|
||||
input_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
input_user VARCHAR(50)
|
||||
MasterAreaTypeID INT PRIMARY KEY,
|
||||
MasterAreaTypeName VARCHAR(100) NOT NULL,
|
||||
MasterAreaTypeDescription TEXT,
|
||||
MasterAreaTypeIsActive BOOLEAN DEFAULT TRUE,
|
||||
MasterAreaTypeCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
MasterAreaTypeCreatedUserID INT,
|
||||
MasterAreaTypeUpdatedAt DATETIME,
|
||||
MasterAreaTypeUpdatedUserID INT,
|
||||
MasterAreaTypeDeletedAt DATETIME,
|
||||
MasterAreaTypeDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Master Particulate Standards
|
||||
CREATE TABLE IF NOT EXISTS master_particulate_standards (
|
||||
standard_id INT PRIMARY KEY,
|
||||
regulation_id INT NOT NULL,
|
||||
area_type_id INT NOT NULL,
|
||||
parameter_code VARCHAR(20) NOT NULL, -- TSP, PM10, PM2.5
|
||||
standard_value DECIMAL(7, 2) NOT NULL,
|
||||
unit VARCHAR(20) DEFAULT 'μg/Nm³',
|
||||
averaging_time VARCHAR(50),
|
||||
description TEXT,
|
||||
status BOOLEAN DEFAULT TRUE,
|
||||
input_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
input_user VARCHAR(50),
|
||||
FOREIGN KEY (regulation_id) REFERENCES master_regulations(regulation_id),
|
||||
FOREIGN KEY (area_type_id) REFERENCES master_area_types(area_type_id)
|
||||
MasterParticulateStandardID INT PRIMARY KEY,
|
||||
MasterRegulationID INT NOT NULL,
|
||||
MasterAreaTypeID INT NOT NULL,
|
||||
MasterParticulateStandardParameterCode VARCHAR(20) NOT NULL, -- TSP, PM10, PM2.5
|
||||
MasterParticulateStandardValue DECIMAL(7,2) NOT NULL,
|
||||
MasterParticulateStandardUnit VARCHAR(20) DEFAULT 'μg/Nm³',
|
||||
MasterParticulateStandardAveragingTime VARCHAR(50),
|
||||
MasterParticulateStandardDescription TEXT,
|
||||
MasterParticulateStandardIsActive BOOLEAN DEFAULT TRUE,
|
||||
MasterParticulateStandardCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
MasterParticulateStandardCreatedUserID INT,
|
||||
MasterParticulateStandardUpdatedAt DATETIME,
|
||||
MasterParticulateStandardUpdatedUserID INT,
|
||||
MasterParticulateStandardDeletedAt DATETIME,
|
||||
MasterParticulateStandardDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Master Particulate Measurement Methods
|
||||
CREATE TABLE IF NOT EXISTS master_particulate_methods (
|
||||
method_id INT PRIMARY KEY,
|
||||
method_code VARCHAR(50) NOT NULL,
|
||||
method_name VARCHAR(255) NOT NULL,
|
||||
parameter_code VARCHAR(20) NOT NULL, -- TSP, PM10, PM2.5
|
||||
description TEXT,
|
||||
standard_reference VARCHAR(100),
|
||||
status BOOLEAN DEFAULT TRUE,
|
||||
input_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
input_user VARCHAR(50)
|
||||
MasterParticulateMethodID INT PRIMARY KEY,
|
||||
MasterParticulateMethodCode VARCHAR(50) NOT NULL,
|
||||
MasterParticulateMethodName VARCHAR(255) NOT NULL,
|
||||
MasterParticulateMethodParameterCode VARCHAR(20) NOT NULL, -- TSP, PM10, PM2.5
|
||||
MasterParticulateMethodDescription TEXT,
|
||||
MasterParticulateMethodStandardReference VARCHAR(100),
|
||||
MasterParticulateMethodIsActive BOOLEAN DEFAULT TRUE,
|
||||
MasterParticulateMethodCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
MasterParticulateMethodCreatedUserID INT,
|
||||
MasterParticulateMethodUpdatedAt DATETIME,
|
||||
MasterParticulateMethodUpdatedUserID INT,
|
||||
MasterParticulateMethodDeletedAt DATETIME,
|
||||
MasterParticulateMethodDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Master Particulate Measurement Equipment
|
||||
CREATE TABLE IF NOT EXISTS master_particulate_equipment (
|
||||
equipment_id INT PRIMARY KEY,
|
||||
equipment_code VARCHAR(20) NOT NULL,
|
||||
equipment_name VARCHAR(100) NOT NULL,
|
||||
equipment_type VARCHAR(50),
|
||||
brand VARCHAR(100),
|
||||
model VARCHAR(100),
|
||||
serial_number VARCHAR(100),
|
||||
parameter_measured VARCHAR(100), -- TSP, PM10, PM2.5, Multi-parameter
|
||||
specifications TEXT,
|
||||
flow_rate VARCHAR(50),
|
||||
filter_type VARCHAR(100),
|
||||
calibration_date DATE,
|
||||
next_calibration_date DATE,
|
||||
calibration_status VARCHAR(20),
|
||||
certificate_file VARCHAR(255),
|
||||
status BOOLEAN DEFAULT TRUE,
|
||||
input_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
input_user VARCHAR(50)
|
||||
MasterParticulateEquipmentID INT PRIMARY KEY,
|
||||
MasterParticulateEquipmentCode VARCHAR(20) NOT NULL,
|
||||
MasterParticulateEquipmentName VARCHAR(100) NOT NULL,
|
||||
MasterParticulateEquipmentType VARCHAR(50),
|
||||
MasterParticulateEquipmentBrand VARCHAR(100),
|
||||
MasterParticulateEquipmentModel VARCHAR(100),
|
||||
MasterParticulateEquipmentSerialNumber VARCHAR(100),
|
||||
MasterParticulateEquipmentParameterMeasured VARCHAR(100), -- TSP, PM10, PM2.5, Multi-parameter
|
||||
MasterParticulateEquipmentSpecifications TEXT,
|
||||
MasterParticulateEquipmentFlowRate VARCHAR(50),
|
||||
MasterParticulateEquipmentFilterType VARCHAR(100),
|
||||
MasterParticulateEquipmentCalibrationDate DATE,
|
||||
MasterParticulateEquipmentNextCalibrationDate DATE,
|
||||
MasterParticulateEquipmentCalibrationStatus VARCHAR(20),
|
||||
MasterParticulateEquipmentCertificateFile VARCHAR(255),
|
||||
MasterParticulateEquipmentIsActive BOOLEAN DEFAULT TRUE,
|
||||
MasterParticulateEquipmentCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
MasterParticulateEquipmentCreatedUserID INT,
|
||||
MasterParticulateEquipmentUpdatedAt DATETIME,
|
||||
MasterParticulateEquipmentUpdatedUserID INT,
|
||||
MasterParticulateEquipmentDeletedAt DATETIME,
|
||||
MasterParticulateEquipmentDeletedUserID INT
|
||||
);
|
||||
|
||||
-- ------------------------------------------------------------------------------
|
||||
@@ -72,91 +86,100 @@ CREATE TABLE IF NOT EXISTS master_particulate_equipment (
|
||||
-- ------------------------------------------------------------------------------
|
||||
|
||||
-- Particulate Sampling Plan
|
||||
CREATE TABLE IF NOT EXISTS trx_particulate_sampling_plan (
|
||||
sampling_plan_id INT PRIMARY KEY,
|
||||
sampling_plan_code VARCHAR(50) NOT NULL,
|
||||
project_name VARCHAR(255) NOT NULL,
|
||||
client_id INT NOT NULL,
|
||||
planned_sampling_date DATE NOT NULL,
|
||||
sampling_location TEXT NOT NULL,
|
||||
point_count INT,
|
||||
parameters VARCHAR(100), -- Comma separated list: TSP, PM10, PM2.5
|
||||
approval_status VARCHAR(20) DEFAULT 'DRAFT',
|
||||
notes TEXT,
|
||||
input_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
input_user VARCHAR(50)
|
||||
CREATE TABLE IF NOT EXISTS particulate_sampling_plans (
|
||||
ParticulateSamplingPlanID INT PRIMARY KEY,
|
||||
ParticulateSamplingPlanCode VARCHAR(50) NOT NULL,
|
||||
ParticulateSamplingPlanProjectName VARCHAR(255) NOT NULL,
|
||||
ClientID INT NOT NULL,
|
||||
ParticulateSamplingPlanDate DATE NOT NULL,
|
||||
ParticulateSamplingPlanLocation TEXT NOT NULL,
|
||||
ParticulateSamplingPlanPointCount INT,
|
||||
ParticulateSamplingPlanParameters VARCHAR(100), -- Comma separated list: TSP, PM10, PM2.5
|
||||
ParticulateSamplingPlanStatus VARCHAR(20) DEFAULT 'DRAFT',
|
||||
ParticulateSamplingPlanNotes TEXT,
|
||||
ParticulateSamplingPlanCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
ParticulateSamplingPlanCreatedUserID INT,
|
||||
ParticulateSamplingPlanUpdatedAt DATETIME,
|
||||
ParticulateSamplingPlanUpdatedUserID INT,
|
||||
ParticulateSamplingPlanDeletedAt DATETIME,
|
||||
ParticulateSamplingPlanDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Particulate Measurement Results - Header
|
||||
CREATE TABLE IF NOT EXISTS trx_particulate_measurement_results (
|
||||
measurement_id INT PRIMARY KEY,
|
||||
sampling_plan_id INT NOT NULL,
|
||||
report_code VARCHAR(50) NOT NULL,
|
||||
sampling_date DATE NOT NULL,
|
||||
start_time TIME,
|
||||
end_time TIME,
|
||||
weather_condition VARCHAR(100),
|
||||
temperature DECIMAL(5, 2),
|
||||
humidity DECIMAL(5, 2),
|
||||
wind_speed DECIMAL(5, 2),
|
||||
wind_direction VARCHAR(10),
|
||||
pressure DECIMAL(7, 2),
|
||||
sampling_officers VARCHAR(100),
|
||||
report_status VARCHAR(20) DEFAULT 'DRAFT',
|
||||
notes TEXT,
|
||||
input_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
input_user VARCHAR(50),
|
||||
FOREIGN KEY (sampling_plan_id) REFERENCES trx_particulate_sampling_plan(sampling_plan_id)
|
||||
CREATE TABLE IF NOT EXISTS particulate_measurements (
|
||||
ParticulateMeasurementID INT PRIMARY KEY,
|
||||
ParticulateSamplingPlanID INT NOT NULL,
|
||||
ParticulateMeasurementCode VARCHAR(50) NOT NULL,
|
||||
ParticulateMeasurementDate DATE NOT NULL,
|
||||
ParticulateMeasurementStartTime TIME,
|
||||
ParticulateMeasurementEndTime TIME,
|
||||
ParticulateMeasurementWeather VARCHAR(100),
|
||||
ParticulateMeasurementTemperature DECIMAL(5,2),
|
||||
ParticulateMeasurementHumidity DECIMAL(5,2),
|
||||
ParticulateMeasurementWindSpeed DECIMAL(5,2),
|
||||
ParticulateMeasurementWindDirection VARCHAR(10),
|
||||
ParticulateMeasurementPressure DECIMAL(7,2),
|
||||
ParticulateMeasurementOfficers VARCHAR(100),
|
||||
ParticulateMeasurementStatus VARCHAR(20) DEFAULT 'DRAFT',
|
||||
ParticulateMeasurementNotes TEXT,
|
||||
ParticulateMeasurementCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
ParticulateMeasurementCreatedUserID INT,
|
||||
ParticulateMeasurementUpdatedAt DATETIME,
|
||||
ParticulateMeasurementUpdatedUserID INT,
|
||||
ParticulateMeasurementDeletedAt DATETIME,
|
||||
ParticulateMeasurementDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Particulate Measurement Details
|
||||
CREATE TABLE IF NOT EXISTS trx_particulate_measurement_details (
|
||||
measurement_detail_id INT PRIMARY KEY,
|
||||
measurement_id INT NOT NULL,
|
||||
point_code VARCHAR(20) NOT NULL,
|
||||
location_name VARCHAR(255) NOT NULL,
|
||||
area_description TEXT,
|
||||
area_type_id INT NOT NULL,
|
||||
latitude DECIMAL(10, 6),
|
||||
longitude DECIMAL(10, 6),
|
||||
sampling_height DECIMAL(4, 2),
|
||||
sampling_duration DECIMAL(5, 2),
|
||||
parameter_code VARCHAR(20) NOT NULL, -- TSP, PM10, PM2.5
|
||||
method_id INT NOT NULL,
|
||||
equipment_id INT NOT NULL,
|
||||
filter_id VARCHAR(50),
|
||||
initial_weight DECIMAL(10, 5),
|
||||
final_weight DECIMAL(10, 5),
|
||||
flow_rate DECIMAL(7, 2),
|
||||
volume_sampled DECIMAL(10, 2),
|
||||
result_value DECIMAL(8, 2) NOT NULL,
|
||||
standard_id INT NOT NULL,
|
||||
compliance_status VARCHAR(20),
|
||||
major_sources TEXT,
|
||||
recommendations TEXT,
|
||||
notes TEXT,
|
||||
input_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
input_user VARCHAR(50),
|
||||
FOREIGN KEY (measurement_id) REFERENCES trx_particulate_measurement_results(measurement_id),
|
||||
FOREIGN KEY (area_type_id) REFERENCES master_area_types(area_type_id),
|
||||
FOREIGN KEY (method_id) REFERENCES master_particulate_methods(method_id),
|
||||
FOREIGN KEY (equipment_id) REFERENCES master_particulate_equipment(equipment_id),
|
||||
FOREIGN KEY (standard_id) REFERENCES master_particulate_standards(standard_id)
|
||||
CREATE TABLE IF NOT EXISTS particulate_measurement_details (
|
||||
ParticulateMeasurementDetailID INT PRIMARY KEY,
|
||||
ParticulateMeasurementID INT NOT NULL,
|
||||
ParticulateMeasurementDetailPointCode VARCHAR(20) NOT NULL,
|
||||
ParticulateMeasurementDetailLocation VARCHAR(255) NOT NULL,
|
||||
ParticulateMeasurementDetailAreaDescription TEXT,
|
||||
MasterAreaTypeID INT NOT NULL,
|
||||
ParticulateMeasurementDetailLatitude DECIMAL(10,6),
|
||||
ParticulateMeasurementDetailLongitude DECIMAL(10,6),
|
||||
ParticulateMeasurementDetailHeight DECIMAL(4,2),
|
||||
ParticulateMeasurementDetailDuration DECIMAL(5,2),
|
||||
ParticulateMeasurementDetailParameterCode VARCHAR(20) NOT NULL, -- TSP, PM10, PM2.5
|
||||
MasterParticulateMethodID INT NOT NULL,
|
||||
MasterParticulateEquipmentID INT NOT NULL,
|
||||
ParticulateMeasurementDetailFilterID VARCHAR(50),
|
||||
ParticulateMeasurementDetailInitialWeight DECIMAL(10,5),
|
||||
ParticulateMeasurementDetailFinalWeight DECIMAL(10,5),
|
||||
ParticulateMeasurementDetailFlowRate DECIMAL(7,2),
|
||||
ParticulateMeasurementDetailVolume DECIMAL(10,2),
|
||||
ParticulateMeasurementDetailResult DECIMAL(8,2) NOT NULL,
|
||||
MasterParticulateStandardID INT NOT NULL,
|
||||
ParticulateMeasurementDetailComplianceStatus VARCHAR(20),
|
||||
ParticulateMeasurementDetailSources TEXT,
|
||||
ParticulateMeasurementDetailRecommendations TEXT,
|
||||
ParticulateMeasurementDetailNotes TEXT,
|
||||
ParticulateMeasurementDetailCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
ParticulateMeasurementDetailCreatedUserID INT,
|
||||
ParticulateMeasurementDetailUpdatedAt DATETIME,
|
||||
ParticulateMeasurementDetailUpdatedUserID INT,
|
||||
ParticulateMeasurementDetailDeletedAt DATETIME,
|
||||
ParticulateMeasurementDetailDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Dust Control Recommendations
|
||||
CREATE TABLE IF NOT EXISTS trx_dust_control_recommendations (
|
||||
recommendation_id INT PRIMARY KEY,
|
||||
measurement_detail_id INT NOT NULL,
|
||||
control_type VARCHAR(50) NOT NULL, -- Engineering, Administrative, PPE
|
||||
control_description TEXT NOT NULL,
|
||||
priority INT,
|
||||
estimated_cost DECIMAL(12, 2),
|
||||
estimated_reduction DECIMAL(5, 1),
|
||||
implementation_status VARCHAR(20) DEFAULT 'PLANNED',
|
||||
input_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
input_user VARCHAR(50),
|
||||
FOREIGN KEY (measurement_detail_id) REFERENCES trx_particulate_measurement_details(measurement_detail_id)
|
||||
CREATE TABLE IF NOT EXISTS dust_control_recommendations (
|
||||
DustControlRecommendationID INT PRIMARY KEY,
|
||||
ParticulateMeasurementDetailID INT NOT NULL,
|
||||
DustControlRecommendationType VARCHAR(50) NOT NULL, -- Engineering, Administrative, PPE
|
||||
DustControlRecommendationDescription TEXT NOT NULL,
|
||||
DustControlRecommendationPriority INT,
|
||||
DustControlRecommendationEstimatedCost DECIMAL(12,2),
|
||||
DustControlRecommendationEstimatedReduction DECIMAL(5,1),
|
||||
DustControlRecommendationStatus VARCHAR(20) DEFAULT 'PLANNED',
|
||||
DustControlRecommendationCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
DustControlRecommendationCreatedUserID INT,
|
||||
DustControlRecommendationUpdatedAt DATETIME,
|
||||
DustControlRecommendationUpdatedUserID INT,
|
||||
DustControlRecommendationDeletedAt DATETIME,
|
||||
DustControlRecommendationDeletedUserID INT
|
||||
);
|
||||
|
||||
-- ------------------------------------------------------------------------------
|
||||
@@ -164,126 +187,126 @@ CREATE TABLE IF NOT EXISTS trx_dust_control_recommendations (
|
||||
-- ------------------------------------------------------------------------------
|
||||
|
||||
-- Insert Data Master Area Types
|
||||
INSERT INTO master_area_types (area_type_id, area_type_name, description, status, input_user)
|
||||
INSERT INTO master_area_types (MasterAreaTypeID, MasterAreaTypeName, MasterAreaTypeDescription, MasterAreaTypeIsActive, MasterAreaTypeCreatedUserID)
|
||||
VALUES
|
||||
(1, 'Industrial Areas', 'Manufacturing and industrial activity areas', TRUE, 'admin'),
|
||||
(2, 'Residential Areas', 'Residential housing and settlements', TRUE, 'admin'),
|
||||
(3, 'Office and Commercial Areas', 'Office buildings and commercial areas', TRUE, 'admin'),
|
||||
(4, 'Parks and Green Areas', 'Public parks and green spaces', TRUE, 'admin'),
|
||||
(5, 'Sensitive Areas', 'Hospitals, schools, and other sensitive locations', TRUE, 'admin');
|
||||
(1, 'Industrial Areas', 'Manufacturing and industrial activity areas', TRUE, 1),
|
||||
(2, 'Residential Areas', 'Residential housing and settlements', TRUE, 1),
|
||||
(3, 'Office and Commercial Areas', 'Office buildings and commercial areas', TRUE, 1),
|
||||
(4, 'Parks and Green Areas', 'Public parks and green spaces', TRUE, 1),
|
||||
(5, 'Sensitive Areas', 'Hospitals, schools, and other sensitive locations', TRUE, 1);
|
||||
|
||||
-- Insert Data Master Particulate Standards
|
||||
INSERT INTO master_particulate_standards (standard_id, regulation_id, area_type_id, parameter_code, standard_value, unit, averaging_time, description, status, input_user)
|
||||
INSERT INTO master_particulate_standards (MasterParticulateStandardID, MasterRegulationID, MasterAreaTypeID, MasterParticulateStandardParameterCode, MasterParticulateStandardValue, MasterParticulateStandardUnit, MasterParticulateStandardAveragingTime, MasterParticulateStandardDescription, MasterParticulateStandardIsActive, MasterParticulateStandardCreatedUserID)
|
||||
VALUES
|
||||
-- TSP/Total Particulate Matter Standards
|
||||
(1, 1, 1, 'TSP', 230.00, 'μg/Nm³', '24 hours', 'Industrial areas TSP standard', TRUE, 'admin'),
|
||||
(2, 1, 2, 'TSP', 90.00, 'μg/Nm³', '24 hours', 'Residential areas TSP standard', TRUE, 'admin'),
|
||||
(3, 1, 3, 'TSP', 90.00, 'μg/Nm³', '24 hours', 'Office and commercial areas TSP standard', TRUE, 'admin'),
|
||||
(4, 1, 4, 'TSP', 90.00, 'μg/Nm³', '24 hours', 'Parks and green areas TSP standard', TRUE, 'admin'),
|
||||
(5, 1, 5, 'TSP', 90.00, 'μg/Nm³', '24 hours', 'Sensitive areas TSP standard', TRUE, 'admin'),
|
||||
(1, 1, 1, 'TSP', 230.00, 'μg/Nm³', '24 hours', 'Industrial areas TSP standard', TRUE, 1),
|
||||
(2, 1, 2, 'TSP', 90.00, 'μg/Nm³', '24 hours', 'Residential areas TSP standard', TRUE, 1),
|
||||
(3, 1, 3, 'TSP', 90.00, 'μg/Nm³', '24 hours', 'Office and commercial areas TSP standard', TRUE, 1),
|
||||
(4, 1, 4, 'TSP', 90.00, 'μg/Nm³', '24 hours', 'Parks and green areas TSP standard', TRUE, 1),
|
||||
(5, 1, 5, 'TSP', 90.00, 'μg/Nm³', '24 hours', 'Sensitive areas TSP standard', TRUE, 1),
|
||||
|
||||
-- PM10 Standards
|
||||
(6, 1, 1, 'PM10', 150.00, 'μg/Nm³', '24 hours', 'Industrial areas PM10 standard', TRUE, 'admin'),
|
||||
(7, 1, 2, 'PM10', 75.00, 'μg/Nm³', '24 hours', 'Residential areas PM10 standard', TRUE, 'admin'),
|
||||
(8, 1, 3, 'PM10', 75.00, 'μg/Nm³', '24 hours', 'Office and commercial areas PM10 standard', TRUE, 'admin'),
|
||||
(9, 1, 4, 'PM10', 75.00, 'μg/Nm³', '24 hours', 'Parks and green areas PM10 standard', TRUE, 'admin'),
|
||||
(10, 1, 5, 'PM10', 75.00, 'μg/Nm³', '24 hours', 'Sensitive areas PM10 standard', TRUE, 'admin'),
|
||||
(6, 1, 1, 'PM10', 150.00, 'μg/Nm³', '24 hours', 'Industrial areas PM10 standard', TRUE, 1),
|
||||
(7, 1, 2, 'PM10', 75.00, 'μg/Nm³', '24 hours', 'Residential areas PM10 standard', TRUE, 1),
|
||||
(8, 1, 3, 'PM10', 75.00, 'μg/Nm³', '24 hours', 'Office and commercial areas PM10 standard', TRUE, 1),
|
||||
(9, 1, 4, 'PM10', 75.00, 'μg/Nm³', '24 hours', 'Parks and green areas PM10 standard', TRUE, 1),
|
||||
(10, 1, 5, 'PM10', 75.00, 'μg/Nm³', '24 hours', 'Sensitive areas PM10 standard', TRUE, 1),
|
||||
|
||||
-- PM2.5 Standards
|
||||
(11, 1, 1, 'PM2.5', 55.00, 'μg/Nm³', '24 hours', 'Industrial areas PM2.5 standard', TRUE, 'admin'),
|
||||
(12, 1, 2, 'PM2.5', 55.00, 'μg/Nm³', '24 hours', 'Residential areas PM2.5 standard', TRUE, 'admin'),
|
||||
(13, 1, 3, 'PM2.5', 55.00, 'μg/Nm³', '24 hours', 'Office and commercial areas PM2.5 standard', TRUE, 'admin'),
|
||||
(14, 1, 4, 'PM2.5', 55.00, 'μg/Nm³', '24 hours', 'Parks and green areas PM2.5 standard', TRUE, 'admin'),
|
||||
(15, 1, 5, 'PM2.5', 55.00, 'μg/Nm³', '24 hours', 'Sensitive areas PM2.5 standard', TRUE, 'admin');
|
||||
(11, 1, 1, 'PM2.5', 55.00, 'μg/Nm³', '24 hours', 'Industrial areas PM2.5 standard', TRUE, 1),
|
||||
(12, 1, 2, 'PM2.5', 55.00, 'μg/Nm³', '24 hours', 'Residential areas PM2.5 standard', TRUE, 1),
|
||||
(13, 1, 3, 'PM2.5', 55.00, 'μg/Nm³', '24 hours', 'Office and commercial areas PM2.5 standard', TRUE, 1),
|
||||
(14, 1, 4, 'PM2.5', 55.00, 'μg/Nm³', '24 hours', 'Parks and green areas PM2.5 standard', TRUE, 1),
|
||||
(15, 1, 5, 'PM2.5', 55.00, 'μg/Nm³', '24 hours', 'Sensitive areas PM2.5 standard', TRUE, 1);
|
||||
|
||||
-- Insert Data Master Particulate Measurement Methods
|
||||
INSERT INTO master_particulate_methods (method_id, method_code, method_name, parameter_code, description, standard_reference, status, input_user)
|
||||
INSERT INTO master_particulate_methods (MasterParticulateMethodID, MasterParticulateMethodCode, MasterParticulateMethodName, MasterParticulateMethodParameterCode, MasterParticulateMethodDescription, MasterParticulateMethodStandardReference, MasterParticulateMethodIsActive, MasterParticulateMethodCreatedUserID)
|
||||
VALUES
|
||||
(1, 'SNI-7119.3-2005', 'High Volume Method for TSP', 'TSP', 'Gravimetric method for TSP using high volume sampler', 'SNI 19-7119.3-2005', TRUE, 'admin'),
|
||||
(2, 'SNI-7119.15-2016', 'High Volume Method for PM10', 'PM10', 'Gravimetric method for PM10 using high volume sampler with PM10 inlet', 'SNI 19-7119.15-2016', TRUE, 'admin'),
|
||||
(3, 'SNI-7119.14-2016', 'Gravimetric Method for PM2.5', 'PM2.5', 'Gravimetric method for PM2.5 using low volume sampler with PM2.5 inlet', 'SNI 19-7119.14-2016', TRUE, 'admin'),
|
||||
(4, 'US-EPA-IO-2.1', 'EPA Method IO-2.1 for TSP', 'TSP', 'EPA Method for sampling TSP using high volume samplers', 'US EPA IO-2.1', TRUE, 'admin'),
|
||||
(5, 'US-EPA-IO-3.1', 'EPA Method IO-3.1 for PM10', 'PM10', 'EPA Method for PM10 sampling', 'US EPA IO-3.1', TRUE, 'admin');
|
||||
(1, 'SNI-7119.3-2005', 'High Volume Method for TSP', 'TSP', 'Gravimetric method for TSP using high volume sampler', 'SNI 19-7119.3-2005', TRUE, 1),
|
||||
(2, 'SNI-7119.15-2016', 'High Volume Method for PM10', 'PM10', 'Gravimetric method for PM10 using high volume sampler with PM10 inlet', 'SNI 19-7119.15-2016', TRUE, 1),
|
||||
(3, 'SNI-7119.14-2016', 'Gravimetric Method for PM2.5', 'PM2.5', 'Gravimetric method for PM2.5 using low volume sampler with PM2.5 inlet', 'SNI 19-7119.14-2016', TRUE, 1),
|
||||
(4, 'US-EPA-IO-2.1', 'EPA Method IO-2.1 for TSP', 'TSP', 'EPA Method for sampling TSP using high volume samplers', 'US EPA IO-2.1', TRUE, 1),
|
||||
(5, 'US-EPA-IO-3.1', 'EPA Method IO-3.1 for PM10', 'PM10', 'EPA Method for PM10 sampling', 'US EPA IO-3.1', TRUE, 1);
|
||||
|
||||
-- Insert Data Master Particulate Measurement Equipment
|
||||
INSERT INTO master_particulate_equipment (equipment_id, equipment_code, equipment_name, equipment_type, brand, model, serial_number, parameter_measured, specifications, flow_rate, filter_type, calibration_date, next_calibration_date, calibration_status, certificate_file, status, input_user)
|
||||
INSERT INTO master_particulate_equipment (MasterParticulateEquipmentID, MasterParticulateEquipmentCode, MasterParticulateEquipmentName, MasterParticulateEquipmentType, MasterParticulateEquipmentBrand, MasterParticulateEquipmentModel, MasterParticulateEquipmentSerialNumber, MasterParticulateEquipmentParameterMeasured, MasterParticulateEquipmentSpecifications, MasterParticulateEquipmentFlowRate, MasterParticulateEquipmentFilterType, MasterParticulateEquipmentCalibrationDate, MasterParticulateEquipmentNextCalibrationDate, MasterParticulateEquipmentCalibrationStatus, MasterParticulateEquipmentCertificateFile, MasterParticulateEquipmentIsActive, MasterParticulateEquipmentCreatedUserID)
|
||||
VALUES
|
||||
(1, 'HVAS-01', 'High Volume Air Sampler', 'HVAS', 'Tisch Environmental', 'TE-5000', 'HV12345', 'TSP', 'Flow rate: 1.13-1.70 m³/min, Motor: Continuous duty brushes', '1.13-1.70 m³/min', 'Glass Fiber Filter 8×10 inch', '2024-04-05', '2025-04-05', 'VALID', '/documents/calibration/hvas_tisch_2024.pdf', TRUE, 'admin'),
|
||||
(2, 'PM10-01', 'PM10 High Volume Sampler', 'PM10 HVAS', 'Tisch Environmental', 'TE-6070', 'PM10-7890', 'PM10', 'Flow rate: 1.13-1.70 m³/min, Size-selective inlet', '1.13-1.70 m³/min', 'Quartz Fiber Filter 8×10 inch', '2024-04-10', '2025-04-10', 'VALID', '/documents/calibration/pm10_tisch_2024.pdf', TRUE, 'admin'),
|
||||
(3, 'PM25-01', 'Low Volume PM2.5 Sampler', 'PM2.5 LVS', 'BGI', 'PQ200', 'PQ-5678', 'PM2.5', 'Flow rate: 16.7 L/min, WINS impactor', '16.7 L/min', '47mm PTFE membrane filter', '2024-03-15', '2025-03-15', 'VALID', '/documents/calibration/pm25_bgi_2024.pdf', TRUE, 'admin'),
|
||||
(4, 'MET-01', 'Weather Station', 'Weather Monitor', 'Davis', 'Vantage Pro2', 'WS78901', 'Meteorological Parameters', 'Temperature, humidity, pressure, wind speed/direction', 'N/A', 'N/A', '2024-03-15', '2025-03-15', 'VALID', '/documents/calibration/met_davis_2024.pdf', TRUE, 'admin'),
|
||||
(5, 'BAL-01', 'Analytical Balance', 'Microbalance', 'Mettler Toledo', 'XPR2U', 'MT34567', 'Filter Weighing', 'Range: 0-2.1g, Readability: 0.1μg, Repeatability: 0.15μg', 'N/A', 'N/A', '2024-02-20', '2025-02-20', 'VALID', '/documents/calibration/bal_mettler_2024.pdf', TRUE, 'admin');
|
||||
(1, 'HVAS-01', 'High Volume Air Sampler', 'HVAS', 'Tisch Environmental', 'TE-5000', 'HV12345', 'TSP', 'Flow rate: 1.13-1.70 m³/min, Motor: Continuous duty brushes', '1.13-1.70 m³/min', 'Glass Fiber Filter 8×10 inch', '2024-04-05', '2025-04-05', 'VALID', '/documents/calibration/hvas_tisch_2024.pdf', TRUE, 1),
|
||||
(2, 'PM10-01', 'PM10 High Volume Sampler', 'PM10 HVAS', 'Tisch Environmental', 'TE-6070', 'PM10-7890', 'PM10', 'Flow rate: 1.13-1.70 m³/min, Size-selective inlet', '1.13-1.70 m³/min', 'Quartz Fiber Filter 8×10 inch', '2024-04-10', '2025-04-10', 'VALID', '/documents/calibration/pm10_tisch_2024.pdf', TRUE, 1),
|
||||
(3, 'PM25-01', 'Low Volume PM2.5 Sampler', 'PM2.5 LVS', 'BGI', 'PQ200', 'PQ-5678', 'PM2.5', 'Flow rate: 16.7 L/min, WINS impactor', '16.7 L/min', '47mm PTFE membrane filter', '2024-03-15', '2025-03-15', 'VALID', '/documents/calibration/pm25_bgi_2024.pdf', TRUE, 1),
|
||||
(4, 'MET-01', 'Weather Station', 'Weather Monitor', 'Davis', 'Vantage Pro2', 'WS78901', 'Meteorological Parameters', 'Temperature, humidity, pressure, wind speed/direction', 'N/A', 'N/A', '2024-03-15', '2025-03-15', 'VALID', '/documents/calibration/met_davis_2024.pdf', TRUE, 1),
|
||||
(5, 'BAL-01', 'Analytical Balance', 'Microbalance', 'Mettler Toledo', 'XPR2U', 'MT34567', 'Filter Weighing', 'Range: 0-2.1g, Readability: 0.1μg, Repeatability: 0.15μg', 'N/A', 'N/A', '2024-02-20', '2025-02-20', 'VALID', '/documents/calibration/bal_mettler_2024.pdf', TRUE, 1);
|
||||
|
||||
-- ------------------------------------------------------------------------------
|
||||
-- Sample Data Insertion - Transaction Tables
|
||||
-- ------------------------------------------------------------------------------
|
||||
|
||||
-- Sample Particulate Sampling Plan
|
||||
INSERT INTO trx_particulate_sampling_plan (sampling_plan_id, sampling_plan_code, project_name, client_id, planned_sampling_date, sampling_location, point_count, parameters, approval_status, notes, input_date, input_user)
|
||||
INSERT INTO particulate_sampling_plans (ParticulateSamplingPlanID, ParticulateSamplingPlanCode, ParticulateSamplingPlanProjectName, ClientID, ParticulateSamplingPlanDate, ParticulateSamplingPlanLocation, ParticulateSamplingPlanPointCount, ParticulateSamplingPlanParameters, ParticulateSamplingPlanStatus, ParticulateSamplingPlanNotes, ParticulateSamplingPlanCreatedAt, ParticulateSamplingPlanCreatedUserID)
|
||||
VALUES
|
||||
(1, 'SP-PART-2024-002', 'Total Particulate Measurement at PT. Integrated Manufacturing Industries', 201, '2024-06-15', 'PT. Integrated Manufacturing Industries, Industrial Zone Block C5, Karawang, West Java', 6, 'TSP,PM10', 'APPROVED', 'Particulate measurement for environmental compliance monitoring', '2024-06-05 10:00:00', 'supervisor');
|
||||
(1, 'SP-PART-2024-002', 'Total Particulate Measurement at PT. Integrated Manufacturing Industries', 201, '2024-06-15', 'PT. Integrated Manufacturing Industries, Industrial Zone Block C5, Karawang, West Java', 6, 'TSP,PM10', 'APPROVED', 'Particulate measurement for environmental compliance monitoring', '2024-06-05 10:00:00', 1);
|
||||
|
||||
-- Sample Particulate Measurement Results - Header
|
||||
INSERT INTO trx_particulate_measurement_results (measurement_id, sampling_plan_id, report_code, sampling_date, start_time, end_time, weather_condition, temperature, humidity, wind_speed, wind_direction, pressure, sampling_officers, report_status, notes, input_date, input_user)
|
||||
INSERT INTO particulate_measurements (ParticulateMeasurementID, ParticulateSamplingPlanID, ParticulateMeasurementCode, ParticulateMeasurementDate, ParticulateMeasurementStartTime, ParticulateMeasurementEndTime, ParticulateMeasurementWeather, ParticulateMeasurementTemperature, ParticulateMeasurementHumidity, ParticulateMeasurementWindSpeed, ParticulateMeasurementWindDirection, ParticulateMeasurementPressure, ParticulateMeasurementOfficers, ParticulateMeasurementStatus, ParticulateMeasurementNotes, ParticulateMeasurementCreatedAt, ParticulateMeasurementCreatedUserID)
|
||||
VALUES
|
||||
(1, 1, 'LHU/PART/06/2024/005', '2024-06-15', '08:30:00', '16:30:00', 'Sunny', 31.0, 68.0, 1.2, 'North', 760.0, 'Rudi Hartono, Siti Fauziah', 'FINAL', 'Measurement conducted during normal operations', '2024-06-15 17:00:00', 'analyst');
|
||||
(1, 1, 'LHU/PART/06/2024/005', '2024-06-15', '08:30:00', '16:30:00', 'Sunny', 31.0, 68.0, 1.2, 'North', 760.0, 'Rudi Hartono, Siti Fauziah', 'FINAL', 'Measurement conducted during normal operations', '2024-06-15 17:00:00', 1);
|
||||
|
||||
-- Sample Particulate Measurement Details
|
||||
INSERT INTO trx_particulate_measurement_details (measurement_detail_id, measurement_id, point_code, location_name, area_description, area_type_id, latitude, longitude, sampling_height, sampling_duration, parameter_code, method_id, equipment_id, filter_id, initial_weight, final_weight, flow_rate, volume_sampled, result_value, standard_id, compliance_status, major_sources, recommendations, notes, input_date, input_user)
|
||||
INSERT INTO particulate_measurement_details (ParticulateMeasurementDetailID, ParticulateMeasurementID, ParticulateMeasurementDetailPointCode, ParticulateMeasurementDetailLocation, ParticulateMeasurementDetailAreaDescription, MasterAreaTypeID, ParticulateMeasurementDetailLatitude, ParticulateMeasurementDetailLongitude, ParticulateMeasurementDetailHeight, ParticulateMeasurementDetailDuration, ParticulateMeasurementDetailParameterCode, MasterParticulateMethodID, MasterParticulateEquipmentID, ParticulateMeasurementDetailFilterID, ParticulateMeasurementDetailInitialWeight, ParticulateMeasurementDetailFinalWeight, ParticulateMeasurementDetailFlowRate, ParticulateMeasurementDetailVolume, ParticulateMeasurementDetailResult, MasterParticulateStandardID, ParticulateMeasurementDetailComplianceStatus, ParticulateMeasurementDetailSources, ParticulateMeasurementDetailRecommendations, ParticulateMeasurementDetailNotes, ParticulateMeasurementDetailCreatedAt, ParticulateMeasurementDetailCreatedUserID)
|
||||
VALUES
|
||||
-- Main Factory Entrance - TSP
|
||||
(1, 1, 'TPM-1', 'Main Factory Entrance', 'Main entrance with moderate traffic', 1, -6.372500, 107.524167, 1.5, 8.0, 'TSP', 1, 1, 'GF-20240615-01', 4.52130, 4.62875, 1.15, 552.0, 215.4, 1, 'COMPLY', 'Vehicle traffic, material transport activities', '', 'Moderate traffic flow during sampling', '2024-06-15 17:05:00', 'analyst'),
|
||||
(1, 1, 'TPM-1', 'Main Factory Entrance', 'Main entrance with moderate traffic', 1, -6.372500, 107.524167, 1.5, 8.0, 'TSP', 1, 1, 'GF-20240615-01', 4.52130, 4.62875, 1.15, 552.0, 215.4, 1, 'COMPLY', 'Vehicle traffic, material transport activities', '', 'Moderate traffic flow during sampling', '2024-06-15 17:05:00', 1),
|
||||
|
||||
-- Main Factory Entrance - PM10
|
||||
(2, 1, 'TPM-1', 'Main Factory Entrance', 'Main entrance with moderate traffic', 1, -6.372500, 107.524167, 1.5, 8.0, 'PM10', 2, 2, 'QF-20240615-01', 4.48730, 4.54947, 1.15, 552.0, 112.7, 6, 'COMPLY', 'Vehicle traffic, material transport activities', '', 'PM10 fraction shows significant contribution', '2024-06-15 17:10:00', 'analyst'),
|
||||
(2, 1, 'TPM-1', 'Main Factory Entrance', 'Main entrance with moderate traffic', 1, -6.372500, 107.524167, 1.5, 8.0, 'PM10', 2, 2, 'QF-20240615-01', 4.48730, 4.54947, 1.15, 552.0, 112.7, 6, 'COMPLY', 'Vehicle traffic, material transport activities', '', 'PM10 fraction shows significant contribution', '2024-06-15 17:10:00', 1),
|
||||
|
||||
-- Production Area (Crusher Unit) - TSP
|
||||
(3, 1, 'TPM-2', 'Production Area (Crusher Unit)', 'Area with crushing equipment and high dust generation', 1, -6.372778, 107.524444, 1.5, 8.0, 'TSP', 1, 1, 'GF-20240615-02', 4.51890, 4.67765, 1.15, 552.0, 287.6, 1, 'NOT_COMPLY', 'Crushing activities, material handling, conveyor transfer points', 'Install dust suppression systems, implement proper enclosure', 'Visible dust emissions during crusher operation', '2024-06-15 17:15:00', 'analyst'),
|
||||
(3, 1, 'TPM-2', 'Production Area (Crusher Unit)', 'Area with crushing equipment and high dust generation', 1, -6.372778, 107.524444, 1.5, 8.0, 'TSP', 1, 1, 'GF-20240615-02', 4.51890, 4.67765, 1.15, 552.0, 287.6, 1, 'NOT_COMPLY', 'Crushing activities, material handling, conveyor transfer points', 'Install dust suppression systems, implement proper enclosure', 'Visible dust emissions during crusher operation', '2024-06-15 17:15:00', 1),
|
||||
|
||||
-- Production Area (Crusher Unit) - PM10
|
||||
(4, 1, 'TPM-2', 'Production Area (Crusher Unit)', 'Area with crushing equipment and high dust generation', 1, -6.372778, 107.524444, 1.5, 8.0, 'PM10', 2, 2, 'QF-20240615-02', 4.49120, 4.57748, 1.15, 552.0, 156.3, 6, 'NOT_COMPLY', 'Crushing activities, material handling, conveyor transfer points', 'Install dust collection systems with adequate filtration', 'High respirable fraction indicates health concerns', '2024-06-15 17:20:00', 'analyst'),
|
||||
(4, 1, 'TPM-2', 'Production Area (Crusher Unit)', 'Area with crushing equipment and high dust generation', 1, -6.372778, 107.524444, 1.5, 8.0, 'PM10', 2, 2, 'QF-20240615-02', 4.49120, 4.57748, 1.15, 552.0, 156.3, 6, 'NOT_COMPLY', 'Crushing activities, material handling, conveyor transfer points', 'Install dust collection systems with adequate filtration', 'High respirable fraction indicates health concerns', '2024-06-15 17:20:00', 1),
|
||||
|
||||
-- Office Building - TSP
|
||||
(5, 1, 'TPM-3', 'Office Building', 'Administrative office area', 3, -6.372944, 107.525000, 1.5, 8.0, 'TSP', 1, 1, 'GF-20240615-03', 4.52670, 4.57255, 1.15, 552.0, 83.1, 3, 'COMPLY', 'Limited sources, mainly from HVAC system', '', 'Indoor air quality with minimal outdoor influence', '2024-06-15 17:25:00', 'analyst'),
|
||||
(5, 1, 'TPM-3', 'Office Building', 'Administrative office area', 3, -6.372944, 107.525000, 1.5, 8.0, 'TSP', 1, 1, 'GF-20240615-03', 4.52670, 4.57255, 1.15, 552.0, 83.1, 3, 'COMPLY', 'Limited sources, mainly from HVAC system', '', 'Indoor air quality with minimal outdoor influence', '2024-06-15 17:25:00', 1),
|
||||
|
||||
-- Office Building - PM10
|
||||
(6, 1, 'TPM-3', 'Office Building', 'Administrative office area', 3, -6.372944, 107.525000, 1.5, 8.0, 'PM10', 2, 2, 'QF-20240615-03', 4.48950, 4.51467, 1.15, 552.0, 45.6, 8, 'COMPLY', 'Limited sources, mainly from HVAC system', '', 'Low PM10 levels indicate good air filtration', '2024-06-15 17:30:00', 'analyst'),
|
||||
(6, 1, 'TPM-3', 'Office Building', 'Administrative office area', 3, -6.372944, 107.525000, 1.5, 8.0, 'PM10', 2, 2, 'QF-20240615-03', 4.48950, 4.51467, 1.15, 552.0, 45.6, 8, 'COMPLY', 'Limited sources, mainly from HVAC system', '', 'Low PM10 levels indicate good air filtration', '2024-06-15 17:30:00', 1),
|
||||
|
||||
-- Eastern Facility Boundary - TSP
|
||||
(7, 1, 'TPM-4', 'Eastern Facility Boundary', 'Eastern boundary of the facility', 1, -6.373111, 107.526111, 1.5, 8.0, 'TSP', 1, 1, 'GF-20240615-04', 4.53010, 4.62778, 1.15, 552.0, 176.8, 1, 'COMPLY', 'General facility operations, stockpiles, road dust', '', 'Unpaved areas contributing to dust levels', '2024-06-15 17:35:00', 'analyst'),
|
||||
(7, 1, 'TPM-4', 'Eastern Facility Boundary', 'Eastern boundary of the facility', 1, -6.373111, 107.526111, 1.5, 8.0, 'TSP', 1, 1, 'GF-20240615-04', 4.53010, 4.62778, 1.15, 552.0, 176.8, 1, 'COMPLY', 'General facility operations, stockpiles, road dust', '', 'Unpaved areas contributing to dust levels', '2024-06-15 17:35:00', 1),
|
||||
|
||||
-- Eastern Facility Boundary - PM10
|
||||
(8, 1, 'TPM-4', 'Eastern Facility Boundary', 'Eastern boundary of the facility', 1, -6.373111, 107.526111, 1.5, 8.0, 'PM10', 2, 2, 'QF-20240615-04', 4.49070, 4.53997, 1.15, 552.0, 89.3, 6, 'COMPLY', 'General facility operations, stockpiles, road dust', '', 'PM10 levels below industrial standard', '2024-06-15 17:40:00', 'analyst'),
|
||||
(8, 1, 'TPM-4', 'Eastern Facility Boundary', 'Eastern boundary of the facility', 1, -6.373111, 107.526111, 1.5, 8.0, 'PM10', 2, 2, 'QF-20240615-04', 4.49070, 4.53997, 1.15, 552.0, 89.3, 6, 'COMPLY', 'General facility operations, stockpiles, road dust', '', 'PM10 levels below industrial standard', '2024-06-15 17:40:00', 1),
|
||||
|
||||
-- Material Storage Area - TSP
|
||||
(9, 1, 'TPM-5', 'Material Storage Area', 'Raw material storage with open piles', 1, -6.373278, 107.524722, 1.5, 8.0, 'TSP', 1, 1, 'GF-20240615-05', 4.52230, 4.67025, 1.15, 552.0, 268.2, 1, 'NOT_COMPLY', 'Raw material stockpiles, loading/unloading operations', 'Cover stockpiles, implement water spraying', 'Wind-blown dust from uncovered material piles', '2024-06-15 17:45:00', 'analyst'),
|
||||
(9, 1, 'TPM-5', 'Material Storage Area', 'Raw material storage with open piles', 1, -6.373278, 107.524722, 1.5, 8.0, 'TSP', 1, 1, 'GF-20240615-05', 4.52230, 4.67025, 1.15, 552.0, 268.2, 1, 'NOT_COMPLY', 'Raw material stockpiles, loading/unloading operations', 'Cover stockpiles, implement water spraying', 'Wind-blown dust from uncovered material piles', '2024-06-15 17:45:00', 1),
|
||||
|
||||
-- Material Storage Area - PM10
|
||||
(10, 1, 'TPM-5', 'Material Storage Area', 'Raw material storage with open piles', 1, -6.373278, 107.524722, 1.5, 8.0, 'PM10', 2, 2, 'QF-20240615-05', 4.48870, 4.56737, 1.15, 552.0, 142.5, 6, 'COMPLY', 'Raw material stockpiles, loading/unloading operations', 'Minimize material handling during high winds', 'PM10 fraction still within limits but elevated', '2024-06-15 17:50:00', 'analyst'),
|
||||
(10, 1, 'TPM-5', 'Material Storage Area', 'Raw material storage with open piles', 1, -6.373278, 107.524722, 1.5, 8.0, 'PM10', 2, 2, 'QF-20240615-05', 4.48870, 4.56737, 1.15, 552.0, 142.5, 6, 'COMPLY', 'Raw material stockpiles, loading/unloading operations', 'Minimize material handling during high winds', 'PM10 fraction still within limits but elevated', '2024-06-15 17:50:00', 1),
|
||||
|
||||
-- Nearest Residential Area - TSP
|
||||
(11, 1, 'TPM-6', 'Nearest Residential Area', 'Residential area near the industrial facility', 2, -6.374167, 107.527222, 1.5, 8.0, 'TSP', 1, 1, 'GF-20240615-06', 4.52450, 4.57884, 1.15, 552.0, 98.5, 2, 'NOT_COMPLY', 'Industrial facility emissions, community activities', 'Establish vegetation buffer, improve dust control', 'Residential area ~500m from facility boundary', '2024-06-15 17:55:00', 'analyst'),
|
||||
(11, 1, 'TPM-6', 'Nearest Residential Area', 'Residential area near the industrial facility', 2, -6.374167, 107.527222, 1.5, 8.0, 'TSP', 1, 1, 'GF-20240615-06', 4.52450, 4.57884, 1.15, 552.0, 98.5, 2, 'NOT_COMPLY', 'Industrial facility emissions, community activities', 'Establish vegetation buffer, improve dust control', 'Residential area ~500m from facility boundary', '2024-06-15 17:55:00', 1),
|
||||
|
||||
-- Nearest Residential Area - PM10
|
||||
(12, 1, 'TPM-6', 'Nearest Residential Area', 'Residential area near the industrial facility', 2, -6.374167, 107.527222, 1.5, 8.0, 'PM10', 2, 2, 'QF-20240615-06', 4.49210, 4.52103, 1.15, 552.0, 52.4, 7, 'COMPLY', 'Industrial facility emissions, community activities', '', 'PM10 levels within residential standard', '2024-06-15 18:00:00', 'analyst');
|
||||
(12, 1, 'TPM-6', 'Nearest Residential Area', 'Residential area near the industrial facility', 2, -6.374167, 107.527222, 1.5, 8.0, 'PM10', 2, 2, 'QF-20240615-06', 4.49210, 4.52103, 1.15, 552.0, 52.4, 7, 'COMPLY', 'Industrial facility emissions, community activities', '', 'PM10 levels within residential standard', '2024-06-15 18:00:00', 1);
|
||||
|
||||
-- Sample Dust Control Recommendations
|
||||
INSERT INTO trx_dust_control_recommendations (recommendation_id, measurement_detail_id, control_type, control_description, priority, estimated_cost, estimated_reduction, implementation_status, input_date, input_user)
|
||||
INSERT INTO dust_control_recommendations (DustControlRecommendationID, ParticulateMeasurementDetailID, DustControlRecommendationType, DustControlRecommendationDescription, DustControlRecommendationPriority, DustControlRecommendationEstimatedCost, DustControlRecommendationEstimatedReduction, DustControlRecommendationStatus, DustControlRecommendationCreatedAt, DustControlRecommendationCreatedUserID)
|
||||
VALUES
|
||||
-- Recommendations for Production Area (Crusher Unit)
|
||||
(1, 3, 'Engineering Control', 'Installation of water spray systems at crusher loading and discharge points', 1, 45000000.00, 30.0, 'PLANNED', '2024-06-20 09:00:00', 'analyst'),
|
||||
(2, 3, 'Engineering Control', 'Enclosure of crushing and screening equipment with appropriate dust collection', 1, 120000000.00, 50.0, 'PLANNED', '2024-06-20 09:05:00', 'analyst'),
|
||||
(3, 3, 'Administrative Control', 'Implement preventive maintenance program for dust collection systems', 2, 0.00, 15.0, 'PLANNED', '2024-06-20 09:10:00', 'analyst'),
|
||||
(4, 4, 'PPE', 'Provision of N95 respirators for workers in crushing area', 1, 15000000.00, 0.0, 'PLANNED', '2024-06-20 09:15:00', 'analyst'),
|
||||
(1, 3, 'Engineering Control', 'Installation of water spray systems at crusher loading and discharge points', 1, 45000000.00, 30.0, 'PLANNED', '2024-06-20 09:00:00', 1),
|
||||
(2, 3, 'Engineering Control', 'Enclosure of crushing and screening equipment with appropriate dust collection', 1, 120000000.00, 50.0, 'PLANNED', '2024-06-20 09:05:00', 1),
|
||||
(3, 3, 'Administrative Control', 'Implement preventive maintenance program for dust collection systems', 2, 0.00, 15.0, 'PLANNED', '2024-06-20 09:10:00', 1),
|
||||
(4, 4, 'PPE', 'Provision of N95 respirators for workers in crushing area', 1, 15000000.00, 0.0, 'PLANNED', '2024-06-20 09:15:00', 1),
|
||||
|
||||
-- Recommendations for Material Storage Area
|
||||
(5, 9, 'Engineering Control', 'Installation of wind barriers around material storage area', 1, 75000000.00, 25.0, 'PLANNED', '2024-06-20 09:20:00', 'analyst'),
|
||||
(6, 9, 'Engineering Control', 'Coverage of stockpiles with tarpaulins or other appropriate materials', 1, 30000000.00, 35.0, 'PLANNED', '2024-06-20 09:25:00', 'analyst'),
|
||||
(7, 9, 'Engineering Control', 'Installation of fixed water sprinkler system for storage area', 2, 60000000.00, 30.0, 'PLANNED', '2024-06-20 09:30:00', 'analyst'),
|
||||
(8, 9, 'Administrative Control', 'Implement SOP for minimizing drop heights during material transfer', 1, 5000000.00, 10.0, 'PLANNED', '2024-06-20 09:35:00', 'analyst'),
|
||||
(5, 9, 'Engineering Control', 'Installation of wind barriers around material storage area', 1, 75000000.00, 25.0, 'PLANNED', '2024-06-20 09:20:00', 1),
|
||||
(6, 9, 'Engineering Control', 'Coverage of stockpiles with tarpaulins or other appropriate materials', 1, 30000000.00, 35.0, 'PLANNED', '2024-06-20 09:25:00', 1),
|
||||
(7, 9, 'Engineering Control', 'Installation of fixed water sprinkler system for storage area', 2, 60000000.00, 30.0, 'PLANNED', '2024-06-20 09:30:00', 1),
|
||||
(8, 9, 'Administrative Control', 'Implement SOP for minimizing drop heights during material transfer', 1, 5000000.00, 10.0, 'PLANNED', '2024-06-20 09:35:00', 1),
|
||||
|
||||
-- Recommendations for Nearest Residential Area
|
||||
(9, 11, 'Engineering Control', 'Establishment of vegetation buffer zone between facility and residential areas', 1, 90000000.00, 15.0, 'PLANNED', '2024-06-20 09:40:00', 'analyst'),
|
||||
(10, 11, 'Engineering Control', 'Paving of unpaved roads near residential boundary', 2, 120000000.00, 20.0, 'PLANNED', '2024-06-20 09:45:00', 'analyst'),
|
||||
(11, 11, 'Administrative Control', 'Implementation of community notification system for high-dust activities', 1, 25000000.00, 0.0, 'PLANNED', '2024-06-20 09:50:00', 'analyst'),
|
||||
(12, 11, 'Administrative Control', 'Schedule dust-generating activities based on wind direction and speed', 1, 0.00, 10.0, 'PLANNED', '2024-06-20 09:55:00', 'analyst');
|
||||
(9, 11, 'Engineering Control', 'Establishment of vegetation buffer zone between facility and residential areas', 1, 90000000.00, 15.0, 'PLANNED', '2024-06-20 09:40:00', 1),
|
||||
(10, 11, 'Engineering Control', 'Paving of unpaved roads near residential boundary', 2, 120000000.00, 20.0, 'PLANNED', '2024-06-20 09:45:00', 1),
|
||||
(11, 11, 'Administrative Control', 'Implementation of community notification system for high-dust activities', 1, 25000000.00, 0.0, 'PLANNED', '2024-06-20 09:50:00', 1),
|
||||
(12, 11, 'Administrative Control', 'Schedule dust-generating activities based on wind direction and speed', 1, 0.00, 10.0, 'PLANNED', '2024-06-20 09:55:00', 1);
|
||||
@@ -3,217 +3,241 @@
|
||||
|
||||
-- Master Regulations Table
|
||||
CREATE TABLE master_regulations (
|
||||
regulation_id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
regulation_code VARCHAR(50) NOT NULL,
|
||||
regulation_name VARCHAR(200) NOT NULL,
|
||||
issuing_authority VARCHAR(100) NOT NULL,
|
||||
regulation_type VARCHAR(50),
|
||||
issue_date DATE,
|
||||
effective_date DATE,
|
||||
description TEXT,
|
||||
file_path VARCHAR(255),
|
||||
is_active BOOLEAN DEFAULT TRUE,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
|
||||
MasterRegulationID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
MasterRegulationCode VARCHAR(50) NOT NULL,
|
||||
MasterRegulationName VARCHAR(200) NOT NULL,
|
||||
MasterRegulationIssuingAuthority VARCHAR(100) NOT NULL,
|
||||
MasterRegulationType VARCHAR(50),
|
||||
MasterRegulationIssueDate DATE,
|
||||
MasterRegulationEffectiveDate DATE,
|
||||
MasterRegulationDescription TEXT,
|
||||
MasterRegulationFilePath VARCHAR(255),
|
||||
MasterRegulationIsActive BOOLEAN DEFAULT TRUE,
|
||||
MasterRegulationCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
MasterRegulationCreatedUserID INT,
|
||||
MasterRegulationUpdatedAt DATETIME,
|
||||
MasterRegulationUpdatedUserID INT,
|
||||
MasterRegulationDeletedAt DATETIME,
|
||||
MasterRegulationDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Master Climate Parameters Table
|
||||
CREATE TABLE master_climate_parameters (
|
||||
parameter_id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
parameter_code VARCHAR(50) NOT NULL,
|
||||
parameter_name VARCHAR(100) NOT NULL,
|
||||
parameter_group VARCHAR(50), -- Physical, Chemical, Biological
|
||||
unit VARCHAR(20),
|
||||
analysis_method VARCHAR(100),
|
||||
description TEXT,
|
||||
price DECIMAL(12, 2),
|
||||
is_active BOOLEAN DEFAULT TRUE,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
|
||||
MasterClimateParameterID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
MasterClimateParameterCode VARCHAR(50) NOT NULL,
|
||||
MasterClimateParameterName VARCHAR(100) NOT NULL,
|
||||
MasterClimateParameterGroup VARCHAR(50),
|
||||
MasterClimateParameterUnit VARCHAR(20),
|
||||
MasterClimateParameterMethod VARCHAR(100),
|
||||
MasterClimateParameterDescription TEXT,
|
||||
MasterClimateParameterPrice DECIMAL(12,2),
|
||||
MasterClimateParameterIsActive BOOLEAN DEFAULT TRUE,
|
||||
MasterClimateParameterCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
MasterClimateParameterCreatedUserID INT,
|
||||
MasterClimateParameterUpdatedAt DATETIME,
|
||||
MasterClimateParameterUpdatedUserID INT,
|
||||
MasterClimateParameterDeletedAt DATETIME,
|
||||
MasterClimateParameterDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Master Threshold Limit Values (TLV) Table
|
||||
-- Master Threshold Values Table
|
||||
CREATE TABLE master_threshold_values (
|
||||
threshold_id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
regulation_id INT,
|
||||
parameter_id INT,
|
||||
room_type VARCHAR(100) NOT NULL,
|
||||
min_value DECIMAL(8, 2),
|
||||
max_value DECIMAL(8, 2),
|
||||
unit VARCHAR(20),
|
||||
description TEXT,
|
||||
is_active BOOLEAN DEFAULT TRUE,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (regulation_id) REFERENCES master_regulations(regulation_id),
|
||||
FOREIGN KEY (parameter_id) REFERENCES master_climate_parameters(parameter_id)
|
||||
MasterThresholdValueID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
MasterRegulationID INT,
|
||||
MasterClimateParameterID INT,
|
||||
MasterThresholdValueRoomType VARCHAR(100) NOT NULL,
|
||||
MasterThresholdValueMin DECIMAL(8,2),
|
||||
MasterThresholdValueMax DECIMAL(8,2),
|
||||
MasterThresholdValueUnit VARCHAR(20),
|
||||
MasterThresholdValueDescription TEXT,
|
||||
MasterThresholdValueIsActive BOOLEAN DEFAULT TRUE,
|
||||
MasterThresholdValueCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
MasterThresholdValueCreatedUserID INT,
|
||||
MasterThresholdValueUpdatedAt DATETIME,
|
||||
MasterThresholdValueUpdatedUserID INT,
|
||||
MasterThresholdValueDeletedAt DATETIME,
|
||||
MasterThresholdValueDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Master Clients Table
|
||||
CREATE TABLE master_clients (
|
||||
client_id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
client_code VARCHAR(50) NOT NULL,
|
||||
client_name VARCHAR(200) NOT NULL,
|
||||
address TEXT,
|
||||
city VARCHAR(100),
|
||||
province VARCHAR(100),
|
||||
postal_code VARCHAR(20),
|
||||
phone_number VARCHAR(50),
|
||||
email VARCHAR(100),
|
||||
contact_person VARCHAR(100),
|
||||
contact_position VARCHAR(100),
|
||||
business_field VARCHAR(100),
|
||||
is_active BOOLEAN DEFAULT TRUE,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
|
||||
MasterClientID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
MasterClientCode VARCHAR(50) NOT NULL,
|
||||
MasterClientName VARCHAR(200) NOT NULL,
|
||||
MasterClientAddress TEXT,
|
||||
MasterClientCity VARCHAR(100),
|
||||
MasterClientProvince VARCHAR(100),
|
||||
MasterClientPostalCode VARCHAR(20),
|
||||
MasterClientPhoneNumber VARCHAR(50),
|
||||
MasterClientEmail VARCHAR(100),
|
||||
MasterClientContactPerson VARCHAR(100),
|
||||
MasterClientContactPosition VARCHAR(100),
|
||||
MasterClientBusinessField VARCHAR(100),
|
||||
MasterClientIsActive BOOLEAN DEFAULT TRUE,
|
||||
MasterClientCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
MasterClientCreatedUserID INT,
|
||||
MasterClientUpdatedAt DATETIME,
|
||||
MasterClientUpdatedUserID INT,
|
||||
MasterClientDeletedAt DATETIME,
|
||||
MasterClientDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Master Personnel Table (Sampling Officers, Analysts, etc.)
|
||||
-- Master Personnel Table
|
||||
CREATE TABLE master_personnel (
|
||||
personnel_id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
employee_id VARCHAR(50) NOT NULL,
|
||||
name VARCHAR(100) NOT NULL,
|
||||
position VARCHAR(100),
|
||||
department VARCHAR(100),
|
||||
email VARCHAR(100),
|
||||
phone_number VARCHAR(50),
|
||||
certifications TEXT,
|
||||
is_active BOOLEAN DEFAULT TRUE,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
|
||||
MasterPersonnelID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
MasterPersonnelEmployeeID VARCHAR(50) NOT NULL,
|
||||
MasterPersonnelName VARCHAR(100) NOT NULL,
|
||||
MasterPersonnelPosition VARCHAR(100),
|
||||
MasterPersonnelDepartment VARCHAR(100),
|
||||
MasterPersonnelEmail VARCHAR(100),
|
||||
MasterPersonnelPhoneNumber VARCHAR(50),
|
||||
MasterPersonnelCertifications TEXT,
|
||||
MasterPersonnelIsActive BOOLEAN DEFAULT TRUE,
|
||||
MasterPersonnelCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
MasterPersonnelCreatedUserID INT,
|
||||
MasterPersonnelUpdatedAt DATETIME,
|
||||
MasterPersonnelUpdatedUserID INT,
|
||||
MasterPersonnelDeletedAt DATETIME,
|
||||
MasterPersonnelDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Master Measurement Equipment Table
|
||||
-- Master Equipment Table
|
||||
CREATE TABLE master_equipment (
|
||||
equipment_id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
equipment_code VARCHAR(50) NOT NULL,
|
||||
equipment_name VARCHAR(100) NOT NULL,
|
||||
brand VARCHAR(100),
|
||||
model VARCHAR(100),
|
||||
serial_number VARCHAR(100),
|
||||
calibration_date DATE,
|
||||
next_calibration_date DATE,
|
||||
parameter_id INT,
|
||||
specifications TEXT,
|
||||
is_active BOOLEAN DEFAULT TRUE,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (parameter_id) REFERENCES master_climate_parameters(parameter_id)
|
||||
MasterEquipmentID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
MasterEquipmentCode VARCHAR(50) NOT NULL,
|
||||
MasterEquipmentName VARCHAR(100) NOT NULL,
|
||||
MasterEquipmentBrand VARCHAR(100),
|
||||
MasterEquipmentModel VARCHAR(100),
|
||||
MasterEquipmentSerialNumber VARCHAR(100),
|
||||
MasterEquipmentCalibrationDate DATE,
|
||||
MasterEquipmentNextCalibrationDate DATE,
|
||||
MasterClimateParameterID INT,
|
||||
MasterEquipmentSpecifications TEXT,
|
||||
MasterEquipmentIsActive BOOLEAN DEFAULT TRUE,
|
||||
MasterEquipmentCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
MasterEquipmentCreatedUserID INT,
|
||||
MasterEquipmentUpdatedAt DATETIME,
|
||||
MasterEquipmentUpdatedUserID INT,
|
||||
MasterEquipmentDeletedAt DATETIME,
|
||||
MasterEquipmentDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Master Sampling Locations Table
|
||||
CREATE TABLE master_sampling_locations (
|
||||
location_id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
client_id INT,
|
||||
location_name VARCHAR(200) NOT NULL,
|
||||
address TEXT,
|
||||
latitude DECIMAL(10, 8),
|
||||
longitude DECIMAL(11, 8),
|
||||
room_type VARCHAR(100),
|
||||
description TEXT,
|
||||
is_active BOOLEAN DEFAULT TRUE,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (client_id) REFERENCES master_clients(client_id)
|
||||
MasterSamplingLocationID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
MasterClientID INT,
|
||||
MasterSamplingLocationName VARCHAR(200) NOT NULL,
|
||||
MasterSamplingLocationAddress TEXT,
|
||||
MasterSamplingLocationLatitude DECIMAL(10,8),
|
||||
MasterSamplingLocationLongitude DECIMAL(11,8),
|
||||
MasterSamplingLocationRoomType VARCHAR(100),
|
||||
MasterSamplingLocationDescription TEXT,
|
||||
MasterSamplingLocationIsActive BOOLEAN DEFAULT TRUE,
|
||||
MasterSamplingLocationCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
MasterSamplingLocationCreatedUserID INT,
|
||||
MasterSamplingLocationUpdatedAt DATETIME,
|
||||
MasterSamplingLocationUpdatedUserID INT,
|
||||
MasterSamplingLocationDeletedAt DATETIME,
|
||||
MasterSamplingLocationDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Measurement Requests Table (Request Form)
|
||||
-- Measurement Requests Table
|
||||
CREATE TABLE measurement_requests (
|
||||
request_id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
request_number VARCHAR(50) NOT NULL,
|
||||
client_id INT,
|
||||
request_date DATE,
|
||||
planned_sampling_date DATE,
|
||||
contact_person VARCHAR(100),
|
||||
status VARCHAR(50), -- draft, submitted, approved, scheduled, completed, canceled
|
||||
notes TEXT,
|
||||
created_by INT,
|
||||
approved_by INT,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (client_id) REFERENCES master_clients(client_id),
|
||||
FOREIGN KEY (created_by) REFERENCES master_personnel(personnel_id),
|
||||
FOREIGN KEY (approved_by) REFERENCES master_personnel(personnel_id)
|
||||
MeasurementRequestID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
MeasurementRequestNumber VARCHAR(50) NOT NULL,
|
||||
MasterClientID INT,
|
||||
MeasurementRequestDate DATE,
|
||||
MeasurementRequestPlannedDate DATE,
|
||||
MeasurementRequestContactPerson VARCHAR(100),
|
||||
MeasurementRequestStatus VARCHAR(50),
|
||||
MeasurementRequestNotes TEXT,
|
||||
MeasurementRequestCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
MeasurementRequestCreatedUserID INT,
|
||||
MeasurementRequestUpdatedAt DATETIME,
|
||||
MeasurementRequestUpdatedUserID INT,
|
||||
MeasurementRequestDeletedAt DATETIME,
|
||||
MeasurementRequestDeletedUserID INT,
|
||||
MeasurementRequestApprovedByID INT
|
||||
);
|
||||
|
||||
-- Measurement Request Details Table
|
||||
CREATE TABLE measurement_request_details (
|
||||
detail_id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
request_id INT,
|
||||
parameter_id INT,
|
||||
location_id INT,
|
||||
points_count INT DEFAULT 1,
|
||||
unit_price DECIMAL(12, 2),
|
||||
subtotal DECIMAL(12, 2),
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (request_id) REFERENCES measurement_requests(request_id),
|
||||
FOREIGN KEY (parameter_id) REFERENCES master_climate_parameters(parameter_id),
|
||||
FOREIGN KEY (location_id) REFERENCES master_sampling_locations(location_id)
|
||||
MeasurementRequestDetailID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
MeasurementRequestID INT,
|
||||
MasterClimateParameterID INT,
|
||||
MasterSamplingLocationID INT,
|
||||
MeasurementRequestDetailPointCount INT DEFAULT 1,
|
||||
MeasurementRequestDetailUnitPrice DECIMAL(12,2),
|
||||
MeasurementRequestDetailSubtotal DECIMAL(12,2),
|
||||
MeasurementRequestDetailCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
MeasurementRequestDetailCreatedUserID INT,
|
||||
MeasurementRequestDetailUpdatedAt DATETIME,
|
||||
MeasurementRequestDetailUpdatedUserID INT,
|
||||
MeasurementRequestDetailDeletedAt DATETIME,
|
||||
MeasurementRequestDetailDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Measurement Schedules Table
|
||||
CREATE TABLE measurement_schedules (
|
||||
schedule_id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
schedule_number VARCHAR(50) NOT NULL,
|
||||
request_id INT,
|
||||
measurement_date DATE,
|
||||
officer_id INT,
|
||||
status VARCHAR(50), -- scheduled, completed, rescheduled, canceled
|
||||
notes TEXT,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (request_id) REFERENCES measurement_requests(request_id),
|
||||
FOREIGN KEY (officer_id) REFERENCES master_personnel(personnel_id)
|
||||
MeasurementScheduleID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
MeasurementScheduleNumber VARCHAR(50) NOT NULL,
|
||||
MeasurementRequestID INT,
|
||||
MeasurementScheduleDate DATE,
|
||||
MasterPersonnelID INT,
|
||||
MeasurementScheduleStatus VARCHAR(50),
|
||||
MeasurementScheduleNotes TEXT,
|
||||
MeasurementScheduleCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
MeasurementScheduleCreatedUserID INT,
|
||||
MeasurementScheduleUpdatedAt DATETIME,
|
||||
MeasurementScheduleUpdatedUserID INT,
|
||||
MeasurementScheduleDeletedAt DATETIME,
|
||||
MeasurementScheduleDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Test Reports Table
|
||||
CREATE TABLE test_reports (
|
||||
report_id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
report_number VARCHAR(50) NOT NULL,
|
||||
request_id INT,
|
||||
schedule_id INT,
|
||||
measurement_date DATE,
|
||||
issue_date DATE,
|
||||
client_id INT,
|
||||
officer_id INT,
|
||||
verified_by INT,
|
||||
approved_by INT,
|
||||
status VARCHAR(50), -- draft, verification, approved, published, revised
|
||||
page_count INT DEFAULT 1,
|
||||
notes TEXT,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (request_id) REFERENCES measurement_requests(request_id),
|
||||
FOREIGN KEY (schedule_id) REFERENCES measurement_schedules(schedule_id),
|
||||
FOREIGN KEY (client_id) REFERENCES master_clients(client_id),
|
||||
FOREIGN KEY (officer_id) REFERENCES master_personnel(personnel_id),
|
||||
FOREIGN KEY (verified_by) REFERENCES master_personnel(personnel_id),
|
||||
FOREIGN KEY (approved_by) REFERENCES master_personnel(personnel_id)
|
||||
TestReportID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
TestReportNumber VARCHAR(50) NOT NULL,
|
||||
MeasurementRequestID INT,
|
||||
MeasurementScheduleID INT,
|
||||
TestReportMeasurementDate DATE,
|
||||
TestReportIssueDate DATE,
|
||||
MasterClientID INT,
|
||||
MasterPersonnelID INT,
|
||||
TestReportVerifiedByID INT,
|
||||
TestReportApprovedByID INT,
|
||||
TestReportStatus VARCHAR(50),
|
||||
TestReportPageCount INT DEFAULT 1,
|
||||
TestReportNotes TEXT,
|
||||
TestReportCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
TestReportCreatedUserID INT,
|
||||
TestReportUpdatedAt DATETIME,
|
||||
TestReportUpdatedUserID INT,
|
||||
TestReportDeletedAt DATETIME,
|
||||
TestReportDeletedUserID INT
|
||||
);
|
||||
|
||||
-- Temperature Measurement Results Table
|
||||
CREATE TABLE temperature_measurement_results (
|
||||
result_id INT PRIMARY KEY AUTO_INCREMENT,
|
||||
report_id INT,
|
||||
location_id INT,
|
||||
sample_code VARCHAR(50) NOT NULL,
|
||||
measurement_time_start TIME,
|
||||
measurement_time_end TIME,
|
||||
parameter_id INT,
|
||||
measurement_value DECIMAL(8, 2),
|
||||
unit VARCHAR(20),
|
||||
method VARCHAR(100),
|
||||
threshold_id INT,
|
||||
notes TEXT,
|
||||
equipment_id INT,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (report_id) REFERENCES test_reports(report_id),
|
||||
FOREIGN KEY (location_id) REFERENCES master_sampling_locations(location_id),
|
||||
FOREIGN KEY (parameter_id) REFERENCES master_climate_parameters(parameter_id),
|
||||
FOREIGN KEY (threshold_id) REFERENCES master_threshold_values(threshold_id),
|
||||
FOREIGN KEY (equipment_id) REFERENCES master_equipment(equipment_id)
|
||||
TemperatureMeasurementResultID INT PRIMARY KEY AUTO_INCREMENT,
|
||||
TestReportID INT,
|
||||
MasterSamplingLocationID INT,
|
||||
TemperatureMeasurementResultSampleCode VARCHAR(50) NOT NULL,
|
||||
TemperatureMeasurementResultStartTime TIME,
|
||||
TemperatureMeasurementResultEndTime TIME,
|
||||
MasterClimateParameterID INT,
|
||||
TemperatureMeasurementResultValue DECIMAL(8,2),
|
||||
TemperatureMeasurementResultUnit VARCHAR(20),
|
||||
TemperatureMeasurementResultMethod VARCHAR(100),
|
||||
MasterThresholdValueID INT,
|
||||
TemperatureMeasurementResultNotes TEXT,
|
||||
MasterEquipmentID INT,
|
||||
TemperatureMeasurementResultCreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
TemperatureMeasurementResultCreatedUserID INT,
|
||||
TemperatureMeasurementResultUpdatedAt DATETIME,
|
||||
TemperatureMeasurementResultUpdatedUserID INT,
|
||||
TemperatureMeasurementResultDeletedAt DATETIME,
|
||||
TemperatureMeasurementResultDeletedUserID INT
|
||||
);
|
||||
|
||||
-- ================================
|
||||
@@ -221,19 +245,32 @@ CREATE TABLE temperature_measurement_results (
|
||||
-- ================================
|
||||
|
||||
-- Insert Regulations
|
||||
INSERT INTO master_regulations (regulation_id, regulation_code, regulation_name, issuing_authority, regulation_type, issue_date, effective_date, description, file_path, is_active) VALUES
|
||||
(1, 'PMK-02-2023', 'Ministry of Health Regulation No. 2 Year 2023', 'Ministry of Health of Indonesia', 'Ministerial Regulation', '2023-01-20', '2023-02-01', 'Regulation on Environmental Health Quality Standards and Health Requirements', '/documents/regulations/PMK_02_2023.pdf', TRUE),
|
||||
(2, 'PERMENAKER-05-2018', 'Ministry of Manpower Regulation No. 5 Year 2018', 'Ministry of Manpower of Indonesia', 'Ministerial Regulation', '2018-04-25', '2018-05-10', 'Regulation on Occupational Safety and Health for the Work Environment', '/documents/regulations/PERMENAKER_05_2018.pdf', TRUE);
|
||||
INSERT INTO master_regulations (
|
||||
MasterRegulationID,
|
||||
MasterRegulationCode,
|
||||
MasterRegulationName,
|
||||
MasterRegulationIssuingAuthority,
|
||||
MasterRegulationType,
|
||||
MasterRegulationIssueDate,
|
||||
MasterRegulationEffectiveDate,
|
||||
MasterRegulationDescription,
|
||||
MasterRegulationFilePath,
|
||||
MasterRegulationIsActive
|
||||
) VALUES (
|
||||
1, 'PMK-02-2023', 'Ministry of Health Regulation No. 2 Year 2023', 'Ministry of Health of Indonesia', 'Ministerial Regulation', '2023-01-20', '2023-02-01', 'Regulation on Environmental Health Quality Standards and Health Requirements', '/documents/regulations/PMK_02_2023.pdf', TRUE
|
||||
), (
|
||||
2, 'PERMENAKER-05-2018', 'Ministry of Manpower Regulation No. 5 Year 2018', 'Ministry of Manpower of Indonesia', 'Ministerial Regulation', '2018-04-25', '2018-05-10', 'Regulation on Occupational Safety and Health for the Work Environment', '/documents/regulations/PERMENAKER_05_2018.pdf', TRUE
|
||||
);
|
||||
|
||||
-- Insert Climate Parameters
|
||||
INSERT INTO master_climate_parameters (parameter_id, parameter_code, parameter_name, parameter_group, unit, analysis_method, description, price, is_active) VALUES
|
||||
INSERT INTO master_climate_parameters (MasterClimateParameterID, MasterClimateParameterCode, MasterClimateParameterName, MasterClimateParameterGroup, MasterClimateParameterUnit, MasterClimateParameterMethod, MasterClimateParameterDescription, MasterClimateParameterPrice, MasterClimateParameterIsActive) VALUES
|
||||
(1, 'TEMP', 'Temperature', 'Physical', '°C', 'SNI 7062: 2019', 'Work climate parameter for room temperature measurement', 75000.00, TRUE),
|
||||
(2, 'HUMID', 'Humidity', 'Physical', '%RH', 'SNI 7062: 2019', 'Work climate parameter for relative humidity measurement', 75000.00, TRUE),
|
||||
(3, 'WBGT', 'Wet Bulb Globe Temperature', 'Physical', '°C', 'SNI 7062: 2019', 'Work climate parameter for indoor/outdoor WBGT measurement', 100000.00, TRUE),
|
||||
(4, 'AIRVEL', 'Air Velocity', 'Physical', 'm/s', 'SNI 7062: 2019', 'Work climate parameter for air velocity measurement', 75000.00, TRUE);
|
||||
|
||||
-- Insert Threshold Values for Temperature
|
||||
INSERT INTO master_threshold_values (threshold_id, regulation_id, parameter_id, room_type, min_value, max_value, unit, description, is_active) VALUES
|
||||
INSERT INTO master_threshold_values (MasterThresholdValueID, MasterRegulationID, MasterClimateParameterID, MasterThresholdValueRoomType, MasterThresholdValueMin, MasterThresholdValueMax, MasterThresholdValueUnit, MasterThresholdValueDescription, MasterThresholdValueIsActive) VALUES
|
||||
(1, 1, 1, 'Administration', 20.00, 25.00, '°C', 'Administration and office work area', TRUE),
|
||||
(2, 1, 1, 'Special Room', 18.00, 24.00, '°C', 'Server room, laboratory, etc.', TRUE),
|
||||
(3, 1, 1, 'Production', 23.00, 26.00, '°C', 'Production area', TRUE),
|
||||
@@ -242,27 +279,27 @@ INSERT INTO master_threshold_values (threshold_id, regulation_id, parameter_id,
|
||||
(6, 1, 1, 'Storage', 16.00, 30.00, '°C', 'Storage room, warehouse', TRUE);
|
||||
|
||||
-- Insert Clients
|
||||
INSERT INTO master_clients (client_id, client_code, client_name, address, city, province, postal_code, phone_number, email, contact_person, contact_position, business_field, is_active) VALUES
|
||||
INSERT INTO master_clients (MasterClientID, MasterClientCode, MasterClientName, MasterClientAddress, MasterClientCity, MasterClientProvince, MasterClientPostalCode, MasterClientPhoneNumber, MasterClientEmail, MasterClientContactPerson, MasterClientContactPosition, MasterClientBusinessField, MasterClientIsActive) VALUES
|
||||
(1, 'CLT-001', 'PT. Indonesia Manufacturing Industry', 'Jl. Industry Raya No. 123', 'Jakarta', 'DKI Jakarta', '12950', '021-5551234', 'contact@manufacturingindonesia.com', 'Budi Santoso', 'HSE Manager', 'Manufacturing', TRUE),
|
||||
(2, 'CLT-002', 'PT. Digital Technology Nusantara', 'Jl. Gatot Subroto Kav. 52-53', 'Jakarta', 'DKI Jakarta', '12710', '021-5552345', 'hrd@dtn.co.id', 'Siti Rahma', 'HR Director', 'Information Technology', TRUE),
|
||||
(3, 'CLT-003', 'City Public Hospital', 'Jl. Health No. 45', 'Bandung', 'West Java', '40112', '022-7654321', 'info@cityhospital.go.id', 'Dr. Ahmad Hidayat', 'Director', 'Healthcare', TRUE);
|
||||
|
||||
-- Insert Personnel
|
||||
INSERT INTO master_personnel (personnel_id, employee_id, name, position, department, email, phone_number, certifications, is_active) VALUES
|
||||
INSERT INTO master_personnel (MasterPersonnelID, MasterPersonnelEmployeeID, MasterPersonnelName, MasterPersonnelPosition, MasterPersonnelDepartment, MasterPersonnelEmail, MasterPersonnelPhoneNumber, MasterPersonnelCertifications, MasterPersonnelIsActive) VALUES
|
||||
(1, 'EMP-001', 'Hendra Wijaya', 'Testing Supervisor', 'Laboratory', 'hendra@lab-env.co.id', '081234567890', 'Work Environment Sampling Certification', TRUE),
|
||||
(2, 'EMP-002', 'Ratna Dewi', 'Senior Analyst', 'Laboratory', 'ratna@lab-env.co.id', '081234567891', 'Laboratory Analyst Certification, General OSH Certification', TRUE),
|
||||
(3, 'EMP-003', 'Deni Hermawan', 'Sampling Officer', 'Laboratory', 'deni@lab-env.co.id', '081234567892', 'Test Sample Collection Certification', TRUE),
|
||||
(4, 'EMP-004', 'Farida Nurhasanah', 'Laboratory Manager', 'Laboratory', 'farida@lab-env.co.id', '081234567893', 'Quality Manager Certification, OSH Certification', TRUE);
|
||||
|
||||
-- Insert Measurement Equipment
|
||||
INSERT INTO master_equipment (equipment_id, equipment_code, equipment_name, brand, model, serial_number, calibration_date, next_calibration_date, parameter_id, specifications, is_active) VALUES
|
||||
INSERT INTO master_equipment (MasterEquipmentID, MasterEquipmentCode, MasterEquipmentName, MasterEquipmentBrand, MasterEquipmentModel, MasterEquipmentSerialNumber, MasterEquipmentCalibrationDate, MasterEquipmentNextCalibrationDate, MasterClimateParameterID, MasterEquipmentSpecifications, MasterEquipmentIsActive) VALUES
|
||||
(1, 'EQP-TH001', 'Thermohygrometer', 'Lutron', 'PHB-318', 'LT12345678', '2023-11-10', '2024-05-10', 1, 'Temperature range: -20°C to 60°C, accuracy ±0.8°C', TRUE),
|
||||
(2, 'EQP-TH002', 'Thermohygrometer', 'Extech', 'RHT50', 'EX87654321', '2023-10-15', '2024-04-15', 1, 'Temperature range: -30°C to 70°C, accuracy ±0.5°C', TRUE),
|
||||
(3, 'EQP-WBGT001', 'WBGT Meter', 'Lutron', 'WBGT-2010SD', 'LW12348765', '2023-11-05', '2024-05-05', 3, 'WBGT range: 15°C to 59°C, accuracy ±0.8°C', TRUE),
|
||||
(4, 'EQP-ANM001', 'Anemometer', 'Lutron', 'AM-4214SD', 'LA23456789', '2023-09-20', '2024-03-20', 4, 'Air velocity range: 0.2 m/s to 35 m/s, accuracy ±2%', TRUE);
|
||||
|
||||
-- Insert Sampling Locations for PT. Indonesia Manufacturing Industry
|
||||
INSERT INTO master_sampling_locations (location_id, client_id, location_name, address, room_type, description, is_active) VALUES
|
||||
INSERT INTO master_sampling_locations (MasterSamplingLocationID, MasterClientID, MasterSamplingLocationName, MasterSamplingLocationAddress, MasterSamplingLocationRoomType, MasterSamplingLocationDescription, MasterSamplingLocationIsActive) VALUES
|
||||
(1, 1, 'Main Meeting Room', 'Floor 2, Main Building', 'Administration', 'Meeting room with 20 person capacity', TRUE),
|
||||
(2, 1, 'HR Work Area', 'Floor 2, Main Building', 'Administration', 'HR staff work area', TRUE),
|
||||
(3, 1, 'Server Room', 'Floor 1, Main Building', 'Special Room', 'Server room with special cooling', TRUE),
|
||||
@@ -274,29 +311,29 @@ INSERT INTO master_sampling_locations (location_id, client_id, location_name, ad
|
||||
-- ================================
|
||||
|
||||
-- Measurement Request Example
|
||||
INSERT INTO measurement_requests (request_id, request_number, client_id, request_date, planned_sampling_date, contact_person, status, notes, created_by, approved_by) VALUES
|
||||
INSERT INTO measurement_requests (MeasurementRequestID, MeasurementRequestNumber, MasterClientID, MeasurementRequestDate, MeasurementRequestPlannedDate, MeasurementRequestContactPerson, MeasurementRequestStatus, MeasurementRequestNotes, MeasurementRequestCreatedUserID, MeasurementRequestApprovedByID) VALUES
|
||||
(1, 'REQ/2024/04/001', 1, '2024-04-05', '2024-04-25', 'Budi Santoso', 'approved', 'Quarterly routine measurement for work climate parameters', 3, 4);
|
||||
|
||||
-- Request Details
|
||||
INSERT INTO measurement_request_details (detail_id, request_id, parameter_id, location_id, points_count, unit_price, subtotal) VALUES
|
||||
(1, 1, 1, 1, 1, 75000.00, 75000.00),
|
||||
(2, 1, 1, 2, 1, 75000.00, 75000.00),
|
||||
(3, 1, 1, 3, 1, 75000.00, 75000.00),
|
||||
(4, 1, 1, 4, 1, 75000.00, 75000.00),
|
||||
(5, 1, 1, 5, 1, 75000.00, 75000.00);
|
||||
INSERT INTO measurement_request_details (MeasurementRequestDetailID, MeasurementRequestID, MasterClimateParameterID, MasterSamplingLocationID, MeasurementRequestDetailPointCount, MeasurementRequestDetailUnitPrice, MeasurementRequestDetailSubtotal, MeasurementRequestDetailCreatedUserID) VALUES
|
||||
(1, 1, 1, 1, 1, 75000.00, 75000.00, 3),
|
||||
(2, 1, 1, 2, 1, 75000.00, 75000.00, 3),
|
||||
(3, 1, 1, 3, 1, 75000.00, 75000.00, 3),
|
||||
(4, 1, 1, 4, 1, 75000.00, 75000.00, 3),
|
||||
(5, 1, 1, 5, 1, 75000.00, 75000.00, 3);
|
||||
|
||||
-- Measurement Schedule
|
||||
INSERT INTO measurement_schedules (schedule_id, schedule_number, request_id, measurement_date, officer_id, status, notes) VALUES
|
||||
(1, 'SCH/2024/04/001', 1, '2024-04-25', 3, 'completed', 'Measurement conducted during normal operating hours');
|
||||
INSERT INTO measurement_schedules (MeasurementScheduleID, MeasurementScheduleNumber, MeasurementRequestID, MeasurementScheduleDate, MasterPersonnelID, MeasurementScheduleStatus, MeasurementScheduleNotes, MeasurementScheduleCreatedUserID) VALUES
|
||||
(1, 'SCH/2024/04/001', 1, '2024-04-25', 3, 'completed', 'Measurement conducted during normal operating hours', 3);
|
||||
|
||||
-- Test Report
|
||||
INSERT INTO test_reports (report_id, report_number, request_id, schedule_id, measurement_date, issue_date, client_id, officer_id, verified_by, approved_by, status, page_count, notes) VALUES
|
||||
(1, 'LHU/TEMP/04/2024/001', 1, 1, '2024-04-25', '2024-04-28', 1, 3, 2, 4, 'published', 2, 'Measurement results show all parameters within normal limits');
|
||||
INSERT INTO test_reports (TestReportID, TestReportNumber, MeasurementRequestID, MeasurementScheduleID, TestReportMeasurementDate, TestReportIssueDate, MasterClientID, MasterPersonnelID, TestReportVerifiedByID, TestReportApprovedByID, TestReportStatus, TestReportPageCount, TestReportNotes, TestReportCreatedUserID) VALUES
|
||||
(1, 'LHU/TEMP/04/2024/001', 1, 1, '2024-04-25', '2024-04-28', 1, 3, 2, 4, 'published', 2, 'Measurement results show all parameters within normal limits', 3);
|
||||
|
||||
-- Temperature Measurement Results
|
||||
INSERT INTO temperature_measurement_results (result_id, report_id, location_id, sample_code, measurement_time_start, measurement_time_end, parameter_id, measurement_value, unit, method, threshold_id, notes, equipment_id) VALUES
|
||||
(1, 1, 1, 'C2504090001', '09:00:00', '09:15:00', 1, 21.00, '°C', 'SNI 7062: 2019', 1, NULL, 1),
|
||||
(2, 1, 2, 'C2504090002', '09:30:00', '09:45:00', 1, 22.00, '°C', 'SNI 7062: 2019', 1, NULL, 1),
|
||||
(3, 1, 3, 'C2504090003', '10:00:00', '10:15:00', 1, 19.00, '°C', 'SNI 7062: 2019', 2, NULL, 1),
|
||||
(4, 1, 4, 'C2504090004', '10:30:00', '10:45:00', 1, 26.00, '°C', 'SNI 7062: 2019', 3, NULL, 1),
|
||||
(5, 1, 5, 'C2504090005', '11:00:00', '11:15:00', 1, 24.00, '°C', 'SNI 7062: 2019', 4, NULL, 1);
|
||||
INSERT INTO temperature_measurement_results (TemperatureMeasurementResultID, TestReportID, MasterSamplingLocationID, TemperatureMeasurementResultSampleCode, TemperatureMeasurementResultStartTime, TemperatureMeasurementResultEndTime, MasterClimateParameterID, TemperatureMeasurementResultValue, TemperatureMeasurementResultUnit, TemperatureMeasurementResultMethod, MasterThresholdValueID, TemperatureMeasurementResultNotes, MasterEquipmentID, TemperatureMeasurementResultCreatedUserID) VALUES
|
||||
(1, 1, 1, 'C2504090001', '09:00:00', '09:15:00', 1, 21.00, '°C', 'SNI 7062: 2019', 1, NULL, 1, 3),
|
||||
(2, 1, 2, 'C2504090002', '09:30:00', '09:45:00', 1, 22.00, '°C', 'SNI 7062: 2019', 1, NULL, 1, 3),
|
||||
(3, 1, 3, 'C2504090003', '10:00:00', '10:15:00', 1, 19.00, '°C', 'SNI 7062: 2019', 2, NULL, 1, 3),
|
||||
(4, 1, 4, 'C2504090004', '10:30:00', '10:45:00', 1, 26.00, '°C', 'SNI 7062: 2019', 3, NULL, 1, 3),
|
||||
(5, 1, 5, 'C2504090005', '11:00:00', '11:15:00', 1, 24.00, '°C', 'SNI 7062: 2019', 4, NULL, 1, 3);
|
||||
Reference in New Issue
Block a user