调整数据库为wzxphoto

This commit is contained in:
2024-05-27 16:53:24 +08:00
parent 8f89fe50df
commit 48cede5427
6 changed files with 43 additions and 18 deletions

View File

@@ -3,12 +3,13 @@ import subprocess
from config.mysql import DB_URL
table = input("请输入表名:")
out_file = f"photo_review/entity/{table}.py"
command = f"sqlacodegen {DB_URL} --outfile={out_file} --tables={table}"
if __name__ == '__main__':
table = input("请输入表名:")
out_file = f"photo_review/entity/{table}.py"
command = f"sqlacodegen {DB_URL} --outfile={out_file} --tables={table}"
try:
subprocess.run(command, shell=True, check=True)
print(f"{table}.py文件生成成功请手动调整Base的声明")
except Exception as e:
print(f"生成{table}.py文件时发生错误: {e}")
try:
subprocess.run(command, shell=True, check=True)
print(f"{table}.py文件生成成功请手动调整Base的声明")
except Exception as e:
print(f"生成{table}.py文件时发生错误: {e}")

View File

@@ -7,7 +7,7 @@ HOSTNAME = '192.168.5.226'
# 端口号
PORT = '3308'
# 库名
DATABASE = 'wzxtest'
DATABASE = 'wzxphoto'
# 用户名
USERNAME = 'root'
# 密码

View File

@@ -17,7 +17,7 @@ class ZxIeCost(Base):
discharge_date = Column(Date, comment='出院日期')
medical_expenses_str = Column(String(255), comment='费用总额字符串')
medical_expenses = Column(DECIMAL(18, 2), comment='费用总额')
createtime = Column(DateTime, comment='创建时间')
create_time = Column(DateTime, comment='创建时间')
creator = Column(String(255), comment='创建人')
modifiedtime = Column(DateTime, comment='修改时间')
modifier = Column(String(255), comment='修改人')
update_time = Column(DateTime, comment='修改时间')
updater = Column(String(255), comment='修改人')

View File

@@ -0,0 +1,23 @@
# coding: utf-8
from sqlalchemy import Column, DECIMAL, DateTime, String
from sqlalchemy.dialects.mysql import INTEGER
from config.mysql import Base
class ZxIeCostDetail(Base):
__tablename__ = 'zx_ie_cost_detail'
pk_ie_cost_detail = Column(INTEGER(11), primary_key=True, comment='费用明细详情主键')
pk_ie_cost = Column(INTEGER(11), nullable=False, comment='费用明细信息抽取主键')
pk_phhd = Column(INTEGER(11), nullable=False, comment='报销案子主键')
_class = Column('class', String(255), comment='类别')
name = Column(String(255), comment='名称')
specification = Column(String(255), comment='规格')
price = Column(DECIMAL(18, 2), comment='单价')
quantity = Column(INTEGER(11), comment='数量')
amount = Column(DECIMAL(18, 2), comment='金额(单价 * 数量)')
create_time = Column(DateTime, comment='创建时间')
creator = Column(String(30), comment='创建人')
update_time = Column(DateTime, comment='修改时间')
updater = Column(String(30), comment='修改人')

View File

@@ -10,6 +10,7 @@ class ZxIeDischarge(Base):
pk_ie_discharge = Column(INTEGER(11), primary_key=True, comment='出院记录信息抽取主键')
pk_phhd = Column(INTEGER(11), nullable=False, unique=True, comment='报销案子主键')
content = Column(String(5000), comment='详细内容')
hospital = Column(String(255), comment='医院')
pk_yljg = Column(INTEGER(11), comment='医院主键')
department = Column(String(255), comment='科别')
@@ -20,7 +21,7 @@ class ZxIeDischarge(Base):
discharge_date_str = Column(String(255), comment='出院日期字符串')
discharge_date = Column(Date, comment='出院日期')
doctor = Column(String(30), comment='主治医师')
createtime = Column(DateTime, comment='创建时间')
create_time = Column(DateTime, comment='创建时间')
creator = Column(String(255), comment='创建人')
modifiedtime = Column(DateTime, comment='修改时间')
modifier = Column(String(255), comment='修改人')
update_time = Column(DateTime, comment='修改时间')
updater = Column(String(255), comment='修改人')

View File

@@ -24,7 +24,7 @@ class ZxIeSettlement(Base):
personal_funded_amount_str = Column(String(255), comment='自费金额字符串')
personal_funded_amount = Column(DECIMAL(18, 2), comment='自费金额')
medical_insurance_type = Column(String(255), comment='医保类型')
createtime = Column(DateTime, comment='创建时间')
create_time = Column(DateTime, comment='创建时间')
creator = Column(String(255), comment='创建人')
modifiedtime = Column(DateTime, comment='修改时间')
modifier = Column(String(255), comment='修改人')
update_time = Column(DateTime, comment='修改时间')
updater = Column(String(255), comment='修改人')