Browse Source

附件关联查询优化

callm 3 days ago
parent
commit
cdfd7d060c
1 changed files with 1 additions and 1 deletions
  1. 1 1
      UAS_MES_JC/FunctionCode/Query/Query_ExeProgress.cs

+ 1 - 1
UAS_MES_JC/FunctionCode/Query/Query_ExeProgress.cs

@@ -329,7 +329,7 @@ namespace UAS_MES_NEW.Query
                     sql.Clear();
                     sql.Append("select MBR_BRNAME||' '||MBR_SOLUTIONNAME||' '|| MBR_REMARK MBR_BRNAME,MP_RESULT,MP_SNCHECKNO,mp_makecode,ma_prodcode,std_class,sc_linecode,ma_craftcode,mp_sourcecode,mp_sncode,");
                     sql.Append("MB_BADREMARK mb_badcode,to_char(mp_indate,'yyyy-mm-dd hh24:mi:ss')mp_indate,mp_inman,em_name from makeprocess left join make on mp_makecode=ma_code left join employee on mp_inman = em_code left join source on ");
-                    sql.Append("mp_sourcecode=sc_code left join STEPTESTDETAIL on std_sn=mp_sncode and to_char(mp_indate,'yyyy-mm-dd hh24:mi:ss')=to_char(STD_INDATE,'yyyy-mm-dd hh24:mi:ss')" +
+                    sql.Append("mp_sourcecode=sc_code left join STEPTESTDETAIL on std_sn=mp_sncode and to_char(mp_indate,'yyyy-mm-dd hh24:mi')=to_char(STD_INDATE,'yyyy-mm-dd hh24:mi')" +
                         "left join (select max(mb_id)mb_id,wm_concat(distinct mb_badcode||' '||MB_BADNAME)||" +
                         "' '||wm_concat(distinct MB_BADREMARK) MB_BADREMARK,mb_sncode,to_char(mb_indate,'yyyy-mm-dd hh24:mi:ss')mb_indate from makebad group by mb_sncode,to_char(mb_indate,'yyyy-mm-dd hh24:mi:ss') ) on mb_sncode=mp_sncode and to_char(mp_indate,'yyyy-mm-dd hh24:mi:ss')=mb_indate " +
                         "left join MAKEBADREASON on mbr_mbid=mb_id  where mp_sncode in (" + mp_sncodes.ToString().Substring(0, mp_sncodes.ToString().Length - 1) + ") and ma_code in (" + makecodes.ToString().Substring(0, makecodes.ToString().Length - 1) + ") order by mp_indate");