|
@@ -33,20 +33,20 @@ public class DeleteBatchByIds extends AbstractMethod {
|
|
@Override
|
|
@Override
|
|
public MappedStatement injectMappedStatement(Class<?> mapperClass, Class<?> modelClass, TableInfo tableInfo) {
|
|
public MappedStatement injectMappedStatement(Class<?> mapperClass, Class<?> modelClass, TableInfo tableInfo) {
|
|
String sql;
|
|
String sql;
|
|
- SqlMethod sqlMethod = SqlMethod.LOGIC_DELETE_BATCH_BY_IDS;
|
|
|
|
|
|
+ sqlMethod = SqlMethod.LOGIC_DELETE_BATCH_BY_IDS;
|
|
if (tableInfo.isLogicDelete()) {
|
|
if (tableInfo.isLogicDelete()) {
|
|
sql = String.format(sqlMethod.getSql(), tableInfo.getTableName(), sqlLogicSet(tableInfo),
|
|
sql = String.format(sqlMethod.getSql(), tableInfo.getTableName(), sqlLogicSet(tableInfo),
|
|
tableInfo.getKeyColumn(),
|
|
tableInfo.getKeyColumn(),
|
|
SqlScriptUtils.convertForeach("#{item}", COLLECTION, null, "item", COMMA),
|
|
SqlScriptUtils.convertForeach("#{item}", COLLECTION, null, "item", COMMA),
|
|
tableInfo.getLogicDeleteSql(true, false));
|
|
tableInfo.getLogicDeleteSql(true, false));
|
|
SqlSource sqlSource = languageDriver.createSqlSource(configuration, sql, Object.class);
|
|
SqlSource sqlSource = languageDriver.createSqlSource(configuration, sql, Object.class);
|
|
- return addUpdateMappedStatement(mapperClass, modelClass, sqlMethod.getMethod(), sqlSource);
|
|
|
|
|
|
+ return addUpdateMappedStatement(mapperClass, modelClass, getMethod(), sqlSource);
|
|
} else {
|
|
} else {
|
|
sqlMethod = SqlMethod.DELETE_BATCH_BY_IDS;
|
|
sqlMethod = SqlMethod.DELETE_BATCH_BY_IDS;
|
|
sql = String.format(sqlMethod.getSql(), tableInfo.getTableName(), tableInfo.getKeyColumn(),
|
|
sql = String.format(sqlMethod.getSql(), tableInfo.getTableName(), tableInfo.getKeyColumn(),
|
|
SqlScriptUtils.convertForeach("#{item}", COLLECTION, null, "item", COMMA));
|
|
SqlScriptUtils.convertForeach("#{item}", COLLECTION, null, "item", COMMA));
|
|
SqlSource sqlSource = languageDriver.createSqlSource(configuration, sql, Object.class);
|
|
SqlSource sqlSource = languageDriver.createSqlSource(configuration, sql, Object.class);
|
|
- return this.addDeleteMappedStatement(mapperClass, sqlMethod.getMethod(), sqlSource);
|
|
|
|
|
|
+ return this.addDeleteMappedStatement(mapperClass, getMethod(), sqlSource);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|