From b076f355b7b438b45e430cbd1c441ef5ff34b6fe Mon Sep 17 00:00:00 2001 From: fengxiang <110431245@qq.com> Date: Mon, 28 May 2018 17:14:19 +0800 Subject: [PATCH] 登录过期相应 --- src/app/business/services/util/example.service.ts | 22 ++++++++++++++++------ 1 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/app/business/services/util/example.service.ts b/src/app/business/services/util/example.service.ts index e1427dd..082c31f 100644 --- a/src/app/business/services/util/example.service.ts +++ b/src/app/business/services/util/example.service.ts @@ -8,16 +8,24 @@ return this.conditions; } - public addCondition(condition: string, colName:string, ...values: any[]){ + public addCondition(condition: string, colName: string, ...values: any[]) { const split = Criteria.CONDITION_SPLIT; // '||' - this.conditions.push(condition+split + colName + split + values.join(split)); + this.conditions.push(condition + split + colName + split + values.join(split)); } - public andLike(col: { name: string, value: any}): Criteria{ + public andLike(col: { name: string, value: any}): Criteria { this.addCondition('andLike', col.name, col.value); return this; } - public andEqualTo(col: { name: string, value: any}): Criteria{ + public andEqualTo(col: { name: string, value: any}): Criteria { this.addCondition('andEqualTo', col.name, col.value); + return this; + } + public andNotEqualTo(col: { name: string, value: any}): Criteria { + this.addCondition('andNotEqualTo', col.name, col.value); + return this; + } + public andGreaterThanOrEqualTo(col: { name: string, value: any}): Criteria { + this.addCondition('andGreaterThanOrEqualTo', col.name, col.value); return this; } } @@ -27,10 +35,12 @@ private static OR_SPLIT = 'or|'; private static CRITERIA_SPLIT = '|||'; private criterion: Criteria[] = []; - + public clear(): void { + this.criterion = []; + } public getSqlParam(): string { let whereSql = ''; - for (const cri of this.criterion){ + for (const cri of this.criterion) { const conditions = cri.getConditions(); whereSql += ExampleService.OR_SPLIT + conditions.join(ExampleService.CRITERIA_SPLIT); } -- Gitblit v1.8.0