| | |
| | | { |
| | | 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='" + |
| | |
| | | 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>(); |
| | |
| | | |
| | | 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) |
| | | { |