|
|
@ -131,7 +131,7 @@ class BllMedicament(Repository):
|
|
|
|
select * from rms_medicament %s
|
|
|
|
select * from rms_medicament %s
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
# 分组查询
|
|
|
|
# 分组查询
|
|
|
|
group_base = " group by `name`, cas_number, net_weight_unit"
|
|
|
|
group_base = " group by `name`, purity, speci"
|
|
|
|
# 动态添加查询条件
|
|
|
|
# 动态添加查询条件
|
|
|
|
where_base = ""
|
|
|
|
where_base = ""
|
|
|
|
if client_id:
|
|
|
|
if client_id:
|
|
|
@ -140,9 +140,9 @@ class BllMedicament(Repository):
|
|
|
|
seach_word = f"%{seach_word}%"
|
|
|
|
seach_word = f"%{seach_word}%"
|
|
|
|
if where_base:
|
|
|
|
if where_base:
|
|
|
|
where_base += " and"
|
|
|
|
where_base += " and"
|
|
|
|
where_base += f" `name` like '{seach_word}' or english_name like '{seach_word}'"
|
|
|
|
where_base += f" `name` like '{seach_word}' or english_name like '{seach_word}' "
|
|
|
|
if where_base:
|
|
|
|
if where_base:
|
|
|
|
where_base = "where" + where_base
|
|
|
|
where_base = f"where {where_base} "
|
|
|
|
# 组装最终sql
|
|
|
|
# 组装最终sql
|
|
|
|
run_sql = sql_all % where_base+group_base
|
|
|
|
run_sql = sql_all % where_base+group_base
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|