pharmacy-pos-qr-system/backend/check_price_columns.py
thug0bin ee300f80ca feat: 소수 환자 약품 뱃지 표시
- 1년간 3명 이하 환자만 사용하는 약품에 환자 이름 뱃지 표시
- 조회 기간 내 사용한 환자는 핑크색으로 강조
- 매출액 컬럼명 변경 (약가 → 매출액)
- SUM(DRUPRICE)로 매출액 계산
2026-03-07 00:43:02 +09:00

32 lines
749 B
Python

# -*- coding: utf-8 -*-
import pyodbc
conn_str = (
'DRIVER={ODBC Driver 17 for SQL Server};'
'SERVER=192.168.0.4\\PM2014;'
'DATABASE=PM_DRUG;'
'UID=sa;'
'PWD=tmddls214!%(;'
'TrustServerCertificate=yes;'
'Connection Timeout=10'
)
conn = pyodbc.connect(conn_str, timeout=10)
cur = conn.cursor()
# CD_GOODS 테이블 전체 컬럼 조회 (라식스)
cur.execute("""
SELECT *
FROM CD_GOODS
WHERE DrugCode = '652100200'
""")
row = cur.fetchone()
if row:
columns = [desc[0] for desc in cur.description]
print("=== CD_GOODS 라식스 전체 컬럼 ===")
for i, col in enumerate(columns):
val = row[i]
if val is not None and val != '' and val != 0:
print(f"{col}: {val}")