格式化代码.

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 @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_BY_ID; SqlMethod sqlMethod;
if (tableInfo.isWithLogicDelete()) { if (tableInfo.isWithLogicDelete()) {
sqlMethod = SqlMethod.LOGIC_DELETE_BY_ID;
List<TableFieldInfo> fieldInfos = tableInfo.getFieldList().stream() List<TableFieldInfo> fieldInfos = tableInfo.getFieldList().stream()
.filter(TableFieldInfo::isWithUpdateFill) .filter(TableFieldInfo::isWithUpdateFill)
.filter(f -> !f.isLogicDelete()) .filter(f -> !f.isLogicDelete())

View File

@ -87,7 +87,6 @@ public abstract class Model<T extends Model<?>> implements Serializable {
*/ */
public boolean deleteById() { public boolean deleteById() {
Assert.isFalse(StringUtils.checkValNull(pkVal()), "deleteById primaryKey is null."); Assert.isFalse(StringUtils.checkValNull(pkVal()), "deleteById primaryKey is null.");
SqlSession sqlSession = sqlSession(); SqlSession sqlSession = sqlSession();
try { try {
return SqlHelper.retBool(sqlSession.delete(sqlStatement(SqlMethod.DELETE_BY_ID), this)); 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() { public boolean updateById() {
Assert.isFalse(StringUtils.checkValNull(pkVal()), "updateById primaryKey is null."); Assert.isFalse(StringUtils.checkValNull(pkVal()), "updateById primaryKey is null.");
// updateById
Map<String, Object> map = CollectionUtils.newHashMapWithExpectedSize(1); Map<String, Object> map = CollectionUtils.newHashMapWithExpectedSize(1);
map.put(Constants.ENTITY, this); map.put(Constants.ENTITY, this);
SqlSession sqlSession = sqlSession(); SqlSession sqlSession = sqlSession();
@ -137,7 +135,6 @@ public abstract class Model<T extends Model<?>> implements Serializable {
Map<String, Object> map = CollectionUtils.newHashMapWithExpectedSize(2); Map<String, Object> map = CollectionUtils.newHashMapWithExpectedSize(2);
map.put(Constants.ENTITY, this); map.put(Constants.ENTITY, this);
map.put(Constants.WRAPPER, updateWrapper); map.put(Constants.WRAPPER, updateWrapper);
// update
SqlSession sqlSession = sqlSession(); SqlSession sqlSession = sqlSession();
try { try {
return SqlHelper.retBool(sqlSession.update(sqlStatement(SqlMethod.UPDATE), map)); 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)); return doGroupBy(condition, column, CollectionUtils.toList(columns));
} }
@Override
public Children groupBy(boolean condition, R column, List<R> columns) { public Children groupBy(boolean condition, R column, List<R> columns) {
return doGroupBy(condition, column, 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)); return orderBy(condition, isAsc, column, CollectionUtils.toList(columns));
} }
@Override
public Children orderBy(boolean condition, boolean isAsc, R column, List<R> columns) { public Children orderBy(boolean condition, boolean isAsc, R column, List<R> columns) {
return doOrderBy(condition, isAsc, column, columns); return doOrderBy(condition, isAsc, column, columns);
} }