From c5f6516358f641f97b931a434052f826b21e7534 Mon Sep 17 00:00:00 2001 From: 13507605001 Date: Tue, 3 Jan 2023 18:06:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=93=E5=8D=B0=E6=A0=87=E7=AD=BE=E4=BF=AE?= =?UTF-8?q?=E6=94=B9;=20=E7=94=B3=E8=AF=B7=E5=8D=95=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Common/create_barcode.py | 2 +- db_logic/medicament.py | 19 +++++++++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/Common/create_barcode.py b/Common/create_barcode.py index 24b20c0..fdbcef3 100644 --- a/Common/create_barcode.py +++ b/Common/create_barcode.py @@ -115,7 +115,7 @@ class CreateBarcode: kwargs.get("purity"), kwargs.get("standard_code"), kwargs.get("remark12"), - kwargs.get("cell_position_code"), + kwargs.get("flow_position_code"), kwargs.get("file_path"), ) document.setHtml(html) diff --git a/db_logic/medicament.py b/db_logic/medicament.py index 578bb07..7f5c431 100644 --- a/db_logic/medicament.py +++ b/db_logic/medicament.py @@ -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