本文整理汇总了C#中WhereSqlClauseBuilder.AppendCondition方法的典型用法代码示例。如果您正苦于以下问题:C# WhereSqlClauseBuilder.AppendCondition方法的具体用法?C# WhereSqlClauseBuilder.AppendCondition怎么用?C# WhereSqlClauseBuilder.AppendCondition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WhereSqlClauseBuilder
的用法示例。
在下文中一共展示了WhereSqlClauseBuilder.AppendCondition方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnBuildQueryCondition
protected override void OnBuildQueryCondition(QueryCondition qc)
{
base.OnBuildQueryCondition(qc);
qc.SelectFields = "*";
qc.FromClause = TimePointContext.Current.UseCurrentTime ? "SC.AUAdminScopeItemSnapshot_Current" : "SC.AUAdminScopeItemSnapshot";
if (string.IsNullOrEmpty(qc.OrderByClause))
qc.OrderByClause = "AUScopeItemName ASC";
WhereSqlClauseBuilder builder = new WhereSqlClauseBuilder();
builder.AppendCondition("SchemaType", this.scopeType).NormalFor("Status");
var timeBuilder = VersionStrategyQuerySqlBuilder.Instance.TimePointToBuilder();
var allCondition = new ConnectiveSqlClauseCollection(builder, timeBuilder).ToSqlString(TSqlBuilder.Instance);
if (string.IsNullOrEmpty(qc.WhereClause))
{
qc.WhereClause = allCondition;
}
else
{
qc.WhereClause = qc.WhereClause + "AND (" + allCondition + ")";
}
}
示例2: OnBuildQueryCondition
protected override void OnBuildQueryCondition(QueryCondition qc)
{
base.OnBuildQueryCondition(qc);
qc.SelectFields = "S.*";
qc.FromClause = this.FromSqlClause;
if (string.IsNullOrEmpty(qc.OrderByClause))
qc.OrderByClause = "S.Name ASC";
var timeCondition = VersionStrategyQuerySqlBuilder.Instance.TimePointToBuilder("S.");
var timeCondition2 = VersionStrategyQuerySqlBuilder.Instance.TimePointToBuilder("R.");
WhereSqlClauseBuilder where = new WhereSqlClauseBuilder().NormalFor("S.Status").NormalFor("R.Status");
var allConditions = new ConnectiveSqlClauseCollection(timeCondition, timeCondition2, where);
where.AppendCondition("S.AUSchemaID", this.schemaID);
where.AppendCondition("R.ParentID", this.parentID);
if (string.IsNullOrEmpty(qc.WhereClause) == false)
qc.WhereClause += " AND ";
qc.WhereClause += allConditions.ToSqlString(TSqlBuilder.Instance);
}
示例3: BuildCondition
private void BuildCondition(QueryCondition qc)
{
WhereSqlClauseBuilder builder = new WhereSqlClauseBuilder();
if (this.deepOption == 1)
{
builder.AppendCondition("C.ContainerID", this.scope.ID);
}
else
{
if (deepOption == 2)
{
builder.AppendItem("C.ContainerID", this.scope.ID, "<>");
}
}
builder.NormalFor("C.Status").NormalFor("S.Status").NormalFor("SM.Status").NormalFor("AUS.Status");
var timeBulder1 = VersionStrategyQuerySqlBuilder.Instance.TimePointToBuilder("C.");
var timeBulder2 = VersionStrategyQuerySqlBuilder.Instance.TimePointToBuilder("S.");
var time3 = VersionStrategyQuerySqlBuilder.Instance.TimePointToBuilder("AUS.");
var time4 = VersionStrategyQuerySqlBuilder.Instance.TimePointToBuilder("SM.");
var conditionClause = new ConnectiveSqlClauseCollection(builder, timeBulder1, timeBulder2, time3, time4).ToSqlString(TSqlBuilder.Instance);
if (string.IsNullOrEmpty(qc.WhereClause) == false)
qc.WhereClause += " AND (" + conditionClause + ")";
else
qc.WhereClause = conditionClause;
}
示例4: BuildWhere
protected virtual void BuildWhere(WhereSqlClauseBuilder where)
{
where.AppendCondition("S.Status", (int)SchemaObjectStatus.Normal);
where.AppendCondition("M.Status", (int)SchemaObjectStatus.Normal);
}