From cf5e996699836cc380b1cb469fea341475eb2b81 Mon Sep 17 00:00:00 2001 From: zjh <2207896513@qq.com> Date: 星期一, 30 六月 2025 15:11:41 +0800 Subject: [PATCH] 代码提交 --- StandardPda/MES.Service/service/QC/LljService.cs | 25 +++++++++++++++++++------ 1 files changed, 19 insertions(+), 6 deletions(-) diff --git a/StandardPda/MES.Service/service/QC/LljService.cs b/StandardPda/MES.Service/service/QC/LljService.cs index df99c12..ab97fe2 100644 --- a/StandardPda/MES.Service/service/QC/LljService.cs +++ b/StandardPda/MES.Service/service/QC/LljService.cs @@ -1039,10 +1039,14 @@ { OracleSQLHelper SQLHelper = new(); //鏌ュ厓鍣ㄤ欢 + //var sql1 = + // string.Format( + // @"select ITEMNAME from MES_IQC_CONSISTENCY_ck where PID='" + + // id + "' group by ITEMNAME order by ITEMNAME"); + var sql1 = string.Format( - @"select ITEMNAME from MES_IQC_CONSISTENCY_ck where PID='" + - id + "' group by ITEMNAME order by ITEMNAME"); + @"select CASE WHEN max(MULTI_SELECT) is null THEN ''ELSE '銆�'||max(MULTI_SELECT)||'銆�' END as A,ITEMNAME as ITEMNAME from MES_IQC_CONSISTENCY_ck where PID='"+id+"' group by ITEMNAME order by ITEMNAME"); //鏌ユ槑缁� var sql2 = string.Format(@"select * from MES_IQC_CONSISTENCY_ck where PID='" + @@ -1055,7 +1059,7 @@ for (var i = 0; i < dataTable1.Rows.Count; i++) { var component = new Component(); - component.Name = dataTable1.Rows[i]["ITEMNAME"].ToString(); + component.Name = dataTable1.Rows[i]["A"].ToString()+ dataTable1.Rows[i]["ITEMNAME"].ToString(); component.Specs = new List<string>(); component.Manufacturers = new List<string>(); component.Id = new List<string>(); @@ -1137,10 +1141,19 @@ OracleSQLHelper SQLHelper = new(); //淇敼缁撴灉 + //var sql2 = string.Format( + // @"select A.ITEMNAME from ( select 888||min(id) id,ITEMNAME from MES_IQC_CONSISTENCY_CK where pid='" + + // id + "' group by ITEMNAME) A " + + // "left join MES_QS_IMAGE b on a.id=b.fid where B.id is null order by ITEMNAME"); + + var sql2 = string.Format( - @"select A.ITEMNAME from ( select 888||min(id) id,ITEMNAME from MES_IQC_CONSISTENCY_CK where pid='" + - id + "' group by ITEMNAME) A " + - "left join MES_QS_IMAGE b on a.id=b.fid where B.id is null order by ITEMNAME"); + @"select A.ITEMNAME from ( select 888||min(id) id,ITEMNAME from MES_IQC_CONSISTENCY_CK where pid='"+id.ToString()+ "' and ITEMNAME not in(select ITEMNAME from MES_IQC_CONSISTENCY_CK where PID='"+id.ToString()+"' and MULTI_SELECT is not null)" + + "group by ITEMNAME) A" + + " left join MES_QS_IMAGE b on a.id=b.fid where B.id is null" + + " union" + + " select '鍒嗙粍锛�' || MULTI_SELECT as ITEMNAME from MES_IQC_CONSISTENCY_CK where pid = '"+id.ToString()+ "' and MULTI_SELECT is not null and MULTI_SELECT not in(select A.MULTI_SELECT as ITEMNAME from (select 888 || min(id) id, MULTI_SELECT from MES_IQC_CONSISTENCY_CK where pid = '"+id.ToString()+ "' and MULTI_SELECT is not null group by MULTI_SELECT,ITEMNAME) A left join MES_QS_IMAGE b on a.id = b.fid where B.id is not null) group by MULTI_SELECT"); + var db = SQLHelper.ExecuteQuery(sql2); if (db.Rows.Count > 0) { -- Gitblit v1.9.3