FormMetadata metadata = MetaDataServiceHelper.Load(this.Context, "PAAP_T_DM_ThicknessAddValue") as FormMetadata;
List
QueryBuilderParemeter queryParam = new QueryBuilderParemeter();
queryParam.BusinessInfo = metadata.BusinessInfo;
queryParam.FilterClauseWihtKey = " F_DM_DeviationType = @DeviationType AND F_DM_SteelseriId = @SteelseriId AND F_DM_WidthSta <= @Width1 AND F_DM_WidthEnd >=@Width2 AND F_DM_StardardThicknessSta <= @Thick1 AND F_DM_StardardThicknessEnd >=@Thick2 AND FDOCUMENTSTATUS = 'C' AND FFORBIDSTATUS = 'A'";
queryParam.SqlParams.Add(new SqlParam("@DeviationType", KDDbType.String, deviationType["Id"]));
queryParam.SqlParams.Add(new SqlParam("@SteelseriId", KDDbType.Int64, steelSri["Id"]));
queryParam.SqlParams.Add(new SqlParam("@Width1", KDDbType.Decimal, width));
queryParam.SqlParams.Add(new SqlParam("@Thick1", KDDbType.Decimal, thick));
queryParam.SqlParams.Add(new SqlParam("@Width2", KDDbType.Decimal, width));
queryParam.SqlParams.Add(new SqlParam("@Thick2", KDDbType.Decimal, thick));
DynamicObject[] thickAddValues = BusinessDataServiceHelper.Load(this.Context, metadata.BusinessInfo.GetDynamicObjectType(), queryParam);
用这个LOAD和在数据库查询:
select * from PAAP_t_Cust_Entry102004 where F_DM_DeviationType = '56ac2f3751da17' AND F_DM_SteelseriId = 101270
AND F_DM_WidthSta <= 1960 AND F_DM_WidthEnd >=1960 AND F_DM_StardardThicknessSta <= 12 AND F_DM_StardardThicknessEnd >=12
AND FDOCUMENTSTATUS = 'C' AND FFORBIDSTATUS = 'A'
前者有20条记录,后者只有一条。前者LOAD出来的大多不满足条件。前者与后者的参数值都是一致的。
推荐阅读