From fbf59c33769903fe1ad64abb29f3675ab828e0bc Mon Sep 17 00:00:00 2001 From: "sas.fajri" Date: Thu, 24 Apr 2025 14:49:17 +0700 Subject: [PATCH] update table --- masterdata.txt | 255 +++++++++++++++++++++++++++---------------------- 1 file changed, 139 insertions(+), 116 deletions(-) diff --git a/masterdata.txt b/masterdata.txt index 2ececbb..cb2be07 100644 --- a/masterdata.txt +++ b/masterdata.txt @@ -1,121 +1,144 @@ CREATE TABLE master_parameters ( - parameter_id INT PRIMARY KEY AUTO_INCREMENT, - parameter_code VARCHAR(20) NOT NULL, - parameter_name VARCHAR(100) NOT NULL, - parameter_group VARCHAR(50), -- misalnya: fisika, kimia, mikrobiologi, logam berat - standard_method VARCHAR(100), -- metode analisis sesuai SNI atau standard lain - unit VARCHAR(20), -- satuan parameter (mg/L, cfu/100mL, dsb) - price DECIMAL(12, 2), -- harga analisis per parameter - instrumentation VARCHAR(100), -- peralatan analisis yang diperlukan - mdl DECIMAL(12, 6), -- Method Detection Limit - container_type VARCHAR(50), -- jenis wadah (HDPE, kaca, dsb) - preservation VARCHAR(200), -- metode preservasi - holding_time VARCHAR(50), -- waktu simpan maksimum - remarks TEXT, - is_active BOOLEAN DEFAULT TRUE, - created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + MasterParameterID INT PRIMARY KEY AUTO_INCREMENT, + MasterParameterCode VARCHAR(20) NOT NULL, + MasterParameterName VARCHAR(100) NOT NULL, + MasterParameterGroup VARCHAR(50), -- misalnya: fisika, kimia, mikrobiologi, logam berat + MasterParameterStandardMethod VARCHAR(100), -- metode analisis sesuai SNI atau standard lain + MasterParameterUnit VARCHAR(20), -- satuan parameter (mg/L, cfu/100mL, dsb) + MasterParameterPrice DECIMAL(12, 2), -- harga analisis per parameter + MasterParameterInstrumentation VARCHAR(100), -- peralatan analisis yang diperlukan + MasterParameterMDL DECIMAL(12, 6), -- Method Detection Limit + MasterParameterContainerType VARCHAR(50), -- jenis wadah (HDPE, kaca, dsb) + MasterParameterPreservation VARCHAR(200), -- metode preservasi + MasterParameterHoldingTime VARCHAR(50), -- waktu simpan maksimum + MasterParameterRemarks TEXT, + MasterParameterIsActive BOOLEAN DEFAULT TRUE, + CreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP, + CreatedUserID INT, + UpdatedAt DATETIME, + UpdatedUserID INT, + DeletedAt DATETIME, + DeletedUserID INT ); CREATE TABLE master_equipment ( - equipment_id INT PRIMARY KEY AUTO_INCREMENT, - equipment_code VARCHAR(20) NOT NULL, - equipment_name VARCHAR(100) NOT NULL, - equipment_type VARCHAR(50) NOT NULL, -- sampling, pengukuran lapangan, preservasi, dll - specifications TEXT, - brand VARCHAR(100), - model VARCHAR(100), - serial_number VARCHAR(100), - purchase_date DATE, - calibration_interval INT, -- interval kalibrasi dalam hari - last_calibration_date DATE, - next_calibration_date DATE, - status VARCHAR(20), -- available, in use, maintenance, retired - location VARCHAR(100), -- lokasi penyimpanan - remarks TEXT, - is_active BOOLEAN DEFAULT TRUE, - created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + MasterEquipmentID INT PRIMARY KEY AUTO_INCREMENT, + MasterEquipmentCode VARCHAR(20) NOT NULL, + MasterEquipmentName VARCHAR(100) NOT NULL, + MasterEquipmentType VARCHAR(50) NOT NULL, -- sampling, pengukuran lapangan, preservasi, dll + MasterEquipmentSpecifications TEXT, + MasterEquipmentBrand VARCHAR(100), + MasterEquipmentModel VARCHAR(100), + MasterEquipmentSerialNumber VARCHAR(100), + MasterEquipmentPurchaseDate DATE, + MasterEquipmentCalibrationInterval INT, -- interval kalibrasi dalam hari + MasterEquipmentLastCalibrationDate DATE, + MasterEquipmentNextCalibrationDate DATE, + MasterEquipmentStatus VARCHAR(20), -- available, in use, maintenance, retired + MasterEquipmentLocation VARCHAR(100), -- lokasi penyimpanan + MasterEquipmentRemarks TEXT, + MasterEquipmentIsActive BOOLEAN DEFAULT TRUE, + CreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP, + CreatedUserID INT, + UpdatedAt DATETIME, + UpdatedUserID INT, + DeletedAt DATETIME, + DeletedUserID INT ); CREATE TABLE master_personnel ( - personnel_id INT PRIMARY KEY AUTO_INCREMENT, - employee_code VARCHAR(20) NOT NULL, - name VARCHAR(100) NOT NULL, - position VARCHAR(50), - department VARCHAR(50), - specialization VARCHAR(100), -- bidang keahlian/spesialisasi - certifications TEXT, -- sertifikasi yang dimiliki - contact_number VARCHAR(20), - email VARCHAR(100), - join_date DATE, - qualification TEXT, -- kualifikasi/pendidikan - status VARCHAR(20), -- active, inactive - remarks 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, + MasterPersonnelCode VARCHAR(20) NOT NULL, + MasterPersonnelName VARCHAR(100) NOT NULL, + MasterPersonnelPosition VARCHAR(50), + MasterPersonnelDepartment VARCHAR(50), + MasterPersonnelSpecialization VARCHAR(100), -- bidang keahlian/spesialisasi + MasterPersonnelCertifications TEXT, -- sertifikasi yang dimiliki + MasterPersonnelContactNumber VARCHAR(20), + MasterPersonnelEmail VARCHAR(100), + MasterPersonnelJoinDate DATE, + MasterPersonnelQualification TEXT, -- kualifikasi/pendidikan + MasterPersonnelStatus VARCHAR(20), -- active, inactive + MasterPersonnelRemarks TEXT, + MasterPersonnelIsActive BOOLEAN DEFAULT TRUE, + CreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP, + CreatedUserID INT, + UpdatedAt DATETIME, + UpdatedUserID INT, + DeletedAt DATETIME, + DeletedUserID INT ); CREATE TABLE master_clients ( - client_id INT PRIMARY KEY AUTO_INCREMENT, - client_code VARCHAR(20) NOT NULL, - client_name VARCHAR(200) NOT NULL, - client_type VARCHAR(50), -- industry, government, private, etc - industry_sector VARCHAR(100), - address TEXT, - city VARCHAR(100), - province VARCHAR(100), - postal_code VARCHAR(20), - main_contact_person VARCHAR(100), - contact_position VARCHAR(100), - contact_phone VARCHAR(20), - contact_email VARCHAR(100), - tax_id VARCHAR(50), -- NPWP - payment_terms VARCHAR(50), - discount_rate DECIMAL(5, 2), - credit_limit DECIMAL(15, 2), - status VARCHAR(20), -- active, inactive - remarks TEXT, - 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(20) NOT NULL, + MasterClientName VARCHAR(200) NOT NULL, + MasterClientType VARCHAR(50), -- industry, government, private, etc + MasterClientIndustrySector VARCHAR(100), + MasterClientAddress TEXT, + MasterClientCity VARCHAR(100), + MasterClientProvince VARCHAR(100), + MasterClientPostalCode VARCHAR(20), + MasterClientContactPerson VARCHAR(100), + MasterClientContactPosition VARCHAR(100), + MasterClientContactPhone VARCHAR(20), + MasterClientContactEmail VARCHAR(100), + MasterClientTaxID VARCHAR(50), -- NPWP + MasterClientPaymentTerms VARCHAR(50), + MasterClientDiscountRate DECIMAL(5, 2), + MasterClientCreditLimit DECIMAL(15, 2), + MasterClientStatus VARCHAR(20), -- active, inactive + MasterClientRemarks TEXT, + MasterClientIsActive BOOLEAN DEFAULT TRUE, + CreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP, + CreatedUserID INT, + UpdatedAt DATETIME, + UpdatedUserID INT, + DeletedAt DATETIME, + DeletedUserID INT ); CREATE TABLE master_sampling_locations ( - location_id INT PRIMARY KEY AUTO_INCREMENT, - location_code VARCHAR(20) NOT NULL, - location_name VARCHAR(200) NOT NULL, - client_id INT, - location_type VARCHAR(50), -- outlet, inlet, sungai, danau, sumur, dsb - address TEXT, - coordinates POINT, -- koordinat GPS (latitude, longitude) - elevation DECIMAL(10, 2), -- elevasi dalam meter - description TEXT, - access_information TEXT, - sampling_point_details TEXT, - 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 (client_id) REFERENCES master_clients(client_id) + MasterSamplingLocationID INT PRIMARY KEY AUTO_INCREMENT, + MasterSamplingLocationCode VARCHAR(20) NOT NULL, + MasterSamplingLocationName VARCHAR(200) NOT NULL, + MasterClientID INT, + MasterSamplingLocationType VARCHAR(50), -- outlet, inlet, sungai, danau, sumur, dsb + MasterSamplingLocationAddress TEXT, + MasterSamplingLocationCoordinates POINT, -- koordinat GPS (latitude, longitude) + MasterSamplingLocationElevation DECIMAL(10, 2), -- elevasi dalam meter + MasterSamplingLocationDescription TEXT, + MasterSamplingLocationAccessInfo TEXT, + MasterSamplingLocationPointDetails TEXT, + MasterSamplingLocationRemarks TEXT, + MasterSamplingLocationIsActive BOOLEAN DEFAULT TRUE, + CreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP, + CreatedUserID INT, + UpdatedAt DATETIME, + UpdatedUserID INT, + DeletedAt DATETIME, + DeletedUserID INT ); CREATE TABLE master_sampling_methods ( - method_id INT PRIMARY KEY AUTO_INCREMENT, - method_code VARCHAR(20) NOT NULL, - method_name VARCHAR(100) NOT NULL, - standard_reference VARCHAR(100), -- referensi standar (SNI, APHA, EPA, dsb) - applicable_matrix VARCHAR(50), -- air, tanah, udara, dsb - method_description TEXT, - equipment_needed TEXT, - procedure_summary TEXT, - qc_requirements TEXT, -- persyaratan quality control - limitations TEXT, - remarks TEXT, - is_active BOOLEAN DEFAULT TRUE, - created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + MasterSamplingMethodID INT PRIMARY KEY AUTO_INCREMENT, + MasterSamplingMethodCode VARCHAR(20) NOT NULL, + MasterSamplingMethodName VARCHAR(100) NOT NULL, + MasterSamplingMethodStandardRef VARCHAR(100), -- referensi standar (SNI, APHA, EPA, dsb) + MasterSamplingMethodMatrix VARCHAR(50), -- air, tanah, udara, dsb + MasterSamplingMethodDescription TEXT, + MasterSamplingMethodEquipment TEXT, + MasterSamplingMethodProcedure TEXT, + MasterSamplingMethodQCRequirements TEXT, -- persyaratan quality control + MasterSamplingMethodLimitations TEXT, + MasterSamplingMethodRemarks TEXT, + MasterSamplingMethodIsActive BOOLEAN DEFAULT TRUE, + CreatedAt DATETIME DEFAULT CURRENT_TIMESTAMP, + CreatedUserID INT, + UpdatedAt DATETIME, + UpdatedUserID INT, + DeletedAt DATETIME, + DeletedUserID INT ); CREATE TABLE master_preservation_methods ( @@ -380,7 +403,7 @@ CREATE TABLE measurement_results_light ( 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 +INSERT INTO master_parameters (MasterParameterID, MasterParameterCode, MasterParameterName, MasterParameterGroup, MasterParameterStandardMethod, MasterParameterUnit, MasterParameterPrice, MasterParameterInstrumentation, MasterParameterMDL, MasterParameterContainerType, MasterParameterPreservation, MasterParameterHoldingTime, MasterParameterRemarks, MasterParameterIsActive) VALUES (1, 'pH', 'pH', 'Fisika', 'SNI 06-6989.11-2019', 'unit', 50000.00, 'pH meter', 0.01, 'HDPE/Glass', 'Analisis segera', '15 menit (lapangan) / 24 jam', 'Parameter lapangan, prioritas analisis', TRUE), (2, 'TSS', 'Total Suspended Solid', 'Fisika', 'SNI 06-6989.3-2019', 'mg/L', 75000.00, 'Analytical Balance, Oven', 1.00, 'HDPE/Glass', 'Pendinginan 4°C', '7 hari', NULL, TRUE), (3, 'COD', 'Chemical Oxygen Demand', 'Kimia', 'SNI 6989.73:2019', 'mg/L', 125000.00, 'COD Reactor, Spektrofotometer', 5.00, 'Glass', 'H₂SO₄ hingga pH<2, pendinginan 4°C', '28 hari', NULL, TRUE), @@ -401,7 +424,7 @@ INSERT INTO master_parameters (parameter_id, parameter_code, parameter_name, par (18, 'SILAU', 'Kesilauan', 'Fisika', 'CIE 112-1994', 'UGR', 90000.00, 'Glare meter', 1.00, 'N/A', 'Pengukuran langsung di lapangan', 'N/A', 'Pengukuran untuk menilai tingkat silau di ruang kerja', TRUE), (19, 'CFLUKS', 'Fluks Cahaya', 'Fisika', 'IES LM-79-08', 'Lumen', 95000.00, 'Integrating Sphere', 10.00, 'N/A', 'Pengukuran langsung di lapangan', 'N/A', 'Parameter untuk mengukur total output cahaya dari sumber', TRUE); -INSERT INTO master_equipment (equipment_id, equipment_code, equipment_name, equipment_type, specifications, brand, model, serial_number, purchase_date, calibration_interval, last_calibration_date, next_calibration_date, status, location, remarks, is_active) VALUES +INSERT INTO master_equipment (MasterEquipmentID, MasterEquipmentCode, MasterEquipmentName, MasterEquipmentType, MasterEquipmentSpecifications, MasterEquipmentBrand, MasterEquipmentModel, MasterEquipmentSerialNumber, MasterEquipmentPurchaseDate, MasterEquipmentCalibrationInterval, MasterEquipmentLastCalibrationDate, MasterEquipmentNextCalibrationDate, MasterEquipmentStatus, MasterEquipmentLocation, MasterEquipmentRemarks, MasterEquipmentIsActive) VALUES (1, 'MULTIP001', 'Multiparameter Water Quality Meter', 'Field Measurement', 'Parameter: pH, DO, Conductivity, Temperature, Turbidity', 'YSI', 'ProDSS', 'YS19K12345', '2023-01-15', 180, '2023-12-10', '2024-06-08', 'available', 'Equipment Room A', 'Alat utama untuk pengukuran lapangan', TRUE), (2, 'pH002', 'pH Meter Portable', 'Field Measurement', 'Range: 0-14, Resolution: 0.01, Accuracy: ±0.02', 'Hanna', 'HI98191', 'HI12345678', '2023-03-20', 90, '2024-01-05', '2024-04-04', 'available', 'Equipment Room A', 'Backup untuk pengukuran pH lapangan', TRUE), (3, 'DO003', 'DO Meter Portable', 'Field Measurement', 'Range: 0-50 mg/L, Resolution: 0.01 mg/L', 'Lutron', 'DO-5519', 'LT5519876', '2022-11-10', 90, '2024-01-10', '2024-04-09', 'in use', 'Field Team B', NULL, TRUE), @@ -423,7 +446,7 @@ INSERT INTO master_equipment (equipment_id, equipment_code, equipment_name, equi (19, 'GLARE004', 'Glare Meter', 'Field Measurement', 'Range: UGR 5-40, Accuracy: ±1 UGR', 'GL Optic', 'GL Spectis 1.0 T Flicker', 'GL12345', '2023-01-25', 180, '2023-07-25', '2024-01-21', 'in use', 'Field Team A', 'Untuk pengukuran tingkat silau', TRUE), (20, 'GRID005', 'Grid Mapping Kit', 'Sampling', 'Grid markers, Measuring tape, Laser distance meter', 'In-house', 'Custom', 'N/A', '2023-03-15', 0, NULL, NULL, 'available', 'Equipment Room B', 'Peralatan penunjang untuk mapping titik sampling', TRUE); -INSERT INTO master_personnel (personnel_id, employee_code, name, position, department, specialization, certifications, contact_number, email, join_date, qualification, status, remarks, is_active) VALUES +INSERT INTO master_personnel (MasterPersonnelID, MasterPersonnelCode, MasterPersonnelName, MasterPersonnelPosition, MasterPersonnelDepartment, MasterPersonnelSpecialization, MasterPersonnelCertifications, MasterPersonnelContactNumber, MasterPersonnelEmail, MasterPersonnelJoinDate, MasterPersonnelQualification, MasterPersonnelStatus, MasterPersonnelRemarks, MasterPersonnelIsActive) VALUES (1, 'EMP001', 'Ahmad Ramadhan', 'Lab Manager', 'Laboratory', 'Environmental Analysis', 'KAN Lead Assessor, ISO 17025 Internal Auditor', '081234567890', 'ahmad@lab-env.co.id', '2015-03-10', 'M.Sc. Environmental Chemistry', 'active', NULL, TRUE), (2, 'EMP002', 'Siti Aminah', 'Sampling Team Leader', 'Field Operations', 'Water Quality Sampling', 'Certified Environmental Sampler, First Aid', '082345678901', 'siti@lab-env.co.id', '2017-06-15', 'B.Sc. Environmental Science', 'active', NULL, TRUE), (3, 'EMP003', 'Budi Santoso', 'Field Technician', 'Field Operations', 'Water & Soil Sampling', 'Certified Environmental Sampler', '083456789012', 'budi@lab-env.co.id', '2019-01-10', 'Diploma in Environmental Technology', 'active', NULL, TRUE), @@ -437,7 +460,7 @@ INSERT INTO master_personnel (personnel_id, employee_code, name, position, depar (11, 'EMP011', 'Rudi Hartono', 'IT Support', 'IT', 'LIMS, Network Management', 'CCNA, Microsoft Certified', '081234543210', 'rudi@lab-env.co.id', '2020-11-15', 'B.Sc. Information Technology', 'active', NULL, TRUE), (12, 'EMP012', 'Dr. Surya Wijaya', 'Technical Director', 'Management', 'Environmental Analytics, Research', 'ISO 17025 Technical Expert', '087654321098', 'surya@lab-env.co.id', '2010-02-01', 'Ph.D. Environmental Chemistry', 'active', NULL, TRUE); -INSERT INTO master_clients (client_id, client_code, client_name, client_type, industry_sector, address, city, province, postal_code, main_contact_person, contact_position, contact_phone, contact_email, tax_id, payment_terms, discount_rate, credit_limit, status, remarks, is_active) VALUES +INSERT INTO master_clients (MasterClientID, MasterClientCode, MasterClientName, MasterClientType, MasterClientIndustrySector, MasterClientAddress, MasterClientCity, MasterClientProvince, MasterClientPostalCode, MasterClientContactPerson, MasterClientContactPosition, MasterClientContactPhone, MasterClientContactEmail, MasterClientTaxID, MasterClientPaymentTerms, MasterClientDiscountRate, MasterClientCreditLimit, MasterClientStatus, MasterClientRemarks, MasterClientIsActive) VALUES (1, 'CL001', 'PT. Industri Tekstil Nusantara', 'industry', 'Textile', 'Jl. Industri No. 123', 'Bandung', 'Jawa Barat', '40123', 'Budi Santoso', 'Environmental Officer', '08123456789', 'budi@tekstilnusantara.com', '01.234.567.8-901.000', 'Net 30', 0.00, 10000000.00, 'active', 'Pelanggan reguler triwulanan', TRUE), (2, 'CL002', 'PT. Kimia Farma Tbk', 'industry', 'Pharmaceutical', 'Jl. Veteran No. 45', 'Jakarta', 'DKI Jakarta', '10110', 'Ani Wijaya', 'EHS Manager', '08234567890', 'ani@kimiafarma.co.id', '02.345.678.9-012.000', 'Net 15', 5.00, 25000000.00, 'active', NULL, TRUE), (3, 'CL003', 'Dinas Lingkungan Hidup Kota', 'government', 'Environmental Regulation', 'Jl. Ahmad Yani No. 35', 'Bandung', 'Jawa Barat', '40115', 'Siti Aminah', 'Koordinator Pemantauan Air', '08765432100', 'siti@dlh.kotabjb.go.id', '03.456.789.0-123.000', 'Government Invoice', 0.00, 50000000.00, 'active', 'Kontrak tahunan', TRUE), @@ -449,7 +472,7 @@ INSERT INTO master_clients (client_id, client_code, client_name, client_type, in (9, 'CL009', 'PT. Pertamina EP', 'government', 'Oil & Gas', 'Jl. Medan Merdeka Timur No. 1A', 'Jakarta', 'DKI Jakarta', '10110', 'Joko Susilo', 'HSE Manager', '08789012345', 'joko@pertamina.com', '09.012.345.6-789.000', 'Net 45', 0.00, 50000000.00, 'active', NULL, TRUE), (10, 'CL010', 'PT. Jakarta Propertindo', 'government', 'Property Development', 'Jl. Kebon Sirih No. 12', 'Jakarta', 'DKI Jakarta', '10340', 'Lina Hartati', 'Environmental Manager', '08890123456', 'lina@jakpro.co.id', '10.123.456.7-890.000', 'Net 30', 0.00, 25000000.00, 'active', NULL, TRUE); -INSERT INTO master_sampling_locations (location_id, location_code, location_name, client_id, location_type, address, coordinates, elevation, description, access_information, sampling_point_details, remarks, is_active) VALUES +INSERT INTO master_sampling_locations (MasterSamplingLocationID, MasterSamplingLocationCode, MasterSamplingLocationName, MasterClientID, MasterSamplingLocationType, MasterSamplingLocationAddress, MasterSamplingLocationCoordinates, MasterSamplingLocationElevation, MasterSamplingLocationDescription, MasterSamplingLocationAccessInfo, MasterSamplingLocationPointDetails, MasterSamplingLocationRemarks, MasterSamplingLocationIsActive) VALUES (1, 'LOC001', 'Outlet IPAL PT. ITN', 1, 'outlet', 'Jl. Industri No. 123, Bandung', POINT(-6.914744, 107.609810), 650.5, 'Outlet dari Instalasi Pengolahan Air Limbah utama', 'Akses melalui pintu belakang pabrik, koordinasi dengan security', 'Sampel diambil dari saluran outlet sebelum bercampur dengan badan air penerima', NULL, TRUE), (2, 'LOC002', 'Inlet IPAL PT. ITN', 1, 'inlet', 'Jl. Industri No. 123, Bandung', POINT(-6.914789, 107.609835), 652.0, 'Inlet menuju Instalasi Pengolahan Air Limbah', 'Akses melalui area produksi, perlu ijin khusus', 'Sampel diambil dari bak ekualisasi sebelum treatment', 'Memerlukan APD lengkap, beresiko bau menyengat', TRUE), (3, 'LOC003', 'Titik 1 Sungai Citarum (Hulu)', 3, 'sungai', 'Desa Cikitu, Kab. Bandung', POINT(-6.947890, 107.632505), 875.3, 'Lokasi hulu Sungai Citarum', 'Akses dengan kendaraan 4WD + jalan kaki 500m', 'Sampel diambil dari tengah sungai dengan perahu', 'Koordinasi dengan penduduk lokal untuk akses', TRUE), @@ -463,18 +486,18 @@ INSERT INTO master_sampling_locations (location_id, location_code, location_name (11, 'LOC011', 'Sumber Air Baku Aqua', 5, 'sumber air', 'Desa Babakan, Kabupaten Sukabumi', POINT(-6.912387, 106.912345), 875.4, 'Sumber mata air untuk produksi air minum', 'Akses terbatas, perlu ijin khusus dan didampingi staff', 'Sampel diambil langsung dari mata air', 'Area steril, perlu protokol khusus', TRUE), (12, 'LOC012', 'Sungai Ciliwung Hulu', 10, 'sungai', 'Kebun Raya Bogor', POINT(-6.597890, 106.799012), 260.5, 'Bagian hulu sungai, kawasan konservasi', 'Akses dari Kebun Raya, perlu izin masuk', 'Sampel diambil dari jembatan dengan tali dan ember', 'Sampel baseline kualitas air', TRUE); -INSERT INTO master_sampling_methods (method_id, method_code, method_name, standard_reference, applicable_matrix, method_description, equipment_needed, procedure_summary, qc_requirements, limitations, remarks, is_active) VALUES +INSERT INTO master_sampling_methods (MasterSamplingMethodID, MasterSamplingMethodCode, MasterSamplingMethodName, MasterSamplingMethodStandardRef, MasterSamplingMethodMatrix, MasterSamplingMethodDescription, MasterSamplingMethodEquipment, MasterSamplingMethodProcedure, MasterSamplingMethodQCRequirements, MasterSamplingMethodLimitations, MasterSamplingMethodRemarks, MasterSamplingMethodIsActive) VALUES (1, 'GS-001', 'Grab Sampling for Surface Water', 'SNI 6989.57:2008', 'air permukaan', 'Pengambilan sampel sesaat untuk air permukaan', 'Botol sampel sesuai parameter, tali, ember, tongkat sampling', 'Sampel diambil secara langsung dari badan air dengan kedalaman sekitar 30cm dari permukaan', 'Blanko lapangan, sampel duplikat 1 per 10 sampel', NULL, NULL, TRUE), (2, 'MS-CAHAYA-01', 'Pengukuran Intensitas Cahaya Ruangan', 'SNI 16-7062-2004', 'ruang_kerja', 'Metode pengukuran intensitas cahaya dalam ruangan', 'Lux meter, tripod, meteran', 'Pengukuran dilakukan dengan menempatkan sensor lux meter pada bidang kerja (umumnya 0.75-0.85m dari lantai). Diambil minimal 3 titik pengukuran yang mewakili area kerja. Untuk ruangan <10m², minimal 1 titik di tengah ruangan.', 'Kalibrasi lux meter sebelum pengukuran, verifikasi dengan standar cahaya (jika ada)', 'Hasil dapat dipengaruhi oleh kondisi cuaca, bayangan, dan refleksi cahaya', NULL, TRUE), (3, 'MS-CAHAYA-02', 'Pengukuran Intensitas Cahaya Area Kerja Industri', 'PERMENAKER No.5 Tahun 2018', 'area_kerja', 'Metode pengukuran intensitas cahaya untuk area kerja industri', 'Lux meter digital, tripod, meteran, lembar grid area kerja', 'Pengukuran dilakukan dengan membuat grid area kerja. Untuk area <100m², minimal 9 titik pengukuran (grid 3x3). Sensor diletakkan pada bidang kerja atau 0.85m dari lantai. Pengukuran dilakukan dalam kondisi operasional normal.', 'Kalibrasi lux meter, pengukuran duplikat minimal 10% dari total titik', 'Pengukuran optimal dilakukan saat aktivitas produksi normal. Perhatikan pengaruh bayangan mesin dan peralatan.', 'Untuk area produksi dengan pencahayaan kritis, perlu pengukuran pada waktu yang berbeda (pagi, siang, malam)', TRUE), (4, 'MS-CAHAYA-03', 'Pengukuran Luminansi Permukaan', 'IES LM-79-08', 'permukaan_kerja', 'Metode pengukuran luminansi (kecerahan) permukaan', 'Luminance meter, tripod, material reflektansi standar', 'Pengukuran dilakukan dengan mengarahkan luminance meter ke permukaan yang diukur pada sudut pengamatan normal. Jarak pengukuran disesuaikan dengan spesifikasi alat.', 'Kalibrasi dengan material reflektansi standar', 'Refleksi cahaya dari permukaan lain dapat mempengaruhi hasil', 'Terutama untuk evaluasi silau dan kontras pencahayaan', TRUE), (5, 'MS-CAHAYA-04', 'Pengukuran Distribusi Cahaya', 'CIE S 025/E:2015', 'ruang_tiga_dimensi', 'Metode pengukuran distribusi cahaya dalam ruang tiga dimensi', 'Lux meter dengan probe 3D, tripod, perangkat lunak pemetaan cahaya', 'Pengukuran dilakukan pada grid tiga dimensi dalam ruangan untuk memetakan distribusi cahaya. Pengukuran minimal pada 3 ketinggian berbeda.', 'Verifikasi dengan pengukuran pada titik referensi', 'Memerlukan waktu pengukuran yang lebih lama', 'Untuk analisis distribusi cahaya yang lebih komprehensif', TRUE); -INSERT INTO master_regulations (regulation_id, regulation_code, regulation_name, issuing_authority, regulation_type, issue_date, effective_date, applicable_sector, scope, summary, file_path, remarks, is_active) VALUES +INSERT INTO master_regulations (MasterRegulationID, MasterRegulationCode, MasterRegulationName, MasterRegulationIssuingAuthority, MasterRegulationType, MasterRegulationIssueDate, MasterRegulationEffectiveDate, MasterRegulationApplicableSector, MasterRegulationScope, MasterRegulationSummary, MasterRegulationFilePath, MasterRegulationRemarks, MasterRegulationIsActive) VALUES (1, 'PMK-02-2023', 'Peraturan Menteri Kesehatan Republik Indonesia Nomor 2 Tahun 2023', 'Kementerian Kesehatan', 'Peraturan Menteri', '2023-01-20', '2023-02-01', 'Kesehatan Lingkungan, Kesehatan Kerja', 'Standar Baku Mutu Kesehatan Lingkungan dan Persyaratan Kesehatan', 'Peraturan ini mengatur tentang standar baku mutu kesehatan lingkungan untuk media udara, air, tanah, pangan, dan sarana/bangunan, serta persyaratan kesehatan lainnya', '/dokumen/regulasi/PMK_02_2023.pdf', 'Menggantikan PMK No.32 Tahun 2017', TRUE), (2, 'PERMENAKER-05-2018', 'Peraturan Menteri Ketenagakerjaan Republik Indonesia Nomor 5 Tahun 2018', 'Kementerian Ketenagakerjaan', 'Peraturan Menteri', '2018-04-25', '2018-05-10', 'Keselamatan dan Kesehatan Kerja', 'Keselamatan dan Kesehatan Kerja Lingkungan Kerja', 'Peraturan ini mengatur tentang standar K3 Lingkungan Kerja termasuk faktor fisika, kimia, biologi, ergonomi dan psikologi', '/dokumen/regulasi/PERMENAKER_05_2018.pdf', NULL, TRUE); -INSERT INTO master_quality_standards (standard_id, standard_code, standard_name, regulation_id, matrix_type, industry_type, parameter_id, min_value, max_value, unit, remarks, is_active) VALUES +INSERT INTO master_quality_standards (MasterQualityStandardID, MasterQualityStandardCode, MasterQualityStandardName, MasterRegulationID, MasterQualityStandardMatrixType, MasterQualityStandardIndustryType, MasterParameterID, MasterQualityStandardMinValue, MasterQualityStandardMaxValue, MasterQualityStandardUnit, MasterQualityStandardRemarks, MasterQualityStandardIsActive) VALUES -- Berdasarkan PMK RI No.2 Tahun 2023 (1, 'PMK-CAH-01', 'Intensitas Cahaya Ruang Kerja Perkantoran', 1, 'ruang_kerja', 'perkantoran', 16, 300.00, NULL, 'Lux', 'Intensitas cahaya untuk pekerjaan rutin', TRUE), (2, 'PMK-CAH-02', 'Intensitas Cahaya Ruang Rapat', 1, 'ruang_rapat', NULL, 16, 300.00, NULL, 'Lux', NULL, TRUE), @@ -498,17 +521,17 @@ INSERT INTO master_quality_standards (standard_id, standard_code, standard_name, (18, 'PMN-CAH-09', 'Luminansi Maksimum', 2, 'area_kerja', 'industri', 17, NULL, 5000.00, 'cd/m²', 'Untuk menghindari efek silau', TRUE), (19, 'PMN-CAH-10', 'Indeks Kesilauan Maksimum', 2, 'area_kerja', 'industri', 18, NULL, 19.00, 'UGR', 'Batas kesilauan yang dapat ditoleransi', TRUE); -INSERT INTO sampling_plans (plan_id, plan_code, project_name, client_id, contact_person_id, request_date, planned_sampling_date, status, created_by, approved_by, approval_date, total_locations, total_parameters, remarks, created_at) VALUES +INSERT INTO sampling_plans (SamplingPlanID, SamplingPlanCode, SamplingPlanProjectName, MasterClientID, SamplingPlanContactPersonID, SamplingPlanRequestDate, SamplingPlanPlannedDate, SamplingPlanStatus, SamplingPlanCreatedBy, SamplingPlanApprovedBy, SamplingPlanApprovalDate, SamplingPlanTotalLocations, SamplingPlanTotalParameters, SamplingPlanRemarks, SamplingPlanCreatedAt) VALUES (1, 'SP-LX-2024-001', 'Monitoring Pencahayaan Ruang Kerja Triwulan I 2024', 1, NULL, '2024-01-05 09:00:00', '2024-01-20', 'approved', 4, 1, '2024-01-10 14:30:00', 10, 1, 'Monitoring rutin triwulanan sesuai PMK No.2 Tahun 2023', '2024-01-05 09:15:20'); -INSERT INTO sampling_plan_locations (plan_location_id, plan_id, location_id, sampling_date, sampling_time, sampling_method_id, sampling_personnel_id, field_parameters, special_instructions, status, remarks) VALUES +INSERT INTO sampling_plan_locations (SamplingPlanLocationID, SamplingPlanID, MasterSamplingLocationID, SamplingPlanLocationDate, SamplingPlanLocationTime, MasterSamplingMethodID, SamplingPlanLocationPersonnelID, SamplingPlanLocationFieldParameters, SamplingPlanLocationSpecialInstructions, SamplingPlanLocationStatus, SamplingPlanLocationRemarks) VALUES (1, 1, 1, '2024-01-20', '09:00:00', 2, 3, 'Intensitas Cahaya', 'Pengukuran dilakukan saat kondisi pencahayaan normal (tidak ada maintenance lampu)', 'planned', 'Area kerja produksi utama'), (2, 1, 2, '2024-01-20', '10:30:00', 2, 3, 'Intensitas Cahaya', 'Pengukuran dilakukan saat kondisi pencahayaan normal (tidak ada maintenance lampu)', 'planned', 'Area IPAL'), (3, 1, NULL, '2024-01-20', '11:30:00', 2, 3, 'Intensitas Cahaya', 'Pengukuran pada area kantor administrasi', 'planned', 'Ruang administrasi lantai 2'), (4, 1, NULL, '2024-01-20', '13:00:00', 2, 3, 'Intensitas Cahaya, Luminansi', 'Pengukuran pada area kerja dengan penggunaan komputer', 'planned', 'Ruang desain produk'), (5, 1, NULL, '2024-01-20', '14:00:00', 2, 3, 'Intensitas Cahaya', 'Pengukuran pada area QC', 'planned', 'Laboratorium QC'); -INSERT INTO sampling_plan_parameters (plan_parameter_id, plan_id, plan_location_id, parameter_id, container_id, preservation_id, quantity, unit_price, remarks) VALUES +INSERT INTO sampling_plan_parameters (SamplingPlanParameterID, SamplingPlanID, SamplingPlanLocationID, MasterParameterID, MasterSampleContainerID, MasterPreservationMethodID, SamplingPlanParameterQuantity, SamplingPlanParameterUnitPrice, SamplingPlanParameterRemarks) VALUES (1, 1, 1, 16, NULL, NULL, 1, 75000.00, 'Pengukuran grid 3x3'), (2, 1, 2, 16, NULL, NULL, 1, 75000.00, 'Pengukuran grid 3x3'), (3, 1, 3, 16, NULL, NULL, 1, 75000.00, 'Pengukuran pada meja kerja utama'), @@ -516,16 +539,16 @@ INSERT INTO sampling_plan_parameters (plan_parameter_id, plan_id, plan_location_ (5, 1, 4, 17, NULL, NULL, 1, 85000.00, 'Pengukuran luminansi layar monitor'), (6, 1, 5, 16, NULL, NULL, 1, 75000.00, 'Pengukuran pada area inspeksi produk'); -INSERT INTO equipment_requisitions (requisition_id, requisition_code, plan_id, requisition_date, requested_by, approved_by, approval_date, sampling_date, return_date, status, remarks) VALUES +INSERT INTO equipment_requisitions (EquipmentRequisitionID, EquipmentRequisitionCode, SamplingPlanID, EquipmentRequisitionDate, EquipmentRequisitionRequestedBy, EquipmentRequisitionApprovedBy, EquipmentRequisitionApprovalDate, EquipmentRequisitionSamplingDate, EquipmentRequisitionReturnDate, EquipmentRequisitionStatus, EquipmentRequisitionRemarks) VALUES (1, 'REQ-LX-2024-001', 1, '2024-01-15 10:30:00', 4, 1, '2024-01-16 09:15:00', '2024-01-20', '2024-01-21', 'approved', 'Peralatan untuk monitoring pencahayaan PT. ITN'); -INSERT INTO equipment_requisition_items (requisition_item_id, requisition_id, equipment_id, quantity, issued_quantity, issued_by, issued_date, returned_quantity, returned_condition, returned_date, verified_by, remarks) VALUES +INSERT INTO equipment_requisition_items (EquipmentRequisitionItemID, EquipmentRequisitionID, MasterEquipmentID, EquipmentRequisitionItemQuantity, EquipmentRequisitionItemIssuedQuantity, EquipmentRequisitionItemIssuedBy, EquipmentRequisitionItemIssuedDate, EquipmentRequisitionItemReturnedQuantity, EquipmentRequisitionItemReturnedCondition, EquipmentRequisitionItemReturnedDate, EquipmentRequisitionItemVerifiedBy, EquipmentRequisitionItemRemarks) VALUES (1, 1, 16, 1, 1, 8, '2024-01-19 15:00:00', NULL, NULL, NULL, NULL, 'Lux meter utama'), (2, 1, 17, 1, 1, 8, '2024-01-19 15:00:00', NULL, NULL, NULL, NULL, 'Lux meter backup'), (3, 1, 18, 1, 1, 8, '2024-01-19 15:00:00', NULL, NULL, NULL, NULL, 'Untuk pengukuran luminansi layar monitor'), (4, 1, 20, 1, 1, 8, '2024-01-19 15:00:00', NULL, NULL, NULL, NULL, 'Peralatan penunjang grid mapping'); -INSERT INTO measurement_results_light (result_id, sample_id, measurement_date, measurement_time, parameter_id, measurement_value, measurement_unit, measurement_point, weather_condition, light_source, ambient_condition, standard_id, is_compliant, analyst_id, verified_by, verification_date, remarks) VALUES +INSERT INTO measurement_results_light (MeasurementResultLightID, SampleID, MeasurementResultLightDate, MeasurementResultLightTime, MasterParameterID, MeasurementResultLightValue, MeasurementResultLightUnit, MeasurementResultLightPoint, MeasurementResultLightWeatherCondition, MeasurementResultLightSource, MeasurementResultLightAmbientCondition, MasterQualityStandardID, MeasurementResultLightIsCompliant, MeasurementResultLightAnalystID, MeasurementResultLightVerifiedBy, MeasurementResultLightVerificationDate, MeasurementResultLightRemarks) VALUES (1, 1, '2024-01-20', '09:15:00', 16, 325.50, 'Lux', 'Titik 1 (Depan)', 'Cerah', 'Lampu fluorescent + Cahaya alami', 'Tirai jendela dibuka 50%', 11, TRUE, 3, 2, '2024-01-21 10:00:00', 'Memenuhi standar Permenaker'), (2, 1, '2024-01-20', '09:20:00', 16, 310.20, 'Lux', 'Titik 2 (Tengah)', 'Cerah', 'Lampu fluorescent + Cahaya alami', 'Tirai jendela dibuka 50%', 11, TRUE, 3, 2, '2024-01-21 10:00:00', 'Memenuhi standar Permenaker'), (3, 1, '2024-01-20', '09:25:00', 16, 290.80, 'Lux', 'Titik 3 (Belakang)', 'Cerah', 'Lampu fluorescent + Cahaya alami', 'Tirai jendela dibuka 50%', 11, TRUE, 3, 2, '2024-01-21 10:00:00', 'Memenuhi standar Permenaker'),