erd
Tables (19)
anomaly_event
- event_id — bigint — Primary key — NOT NULL
- turbine_id — bigint — Foreign key → turbine.turbine_id — NOT NULL
- start_time — datetime(6) — NOT NULL — 이상 감지 시작
- end_time — datetime(6) — NULL 이면 진행 중
- expected_power — double — 모델 예측 출력(kW)
- actual_power — double — 실제 출력(kW)
- z_score — double — 기대-실측 차이의 표준화 값. 계층 A 는 NULL
- deviation_pct — double — 기대 대비 편차율
- tier — varchar(20) — NOT NULL — A: 급성, B: 만성
- event_type — varchar(50) — NOT NULL — PROLONGED_STOP / DATA_MISSING / CHRONIC_SCREENING / CHRONIC_CONFIRMED
- scope — varchar(20) — DATA_MISSING 전용. FARM: 수집·통신 장애, TURBINE: 설비 문제
- energy_ratio_30d — double — 계층 B 지표(호기 30일 에너지비 - 단지 중앙값). 계층 A 는 NULL
- estimated_loss_kwh — double — 놓친 발전량(kWh). DATA_MISSING 은 관측이 없어 산출 불가
- created_at — datetime(6) — NOT NULL
asos_record
- asos_station_id — bigint — Primary key — NOT NULL
- recorded_at — datetime(6) — Primary key — NOT NULL
- sd_hr3 — double — 3시간 신적설(cm)
- sd_day — double — 일 신적설(cm)
- sd_tot — double — 적설(cm)
assignment
- user_id — bigint — Foreign key → user.user_id — NOT NULL
- wind_farm_id — bigint — Foreign key → wind_farm.wind_farm_id — NOT NULL
- created_at — datetime(6) — NOT NULL
audit_log
- log_id — bigint — Primary key — NOT NULL
- user_id — bigint — Foreign key → user.user_id — NOT NULL — 행위 주체
- action_type — varchar(50) — NOT NULL — report_edit / report_approve / notification_sent / role_change / login / logout
- target_table — varchar(50) — 예: report, users
- target_id — bigint — 예: report_id 값
- created_at — datetime(6) — NOT NULL
aws_record
- aws_station_id — bigint — Primary key — NOT NULL
- recorded_at — datetime(6) — Primary key — NOT NULL
- temperature — double — 기온(°C)
- pressure — double — 기압(hPa)
- humidity — double — 습도(%)
- wind_direction — double — 풍향(deg)
- precipitation — double — 강수량(mm)
blade
- blade_id — bigint — Primary key — NOT NULL
- turbine_id — bigint — Foreign key → turbine.turbine_id — NOT NULL
- blade_tag — varchar(10) — NOT NULL
- installation_date — date
- created_at — datetime(6)
daily_generation
- stat_at — datetime(6) — Primary key — NOT NULL
- turbine_id — bigint — Foreign key → turbine.turbine_id — NOT NULL
- daily_power_output — double
defect
- defect_id — bigint — Primary key — NOT NULL
- inspection_id — bigint — Foreign key → inspection.inspection_id — NOT NULL
- blade_id — bigint — Foreign key → blade.blade_id — NOT NULL
- defect_type — varchar(50) — NOT NULL — YOLO 모델의 클래스명 (9종: Contamination, Paint Damage 등)
- severity — int
- part_side — varchar(20) — LE / TE / PS / SS
- bbox_x — double
- bbox_y — double
- bbox_w — double
- bbox_h — double
- confidence — double — AI 검출 신뢰도 0~1
- image_path — varchar(500)
- created_at — datetime(6)
flyway_schema_history
- installed_rank — int — Primary key — NOT NULL
- version — varchar(50)
- description — varchar(200) — NOT NULL
- type — varchar(20) — NOT NULL
- script — varchar(1000) — NOT NULL
- checksum — int
- installed_by — varchar(100) — NOT NULL
- installed_on — timestamp — NOT NULL
- execution_time — int — NOT NULL
- success — tinyint(1) — NOT NULL
inspection
- inspection_id — bigint — Primary key — NOT NULL
- turbine_id — bigint — Foreign key → turbine.turbine_id — NOT NULL
- user_id — bigint — Foreign key → user.user_id
- report_id — bigint — Foreign key → report.report_id
- inspection_start — datetime(6) — NOT NULL — 드론 촬영 날짜
- inspection_end — datetime(6) — NOT NULL
- status — varchar(50) — NOT NULL
- created_at — datetime(6)
monthly_generation
- stat_at — datetime(6) — Primary key — NOT NULL
- turbine_id — bigint — Foreign key → turbine.turbine_id — NOT NULL
- monthly_power_output — double
notification
- notification_id — bigint — Primary key — NOT NULL
- user_id — bigint — Foreign key → user.user_id — NOT NULL — 알림 받는 관리자
- report_id — bigint — Foreign key → report.report_id — 알림 발생 원인
- report_title — varchar(200)
- is_read — tinyint(1) — NOT NULL
- sent_at — datetime(6) — NOT NULL
outbox_event
- id — bigint — Primary key — NOT NULL
- aggregate_type — varchar(50) — NOT NULL — 도메인 타입 (예: Inspection)
- aggregate_id — varchar(50) — NOT NULL — 대상 엔티티 ID
- event_type — varchar(100) — NOT NULL — 예: InspectionImageUploaded
- payload — json — NOT NULL — SQS 로 발행할 실제 데이터 본문
- status — varchar(20) — NOT NULL — PENDING / PUBLISHED / FAILED
- created_at — datetime(6) — NOT NULL
report
- report_id — bigint — Primary key — NOT NULL
- wind_farm_id — bigint — Foreign key → wind_farm.wind_farm_id — NOT NULL
- turbine_id — bigint — Foreign key → turbine.turbine_id
- approver_id — bigint — Foreign key → user.user_id — 생성 요청자 user_id(엔티티 createdBy 로 매핑). 자동 생성(이상감지)은 NULL
- anomaly_event_id — bigint — Foreign key → anomaly_event.event_id — 자동 생성 트리거가 된 이벤트. 운영/정기 보고서는 NULL
- report_type — varchar(50) — NOT NULL — WIND_FARM_OPERATION / TURBINE_OPERATION / DEFECT_DIAGNOSIS / ANOMALY_EVENT
- period_start — datetime(6) — NOT NULL
- period_end — datetime(6) — NOT NULL
- title — varchar(200)
- context — mediumtext
- status — varchar(50) — NOT NULL — PENDING(적재만 됨) / PROCESSING(생성중) / GENERATED(생성됨)
- generated_at — datetime(6)
scada_record
- recorded_at — datetime(6) — Primary key — NOT NULL
- turbine_id — bigint — Foreign key → turbine.turbine_id — NOT NULL
- power_output — double
- wind_speed — double — 나셀 풍속(m/s)
- air_density — double — 공기밀도(kg/m^3), 계산값
- norm_wind_speed — double — IEC 61400-12-1 기준 보정 풍속
- is_stopped — tinyint — 터빈 정지 여부(0/1)
- train_mask — tinyint — 정상거동 여부(0/1)
- expected_power_pooled — double — 단지 통합 모델 기대 발전량(kW)
- expected_power_unit — double — 터빈별 모델 기대 발전량(kW)
turbine
- turbine_id — bigint — Primary key — NOT NULL
- wind_farm_id — bigint — Foreign key → wind_farm.wind_farm_id — NOT NULL
- turbine_model_id — bigint — Foreign key → turbine_model.turbine_model_id — NOT NULL
- turbine_code — varchar(20) — NOT NULL
- turbine_latitude — double — NOT NULL
- turbine_longitude — double — NOT NULL
- installation_date — date
- created_at — datetime(6)
turbine_model
- turbine_model_id — bigint — Primary key — NOT NULL
- model — varchar(50) — NOT NULL
- manufacturer — varchar(50)
- rated_power — int
- rotor_diameter — double
- hub_height — double
- blade_length — double
- cut_in_speed — double
- rated_speed — double
- cut_out_speed — double
user
- user_id — bigint — Primary key — NOT NULL
- employee_id — varchar(255) — NOT NULL
- password — varchar(255) — NOT NULL
- user_name — varchar(255) — NOT NULL
- department — varchar(50)
- phone — varchar(20)
- role — varchar(20) — NOT NULL
- status — varchar(20) — NOT NULL
- login_fail_count — int — NOT NULL
- latest_session_id — varchar(64)
- created_at — datetime(6) — NOT NULL
- updated_at — datetime(6) — NOT NULL
wind_farm
- wind_farm_id — bigint — Primary key — NOT NULL
- wind_farm_name — varchar(100) — NOT NULL
- wind_farm_latitude — double — NOT NULL
- wind_farm_longitude — double — NOT NULL
- capacity — double
- installation_date — date
- address — varchar(200)
- created_at — datetime(6)
- aws_station_id — bigint
- asos_station_id — bigint