kgdxpr 1 year ago
commit eec1100417

@ -119,16 +119,16 @@ public class DataShareModel {
if (StrKit.isBlank(subscribe_system_ids)) {
//这个系统已经订阅了哪些系统的哪些表
String sql = "select subscribe_system_ids from t_datashare_system where system_id=?";
subscribe_system_ids = Db.queryStr(sql, system_id);
String exist_subscribe_system_ids = Db.queryStr(sql, system_id);
//对于这些表都需要回收此用户的读权限
for (String s : subscribe_system_ids.split(",")) {
for (String s : exist_subscribe_system_ids.split(",")) {
List<Record> list = getShareTable(Integer.parseInt(s));
for (Record r : list) {
PgUtil.revokeUserPrivilege(user_name, r.getStr("table_name"), PgUtil.READ);
}
}
sql = "update t_datashare_system set subscribe_system_ids=? where system_id=?";
Db.update(sql, subscribe_system_ids, system_id);
sql = "update t_datashare_system set subscribe_system_ids=null where system_id=?";
Db.update(sql, system_id);
return;
}
//如果是修改为新的订阅系统

@ -1,6 +1,9 @@
#namespace("DataShare")
#sql("listSystem")
select t1.* from t_datashare_system as t1 where
select t1.*,
(select count(1) from t_datashare_table as t2 where t2.system_id=t1.system_id) as share_table_count,
array_length(string_to_array(t1.url, ','), 1) as subscribe_system_count
from t_datashare_system as t1 where
t1.system_name like #para(keyword, "like")
#if(exclude)
and t1.system_id<>#para(exclude)

Loading…
Cancel
Save