Sfoglia il codice sorgente

修复:隐藏行/显示行

wangming 11 mesi fa
parent
commit
b6b15056e5

+ 3 - 2
luckysheet-postgre/src/main/java/com/xc/luckysheet/postgres/impl/RecordDataUpdataHandle.java

@@ -110,7 +110,8 @@ public class RecordDataUpdataHandle extends BaseHandle implements IRecordDataUpd
             for (String key : queryDB.keySet()) {
                 condition=condition+"and "+key+"='"+queryDB.get(key)+"'";
             }
-            String updateSql="update "+JfGridConfigModel.TABLENAME+" set json_data=json_data #- '{"+keyName+"}'  where 1=1 " +condition;
+//            String updateSql="update "+JfGridConfigModel.TABLENAME+" set json_data=json_data #- '{"+keyName+"}'  where 1=1 " +condition;
+            String updateSql="update "+JfGridConfigModel.TABLENAME+" set json_data=jsonb_set(json_data,'{" + keyName + "}', '{}', false)  where 1=1 " +condition;
             log.info("rmCellDataValue--"+updateSql);
             jdbcTemplate_postgresql.update(updateSql);
             return true;
@@ -512,7 +513,7 @@ public class RecordDataUpdataHandle extends BaseHandle implements IRecordDataUpd
                 word=word+","+position;
             }
             //(jsonb_v,'{myinfo,celldata,0}','{"c":1,"r":1,"v":{"con":"str"}}',false)
-            String updateSql="update "+JfGridConfigModel.TABLENAME+" set json_data=jsonb_set(json_data,'{"+word+"}','"+db.toString()+"',false) where 1=1 " +condition;
+            String updateSql="update "+JfGridConfigModel.TABLENAME+" set json_data=jsonb_set(json_data,'{"+word+"}','"+db.toString()+"',true) where 1=1 " +condition;
             log.info("updateSql:"+updateSql);
             jdbcTemplate_postgresql.update(updateSql,arr.toArray());
             return true;