Browse Source

code style

miemie 5 years ago
parent
commit
866e429084

+ 1 - 1
mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/injector/methods/SelectById.java

@@ -36,7 +36,7 @@ public class SelectById extends AbstractMethod {
         SqlSource sqlSource = new RawSqlSource(configuration, String.format(sqlMethod.getSql(),
             sqlSelectColumns(tableInfo, false),
             tableInfo.getTableName(), tableInfo.getKeyColumn(), tableInfo.getKeyProperty(),
-            tableInfo.getLogicDeleteSql(true, false)), Object.class);
+            tableInfo.getLogicDeleteSql(true, true)), Object.class);
         return this.addSelectMappedStatementForTable(mapperClass, sqlMethod.getMethod(), sqlSource, tableInfo);
     }
 }

+ 2 - 10
mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/injector/methods/SelectCount.java

@@ -32,16 +32,8 @@ public class SelectCount extends AbstractMethod {
     @Override
     public MappedStatement injectMappedStatement(Class<?> mapperClass, Class<?> modelClass, TableInfo tableInfo) {
         SqlMethod sqlMethod = SqlMethod.SELECT_COUNT;
-        String sql = String.format(
-                sqlMethod.getSql(),
-                sqlFirst(),
-                this.sqlCount(),
-                tableInfo.getTableName(),
-                sqlWhereEntityWrapper(
-                        true,
-                        tableInfo
-                ),
-                sqlComment());
+        String sql = String.format(sqlMethod.getSql(), sqlFirst(), sqlCount(), tableInfo.getTableName(),
+            sqlWhereEntityWrapper(true, tableInfo), sqlComment());
         SqlSource sqlSource = languageDriver.createSqlSource(configuration, sql, modelClass);
         return this.addSelectMappedStatementForOther(mapperClass, getMethod(sqlMethod), sqlSource, Integer.class);
     }

+ 2 - 7
mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/injector/methods/SelectList.java

@@ -32,13 +32,8 @@ public class SelectList extends AbstractMethod {
     @Override
     public MappedStatement injectMappedStatement(Class<?> mapperClass, Class<?> modelClass, TableInfo tableInfo) {
         SqlMethod sqlMethod = SqlMethod.SELECT_LIST;
-        String sql = String.format(
-                sqlMethod.getSql(),
-                sqlFirst(),
-                sqlSelectColumns(tableInfo, true),
-                tableInfo.getTableName(),
-                sqlWhereEntityWrapper(true, tableInfo),
-                sqlComment());
+        String sql = String.format(sqlMethod.getSql(), sqlFirst(), sqlSelectColumns(tableInfo, true), tableInfo.getTableName(),
+            sqlWhereEntityWrapper(true, tableInfo), sqlComment());
         SqlSource sqlSource = languageDriver.createSqlSource(configuration, sql, modelClass);
         return this.addSelectMappedStatementForTable(mapperClass, getMethod(sqlMethod), sqlSource, tableInfo);
     }

+ 2 - 7
mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/injector/methods/SelectMaps.java

@@ -34,13 +34,8 @@ public class SelectMaps extends AbstractMethod {
     @Override
     public MappedStatement injectMappedStatement(Class<?> mapperClass, Class<?> modelClass, TableInfo tableInfo) {
         SqlMethod sqlMethod = SqlMethod.SELECT_MAPS;
-        String sql = String.format(
-                sqlMethod.getSql(),
-                sqlFirst(),
-                sqlSelectColumns(tableInfo, true),
-                tableInfo.getTableName(),
-                sqlWhereEntityWrapper(true, tableInfo),
-                sqlComment());
+        String sql = String.format(sqlMethod.getSql(), sqlFirst(), sqlSelectColumns(tableInfo, true), tableInfo.getTableName(),
+            sqlWhereEntityWrapper(true, tableInfo), sqlComment());
         SqlSource sqlSource = languageDriver.createSqlSource(configuration, sql, modelClass);
         return this.addSelectMappedStatementForOther(mapperClass, getMethod(sqlMethod), sqlSource, Map.class);
     }

+ 2 - 7
mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/injector/methods/SelectMapsPage.java

@@ -34,13 +34,8 @@ public class SelectMapsPage extends AbstractMethod {
     @Override
     public MappedStatement injectMappedStatement(Class<?> mapperClass, Class<?> modelClass, TableInfo tableInfo) {
         SqlMethod sqlMethod = SqlMethod.SELECT_MAPS_PAGE;
-        String sql = String.format(
-                sqlMethod.getSql(),
-                sqlFirst(),
-                sqlSelectColumns(tableInfo, true),
-                tableInfo.getTableName(),
-                sqlWhereEntityWrapper(true, tableInfo),
-                sqlComment());
+        String sql = String.format(sqlMethod.getSql(), sqlFirst(), sqlSelectColumns(tableInfo, true),
+            tableInfo.getTableName(), sqlWhereEntityWrapper(true, tableInfo), sqlComment());
         SqlSource sqlSource = languageDriver.createSqlSource(configuration, sql, modelClass);
         return this.addSelectMappedStatementForOther(mapperClass, getMethod(sqlMethod), sqlSource, Map.class);
     }

+ 2 - 7
mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/injector/methods/SelectObjs.java

@@ -32,13 +32,8 @@ public class SelectObjs extends AbstractMethod {
     @Override
     public MappedStatement injectMappedStatement(Class<?> mapperClass, Class<?> modelClass, TableInfo tableInfo) {
         SqlMethod sqlMethod = SqlMethod.SELECT_OBJS;
-        String sql = String.format(
-                sqlMethod.getSql(),
-                sqlFirst(),
-                sqlSelectObjsColumns(tableInfo),
-                tableInfo.getTableName(),
-                sqlWhereEntityWrapper(true, tableInfo),
-                sqlComment());
+        String sql = String.format(sqlMethod.getSql(), sqlFirst(), sqlSelectObjsColumns(tableInfo),
+            tableInfo.getTableName(), sqlWhereEntityWrapper(true, tableInfo), sqlComment());
         SqlSource sqlSource = languageDriver.createSqlSource(configuration, sql, modelClass);
         return this.addSelectMappedStatementForOther(mapperClass, getMethod(sqlMethod), sqlSource, Object.class);
     }

+ 3 - 9
mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/injector/methods/SelectOne.java

@@ -32,15 +32,9 @@ public class SelectOne extends AbstractMethod {
     @Override
     public MappedStatement injectMappedStatement(Class<?> mapperClass, Class<?> modelClass, TableInfo tableInfo) {
         SqlMethod sqlMethod = SqlMethod.SELECT_ONE;
-        SqlSource sqlSource = languageDriver.createSqlSource(configuration,
-                String.format(
-                        sqlMethod.getSql(),
-                        sqlFirst(),
-                        this.sqlSelectColumns(tableInfo, true),
-                        tableInfo.getTableName(),
-                        this.sqlWhereEntityWrapper(true, tableInfo),
-                        sqlComment()),
-            modelClass);
+        SqlSource sqlSource = languageDriver.createSqlSource(configuration, String.format(sqlMethod.getSql(),
+            sqlFirst(), sqlSelectColumns(tableInfo, true), tableInfo.getTableName(),
+            sqlWhereEntityWrapper(true, tableInfo), sqlComment()), modelClass);
         return this.addSelectMappedStatementForTable(mapperClass, getMethod(sqlMethod), sqlSource, tableInfo);
     }
 }

+ 2 - 7
mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/injector/methods/SelectPage.java

@@ -32,13 +32,8 @@ public class SelectPage extends AbstractMethod {
     @Override
     public MappedStatement injectMappedStatement(Class<?> mapperClass, Class<?> modelClass, TableInfo tableInfo) {
         SqlMethod sqlMethod = SqlMethod.SELECT_PAGE;
-        String sql = String.format(
-                sqlMethod.getSql(),
-                sqlFirst(),
-                sqlSelectColumns(tableInfo, true),
-                tableInfo.getTableName(),
-                sqlWhereEntityWrapper(true, tableInfo),
-                sqlComment());
+        String sql = String.format(sqlMethod.getSql(), sqlFirst(), sqlSelectColumns(tableInfo, true),
+            tableInfo.getTableName(), sqlWhereEntityWrapper(true, tableInfo), sqlComment());
         SqlSource sqlSource = languageDriver.createSqlSource(configuration, sql, modelClass);
         return this.addSelectMappedStatementForTable(mapperClass, getMethod(sqlMethod), sqlSource, tableInfo);
     }

+ 1 - 2
mybatis-plus-core/src/main/java/com/baomidou/mybatisplus/core/injector/methods/Update.java

@@ -34,8 +34,7 @@ public class Update extends AbstractMethod {
         SqlMethod sqlMethod = SqlMethod.UPDATE;
         String sql = String.format(sqlMethod.getSql(), tableInfo.getTableName(),
             sqlSet(true, true, tableInfo, true, ENTITY, ENTITY_DOT),
-            sqlWhereEntityWrapper(true, tableInfo),
-            sqlComment());
+            sqlWhereEntityWrapper(true, tableInfo), sqlComment());
         SqlSource sqlSource = languageDriver.createSqlSource(configuration, sql, modelClass);
         return this.addUpdateMappedStatement(mapperClass, modelClass, getMethod(sqlMethod), sqlSource);
     }