pg-mvc-service 2.0.13 → 2.0.15
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.
|
@@ -59,6 +59,7 @@ class TableModel {
|
|
|
59
59
|
}
|
|
60
60
|
get createSqlFromJoinWhere() {
|
|
61
61
|
let sql = ` FROM ${this.TableName} as "${this.TableAlias}"`;
|
|
62
|
+
console.log('createSqlFromJoinWhere', this.joinConditions);
|
|
62
63
|
for (const join of this.joinConditions) {
|
|
63
64
|
const joins = {
|
|
64
65
|
inner: ' INNER JOIN',
|
|
@@ -67,7 +68,9 @@ class TableModel {
|
|
|
67
68
|
};
|
|
68
69
|
sql += joins[join.type];
|
|
69
70
|
sql += ` ${join.model.TableName} as "${join.model.TableAlias}" ON `;
|
|
71
|
+
console.log(join, 'createSqlFronJOin', this.vars);
|
|
70
72
|
const query = WhereExpression_1.default.createCondition(join.conditions, this, this.vars.length + 1);
|
|
73
|
+
console.log('createSqlFronJoin end', this.vars, query.vars);
|
|
71
74
|
sql += query.expression;
|
|
72
75
|
if (query.vars !== undefined) {
|
|
73
76
|
this.vars = [...this.vars, ...query.vars];
|
|
@@ -207,6 +210,7 @@ class TableModel {
|
|
|
207
210
|
* @param conditions 結合条件を指定します。条件はオブジェクトまたは文字列で指定できます。
|
|
208
211
|
*/
|
|
209
212
|
join(joinType, joinModel, conditions) {
|
|
213
|
+
console.log({ type: joinType, model: joinModel, conditions: conditions }, this.joinConditions);
|
|
210
214
|
this.joinConditions.push({ type: joinType, model: joinModel, conditions: conditions });
|
|
211
215
|
}
|
|
212
216
|
where(left, operator, right) {
|
package/package.json
CHANGED
package/src/models/TableModel.ts
CHANGED
|
@@ -81,6 +81,7 @@ export class TableModel {
|
|
|
81
81
|
private get createSqlFromJoinWhere(): string {
|
|
82
82
|
let sql = ` FROM ${this.TableName} as "${this.TableAlias}"`;
|
|
83
83
|
|
|
84
|
+
console.log('createSqlFromJoinWhere', this.joinConditions);
|
|
84
85
|
for (const join of this.joinConditions) {
|
|
85
86
|
const joins = {
|
|
86
87
|
inner: ' INNER JOIN',
|
|
@@ -89,7 +90,9 @@ export class TableModel {
|
|
|
89
90
|
}
|
|
90
91
|
sql += joins[join.type];
|
|
91
92
|
sql += ` ${join.model.TableName} as "${join.model.TableAlias}" ON `;
|
|
93
|
+
console.log(join, 'createSqlFronJOin', this.vars);
|
|
92
94
|
const query = WhereExpression.createCondition(join.conditions, this, this.vars.length + 1);
|
|
95
|
+
console.log('createSqlFronJoin end', this.vars, query.vars);
|
|
93
96
|
sql += query.expression;
|
|
94
97
|
if (query.vars !== undefined) {
|
|
95
98
|
this.vars = [...this.vars, ...query.vars]
|
|
@@ -247,6 +250,7 @@ export class TableModel {
|
|
|
247
250
|
* @param conditions 結合条件を指定します。条件はオブジェクトまたは文字列で指定できます。
|
|
248
251
|
*/
|
|
249
252
|
public join(joinType: 'left' | 'inner' | 'full', joinModel: TableModel, conditions: Array<TNestedCondition>): void {
|
|
253
|
+
console.log({type: joinType, model: joinModel, conditions: conditions}, this.joinConditions);
|
|
250
254
|
this.joinConditions.push({type: joinType, model: joinModel, conditions: conditions});
|
|
251
255
|
}
|
|
252
256
|
|