格式化代码.

This commit is contained in:
nieqiurong 2023-09-12 14:08:49 +08:00
parent 5bf9f62907
commit 23244d91c2
3 changed files with 4 additions and 4 deletions

View File

@ -52,8 +52,9 @@ public class DeleteById extends AbstractMethod {
@Override
public MappedStatement injectMappedStatement(Class<?> mapperClass, Class<?> modelClass, TableInfo tableInfo) {
String sql;
SqlMethod sqlMethod = SqlMethod.LOGIC_DELETE_BY_ID;
SqlMethod sqlMethod;
if (tableInfo.isWithLogicDelete()) {
sqlMethod = SqlMethod.LOGIC_DELETE_BY_ID;
List<TableFieldInfo> fieldInfos = tableInfo.getFieldList().stream()
.filter(TableFieldInfo::isWithUpdateFill)
.filter(f -> !f.isLogicDelete())

View File

@ -87,7 +87,6 @@ public abstract class Model<T extends Model<?>> implements Serializable {
*/
public boolean deleteById() {
Assert.isFalse(StringUtils.checkValNull(pkVal()), "deleteById primaryKey is null.");
SqlSession sqlSession = sqlSession();
try {
return SqlHelper.retBool(sqlSession.delete(sqlStatement(SqlMethod.DELETE_BY_ID), this));
@ -117,7 +116,6 @@ public abstract class Model<T extends Model<?>> implements Serializable {
*/
public boolean updateById() {
Assert.isFalse(StringUtils.checkValNull(pkVal()), "updateById primaryKey is null.");
// updateById
Map<String, Object> map = CollectionUtils.newHashMapWithExpectedSize(1);
map.put(Constants.ENTITY, this);
SqlSession sqlSession = sqlSession();
@ -137,7 +135,6 @@ public abstract class Model<T extends Model<?>> implements Serializable {
Map<String, Object> map = CollectionUtils.newHashMapWithExpectedSize(2);
map.put(Constants.ENTITY, this);
map.put(Constants.WRAPPER, updateWrapper);
// update
SqlSession sqlSession = sqlSession();
try {
return SqlHelper.retBool(sqlSession.update(sqlStatement(SqlMethod.UPDATE), map));

View File

@ -243,6 +243,7 @@ public abstract class AbstractChainWrapper<T, R, Children extends AbstractChainW
return doGroupBy(condition, column, CollectionUtils.toList(columns));
}
@Override
public Children groupBy(boolean condition, R column, List<R> columns) {
return doGroupBy(condition, column, columns);
}
@ -263,6 +264,7 @@ public abstract class AbstractChainWrapper<T, R, Children extends AbstractChainW
return orderBy(condition, isAsc, column, CollectionUtils.toList(columns));
}
@Override
public Children orderBy(boolean condition, boolean isAsc, R column, List<R> columns) {
return doOrderBy(condition, isAsc, column, columns);
}