From 7ca521e4267b987270f6ccbb9a6c076aeb467d96 Mon Sep 17 00:00:00 2001 From: fengxiang <110431245@qq.com> Date: Wed, 04 Jul 2018 17:11:33 +0800 Subject: [PATCH] 设备,监控站 管理功能增强 --- src/app/business/services/util/example.service.ts | 13 ++++++++++--- 1 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/app/business/services/util/example.service.ts b/src/app/business/services/util/example.service.ts index 082c31f..fdcb472 100644 --- a/src/app/business/services/util/example.service.ts +++ b/src/app/business/services/util/example.service.ts @@ -8,9 +8,16 @@ return this.conditions; } - public addCondition(condition: string, colName: string, ...values: any[]) { + private addCondition(condition: string, colName: string, ...values: any[]) { const split = Criteria.CONDITION_SPLIT; // '||' - this.conditions.push(condition + split + colName + split + values.join(split)); + let conditionStr = condition + split + colName; + if (!!values && values.length > 0) { + conditionStr += split + values.join(split); + } + this.conditions.push(conditionStr); + } + public andCondition(condition: string) { + this.addCondition('andCondition', condition); } public andLike(col: { name: string, value: any}): Criteria { this.addCondition('andLike', col.name, col.value); @@ -47,7 +54,7 @@ return encodeURI(whereSql); } constructor() { } - public or() { + public or(): Criteria { const cri = new Criteria(); this.criterion.push(cri); return cri; -- Gitblit v1.8.0