baja-lite 1.4.13 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/sql.d.ts +2 -0
- package/sql.js +8 -7
package/package.json
CHANGED
package/sql.d.ts
CHANGED
|
@@ -1331,6 +1331,7 @@ export declare class SqlService<T extends object> {
|
|
|
1331
1331
|
pageNumber?: number;
|
|
1332
1332
|
limitSelf?: boolean;
|
|
1333
1333
|
countSelf?: boolean;
|
|
1334
|
+
sum?: boolean;
|
|
1334
1335
|
sumSelf?: boolean;
|
|
1335
1336
|
sortName?: string;
|
|
1336
1337
|
sortType?: string;
|
|
@@ -1348,6 +1349,7 @@ export declare class SqlService<T extends object> {
|
|
|
1348
1349
|
pageNumber?: number;
|
|
1349
1350
|
limitSelf?: boolean;
|
|
1350
1351
|
countSelf?: boolean;
|
|
1352
|
+
sum?: boolean;
|
|
1351
1353
|
sumSelf?: boolean;
|
|
1352
1354
|
sortName?: string;
|
|
1353
1355
|
sortType?: string;
|
package/sql.js
CHANGED
|
@@ -2945,16 +2945,17 @@ export class SqlService {
|
|
|
2945
2945
|
let sql = globalThis[_sqlCache].load(this._matchSqlid(option.sqlId), { ctx: option.context, isCount: false, ...option.params });
|
|
2946
2946
|
let sqlSum = '';
|
|
2947
2947
|
let sqlCount = '';
|
|
2948
|
-
if (option.
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
if (option.limitSelf !== true) {
|
|
2952
|
-
if (option.countSelf !== true) {
|
|
2948
|
+
if (option.sum) {
|
|
2949
|
+
if (option.sumSelf) {
|
|
2950
|
+
sqlCount = globalThis[_sqlCache].load(this._matchSqlid(`${option.sqlId}_sum`), { ctx: option.context, isCount: false, isSum: true, ...option.params });
|
|
2953
2951
|
}
|
|
2954
|
-
|
|
2955
|
-
|
|
2952
|
+
else {
|
|
2953
|
+
sqlSum = globalThis[_sqlCache].load(this._matchSqlid(option.sqlId), { ctx: option.context, isCount: false, isSum: true, ...option.params });
|
|
2956
2954
|
}
|
|
2957
2955
|
}
|
|
2956
|
+
if (option.limitSelf !== true && option.pageSize > 0) {
|
|
2957
|
+
sql = `${sql} LIMIT ${option.params['limitStart']}, ${option.pageSize}`;
|
|
2958
|
+
}
|
|
2958
2959
|
if (option.pageSize > 0) {
|
|
2959
2960
|
if (option.countSelf) {
|
|
2960
2961
|
sqlCount = globalThis[_sqlCache].load(this._matchSqlid(`${option.sqlId}_count`), { ctx: option.context, isCount: true, isSum: false, ...option.params });
|