mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-06 08:38:26 +08:00
commit
5814d254b8
@ -231,12 +231,14 @@ public class ClickhouseDialectImpl extends CommonsDialectImpl {
|
|||||||
}
|
}
|
||||||
// 单主键
|
// 单主键
|
||||||
else {
|
else {
|
||||||
|
sql.append(wrap(primaryKeys[0])).append(IN).append(BRACKET_LEFT);
|
||||||
for (int i = 0; i < ids.length; i++) {
|
for (int i = 0; i < ids.length; i++) {
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
sql.append(OR);
|
sql.append(DELIMITER);
|
||||||
}
|
}
|
||||||
sql.append(wrap(primaryKeys[0])).append(EQUALS_PLACEHOLDER);
|
sql.append(PLACEHOLDER);
|
||||||
}
|
}
|
||||||
|
sql.append(BRACKET_RIGHT);
|
||||||
}
|
}
|
||||||
prepareAuth(schema, table, sql, OperateType.DELETE);
|
prepareAuth(schema, table, sql, OperateType.DELETE);
|
||||||
return sql.toString();
|
return sql.toString();
|
||||||
@ -294,12 +296,14 @@ public class ClickhouseDialectImpl extends CommonsDialectImpl {
|
|||||||
}
|
}
|
||||||
// 单主键
|
// 单主键
|
||||||
else {
|
else {
|
||||||
|
sql.append(wrap(primaryKeys[0])).append(IN).append(BRACKET_LEFT);
|
||||||
for (int i = 0; i < primaryValues.length; i++) {
|
for (int i = 0; i < primaryValues.length; i++) {
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
sql.append(OR);
|
sql.append(DELIMITER);
|
||||||
}
|
}
|
||||||
sql.append(wrap(primaryKeys[0])).append(EQUALS_PLACEHOLDER);
|
sql.append(PLACEHOLDER);
|
||||||
}
|
}
|
||||||
|
sql.append(BRACKET_RIGHT);
|
||||||
}
|
}
|
||||||
|
|
||||||
sql.append(BRACKET_RIGHT).append(AND).append(buildLogicNormalCondition(logicDeleteColumn, tableInfo));
|
sql.append(BRACKET_RIGHT).append(AND).append(buildLogicNormalCondition(logicDeleteColumn, tableInfo));
|
||||||
|
|||||||
@ -47,6 +47,7 @@ import java.util.stream.Collectors;
|
|||||||
import java.util.stream.IntStream;
|
import java.util.stream.IntStream;
|
||||||
|
|
||||||
import static com.mybatisflex.core.constant.SqlConsts.AND;
|
import static com.mybatisflex.core.constant.SqlConsts.AND;
|
||||||
|
import static com.mybatisflex.core.constant.SqlConsts.IN;
|
||||||
import static com.mybatisflex.core.constant.SqlConsts.ASTERISK;
|
import static com.mybatisflex.core.constant.SqlConsts.ASTERISK;
|
||||||
import static com.mybatisflex.core.constant.SqlConsts.BLANK;
|
import static com.mybatisflex.core.constant.SqlConsts.BLANK;
|
||||||
import static com.mybatisflex.core.constant.SqlConsts.BRACKET_LEFT;
|
import static com.mybatisflex.core.constant.SqlConsts.BRACKET_LEFT;
|
||||||
@ -242,12 +243,14 @@ public class CommonsDialectImpl implements IDialect {
|
|||||||
}
|
}
|
||||||
// 单主键
|
// 单主键
|
||||||
else {
|
else {
|
||||||
|
sql.append(wrap(primaryKeys[0])).append(IN).append(BRACKET_LEFT);
|
||||||
for (int i = 0; i < ids.length; i++) {
|
for (int i = 0; i < ids.length; i++) {
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
sql.append(OR);
|
sql.append(DELIMITER);
|
||||||
}
|
}
|
||||||
sql.append(wrap(primaryKeys[0])).append(EQUALS_PLACEHOLDER);
|
sql.append(PLACEHOLDER);
|
||||||
}
|
}
|
||||||
|
sql.append(BRACKET_RIGHT);
|
||||||
}
|
}
|
||||||
prepareAuth(schema, table, sql, OperateType.DELETE);
|
prepareAuth(schema, table, sql, OperateType.DELETE);
|
||||||
return sql.toString();
|
return sql.toString();
|
||||||
@ -776,12 +779,14 @@ public class CommonsDialectImpl implements IDialect {
|
|||||||
}
|
}
|
||||||
// 单主键
|
// 单主键
|
||||||
else {
|
else {
|
||||||
|
sql.append(wrap(primaryKeys[0])).append(IN).append(BRACKET_LEFT);
|
||||||
for (int i = 0; i < primaryValues.length; i++) {
|
for (int i = 0; i < primaryValues.length; i++) {
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
sql.append(OR);
|
sql.append(DELIMITER);
|
||||||
}
|
}
|
||||||
sql.append(wrap(primaryKeys[0])).append(EQUALS_PLACEHOLDER);
|
sql.append(PLACEHOLDER);
|
||||||
}
|
}
|
||||||
|
sql.append(BRACKET_RIGHT);
|
||||||
}
|
}
|
||||||
|
|
||||||
sql.append(BRACKET_RIGHT).append(AND).append(buildLogicNormalCondition(logicDeleteColumn, tableInfo));
|
sql.append(BRACKET_RIGHT).append(AND).append(buildLogicNormalCondition(logicDeleteColumn, tableInfo));
|
||||||
@ -1025,12 +1030,14 @@ public class CommonsDialectImpl implements IDialect {
|
|||||||
}
|
}
|
||||||
// 单主键
|
// 单主键
|
||||||
else {
|
else {
|
||||||
|
sql.append(wrap(primaryKeys[0])).append(IN).append(BRACKET_LEFT);
|
||||||
for (int i = 0; i < primaryValues.length; i++) {
|
for (int i = 0; i < primaryValues.length; i++) {
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
sql.append(OR);
|
sql.append(DELIMITER);
|
||||||
}
|
}
|
||||||
sql.append(wrap(primaryKeys[0])).append(EQUALS_PLACEHOLDER);
|
sql.append(PLACEHOLDER);
|
||||||
}
|
}
|
||||||
|
sql.append(BRACKET_RIGHT);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (StringUtil.hasText(logicDeleteColumn) || ArrayUtil.isNotEmpty(tenantIdArgs)) {
|
if (StringUtil.hasText(logicDeleteColumn) || ArrayUtil.isNotEmpty(tenantIdArgs)) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user