Jelajahi Sumber

code formatter 2

shiqian 4 tahun lalu
induk
melakukan
cf68031a12

+ 8 - 12
boman-web-core/src/main/java/com/boman/web/core/mapper/StandardlyMapper.java

@@ -28,10 +28,9 @@ public interface StandardlyMapper {
 
     Logger LOGGER = LoggerFactory.getLogger(StandardlyMapper.class);
 
-    @UpdateProvider(
-            type = SqlProvider.class,
-            method = "update"
-    )
+
+    /** {@link SqlProvider#update(java.util.Map)} */
+    @UpdateProvider(type = SqlProvider.class, method = "update")
     int updateById(@Param("tableName") String var1, @Param("model") JSONObject var2
             , @Param("pkName") String pkName, @Param("ids") Long[] ids);
 
@@ -85,12 +84,9 @@ public interface StandardlyMapper {
     int updates(@Param("tableName") String var1, @Param("models") Collection<Object> var2, @Param("processor") Consumer<JSONObject> var3);
 
     /** {@link SqlProvider#updateByIdList(Map)} */
-    @UpdateProvider(
-            type = SqlProvider.class,
-            method = "updateByIdList"
-    )
-    int updateByIdList(@Param("tableName") String var1, @Param("pkName") String pkName
-            , @Param("idList") List<Long> var2, @Param("models") JSONObject models);
+    @UpdateProvider(type = SqlProvider.class, method = "updateByIdList")
+    int updateByIdList(@Param("tableName") String tableName, @Param("pkName") String pkName
+            , @Param("idList") List<Long> idList, @Param("model") JSONObject models);
 
     @Select("select id from ${tableName} where ${akColumnName} = #{akColumnValue}")
     Long selectIdByAkColumn(@Param("tableName") String tableName, @Param("akColumnName") String akColumnName, @Param("akColumnValue") String akColumnValue);
@@ -188,7 +184,7 @@ public interface StandardlyMapper {
     JSONObject getNewest(@Param("tableName") String tableName);
 
     @SuppressWarnings("unchecked")
-    public static class SqlProvider {
+    class SqlProvider {
         static final String[] READONLY_COLUMNS = new String[]{"OWNERID", "OWNERNAME", "OWNERENAME", "CREATIONDATE", "ID"};
 
         public SqlProvider() {
@@ -349,7 +345,7 @@ public interface StandardlyMapper {
             String tableName = (String) para.get("tableName");
             String pkName = (String) para.get("pkName");
             List<Long> idList = (List<Long>) para.get("idList");
-            JSONObject models = (JSONObject) para.get("models");
+            JSONObject models = (JSONObject) para.get("model");
 
             StringBuilder wholeSql = new StringBuilder();
             wholeSql.append("update ").append(tableName).append(" set ");

+ 5 - 3
boman-web-core/src/main/java/com/boman/web/core/service/submit/BaseSubmitServiceImpl.java

@@ -2,9 +2,13 @@ package com.boman.web.core.service.submit;
 
 import com.alibaba.fastjson.JSONObject;
 import com.boman.web.core.mapper.StandardlyMapper;
+import com.google.common.collect.Lists;
+import org.apache.commons.lang3.ArrayUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.Arrays;
+
 import static com.boman.common.core.utils.obj.ObjectUtils.requireNonNull;
 
 
@@ -31,8 +35,6 @@ public class BaseSubmitServiceImpl implements IBaseSubmitService {
     @Override
     public int handlerSubmit(String tableName, String pkName, JSONObject model, Long id) {
         requireNonNull(model, "提交的数据为空");
-        Long[] longs = new Long[1];
-        longs[0] = id;
-        return mapper.updateById(tableName, model, pkName, longs);
+        return mapper.updateByIdList(tableName, pkName, Lists.newArrayList(id), model);
     }
 }