|
|
|
@ -622,14 +622,21 @@ class BllMedicament(Repository):
|
|
|
|
|
filter_base += f" (`name` like '{name}' or english_name like '{name}') "
|
|
|
|
|
if filter_base:
|
|
|
|
|
filter_base = f" and {filter_base}"
|
|
|
|
|
# sql_all = f"""
|
|
|
|
|
# select a.*,b.client_name from (
|
|
|
|
|
# select
|
|
|
|
|
# `name`, speci, purity, count(*) drug_num, manufacturer, distributor,client_id,medicament_id
|
|
|
|
|
# from
|
|
|
|
|
# rms_medicament WHERE `status`=1 {filter_base}
|
|
|
|
|
# GROUP BY
|
|
|
|
|
# `name`, speci, purity, client_id
|
|
|
|
|
# ) a LEFT JOIN (
|
|
|
|
|
# select * from rms_client
|
|
|
|
|
# ) b on a.client_id = b.client_id
|
|
|
|
|
# """
|
|
|
|
|
sql_all = f"""
|
|
|
|
|
select a.*,b.client_name from (
|
|
|
|
|
select
|
|
|
|
|
`name`, speci, purity, count(*) drug_num, manufacturer, distributor,client_id,medicament_id
|
|
|
|
|
from
|
|
|
|
|
rms_medicament WHERE `status`=1 {filter_base}
|
|
|
|
|
GROUP BY
|
|
|
|
|
`name`, speci, purity, client_id
|
|
|
|
|
select * from rms_medicament WHERE `status`=1 {filter_base}
|
|
|
|
|
) a LEFT JOIN (
|
|
|
|
|
select * from rms_client
|
|
|
|
|
) b on a.client_id = b.client_id
|
|
|
|
|