修改老师电脑上安装的报表导出查询sql

This commit is contained in:
马巧 2025-09-24 13:59:47 +08:00
parent fdcf866120
commit 1f6265e8d7
1 changed files with 3 additions and 3 deletions

View File

@ -400,8 +400,8 @@ namespace DM_Weight.Report
string p_machine_id = (ConfigurationManager.AppSettings["machineId"] ?? "DM1");
string SQL = $@" select ab.drug_id, ab.type,
di.drug_name AS DrugName,di.Drug_spec AS DrugSpec,di.big_unit AS BigUnit,di.small_unit AS SmallUnit,
DATE_FORMAT(ab.create_date,'%Y/%m/%d') AS YearMD,ab.manu_no AS ManuNo,DATE_FORMAT(ab.eff_date,'%Y%m%d') AS effDate,IF(ab.type=1,ab.add_quantity,'') AS InQuantity,ab.shoushuJian AS shoushuJian,
re.Patient_name AS PName,re.sex AS Sex,re.age AS Age,re.use_dose AS UseDose,re.residual_dose AS ResidualDose,re.create_time AS DiposalTime
DATE_FORMAT(ab.create_date,'%Y/%m/%d') AS YearMD,ab.manu_no AS ManuNo,DATE_FORMAT(ab.eff_date,'%Y%m%d') AS effDate,IF(ab.type=2,'',ab.add_quantity) AS InQuantity,ab.shoushuJian AS shoushuJian,
re.Patient_name AS PName,re.sex AS Sex,re.age AS Age,IF(ab.type=3,ab.use_dose,re.use_dose) AS UseDose,IF(ab.type=3,ab.residual_dose,re.residual_dose) AS ResidualDose,re.create_time AS DiposalTime
,re.operator_name, ab.manu_stock AS Stock,ab.total_stock AS empty,ab.total_stock,UL.User_name AS SendUser,
IF(ab.type=1,UL.User_name,UL2.User_name) AS InCheckUser,
re.supervisor_name AS CheckUser,ab.manu_stock,ab.total_stock,ab.user_id1,ab.user_id2,ab.out_Quantity
@ -413,7 +413,7 @@ namespace DM_Weight.Report
LEFT JOIN order_info_sm oi on ab.invoice_no=oi.order_no
LEFT JOIN user_list UL ON ab.user_id1=UL.ID
LEFT JOIN user_list UL2 ON ab.user_id2=UL.ID
LEFT JOIN surgical_residual re on ab.invoice_no=re.order_no WHERE ab.machine_id='DM3' and ab.type in(1,2) and
LEFT JOIN surgical_residual re on ab.invoice_no=re.order_no WHERE ab.machine_id='DM3' and ab.type in(1,2,3) and
ab.create_time>'{p_startDate}' AND ab.create_time<'{p_endDate}' ";
if (!string.IsNullOrEmpty(drug_id))
{