strSql.Append(@"select a.*,case when a.Type='02' then(select MoldNames from Base_Mold as b where a.ObjectID =b.Id ) when (a.Type ='03' OR a.Type='04') then(select UserName from User_Detail as c where a.ObjectID=c.Id) end CheckNameEd,b.GoodsName as ProName,b.CustomerName as CustName,b.SaleOrderCode as OrderNum ,c.RealName as CheckName from Doc_InspectionRecord as a");
strSql.Append(" left join v_SubDispatchingInfo as b");
strSql.Append(" on a.DispatchingItemID=b.SubId ");
strSql.Append(" left join Base_User as c");
strSql.Append(" on a.InspectionUser=c.UserId");