fix: 对于in和not in 需要使用quoteIdentifier进行包裹,避免id中的-号被识别为运算符

This commit is contained in:
Pan Qiancheng 2025-12-30 18:38:59 +08:00
parent 1d464a38a9
commit 846cccb325
2 changed files with 2 additions and 2 deletions

View File

@ -638,7 +638,7 @@ class SqlTranslator {
filter: filter2[attr]
}, currentNumber, filterRefAlias, option);
currentNumber = ct2;
whereText += `(${refAlia2}.id ${predicate} (${stmt}))`;
whereText += `(${this.quoteIdentifier(alias)}.${this.quoteIdentifier('id')} ${predicate} (${stmt}))`;
}
else {
/**

View File

@ -812,7 +812,7 @@ export abstract class SqlTranslator<ED extends EntityDict & BaseEntityDict> {
}, currentNumber, filterRefAlias, option);
currentNumber = ct2;
whereText += `(${refAlia2}.id ${predicate} (${stmt}))`;
whereText += `(${this.quoteIdentifier(alias)}.${this.quoteIdentifier('id')} ${predicate} (${stmt}))`;
}
else {
/**