vartable=SqlHelperEx.DoQuery("select a.ProductCatalog_ID,a.CatalogDetail_ID,a.Goods_Name,a.Goods_ID,b.Goods_ID,a.UnitConvertDirection,a.MainUnitRatio,a.SecondUnitRatio,a.Goods_Spec from {0} a left outer join {1} b on a.Goods_ID = b.Goods_ID where 1=1 {2}".FormatWith(TableNames.客户端产品分类明细,TableNames.客户端产品分类配制存货,isSelected==true?"and b.Goods_ID is not null":string.Empty));
vartable=SqlHelperEx.DoQuery("select a.ProductCatalog_ID,a.CatalogDetail_ID,a.Goods_Name,a.Goods_ID,b.Goods_ID,a.UnitConvertDirection,a.MainUnitRatio,a.SecondUnitRatio,a.Goods_Spec from {0} a left outer join {1} b on a.ProductCatalog_ID = b.ProductCatalog_ID and a.Goods_ID = b.Goods_ID where 1=1 {2}".FormatWith(TableNames.客户端产品分类明细,TableNames.客户端产品分类配制存货,isSelected==true?"and b.Goods_ID is not null":string.Empty));
varsql="select a.Goods_ID, a.Goods_Name,a.Goods_Spec,a.Goods_MainUnit,a.PlanNumber,a.DetailID,e.FinishNumber,a.Department_Name,a.Remark from {0} a inner join {1} b on a.ProductPlan_ID = b.ProductPlan_ID inner join {2} c on c.Goods_ID = a.Goods_ID inner join {3} d on c.ProductTeam_ID = d.ProductTeam_ID left outer join {4} e on a.DetailID = e.DetailID where b.PlanDate >='{5}' and b.PlanDate < '{6}' and a.IsFinish = 0 and d.ProductTeam_ID = {7}".FormatWith(TableNames.生产计划分割明细,TableNames.生产计划,TableNames.生产班组产出明细,TableNames.生产班组,TableNames.生产计划分割明细完工数量,startDate,date.AddDays(1),planTeamID);
varsql="select a.Goods_ID, a.Goods_Name,a.Goods_Spec,a.Goods_MainUnit,a.PlanNumber,a.DetailID,e.FinishNumber,a.Department_Name,a.Remark from {0} a inner join {1} b on a.ProductPlan_ID = b.ProductPlan_ID inner join {2} c on c.Goods_ID = a.Goods_ID inner join {3} d on c.ProductTeam_ID = d.ProductTeam_ID left outer join {4} e on a.DetailID = e.DetailID where a.IsFinish = 0 and d.ProductTeam_ID = {5}".FormatWith(TableNames.生产计划分割明细,TableNames.生产计划,TableNames.生产班组产出明细,TableNames.生产班组,TableNames.生产计划分割明细完工数量,planTeamID);