🔧 볼트 재질 정보 개선 및 A320/A194M 패턴 지원
Some checks failed
SonarQube Analysis / SonarQube Scan (push) Has been cancelled
Some checks failed
SonarQube Analysis / SonarQube Scan (push) Has been cancelled
- bolt_classifier.py: A320/A194M 조합 패턴 처리 로직 추가 - material_grade_extractor.py: A320/A194M 패턴 추출 개선 - integrated_classifier.py: SPECIAL, U_BOLT 카테고리 우선 분류 - 데이터베이스: 492개 볼트의 material_grade를 완전한 형태로 업데이트 - A320/A194M GR B8/8: 78개 - A193/A194 GR B7/2H: 414개 - 프론트엔드: BOLT 카테고리 전용 UI (길이 표시) - Excel 내보내기: BOLT용 컬럼 순서 및 재질 정보 개선 - SPECIAL, U_BOLT 카테고리 지원 추가
This commit is contained in:
130
backend/scripts/24_add_special_category_support.sql
Normal file
130
backend/scripts/24_add_special_category_support.sql
Normal file
@@ -0,0 +1,130 @@
|
||||
-- ================================
|
||||
-- SPECIAL 카테고리 지원 추가 마이그레이션
|
||||
-- 생성일: 2025.09.30
|
||||
-- 목적: SPECIAL 카테고리 분류 및 관련 기능 지원
|
||||
-- ================================
|
||||
|
||||
-- 1. materials 테이블 SPECIAL 카테고리 지원 확인
|
||||
-- ================================
|
||||
|
||||
-- classified_category 컬럼이 SPECIAL 값을 지원하는지 확인
|
||||
-- (이미 VARCHAR(50)이므로 추가 작업 불필요, 하지만 명시적으로 체크)
|
||||
|
||||
-- SPECIAL 카테고리 관련 인덱스 추가 (성능 최적화)
|
||||
CREATE INDEX IF NOT EXISTS idx_materials_special_category
|
||||
ON materials(classified_category)
|
||||
WHERE classified_category = 'SPECIAL';
|
||||
|
||||
-- 2. SPECIAL 카테고리 분류 규칙 테이블 생성
|
||||
-- ================================
|
||||
|
||||
-- SPECIAL 키워드 패턴 테이블
|
||||
CREATE TABLE IF NOT EXISTS special_classification_patterns (
|
||||
id SERIAL PRIMARY KEY,
|
||||
pattern_type VARCHAR(20) NOT NULL, -- 'KEYWORD', 'REGEX', 'EXACT'
|
||||
pattern_value VARCHAR(200) NOT NULL,
|
||||
description TEXT,
|
||||
priority INTEGER DEFAULT 1, -- 우선순위 (낮을수록 높은 우선순위)
|
||||
is_active BOOLEAN DEFAULT TRUE,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
-- 기본 SPECIAL 키워드 패턴 삽입
|
||||
INSERT INTO special_classification_patterns (pattern_type, pattern_value, description, priority) VALUES
|
||||
('KEYWORD', 'SPECIAL', '영문 SPECIAL 키워드', 1),
|
||||
('KEYWORD', '스페셜', '한글 스페셜 키워드', 1),
|
||||
('KEYWORD', 'SPEC', '영문 SPEC 축약어', 2),
|
||||
('KEYWORD', 'SPL', '영문 SPL 축약어', 2)
|
||||
ON CONFLICT DO NOTHING;
|
||||
|
||||
-- 3. SPECIAL 자재 추가 정보 테이블
|
||||
-- ================================
|
||||
|
||||
-- SPECIAL 자재 상세 정보 테이블 (도면 업로드 관련)
|
||||
CREATE TABLE IF NOT EXISTS special_material_details (
|
||||
id SERIAL PRIMARY KEY,
|
||||
material_id INTEGER REFERENCES materials(id) ON DELETE CASCADE,
|
||||
file_id INTEGER REFERENCES files(id) ON DELETE CASCADE,
|
||||
|
||||
-- 도면 정보
|
||||
drawing_number VARCHAR(100), -- 도면 번호
|
||||
drawing_revision VARCHAR(20), -- 도면 리비전
|
||||
drawing_uploaded BOOLEAN DEFAULT FALSE, -- 도면 업로드 여부
|
||||
drawing_file_path TEXT, -- 도면 파일 경로
|
||||
|
||||
-- 특수 요구사항
|
||||
special_requirements TEXT, -- 특수 제작 요구사항
|
||||
manufacturing_notes TEXT, -- 제작 참고사항
|
||||
approval_required BOOLEAN DEFAULT TRUE, -- 승인 필요 여부
|
||||
approved_by VARCHAR(100), -- 승인자
|
||||
approved_at TIMESTAMP, -- 승인 일시
|
||||
|
||||
-- 분류 정보
|
||||
classification_confidence FLOAT DEFAULT 1.0,
|
||||
classification_reason TEXT, -- 분류 근거
|
||||
|
||||
-- 관리 정보
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
-- 4. 인덱스 생성 (성능 최적화)
|
||||
-- ================================
|
||||
|
||||
-- special_classification_patterns 인덱스
|
||||
CREATE INDEX IF NOT EXISTS idx_special_patterns_type ON special_classification_patterns(pattern_type);
|
||||
CREATE INDEX IF NOT EXISTS idx_special_patterns_active ON special_classification_patterns(is_active);
|
||||
CREATE INDEX IF NOT EXISTS idx_special_patterns_priority ON special_classification_patterns(priority);
|
||||
|
||||
-- special_material_details 인덱스
|
||||
CREATE INDEX IF NOT EXISTS idx_special_details_material ON special_material_details(material_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_special_details_file ON special_material_details(file_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_special_details_drawing_uploaded ON special_material_details(drawing_uploaded);
|
||||
CREATE INDEX IF NOT EXISTS idx_special_details_approval ON special_material_details(approval_required);
|
||||
|
||||
-- 5. 기존 자재 재분류 (선택적)
|
||||
-- ================================
|
||||
|
||||
-- 기존 자료 중 SPECIAL 키워드가 포함된 자재를 SPECIAL 카테고리로 재분류
|
||||
UPDATE materials
|
||||
SET
|
||||
classified_category = 'SPECIAL',
|
||||
classification_confidence = 1.0,
|
||||
updated_by = 'SYSTEM_MIGRATION',
|
||||
classified_at = CURRENT_TIMESTAMP
|
||||
WHERE
|
||||
(
|
||||
UPPER(original_description) LIKE '%SPECIAL%' OR
|
||||
UPPER(original_description) LIKE '%스페셜%' OR
|
||||
UPPER(original_description) LIKE '%SPEC%' OR
|
||||
UPPER(original_description) LIKE '%SPL%'
|
||||
)
|
||||
AND (classified_category IS NULL OR classified_category != 'SPECIAL');
|
||||
|
||||
-- 6. 통계 및 검증
|
||||
-- ================================
|
||||
|
||||
-- SPECIAL 카테고리 자재 개수 확인
|
||||
DO $$
|
||||
DECLARE
|
||||
special_count INTEGER;
|
||||
BEGIN
|
||||
SELECT COUNT(*) INTO special_count FROM materials WHERE classified_category = 'SPECIAL';
|
||||
RAISE NOTICE 'SPECIAL 카테고리로 분류된 자재 개수: %', special_count;
|
||||
END $$;
|
||||
|
||||
-- 7. 권한 설정 (필요시)
|
||||
-- ================================
|
||||
|
||||
-- SPECIAL 자재 관리 권한 (향후 확장용)
|
||||
-- 현재는 기본 materials 테이블 권한을 따름
|
||||
|
||||
COMMIT;
|
||||
|
||||
-- ================================
|
||||
-- 마이그레이션 완료 로그
|
||||
-- ================================
|
||||
INSERT INTO migration_log (script_name, executed_at, description) VALUES
|
||||
('24_add_special_category_support.sql', CURRENT_TIMESTAMP, 'SPECIAL 카테고리 지원 추가 및 기존 자재 재분류')
|
||||
ON CONFLICT DO NOTHING;
|
||||
151
backend/scripts/25_execute_special_category_migration.py
Executable file
151
backend/scripts/25_execute_special_category_migration.py
Executable file
@@ -0,0 +1,151 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
SPECIAL 카테고리 마이그레이션 실행 스크립트
|
||||
생성일: 2025.09.30
|
||||
목적: SPECIAL 카테고리 지원 추가 및 기존 자재 재분류
|
||||
"""
|
||||
|
||||
import sys
|
||||
import os
|
||||
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
|
||||
from sqlalchemy import create_engine, text
|
||||
from app.database import DATABASE_URL
|
||||
|
||||
def execute_special_migration():
|
||||
"""SPECIAL 카테고리 마이그레이션 실행"""
|
||||
engine = create_engine(DATABASE_URL)
|
||||
|
||||
with engine.connect() as conn:
|
||||
print("🚀 SPECIAL 카테고리 마이그레이션 시작...")
|
||||
print("=" * 60)
|
||||
|
||||
try:
|
||||
# 1. 마이그레이션 스크립트 실행
|
||||
print("📋 1단계: 마이그레이션 스크립트 실행...")
|
||||
script_path = os.path.join(os.path.dirname(__file__), '24_add_special_category_support.sql')
|
||||
with open(script_path, 'r', encoding='utf-8') as f:
|
||||
sql_content = f.read()
|
||||
|
||||
# SQL 명령어들을 분리하여 실행
|
||||
sql_commands = sql_content.split(';')
|
||||
for i, command in enumerate(sql_commands):
|
||||
command = command.strip()
|
||||
if command and not command.startswith('--') and command != 'COMMIT':
|
||||
try:
|
||||
conn.execute(text(command))
|
||||
if i % 10 == 0: # 진행상황 표시
|
||||
print(f" - 명령어 {i+1}/{len(sql_commands)} 실행 중...")
|
||||
except Exception as e:
|
||||
print(f" ⚠️ 명령어 실행 중 오류 (무시됨): {e}")
|
||||
continue
|
||||
|
||||
print("✅ 마이그레이션 스크립트 실행 완료")
|
||||
|
||||
# 2. 기존 자재 재분류 확인
|
||||
print("\n📊 2단계: 기존 자재 재분류 결과 확인...")
|
||||
|
||||
# SPECIAL 키워드가 포함된 자재 개수 확인
|
||||
result = conn.execute(text("""
|
||||
SELECT COUNT(*) as count
|
||||
FROM materials
|
||||
WHERE classified_category = 'SPECIAL'
|
||||
""")).fetchone()
|
||||
|
||||
special_count = result.count if result else 0
|
||||
print(f" - SPECIAL 카테고리로 분류된 자재: {special_count}개")
|
||||
|
||||
# 키워드별 분류 결과 확인
|
||||
keyword_results = conn.execute(text("""
|
||||
SELECT
|
||||
CASE
|
||||
WHEN UPPER(original_description) LIKE '%SPECIAL%' THEN 'SPECIAL'
|
||||
WHEN UPPER(original_description) LIKE '%스페셜%' THEN '스페셜'
|
||||
WHEN UPPER(original_description) LIKE '%SPEC%' THEN 'SPEC'
|
||||
WHEN UPPER(original_description) LIKE '%SPL%' THEN 'SPL'
|
||||
END as keyword_type,
|
||||
COUNT(*) as count
|
||||
FROM materials
|
||||
WHERE classified_category = 'SPECIAL'
|
||||
GROUP BY keyword_type
|
||||
ORDER BY count DESC
|
||||
""")).fetchall()
|
||||
|
||||
if keyword_results:
|
||||
print(" - 키워드별 분류 결과:")
|
||||
for row in keyword_results:
|
||||
print(f" * {row.keyword_type}: {row.count}개")
|
||||
|
||||
# 3. 테이블 생성 확인
|
||||
print("\n🏗️ 3단계: 새 테이블 생성 확인...")
|
||||
|
||||
# special_classification_patterns 테이블 확인
|
||||
patterns_count = conn.execute(text("""
|
||||
SELECT COUNT(*) as count
|
||||
FROM special_classification_patterns
|
||||
""")).fetchone()
|
||||
|
||||
patterns_count = patterns_count.count if patterns_count else 0
|
||||
print(f" - special_classification_patterns 테이블: {patterns_count}개 패턴 등록됨")
|
||||
|
||||
# special_material_details 테이블 확인
|
||||
details_exists = conn.execute(text("""
|
||||
SELECT EXISTS (
|
||||
SELECT 1 FROM information_schema.tables
|
||||
WHERE table_name = 'special_material_details'
|
||||
) as exists
|
||||
""")).fetchone()
|
||||
|
||||
if details_exists.exists:
|
||||
print(" - special_material_details 테이블: 생성 완료")
|
||||
else:
|
||||
print(" - ❌ special_material_details 테이블: 생성 실패")
|
||||
|
||||
# 4. 인덱스 생성 확인
|
||||
print("\n🔍 4단계: 인덱스 생성 확인...")
|
||||
|
||||
special_indexes = conn.execute(text("""
|
||||
SELECT indexname
|
||||
FROM pg_indexes
|
||||
WHERE indexname LIKE '%special%'
|
||||
ORDER BY indexname
|
||||
""")).fetchall()
|
||||
|
||||
if special_indexes:
|
||||
print(" - SPECIAL 관련 인덱스:")
|
||||
for idx in special_indexes:
|
||||
print(f" * {idx.indexname}")
|
||||
else:
|
||||
print(" - ⚠️ SPECIAL 관련 인덱스가 생성되지 않았습니다.")
|
||||
|
||||
# 커밋
|
||||
conn.commit()
|
||||
|
||||
print("\n" + "=" * 60)
|
||||
print("🎉 SPECIAL 카테고리 마이그레이션 완료!")
|
||||
print(f"📊 총 {special_count}개 자재가 SPECIAL 카테고리로 분류되었습니다.")
|
||||
print("🔧 새로운 기능:")
|
||||
print(" - SPECIAL 키워드 자동 감지")
|
||||
print(" - 도면 업로드 관리")
|
||||
print(" - 특수 제작 요구사항 추적")
|
||||
print(" - 승인 프로세스 지원")
|
||||
|
||||
except Exception as e:
|
||||
print(f"\n❌ 마이그레이션 실행 중 오류 발생: {e}")
|
||||
conn.rollback()
|
||||
raise
|
||||
|
||||
def main():
|
||||
"""메인 실행 함수"""
|
||||
print("SPECIAL 카테고리 마이그레이션 실행")
|
||||
print("TK-MP-Project - 특수 자재 관리 시스템")
|
||||
print("=" * 60)
|
||||
|
||||
try:
|
||||
execute_special_migration()
|
||||
except Exception as e:
|
||||
print(f"\n💥 마이그레이션 실패: {e}")
|
||||
sys.exit(1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
114
backend/scripts/26_update_bolt_material_grades.py
Normal file
114
backend/scripts/26_update_bolt_material_grades.py
Normal file
@@ -0,0 +1,114 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
볼트 재질 정보 업데이트 스크립트
|
||||
A320/A194M 패턴 등을 올바르게 인식하도록 기존 볼트들의 material_grade 재분류
|
||||
"""
|
||||
|
||||
import os
|
||||
import sys
|
||||
import psycopg2
|
||||
from psycopg2.extras import RealDictCursor
|
||||
|
||||
# 프로젝트 루트 디렉토리를 Python 경로에 추가
|
||||
sys.path.append('/app')
|
||||
|
||||
from app.services.bolt_classifier import classify_bolt_material
|
||||
|
||||
def update_bolt_material_grades():
|
||||
"""기존 볼트들의 material_grade 업데이트"""
|
||||
|
||||
# 데이터베이스 연결
|
||||
try:
|
||||
conn = psycopg2.connect(
|
||||
host=os.getenv('DB_HOST', 'postgres'),
|
||||
port=os.getenv('DB_PORT', '5432'),
|
||||
database=os.getenv('DB_NAME', 'tk_mp_bom'),
|
||||
user=os.getenv('DB_USER', 'tkmp_user'),
|
||||
password=os.getenv('DB_PASSWORD', 'tkmp2024!')
|
||||
)
|
||||
|
||||
cursor = conn.cursor(cursor_factory=RealDictCursor)
|
||||
|
||||
print("🔧 볼트 재질 정보 업데이트 시작...")
|
||||
|
||||
# 볼트 카테고리 자재들 조회
|
||||
cursor.execute("""
|
||||
SELECT id, original_description, material_grade, full_material_grade
|
||||
FROM materials
|
||||
WHERE classified_category = 'BOLT'
|
||||
ORDER BY id
|
||||
""")
|
||||
|
||||
bolts = cursor.fetchall()
|
||||
print(f"📊 총 {len(bolts)}개 볼트 발견")
|
||||
|
||||
updated_count = 0
|
||||
|
||||
for bolt in bolts:
|
||||
bolt_id = bolt['id']
|
||||
original_desc = bolt['original_description'] or ''
|
||||
current_material_grade = bolt['material_grade'] or ''
|
||||
current_full_grade = bolt['full_material_grade'] or ''
|
||||
|
||||
# 볼트 재질 재분류
|
||||
material_result = classify_bolt_material(original_desc)
|
||||
|
||||
if material_result and material_result.get('standard') != 'UNKNOWN':
|
||||
new_standard = material_result.get('standard', '')
|
||||
new_grade = material_result.get('grade', '')
|
||||
|
||||
# 새로운 material_grade 구성
|
||||
if new_grade and new_grade != 'UNKNOWN':
|
||||
if new_standard in new_grade:
|
||||
# 이미 standard가 포함된 경우 (예: "ASTM A320/A194M")
|
||||
new_material_grade = new_grade
|
||||
else:
|
||||
# standard + grade 조합 (예: "ASTM A193" + "B7")
|
||||
new_material_grade = f"{new_standard} {new_grade}" if new_grade not in new_standard else new_standard
|
||||
else:
|
||||
new_material_grade = new_standard
|
||||
|
||||
# 기존 값과 다른 경우에만 업데이트
|
||||
if new_material_grade != current_material_grade:
|
||||
print(f"🔄 ID {bolt_id}: '{current_material_grade}' → '{new_material_grade}'")
|
||||
print(f" 원본: {original_desc}")
|
||||
|
||||
cursor.execute("""
|
||||
UPDATE materials
|
||||
SET material_grade = %s
|
||||
WHERE id = %s
|
||||
""", (new_material_grade, bolt_id))
|
||||
|
||||
updated_count += 1
|
||||
|
||||
# 변경사항 커밋
|
||||
conn.commit()
|
||||
|
||||
print(f"✅ 볼트 재질 정보 업데이트 완료: {updated_count}개 업데이트됨")
|
||||
|
||||
# 업데이트 결과 확인
|
||||
cursor.execute("""
|
||||
SELECT material_grade, COUNT(*) as count
|
||||
FROM materials
|
||||
WHERE classified_category = 'BOLT'
|
||||
GROUP BY material_grade
|
||||
ORDER BY count DESC
|
||||
""")
|
||||
|
||||
results = cursor.fetchall()
|
||||
print("\n📈 업데이트 후 볼트 재질 분포:")
|
||||
for result in results:
|
||||
print(f" {result['material_grade']}: {result['count']}개")
|
||||
|
||||
except Exception as e:
|
||||
print(f"❌ 오류 발생: {str(e)}")
|
||||
if conn:
|
||||
conn.rollback()
|
||||
finally:
|
||||
if cursor:
|
||||
cursor.close()
|
||||
if conn:
|
||||
conn.close()
|
||||
|
||||
if __name__ == "__main__":
|
||||
update_bolt_material_grades()
|
||||
@@ -129,6 +129,83 @@ CREATE INDEX IF NOT EXISTS idx_support_details_material_id ON support_details(ma
|
||||
CREATE INDEX IF NOT EXISTS idx_support_details_file_id ON support_details(file_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_support_details_support_type ON support_details(support_type);
|
||||
|
||||
-- 8. SPECIAL 카테고리 지원 추가
|
||||
-- ================================
|
||||
|
||||
-- SPECIAL 카테고리 관련 인덱스 추가 (성능 최적화)
|
||||
CREATE INDEX IF NOT EXISTS idx_materials_special_category
|
||||
ON materials(classified_category)
|
||||
WHERE classified_category = 'SPECIAL';
|
||||
|
||||
-- SPECIAL 키워드 패턴 테이블
|
||||
CREATE TABLE IF NOT EXISTS special_classification_patterns (
|
||||
id SERIAL PRIMARY KEY,
|
||||
pattern_type VARCHAR(20) NOT NULL, -- 'KEYWORD', 'REGEX', 'EXACT'
|
||||
pattern_value VARCHAR(200) NOT NULL,
|
||||
description TEXT,
|
||||
priority INTEGER DEFAULT 1, -- 우선순위 (낮을수록 높은 우선순위)
|
||||
is_active BOOLEAN DEFAULT TRUE,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
-- 기본 SPECIAL 키워드 패턴 삽입
|
||||
INSERT INTO special_classification_patterns (pattern_type, pattern_value, description, priority) VALUES
|
||||
('KEYWORD', 'SPECIAL', '영문 SPECIAL 키워드', 1),
|
||||
('KEYWORD', '스페셜', '한글 스페셜 키워드', 1),
|
||||
('KEYWORD', 'SPEC', '영문 SPEC 축약어', 2),
|
||||
('KEYWORD', 'SPL', '영문 SPL 축약어', 2)
|
||||
ON CONFLICT DO NOTHING;
|
||||
|
||||
-- SPECIAL 자재 상세 정보 테이블 (도면 업로드 관련)
|
||||
CREATE TABLE IF NOT EXISTS special_material_details (
|
||||
id SERIAL PRIMARY KEY,
|
||||
material_id INTEGER REFERENCES materials(id) ON DELETE CASCADE,
|
||||
file_id INTEGER REFERENCES files(id) ON DELETE CASCADE,
|
||||
|
||||
-- 도면 정보
|
||||
drawing_number VARCHAR(100), -- 도면 번호
|
||||
drawing_revision VARCHAR(20), -- 도면 리비전
|
||||
drawing_uploaded BOOLEAN DEFAULT FALSE, -- 도면 업로드 여부
|
||||
drawing_file_path TEXT, -- 도면 파일 경로
|
||||
|
||||
-- 특수 요구사항
|
||||
special_requirements TEXT, -- 특수 제작 요구사항
|
||||
manufacturing_notes TEXT, -- 제작 참고사항
|
||||
approval_required BOOLEAN DEFAULT TRUE, -- 승인 필요 여부
|
||||
approved_by VARCHAR(100), -- 승인자
|
||||
approved_at TIMESTAMP, -- 승인 일시
|
||||
|
||||
-- 분류 정보
|
||||
classification_confidence FLOAT DEFAULT 1.0,
|
||||
classification_reason TEXT, -- 분류 근거
|
||||
|
||||
-- 관리 정보
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
-- SPECIAL 관련 인덱스
|
||||
CREATE INDEX IF NOT EXISTS idx_special_patterns_type ON special_classification_patterns(pattern_type);
|
||||
CREATE INDEX IF NOT EXISTS idx_special_patterns_active ON special_classification_patterns(is_active);
|
||||
CREATE INDEX IF NOT EXISTS idx_special_details_material ON special_material_details(material_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_special_details_drawing_uploaded ON special_material_details(drawing_uploaded);
|
||||
|
||||
-- 기존 자재 중 SPECIAL 키워드가 포함된 자재를 SPECIAL 카테고리로 재분류
|
||||
UPDATE materials
|
||||
SET
|
||||
classified_category = 'SPECIAL',
|
||||
classification_confidence = 1.0,
|
||||
classified_at = CURRENT_TIMESTAMP
|
||||
WHERE
|
||||
(
|
||||
UPPER(original_description) LIKE '%SPECIAL%' OR
|
||||
UPPER(original_description) LIKE '%스페셜%' OR
|
||||
UPPER(original_description) LIKE '%SPEC%' OR
|
||||
UPPER(original_description) LIKE '%SPL%'
|
||||
)
|
||||
AND (classified_category IS NULL OR classified_category != 'SPECIAL');
|
||||
|
||||
-- 7. 기존 데이터 정리 (선택사항)
|
||||
-- ================================
|
||||
|
||||
|
||||
Reference in New Issue
Block a user