数据库调用
// 调用数据库方法 方法1:
var ydlParams = StringUtils.GetSqlWithCardinalityAndParam(WLNM, "@ydlParams", 2, true);
var Dys = DBUtils.ExecuteDynamicObject(this.Context,
string.Format(@"select DISTINCT T.FID,T.FNUMBER,T.FSUPPLIERID,A.* from
t_PUR_PriceList t
inner join t_PUR_PriceListEntry A ON T.FID = A.FID
inner join {0} B ON A.FMATERIALID = B.FID", ydlwl.Item1), null, null, System.Data.CommandType.Text, ydlwl.Item2);
// 调用数据库方法 方法2:
var wlnms = a1.Select(t => t["FMATERIALID"].ToString()).Distinct().ToArray();
var ydlwl = StringUtils.GetSqlWithCardinalityAndParam(wlnms, "@ydlParams", 2, true);
string sql = string.Format(@"SELECT
A.FMATERIALID,
A.F_JSLX,
B.F_DJ,
B.F_SSRQ,
B.F_SXRQ
FROM {0} FF
INNER JOIN T_BD_MATERIAL A ON FF.FID = A.FMATERIALID
LEFT JOIN T_BAS_PREBDFIVE B ON A.F_JSLX = B.F_JSLX
WHERE
A.F_JSLX <> '' AND
B.F_SXRQ = @RQ ", ydlParams.Item1);
var a1 = DBUtils.ExecuteDynamicObject(Context, sql, null, null, System.Data.CommandType.Text, new SqlParam[] {new SqlParam("@ydlParams", KDDbType.udt_varchartable,WLNM),
new SqlParam("@RQ", KDDbType.String, dateOnlyString)});
数据库调用
本文2024-09-16 17:42:55发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-17486.html