From cb0ce5e1e7db324379b38510dae56c6f16eda5a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E7=9A=87?= <236220500@qq.com> Date: Wed, 24 Nov 2021 17:04:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9D=83=E9=99=90=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xpack/impl/AuthXpackDefaultService.java | 140 +++++++ .../xpack/impl/DeptXpackDefaultService.java | 365 ++++++++++++++++++ .../auth/XpackExtSysAuthDetailMapper.java | 13 + .../auth/XpackExtSysAuthDetailMapper.xml | 54 +++ .../mapper/auth/XpackExtSysAuthMapper.java | 14 + .../mapper/auth/XpackExtSysAuthMapper.xml | 81 ++++ .../mapper/auth/XpackExtVAuthModelMapper.java | 9 + .../mapper/auth/XpackExtVAuthModelMapper.xml | 95 +++++ .../mapper/auth/XpackSysAuthDetailMapper.java | 31 ++ .../mapper/auth/XpackSysAuthDetailMapper.xml | 291 ++++++++++++++ .../xpack/mapper/auth/XpackSysAuthMapper.java | 30 ++ .../xpack/mapper/auth/XpackSysAuthMapper.xml | 276 +++++++++++++ .../mapper/auth/XpackVAuthModelMapper.java | 23 ++ .../mapper/auth/XpackVAuthModelMapper.xml | 223 +++++++++++ .../xpack/mapper/dept/XpackExtDeptMapper.java | 29 ++ .../xpack/mapper/dept/XpackExtDeptMapper.xml | 21 + .../xpack/mapper/dept/XpackSysDeptMapper.java | 31 ++ .../xpack/mapper/dept/XpackSysDeptMapper.xml | 275 +++++++++++++ .../src/main/resources/application.properties | 2 +- .../common/service/PluginMenuService.java | 2 - .../dto/request/XpackBaseTreeRequest.java | 4 +- .../auth/dto/request/XpackSysAuthRequest.java | 4 + .../entity/XpackSysAuthDetailExample.java | 147 +++++++ .../auth/entity/XpackSysAuthExample.java | 187 +++++++++ .../auth/entity/XpackVAuthModelExample.java | 186 +++++++++ .../dept/entity/XpackSysDeptExample.java | 167 ++++++++ .../role/entity/XpackSysRoleExample.java | 188 +++++++++ 27 files changed, 2883 insertions(+), 5 deletions(-) create mode 100644 backend/src/main/java/com/ipsos/plugins/xpack/impl/AuthXpackDefaultService.java create mode 100644 backend/src/main/java/com/ipsos/plugins/xpack/impl/DeptXpackDefaultService.java create mode 100644 backend/src/main/java/com/ipsos/plugins/xpack/mapper/auth/XpackExtSysAuthDetailMapper.java create mode 100644 backend/src/main/java/com/ipsos/plugins/xpack/mapper/auth/XpackExtSysAuthDetailMapper.xml create mode 100644 backend/src/main/java/com/ipsos/plugins/xpack/mapper/auth/XpackExtSysAuthMapper.java create mode 100644 backend/src/main/java/com/ipsos/plugins/xpack/mapper/auth/XpackExtSysAuthMapper.xml create mode 100644 backend/src/main/java/com/ipsos/plugins/xpack/mapper/auth/XpackExtVAuthModelMapper.java create mode 100644 backend/src/main/java/com/ipsos/plugins/xpack/mapper/auth/XpackExtVAuthModelMapper.xml create mode 100644 backend/src/main/java/com/ipsos/plugins/xpack/mapper/auth/XpackSysAuthDetailMapper.java create mode 100644 backend/src/main/java/com/ipsos/plugins/xpack/mapper/auth/XpackSysAuthDetailMapper.xml create mode 100644 backend/src/main/java/com/ipsos/plugins/xpack/mapper/auth/XpackSysAuthMapper.java create mode 100644 backend/src/main/java/com/ipsos/plugins/xpack/mapper/auth/XpackSysAuthMapper.xml create mode 100644 backend/src/main/java/com/ipsos/plugins/xpack/mapper/auth/XpackVAuthModelMapper.java create mode 100644 backend/src/main/java/com/ipsos/plugins/xpack/mapper/auth/XpackVAuthModelMapper.xml create mode 100644 backend/src/main/java/com/ipsos/plugins/xpack/mapper/dept/XpackExtDeptMapper.java create mode 100644 backend/src/main/java/com/ipsos/plugins/xpack/mapper/dept/XpackExtDeptMapper.xml create mode 100644 backend/src/main/java/com/ipsos/plugins/xpack/mapper/dept/XpackSysDeptMapper.java create mode 100644 backend/src/main/java/com/ipsos/plugins/xpack/mapper/dept/XpackSysDeptMapper.xml create mode 100644 plugins/plugin-interface/src/main/java/com/ipsos/plugins/xpack/auth/entity/XpackSysAuthDetailExample.java create mode 100644 plugins/plugin-interface/src/main/java/com/ipsos/plugins/xpack/auth/entity/XpackSysAuthExample.java create mode 100644 plugins/plugin-interface/src/main/java/com/ipsos/plugins/xpack/auth/entity/XpackVAuthModelExample.java create mode 100644 plugins/plugin-interface/src/main/java/com/ipsos/plugins/xpack/dept/entity/XpackSysDeptExample.java create mode 100644 plugins/plugin-interface/src/main/java/com/ipsos/plugins/xpack/role/entity/XpackSysRoleExample.java diff --git a/backend/src/main/java/com/ipsos/plugins/xpack/impl/AuthXpackDefaultService.java b/backend/src/main/java/com/ipsos/plugins/xpack/impl/AuthXpackDefaultService.java new file mode 100644 index 0000000..f087b1f --- /dev/null +++ b/backend/src/main/java/com/ipsos/plugins/xpack/impl/AuthXpackDefaultService.java @@ -0,0 +1,140 @@ +package com.ipsos.plugins.xpack.impl; + +import com.ipsos.common.constants.PluginSystemConstants; +import com.ipsos.common.dto.PluginSysMenu; +import com.ipsos.plugins.xpack.auth.dto.request.XpackBaseTreeRequest; +import com.ipsos.plugins.xpack.auth.dto.request.XpackSysAuthRequest; +import com.ipsos.plugins.xpack.auth.dto.response.*; +import com.ipsos.plugins.xpack.auth.entity.XpackVAuthModelExample; +import com.ipsos.plugins.xpack.auth.service.AuthXpackService; +import com.ipsos.plugins.xpack.mapper.auth.*; +import org.apache.ibatis.annotations.Param; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; +import org.springframework.util.StringUtils; + +import java.io.InputStream; +import java.util.*; +import java.util.stream.Collectors; + +@Service +public class AuthXpackDefaultService extends AuthXpackService { + private static List MODEL_TYPES; + @Autowired + private XpackSysAuthMapper sysAuthMapper; + + @Autowired + private XpackSysAuthDetailMapper sysAuthDetailMapper; + + @Autowired + private XpackExtSysAuthDetailMapper extSysAuthDetailMapper; + + @Autowired + private XpackExtVAuthModelMapper extVAuthModelMapper; + + @Autowired + private XpackExtSysAuthMapper extSysAuthMapper; + + public Map> searchAuthDetails(XpackSysAuthRequest request) { + return (Map) ((List) Optional.ofNullable(extSysAuthMapper.search(request)).orElse(new ArrayList())).stream().collect(Collectors.groupingBy(XpackSysAuthDetailDTO::getAuthSource)); + } + + protected InputStream readContent(String name) { + return name.getClass().getClassLoader().getResourceAsStream((new StringBuilder()).insert(0, "static/").append(name).toString()); + } + + public List searchAuthModelTree(XpackBaseTreeRequest request, Long userId, Boolean isAdmin) { + request.setCreateBy(String.valueOf(userId)); + if (!MODEL_TYPES.contains(request.getModelType()) || userId != null && isAdmin) { + request.setWithAuth("0"); + } else { + request.setWithAuth("1"); + } + + return extVAuthModelMapper.searchTree(request); + } + + public void authChange(XpackSysAuthRequest request, Long userId, String userName, Boolean isAdmin) { + XpackSysAuthDetail sysAuthDetail = request.getAuthDetail(); + List authIds; + if (CollectionUtils.isEmpty(authIds = vAuthIds(request.getAuthSource(), request.getAuthSourceType(), userId, isAdmin))) { + throw new RuntimeException("i18n_auth_source_be_canceled"); + } else { + List var = vAuthIds(request.getAuthTarget(), request.getAuthTargetType(), userId, isAdmin); + if (!CollectionUtils.isEmpty(authIds) && !CollectionUtils.isEmpty(var)) { + List ids = new ArrayList(); + var.stream().forEach((ax) -> { + authIds.forEach((id) -> { + String authId = getAuthId(id, request.getAuthSourceType(), ax, request.getAuthTargetType(), userName); + ids.add(authId); + }); + }); + if (sysAuthDetail.getPrivilegeValue() == PluginSystemConstants.PRIVILEGE_VALUE.ON) { + extSysAuthDetailMapper.authDetailsChange(PluginSystemConstants.PRIVILEGE_VALUE.OFF, sysAuthDetail.getPrivilegeType(), ids); + return; + } + extSysAuthDetailMapper.authDetailsChange(PluginSystemConstants.PRIVILEGE_VALUE.ON, sysAuthDetail.getPrivilegeType(), ids); + } + } + } + + public List searchAuthDetailsModel(String authType) { + return extSysAuthDetailMapper.searchAuthTypeModel(authType); + } + + public List menus() { + final PluginSysMenu pluginSysMenu = new PluginSysMenu(); + pluginSysMenu.setMenuId(41L); + pluginSysMenu.setPid(1L); + pluginSysMenu.setHidden(false); + pluginSysMenu.setComponent("SystemAuth"); + pluginSysMenu.setIcon("password"); + pluginSysMenu.setTitle("权限管理"); + pluginSysMenu.setName("system-auth"); + pluginSysMenu.setPath("system-auth"); + pluginSysMenu.setPermission("auth:read"); + pluginSysMenu.setNoLayout(true); + pluginSysMenu.setType(1); + pluginSysMenu.setMenuSort(4); + return new ArrayList() { + { + add(pluginSysMenu); + } + }; + } + + static { + String[] modelTypes = new String[5]; + boolean var10002 = true; + modelTypes[0] = "link"; + modelTypes[1] = "dataset"; + modelTypes[2] = "chart"; + modelTypes[3] = "panel"; + modelTypes[4] = "menu"; + MODEL_TYPES = Arrays.asList(modelTypes); + } + + // $FF: synthetic method + private List vAuthIds(String authSource, String authSourceType, Long userId, Boolean isAdmin) { + return (List) ((List) Optional.ofNullable(searchAuthModelTree(new XpackBaseTreeRequest(authSource, authSourceType, "children"), userId, isAdmin)).orElse(new ArrayList())).stream().map(XpackVAuthModel::getId).collect(Collectors.toList()); + } + + private String getAuthId(String authSource, String authSourceType, String authTarget, String authTargetType, String authUser) { + String authId; + if (StringUtils.isEmpty(authId = extSysAuthMapper.findAuthId(authSource, authSourceType, authTarget, authTargetType))) { + authId = UUID.randomUUID().toString(); + XpackSysAuth sysAuth = new XpackSysAuth(); + sysAuth.setId(authId); + sysAuth.setAuthSource(authSource); + sysAuth.setAuthSourceType(authSourceType); + sysAuth.setAuthTarget(authTarget); + sysAuth.setAuthTargetType(authTargetType); + sysAuth.setAuthTime(System.currentTimeMillis()); + sysAuth.setAuthUser(authUser); + sysAuthMapper.insertSelective(sysAuth); + extSysAuthDetailMapper.copyAuthModel(authSourceType, authId, authUser); + } + return authId; + } +} diff --git a/backend/src/main/java/com/ipsos/plugins/xpack/impl/DeptXpackDefaultService.java b/backend/src/main/java/com/ipsos/plugins/xpack/impl/DeptXpackDefaultService.java new file mode 100644 index 0000000..48ab2ec --- /dev/null +++ b/backend/src/main/java/com/ipsos/plugins/xpack/impl/DeptXpackDefaultService.java @@ -0,0 +1,365 @@ +package com.ipsos.plugins.xpack.impl; + +import com.ipsos.common.dto.PluginSimpleTreeNode; +import com.ipsos.common.dto.PluginSysMenu; +import com.ipsos.common.entity.XpackGridRequest; +import com.ipsos.common.util.PluginCommonUtil; +import com.ipsos.plugins.xpack.auth.entity.XpackSysAuthExample; +import com.ipsos.plugins.xpack.dept.dto.request.XpackCreateDept; +import com.ipsos.plugins.xpack.dept.dto.request.XpackDeleteDept; +import com.ipsos.plugins.xpack.dept.dto.request.XpackMoveDept; +import com.ipsos.plugins.xpack.dept.dto.response.XpackDeptTreeNode; +import com.ipsos.plugins.xpack.dept.dto.response.XpackSysDept; +import com.ipsos.plugins.xpack.dept.entity.XpackSysDeptExample; +import com.ipsos.plugins.xpack.dept.service.DeptXpackService; +import com.ipsos.plugins.xpack.mapper.dept.XpackExtDeptMapper; +import com.ipsos.plugins.xpack.mapper.dept.XpackSysDeptMapper; + +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import javax.annotation.Resource; + +import org.apache.commons.lang3.ObjectUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.jdbc.datasource.DataSourceTransactionManager; +import org.springframework.stereotype.Service; +import org.springframework.transaction.TransactionDefinition; +import org.springframework.transaction.TransactionStatus; +import org.springframework.util.CollectionUtils; + +@Service +public class DeptXpackDefaultService extends DeptXpackService { + public static final Long DEPT_ROOT_PID = 0L; + + @Autowired(required = false) + private XpackExtDeptMapper c; + + @Resource + TransactionDefinition ALLATORIxDEMO; + + private static final Integer e = 0; + @Resource + private DataSourceTransactionManager C; + + @Autowired(required = false) + private XpackSysDeptMapper m; + + public int batchDelete(List a) { + TransactionStatus transactionStatus = C.getTransaction(ALLATORIxDEMO); + try { + a = (List) a.stream().map((ax) -> { + Long var2; + if ((var2 = ax.getPid()) != DEPT_ROOT_PID) { + c.decreasingSubcount(var2); + } + return ax.getDeptId(); + }).collect(Collectors.toList()); + c.updateUserDeptId(a.stream().map(XpackDeleteDept::getDeptId).collect(Collectors.toList())); + int var5 = c.batchDelete(a.stream().map(XpackDeleteDept::getDeptId).collect(Collectors.toList())); + C.commit(transactionStatus); + return var5; + } catch (Exception var4) { + C.rollback(transactionStatus); + throw new RuntimeException(var4); + } + } + + public List nodesTreeByCondition(XpackGridRequest a) { + List allNodes = getAllNodes(); + List pluginSimpleTreeNodes; + if (CollectionUtils.isEmpty(pluginSimpleTreeNodes = getPluginSimpleTreeNode(a))) { + return new ArrayList(); + } else { + pluginSimpleTreeNodes = buildPluginSimpleTreeNodes(allNodes, pluginSimpleTreeNodes); + XpackSysDeptExample sysDeptExample = new XpackSysDeptExample(); + if (!CollectionUtils.isEmpty(pluginSimpleTreeNodes)) { + sysDeptExample.createCriteria().andDeptIdIn(pluginSimpleTreeNodes); + } + sysDeptExample.setOrderByClause(XpackSysAuthExample.ALLATORIxDEMO("dept_sort")); + return m.selectByExample(sysDeptExample); + } + } + + public List menus() { + PluginSysMenu var1 = createDept(); + PluginSysMenu var2 = delDept(); + PluginSysMenu var3 = editDept(); + PluginSysMenu var4 = manageDept(); + PluginSysMenu var5 = deptForm(); + ArrayList var6; + (var6 = new ArrayList()).add(var1); + var6.add(var2); + var6.add(var3); + var6.add(var4); + var6.add(var5); + return var6; + } + + protected InputStream readContent(String name) { + return name.getClass().getClassLoader().getResourceAsStream((new StringBuilder()).insert(0, "static/").append(name).toString()); + } + + public List searchTree(Long a) { + List deptList = nodesByPid(0L); + if (a == DEPT_ROOT_PID) { + return (List) deptList.stream().map((dept) -> { + XpackDeptTreeNode deptTreeNode = new XpackDeptTreeNode(); + deptTreeNode.setId(dept.getDeptId()); + deptTreeNode.setLabel(dept.getName()); + deptTreeNode.setHasChildren(dept.getSubCount() > 0); + return deptTreeNode; + }).collect(Collectors.toList()); + } else { + XpackSysDept var3 = m.selectByPrimaryKey(a); + if (deptList.stream().anyMatch((ax) -> ax.getDeptId() == a)) { + return (List) deptList.stream().map((ax) -> { + XpackDeptTreeNode var2 = new XpackDeptTreeNode(); + var2.setId(ax.getDeptId()); + var2.setLabel(ax.getName()); + var2.setHasChildren(ax.getSubCount() > 0); + return var2; + }).collect(Collectors.toList()); + } else { +// XpackDeptTreeNode var7 = a.ALLATORIxDEMO(var3); +// +// XpackSysDept var4; +// for (XpackSysDept var10000 = a; var10000.getPid() != DEPT_ROOT_PID; var10000 = var4) { +// XpackDeptTreeNode var5 = a.ALLATORIxDEMO(var4 = a.m.selectByPrimaryKey(a.getPid())); +// var5.setChildren(var7.toList()); +// a = var4; +// var7 = var5; +// } +// +// return (List) var2.stream().map((ax) -> { +// return ax.getDeptId() == var7.getId() ? var7 : a.ALLATORIxDEMO(ax); +// }).collect(Collectors.toList()); + return new ArrayList<>(); + } + } + } + + public int update(XpackCreateDept a) { + TransactionStatus var2 = C.getTransaction(ALLATORIxDEMO); + XpackSysDept var3 = (XpackSysDept) PluginCommonUtil.copyBean(new XpackSysDept(), a); + if (a.isTop()) { + var3.setPid(DEPT_ROOT_PID); + } + + var3.setUpdateTime(System.currentTimeMillis()); + var3.setUpdateBy((String) null); + Long deptId = var3.getDeptId(); + XpackSysDept primaryKey = m.selectByPrimaryKey(deptId); + List var4 = nodesByPid(var3.getPid()); + try { + if (var3.getPid() != a.getPid()) { + Long var6 = a.getPid(); + if (!CollectionUtils.isEmpty(var4) && var4.stream().anyMatch((ax) -> { + return StringUtils.equals(ax.getName(), var3.getName()); + })) { + C.commit(var2); + return -2; + } + + if (var6 != DEPT_ROOT_PID) { + c.decreasingSubcount(var6); + } + + if (var3.getPid() != DEPT_ROOT_PID) { + c.incrementalSubcount(var3.getPid()); + } + } + + if (!CollectionUtils.isEmpty(var4) && var4.stream().anyMatch((ax) -> { + return StringUtils.equals(ax.getName(), var3.getName()) && var3.getDeptId() != ax.getDeptId(); + })) { + C.commit(var2); + return -2; + } else { + int var10 = m.updateByPrimaryKeySelective(var3); + C.commit(var2); + return var10; + } + } catch (Exception var7) { + C.rollback(var2); + throw new RuntimeException(var7); + } + } + + public int add(XpackCreateDept a) { + TransactionStatus var2 = C.getTransaction(ALLATORIxDEMO); + XpackSysDept var3 = (XpackSysDept) PluginCommonUtil.copyBean(new XpackSysDept(), a); + if (a.isTop()) { + var3.setPid(DEPT_ROOT_PID); + } + + List sysDeptList; + if (!CollectionUtils.isEmpty(sysDeptList = nodesByPid(var3.getPid())) && sysDeptList.stream().anyMatch((ax) -> { + return StringUtils.equals(ax.getName(), var3.getName()); + })) { + C.commit(var2); + return -2; + } else { + long var4 = System.currentTimeMillis(); + var3.setCreateTime(var4); + var3.setUpdateTime(var4); + var3.setCreateBy((String) null); + var3.setUpdateBy((String) null); + var3.setSubCount(e); + + try { + int saveXpackSysDept = m.insert(var3); + Long var9 = null; + if ((var9 = var3.getPid()) != DEPT_ROOT_PID) { + c.incrementalSubcount(var9); + } + C.commit(var2); + return saveXpackSysDept == 1 ? saveXpackSysDept : -1; + } catch (Exception var6) { + C.rollback(var2); + throw new RuntimeException(var6); + } + } + } + + public void move(XpackMoveDept a) { + TransactionStatus var2 = C.getTransaction(ALLATORIxDEMO); + try { + Long resourceId = a.getResourceId(); + Long targetId = a.getTargetId(); + XpackSysDept var4 = m.selectByPrimaryKey(resourceId); + c.decreasingSubcount(var4.getPid()); + var4 = new XpackSysDept(); + var4.setDeptId(resourceId); + var4.setPid(targetId); + m.updateByPrimaryKeySelective(var4); + c.incrementalSubcount(targetId); + C.commit(var2); + } catch (Exception var5) { + C.rollback(var2); + throw new RuntimeException(var5); + } + } + + public List nodesByPid(Long a) { + XpackSysDeptExample sysDeptExample; + XpackSysDeptExample.Criteria criteria = (sysDeptExample = new XpackSysDeptExample()).createCriteria(); + if (ObjectUtils.isEmpty(a)) { + criteria.andPidEqualTo(0L); + } else { + criteria.andPidEqualTo(a); + } + sysDeptExample.setOrderByClause("dept_sort"); + return m.selectByExample(sysDeptExample); + } + + + // $FF: synthetic method + private PluginSysMenu editDept() { + PluginSysMenu sysMenu = new PluginSysMenu(); + sysMenu.setIcon((String)null); + sysMenu.setTitle("编辑组织"); + sysMenu.setMenuId(20L); + sysMenu.setPid(4L); + sysMenu.setHidden(false); + sysMenu.setPermission("dept:edit"); + sysMenu.setType(2); + sysMenu.setMenuSort(999); + return sysMenu; + } + + // $FF: synthetic method + private List getAllNodes() { + return c.allNodes(); + } + + // $FF: synthetic method + private List buildPluginSimpleTreeNodes(List pluginSimpleTreeNodes, List pluginSimpleTreeNodes2) { +// List a = (Map)a.stream().collect(Collectors.toMap(PluginSimpleTreeNode::getId, (ax) -> { +// return ax; +// })); +// return (List)a.parallelStream().flatMap((ax) -> { +// ArrayList var2 = new ArrayList(); +// +// Long var3; +// for(PluginSimpleTreeNode var10000 = ax = ax; var10000 != null; var10000 = ax = (PluginSimpleTreeNode)a.get(var3)) { +// var2.add(ax.getId()); +// var3 = ax.getPid(); +// } +// +// return var2.stream(); +// }).distinct().collect(Collectors.toList()); + return new ArrayList<>(); + } + + // $FF: synthetic method + private PluginSysMenu createDept() { + PluginSysMenu sysMenu = new PluginSysMenu(); + sysMenu.setIcon((String)null); + sysMenu.setTitle("创建组织"); + sysMenu.setMenuId(18L); + sysMenu.setPid(4L); + sysMenu.setHidden(false); + sysMenu.setPermission("dept:add"); + sysMenu.setType(2); + sysMenu.setMenuSort(999); + return sysMenu; + } + + // $FF: synthetic method + private List getPluginSimpleTreeNode(XpackGridRequest request) { + return c.nodesByExample(request.convertExample()); + } + + // $FF: synthetic method + private PluginSysMenu manageDept() { + PluginSysMenu sysMenu = new PluginSysMenu(); + sysMenu.setIcon("dept"); + sysMenu.setTitle("组织管理"); + sysMenu.setMenuId(4L); + sysMenu.setPid(1L); + sysMenu.setHidden(false); + sysMenu.setComponent("SystemDept"); + sysMenu.setName("system-dept"); + sysMenu.setPath("dept"); + sysMenu.setPermission("dept:read"); + sysMenu.setType(1); + sysMenu.setSubCount(3); + sysMenu.setMenuSort(3); + return sysMenu; + } + + // $FF: synthetic method + private PluginSysMenu delDept() { + PluginSysMenu sysMenu = new PluginSysMenu(); + sysMenu.setIcon((String)null); + sysMenu.setTitle("删除组织"); + sysMenu.setMenuId(19L); + sysMenu.setPid(4L); + sysMenu.setHidden(false); + sysMenu.setPermission("dept:del"); + sysMenu.setType(2); + sysMenu.setMenuSort(999); + return sysMenu; + } + + // $FF: synthetic method + private PluginSysMenu deptForm() { + PluginSysMenu sysMenu = new PluginSysMenu(); + sysMenu.setIcon((String)null); + sysMenu.setTitle("组织表单"); + sysMenu.setMenuId(37L); + sysMenu.setPid(1L); + sysMenu.setHidden(true); + sysMenu.setComponent("SystemDeptForm"); + sysMenu.setName("system-dept-form"); + sysMenu.setPath("dept-form"); + sysMenu.setType(1); + sysMenu.setMenuSort(999); + return sysMenu; + } +} + diff --git a/backend/src/main/java/com/ipsos/plugins/xpack/mapper/auth/XpackExtSysAuthDetailMapper.java b/backend/src/main/java/com/ipsos/plugins/xpack/mapper/auth/XpackExtSysAuthDetailMapper.java new file mode 100644 index 0000000..cac1040 --- /dev/null +++ b/backend/src/main/java/com/ipsos/plugins/xpack/mapper/auth/XpackExtSysAuthDetailMapper.java @@ -0,0 +1,13 @@ +package com.ipsos.plugins.xpack.mapper.auth; + +import com.ipsos.plugins.xpack.auth.dto.response.XpackSysAuthDetail; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface XpackExtSysAuthDetailMapper { + void copyAuthModel(@Param("authTypeModel") String authTypeModel, @Param("authId") String authId, @Param("createUser") String createUser); + + void authDetailsChange(@Param("privilegeValue") Integer privilegeValue, @Param("privilegeType") Integer privilegeType, @Param("authIds") List authIds); + + List searchAuthTypeModel(@Param("authTypeModel") String authTypeModel); +} diff --git a/backend/src/main/java/com/ipsos/plugins/xpack/mapper/auth/XpackExtSysAuthDetailMapper.xml b/backend/src/main/java/com/ipsos/plugins/xpack/mapper/auth/XpackExtSysAuthDetailMapper.xml new file mode 100644 index 0000000..9c7eb5d --- /dev/null +++ b/backend/src/main/java/com/ipsos/plugins/xpack/mapper/auth/XpackExtSysAuthDetailMapper.xml @@ -0,0 +1,54 @@ + + + + + + + + INSERT INTO sys_auth_detail ( + id, + auth_id, + privilege_name, + privilege_type, + privilege_value, + privilege_extend, + remark, + create_user, + create_time + ) SELECT + uuid() AS id, + #{authId} AS auth_id, + sys_auth_detail.privilege_name, + sys_auth_detail.privilege_type, + sys_auth_detail.privilege_value, + sys_auth_detail.privilege_extend, + sys_auth_detail.remark, + #{createUser} AS create_user, + unix_timestamp(now())* 1000 AS create_time + FROM + sys_auth_detail where auth_id =#{authTypeModel} + + + + + UPDATE sys_auth_detail + SET privilege_value = #{privilegeValue} + + auth_id in + #{authId} + + and privilege_type <= #{privilegeType} + + + and privilege_type >= #{privilegeType} + + + + + diff --git a/backend/src/main/java/com/ipsos/plugins/xpack/mapper/auth/XpackExtSysAuthMapper.java b/backend/src/main/java/com/ipsos/plugins/xpack/mapper/auth/XpackExtSysAuthMapper.java new file mode 100644 index 0000000..f253045 --- /dev/null +++ b/backend/src/main/java/com/ipsos/plugins/xpack/mapper/auth/XpackExtSysAuthMapper.java @@ -0,0 +1,14 @@ +package com.ipsos.plugins.xpack.mapper.auth; + +import com.ipsos.plugins.xpack.auth.dto.request.XpackSysAuthRequest; +import com.ipsos.plugins.xpack.auth.dto.response.XpackSysAuthDetailDTO; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface XpackExtSysAuthMapper { + Boolean authExist(@Param("authSource") String authSource, @Param("authTarget") String authTarget); + + String findAuthId(@Param("authSource") String authSource, @Param("authSourceType") String authSourceType, @Param("authTarget") String authTarget, @Param("authTargetType") String authTargetType); + + List search(XpackSysAuthRequest authRequest); +} diff --git a/backend/src/main/java/com/ipsos/plugins/xpack/mapper/auth/XpackExtSysAuthMapper.xml b/backend/src/main/java/com/ipsos/plugins/xpack/mapper/auth/XpackExtSysAuthMapper.xml new file mode 100644 index 0000000..cab5eb2 --- /dev/null +++ b/backend/src/main/java/com/ipsos/plugins/xpack/mapper/auth/XpackExtSysAuthMapper.xml @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/backend/src/main/java/com/ipsos/plugins/xpack/mapper/auth/XpackExtVAuthModelMapper.java b/backend/src/main/java/com/ipsos/plugins/xpack/mapper/auth/XpackExtVAuthModelMapper.java new file mode 100644 index 0000000..e05235e --- /dev/null +++ b/backend/src/main/java/com/ipsos/plugins/xpack/mapper/auth/XpackExtVAuthModelMapper.java @@ -0,0 +1,9 @@ +package com.ipsos.plugins.xpack.mapper.auth; + +import com.ipsos.plugins.xpack.auth.dto.request.XpackBaseTreeRequest; +import com.ipsos.plugins.xpack.auth.dto.response.XpackVAuthModelDTO; +import java.util.List; + +public interface XpackExtVAuthModelMapper { + List searchTree(XpackBaseTreeRequest baseTreeRequest); +} diff --git a/backend/src/main/java/com/ipsos/plugins/xpack/mapper/auth/XpackExtVAuthModelMapper.xml b/backend/src/main/java/com/ipsos/plugins/xpack/mapper/auth/XpackExtVAuthModelMapper.xml new file mode 100644 index 0000000..ea29522 --- /dev/null +++ b/backend/src/main/java/com/ipsos/plugins/xpack/mapper/auth/XpackExtVAuthModelMapper.xml @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/backend/src/main/java/com/ipsos/plugins/xpack/mapper/auth/XpackSysAuthDetailMapper.java b/backend/src/main/java/com/ipsos/plugins/xpack/mapper/auth/XpackSysAuthDetailMapper.java new file mode 100644 index 0000000..d43a702 --- /dev/null +++ b/backend/src/main/java/com/ipsos/plugins/xpack/mapper/auth/XpackSysAuthDetailMapper.java @@ -0,0 +1,31 @@ +package com.ipsos.plugins.xpack.mapper.auth; + +import com.ipsos.plugins.xpack.auth.dto.response.XpackSysAuthDetail; +import java.util.List; + +import com.ipsos.plugins.xpack.auth.entity.XpackSysAuthDetailExample; +import org.apache.ibatis.annotations.Param; + +public interface XpackSysAuthDetailMapper { + List selectByExample(XpackSysAuthDetailExample sysAuthDetailExample); + + int deleteByExample(XpackSysAuthDetailExample sysAuthDetailExample); + + XpackSysAuthDetail selectByPrimaryKey(String primaryKey); + + int updateByPrimaryKey(XpackSysAuthDetail sysAuthDetail); + + int deleteByPrimaryKey(String primaryKey); + + int insert(XpackSysAuthDetail sysAuthDetail); + + int updateByExample(@Param("record") XpackSysAuthDetail record, @Param("example") XpackSysAuthDetailExample example); + + int updateByPrimaryKeySelective(XpackSysAuthDetail sysAuthDetail); + + int updateByExampleSelective(@Param("record") XpackSysAuthDetail record, @Param("example") XpackSysAuthDetailExample example); + + long countByExample(XpackSysAuthDetailExample sysAuthDetailExample); + + int insertSelective(XpackSysAuthDetail sysAuthDetail); +} diff --git a/backend/src/main/java/com/ipsos/plugins/xpack/mapper/auth/XpackSysAuthDetailMapper.xml b/backend/src/main/java/com/ipsos/plugins/xpack/mapper/auth/XpackSysAuthDetailMapper.xml new file mode 100644 index 0000000..67933ed --- /dev/null +++ b/backend/src/main/java/com/ipsos/plugins/xpack/mapper/auth/XpackSysAuthDetailMapper.xml @@ -0,0 +1,291 @@ + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, auth_id, privilege_name, privilege_type, privilege_value, privilege_extend, remark, + create_user, create_time, update_time + + + + + delete from sys_auth_detail + where id = #{id,jdbcType=VARCHAR} + + + delete from sys_auth_detail + + + + + + insert into sys_auth_detail (id, auth_id, privilege_name, + privilege_type, privilege_value, privilege_extend, + remark, create_user, create_time, + update_time) + values (#{id,jdbcType=VARCHAR}, #{authId,jdbcType=VARCHAR}, #{privilegeName,jdbcType=VARCHAR}, + #{privilegeType,jdbcType=INTEGER}, #{privilegeValue,jdbcType=INTEGER}, #{privilegeExtend,jdbcType=VARCHAR}, + #{remark,jdbcType=VARCHAR}, #{createUser,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, + #{updateTime,jdbcType=BIGINT}) + + + insert into sys_auth_detail + + + id, + + + auth_id, + + + privilege_name, + + + privilege_type, + + + privilege_value, + + + privilege_extend, + + + remark, + + + create_user, + + + create_time, + + + update_time, + + + + + #{id,jdbcType=VARCHAR}, + + + #{authId,jdbcType=VARCHAR}, + + + #{privilegeName,jdbcType=VARCHAR}, + + + #{privilegeType,jdbcType=INTEGER}, + + + #{privilegeValue,jdbcType=INTEGER}, + + + #{privilegeExtend,jdbcType=VARCHAR}, + + + #{remark,jdbcType=VARCHAR}, + + + #{createUser,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=BIGINT}, + + + #{updateTime,jdbcType=BIGINT}, + + + + + + update sys_auth_detail + + + id = #{record.id,jdbcType=VARCHAR}, + + + auth_id = #{record.authId,jdbcType=VARCHAR}, + + + privilege_name = #{record.privilegeName,jdbcType=VARCHAR}, + + + privilege_type = #{record.privilegeType,jdbcType=INTEGER}, + + + privilege_value = #{record.privilegeValue,jdbcType=INTEGER}, + + + privilege_extend = #{record.privilegeExtend,jdbcType=VARCHAR}, + + + remark = #{record.remark,jdbcType=VARCHAR}, + + + create_user = #{record.createUser,jdbcType=VARCHAR}, + + + create_time = #{record.createTime,jdbcType=BIGINT}, + + + update_time = #{record.updateTime,jdbcType=BIGINT}, + + + + + + + + update sys_auth_detail + set id = #{record.id,jdbcType=VARCHAR}, + auth_id = #{record.authId,jdbcType=VARCHAR}, + privilege_name = #{record.privilegeName,jdbcType=VARCHAR}, + privilege_type = #{record.privilegeType,jdbcType=INTEGER}, + privilege_value = #{record.privilegeValue,jdbcType=INTEGER}, + privilege_extend = #{record.privilegeExtend,jdbcType=VARCHAR}, + remark = #{record.remark,jdbcType=VARCHAR}, + create_user = #{record.createUser,jdbcType=VARCHAR}, + create_time = #{record.createTime,jdbcType=BIGINT}, + update_time = #{record.updateTime,jdbcType=BIGINT} + + + + + + update sys_auth_detail + + + auth_id = #{authId,jdbcType=VARCHAR}, + + + privilege_name = #{privilegeName,jdbcType=VARCHAR}, + + + privilege_type = #{privilegeType,jdbcType=INTEGER}, + + + privilege_value = #{privilegeValue,jdbcType=INTEGER}, + + + privilege_extend = #{privilegeExtend,jdbcType=VARCHAR}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + create_user = #{createUser,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=BIGINT}, + + + update_time = #{updateTime,jdbcType=BIGINT}, + + + where id = #{id,jdbcType=VARCHAR} + + + update sys_auth_detail + set auth_id = #{authId,jdbcType=VARCHAR}, + privilege_name = #{privilegeName,jdbcType=VARCHAR}, + privilege_type = #{privilegeType,jdbcType=INTEGER}, + privilege_value = #{privilegeValue,jdbcType=INTEGER}, + privilege_extend = #{privilegeExtend,jdbcType=VARCHAR}, + remark = #{remark,jdbcType=VARCHAR}, + create_user = #{createUser,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=BIGINT}, + update_time = #{updateTime,jdbcType=BIGINT} + where id = #{id,jdbcType=VARCHAR} + + diff --git a/backend/src/main/java/com/ipsos/plugins/xpack/mapper/auth/XpackSysAuthMapper.java b/backend/src/main/java/com/ipsos/plugins/xpack/mapper/auth/XpackSysAuthMapper.java new file mode 100644 index 0000000..1518565 --- /dev/null +++ b/backend/src/main/java/com/ipsos/plugins/xpack/mapper/auth/XpackSysAuthMapper.java @@ -0,0 +1,30 @@ +package com.ipsos.plugins.xpack.mapper.auth; + +import com.ipsos.plugins.xpack.auth.dto.response.XpackSysAuth; +import com.ipsos.plugins.xpack.auth.entity.XpackSysAuthExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface XpackSysAuthMapper { + int updateByPrimaryKeySelective(XpackSysAuth var1); + + int updateByExample(@Param("record") XpackSysAuth record, @Param("example") XpackSysAuthExample example); + + int deleteByExample(XpackSysAuthExample example); + + int insert(XpackSysAuth sysAuth); + + int updateByPrimaryKey(XpackSysAuth sysAuth); + + int insertSelective(XpackSysAuth sysAuth); + + XpackSysAuth selectByPrimaryKey(String primaryKey); + + int deleteByPrimaryKey(String primaryKey); + + List selectByExample(XpackSysAuthExample example); + + long countByExample(XpackSysAuthExample example); + + int updateByExampleSelective(@Param("record") XpackSysAuth record, @Param("example") XpackSysAuthExample example); +} diff --git a/backend/src/main/java/com/ipsos/plugins/xpack/mapper/auth/XpackSysAuthMapper.xml b/backend/src/main/java/com/ipsos/plugins/xpack/mapper/auth/XpackSysAuthMapper.xml new file mode 100644 index 0000000..064a22a --- /dev/null +++ b/backend/src/main/java/com/ipsos/plugins/xpack/mapper/auth/XpackSysAuthMapper.xml @@ -0,0 +1,276 @@ + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, auth_source, auth_source_type, auth_target, auth_target_type, auth_time, auth_details, + auth_user, update_time + + + + + delete from sys_auth + where id = #{id,jdbcType=VARCHAR} + + + delete from sys_auth + + + + + + insert into sys_auth (id, auth_source, auth_source_type, + auth_target, auth_target_type, auth_time, + auth_details, auth_user, update_time + ) + values (#{id,jdbcType=VARCHAR}, #{authSource,jdbcType=VARCHAR}, #{authSourceType,jdbcType=VARCHAR}, + #{authTarget,jdbcType=VARCHAR}, #{authTargetType,jdbcType=VARCHAR}, #{authTime,jdbcType=BIGINT}, + #{authDetails,jdbcType=VARCHAR}, #{authUser,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP} + ) + + + insert into sys_auth + + + id, + + + auth_source, + + + auth_source_type, + + + auth_target, + + + auth_target_type, + + + auth_time, + + + auth_details, + + + auth_user, + + + update_time, + + + + + #{id,jdbcType=VARCHAR}, + + + #{authSource,jdbcType=VARCHAR}, + + + #{authSourceType,jdbcType=VARCHAR}, + + + #{authTarget,jdbcType=VARCHAR}, + + + #{authTargetType,jdbcType=VARCHAR}, + + + #{authTime,jdbcType=BIGINT}, + + + #{authDetails,jdbcType=VARCHAR}, + + + #{authUser,jdbcType=VARCHAR}, + + + #{updateTime,jdbcType=TIMESTAMP}, + + + + + + update sys_auth + + + id = #{record.id,jdbcType=VARCHAR}, + + + auth_source = #{record.authSource,jdbcType=VARCHAR}, + + + auth_source_type = #{record.authSourceType,jdbcType=VARCHAR}, + + + auth_target = #{record.authTarget,jdbcType=VARCHAR}, + + + auth_target_type = #{record.authTargetType,jdbcType=VARCHAR}, + + + auth_time = #{record.authTime,jdbcType=BIGINT}, + + + auth_details = #{record.authDetails,jdbcType=VARCHAR}, + + + auth_user = #{record.authUser,jdbcType=VARCHAR}, + + + update_time = #{record.updateTime,jdbcType=TIMESTAMP}, + + + + + + + + update sys_auth + set id = #{record.id,jdbcType=VARCHAR}, + auth_source = #{record.authSource,jdbcType=VARCHAR}, + auth_source_type = #{record.authSourceType,jdbcType=VARCHAR}, + auth_target = #{record.authTarget,jdbcType=VARCHAR}, + auth_target_type = #{record.authTargetType,jdbcType=VARCHAR}, + auth_time = #{record.authTime,jdbcType=BIGINT}, + auth_details = #{record.authDetails,jdbcType=VARCHAR}, + auth_user = #{record.authUser,jdbcType=VARCHAR}, + update_time = #{record.updateTime,jdbcType=TIMESTAMP} + + + + + + update sys_auth + + + auth_source = #{authSource,jdbcType=VARCHAR}, + + + auth_source_type = #{authSourceType,jdbcType=VARCHAR}, + + + auth_target = #{authTarget,jdbcType=VARCHAR}, + + + auth_target_type = #{authTargetType,jdbcType=VARCHAR}, + + + auth_time = #{authTime,jdbcType=BIGINT}, + + + auth_details = #{authDetails,jdbcType=VARCHAR}, + + + auth_user = #{authUser,jdbcType=VARCHAR}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + where id = #{id,jdbcType=VARCHAR} + + + update sys_auth + set auth_source = #{authSource,jdbcType=VARCHAR}, + auth_source_type = #{authSourceType,jdbcType=VARCHAR}, + auth_target = #{authTarget,jdbcType=VARCHAR}, + auth_target_type = #{authTargetType,jdbcType=VARCHAR}, + auth_time = #{authTime,jdbcType=BIGINT}, + auth_details = #{authDetails,jdbcType=VARCHAR}, + auth_user = #{authUser,jdbcType=VARCHAR}, + update_time = #{updateTime,jdbcType=TIMESTAMP} + where id = #{id,jdbcType=VARCHAR} + + diff --git a/backend/src/main/java/com/ipsos/plugins/xpack/mapper/auth/XpackVAuthModelMapper.java b/backend/src/main/java/com/ipsos/plugins/xpack/mapper/auth/XpackVAuthModelMapper.java new file mode 100644 index 0000000..2f8a52f --- /dev/null +++ b/backend/src/main/java/com/ipsos/plugins/xpack/mapper/auth/XpackVAuthModelMapper.java @@ -0,0 +1,23 @@ +package com.ipsos.plugins.xpack.mapper.auth; + +import com.ipsos.plugins.xpack.auth.dto.response.XpackVAuthModel; +import java.util.List; + +import com.ipsos.plugins.xpack.auth.entity.XpackVAuthModelExample; +import org.apache.ibatis.annotations.Param; + +public interface XpackVAuthModelMapper { + long countByExample(XpackVAuthModelExample var1); + + int updateByExample(@Param("record") XpackVAuthModel var1, @Param("example") XpackVAuthModelExample var2); + + int insert(XpackVAuthModel var1); + + int deleteByExample(XpackVAuthModelExample var1); + + int updateByExampleSelective(@Param("record") XpackVAuthModel var1, @Param("example") XpackVAuthModelExample var2); + + int insertSelective(XpackVAuthModel var1); + + List selectByExample(XpackVAuthModelExample var1); +} diff --git a/backend/src/main/java/com/ipsos/plugins/xpack/mapper/auth/XpackVAuthModelMapper.xml b/backend/src/main/java/com/ipsos/plugins/xpack/mapper/auth/XpackVAuthModelMapper.xml new file mode 100644 index 0000000..da06673 --- /dev/null +++ b/backend/src/main/java/com/ipsos/plugins/xpack/mapper/auth/XpackVAuthModelMapper.xml @@ -0,0 +1,223 @@ + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, `name`, `label`, pid, node_type, model_type, model_inner_type, auth_type, create_by + + + + delete from v_auth_model + + + + + + insert into v_auth_model (id, `name`, `label`, + pid, node_type, model_type, + model_inner_type, auth_type, create_by + ) + values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{label,jdbcType=VARCHAR}, + #{pid,jdbcType=VARCHAR}, #{nodeType,jdbcType=VARCHAR}, #{modelType,jdbcType=VARCHAR}, + #{modelInnerType,jdbcType=VARCHAR}, #{authType,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR} + ) + + + insert into v_auth_model + + + id, + + + `name`, + + + `label`, + + + pid, + + + node_type, + + + model_type, + + + model_inner_type, + + + auth_type, + + + create_by, + + + + + #{id,jdbcType=VARCHAR}, + + + #{name,jdbcType=VARCHAR}, + + + #{label,jdbcType=VARCHAR}, + + + #{pid,jdbcType=VARCHAR}, + + + #{nodeType,jdbcType=VARCHAR}, + + + #{modelType,jdbcType=VARCHAR}, + + + #{modelInnerType,jdbcType=VARCHAR}, + + + #{authType,jdbcType=VARCHAR}, + + + #{createBy,jdbcType=VARCHAR}, + + + + + + update v_auth_model + + + id = #{record.id,jdbcType=VARCHAR}, + + + `name` = #{record.name,jdbcType=VARCHAR}, + + + `label` = #{record.label,jdbcType=VARCHAR}, + + + pid = #{record.pid,jdbcType=VARCHAR}, + + + node_type = #{record.nodeType,jdbcType=VARCHAR}, + + + model_type = #{record.modelType,jdbcType=VARCHAR}, + + + model_inner_type = #{record.modelInnerType,jdbcType=VARCHAR}, + + + auth_type = #{record.authType,jdbcType=VARCHAR}, + + + create_by = #{record.createBy,jdbcType=VARCHAR}, + + + + + + + + update v_auth_model + set id = #{record.id,jdbcType=VARCHAR}, + `name` = #{record.name,jdbcType=VARCHAR}, + `label` = #{record.label,jdbcType=VARCHAR}, + pid = #{record.pid,jdbcType=VARCHAR}, + node_type = #{record.nodeType,jdbcType=VARCHAR}, + model_type = #{record.modelType,jdbcType=VARCHAR}, + model_inner_type = #{record.modelInnerType,jdbcType=VARCHAR}, + auth_type = #{record.authType,jdbcType=VARCHAR}, + create_by = #{record.createBy,jdbcType=VARCHAR} + + + + + diff --git a/backend/src/main/java/com/ipsos/plugins/xpack/mapper/dept/XpackExtDeptMapper.java b/backend/src/main/java/com/ipsos/plugins/xpack/mapper/dept/XpackExtDeptMapper.java new file mode 100644 index 0000000..15b47d7 --- /dev/null +++ b/backend/src/main/java/com/ipsos/plugins/xpack/mapper/dept/XpackExtDeptMapper.java @@ -0,0 +1,29 @@ +package com.ipsos.plugins.xpack.mapper.dept; + +import java.util.List; + +import com.ipsos.common.dto.PluginSimpleTreeNode; +import com.ipsos.common.entity.XpackGridExample; +import org.apache.ibatis.annotations.Delete; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Update; + +public interface XpackExtDeptMapper { + + List allNodes(); + + @Delete({""}) + int batchDelete(@Param("ids") List var1); + + List nodesByExample(XpackGridExample var1); + + @Update({" update sys_dept set sub_count = sub_count-1 where dept_id = #{deptId} and sub_count > 0"}) + int decreasingSubcount(@Param("deptId") Long var1); + + @Update({""}) + int updateUserDeptId(@Param("ids") List var1); + + @Update({" update sys_dept set sub_count = sub_count+1 where dept_id = #{deptId} "}) + int incrementalSubcount(@Param("deptId") Long var1); +} diff --git a/backend/src/main/java/com/ipsos/plugins/xpack/mapper/dept/XpackExtDeptMapper.xml b/backend/src/main/java/com/ipsos/plugins/xpack/mapper/dept/XpackExtDeptMapper.xml new file mode 100644 index 0000000..8186c48 --- /dev/null +++ b/backend/src/main/java/com/ipsos/plugins/xpack/mapper/dept/XpackExtDeptMapper.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + diff --git a/backend/src/main/java/com/ipsos/plugins/xpack/mapper/dept/XpackSysDeptMapper.java b/backend/src/main/java/com/ipsos/plugins/xpack/mapper/dept/XpackSysDeptMapper.java new file mode 100644 index 0000000..1b6221e --- /dev/null +++ b/backend/src/main/java/com/ipsos/plugins/xpack/mapper/dept/XpackSysDeptMapper.java @@ -0,0 +1,31 @@ +package com.ipsos.plugins.xpack.mapper.dept; + +import java.util.List; + +import com.ipsos.plugins.xpack.dept.dto.response.XpackSysDept; +import com.ipsos.plugins.xpack.dept.entity.XpackSysDeptExample; +import org.apache.ibatis.annotations.Param; + +public interface XpackSysDeptMapper { + int insertSelective(XpackSysDept var1); + + int deleteByPrimaryKey(Long var1); + + int updateByExampleSelective(@Param("record") XpackSysDept record, @Param("example") XpackSysDeptExample example); + + XpackSysDept selectByPrimaryKey(Long var1); + + int updateByPrimaryKey(XpackSysDept var1); + + int insert(XpackSysDept var1); + + List selectByExample(XpackSysDeptExample var1); + + long countByExample(XpackSysDeptExample var1); + + int deleteByExample(XpackSysDeptExample var1); + + int updateByExample(@Param("record") XpackSysDept record, @Param("example") XpackSysDeptExample example); + + int updateByPrimaryKeySelective(XpackSysDept var1); +} diff --git a/backend/src/main/java/com/ipsos/plugins/xpack/mapper/dept/XpackSysDeptMapper.xml b/backend/src/main/java/com/ipsos/plugins/xpack/mapper/dept/XpackSysDeptMapper.xml new file mode 100644 index 0000000..b96f047 --- /dev/null +++ b/backend/src/main/java/com/ipsos/plugins/xpack/mapper/dept/XpackSysDeptMapper.xml @@ -0,0 +1,275 @@ + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + dept_id, pid, sub_count, `name`, dept_sort, create_by, update_by, create_time, update_time + + + + + delete from sys_dept + where dept_id = #{deptId,jdbcType=BIGINT} + + + delete from sys_dept + + + + + + insert into sys_dept (dept_id, pid, sub_count, + `name`, dept_sort, create_by, + update_by, create_time, update_time + ) + values (#{deptId,jdbcType=BIGINT}, #{pid,jdbcType=BIGINT}, #{subCount,jdbcType=INTEGER}, + #{name,jdbcType=VARCHAR}, #{deptSort,jdbcType=INTEGER}, #{createBy,jdbcType=VARCHAR}, + #{updateBy,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT} + ) + + + insert into sys_dept + + + dept_id, + + + pid, + + + sub_count, + + + `name`, + + + dept_sort, + + + create_by, + + + update_by, + + + create_time, + + + update_time, + + + + + #{deptId,jdbcType=BIGINT}, + + + #{pid,jdbcType=BIGINT}, + + + #{subCount,jdbcType=INTEGER}, + + + #{name,jdbcType=VARCHAR}, + + + #{deptSort,jdbcType=INTEGER}, + + + #{createBy,jdbcType=VARCHAR}, + + + #{updateBy,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=BIGINT}, + + + #{updateTime,jdbcType=BIGINT}, + + + + + + update sys_dept + + + dept_id = #{record.deptId,jdbcType=BIGINT}, + + + pid = #{record.pid,jdbcType=BIGINT}, + + + sub_count = #{record.subCount,jdbcType=INTEGER}, + + + `name` = #{record.name,jdbcType=VARCHAR}, + + + dept_sort = #{record.deptSort,jdbcType=INTEGER}, + + + create_by = #{record.createBy,jdbcType=VARCHAR}, + + + update_by = #{record.updateBy,jdbcType=VARCHAR}, + + + create_time = #{record.createTime,jdbcType=BIGINT}, + + + update_time = #{record.updateTime,jdbcType=BIGINT}, + + + + + + + + update sys_dept + set dept_id = #{record.deptId,jdbcType=BIGINT}, + pid = #{record.pid,jdbcType=BIGINT}, + sub_count = #{record.subCount,jdbcType=INTEGER}, + `name` = #{record.name,jdbcType=VARCHAR}, + dept_sort = #{record.deptSort,jdbcType=INTEGER}, + create_by = #{record.createBy,jdbcType=VARCHAR}, + update_by = #{record.updateBy,jdbcType=VARCHAR}, + create_time = #{record.createTime,jdbcType=BIGINT}, + update_time = #{record.updateTime,jdbcType=BIGINT} + + + + + + update sys_dept + + + pid = #{pid,jdbcType=BIGINT}, + + + sub_count = #{subCount,jdbcType=INTEGER}, + + + `name` = #{name,jdbcType=VARCHAR}, + + + dept_sort = #{deptSort,jdbcType=INTEGER}, + + + create_by = #{createBy,jdbcType=VARCHAR}, + + + update_by = #{updateBy,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=BIGINT}, + + + update_time = #{updateTime,jdbcType=BIGINT}, + + + where dept_id = #{deptId,jdbcType=BIGINT} + + + update sys_dept + set pid = #{pid,jdbcType=BIGINT}, + sub_count = #{subCount,jdbcType=INTEGER}, + `name` = #{name,jdbcType=VARCHAR}, + dept_sort = #{deptSort,jdbcType=INTEGER}, + create_by = #{createBy,jdbcType=VARCHAR}, + update_by = #{updateBy,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=BIGINT}, + update_time = #{updateTime,jdbcType=BIGINT} + where dept_id = #{deptId,jdbcType=BIGINT} + + diff --git a/backend/src/main/resources/application.properties b/backend/src/main/resources/application.properties index ece006f..d4ad9da 100644 --- a/backend/src/main/resources/application.properties +++ b/backend/src/main/resources/application.properties @@ -1,7 +1,7 @@ spring.application.name=dataease server.port=8081 - +#spring.aop.proxy-target-class=true # Hikari spring.datasource.type=com.zaxxer.hikari.HikariDataSource spring.datasource.hikari.minimum-idle=5 diff --git a/plugins/plugin-common/src/main/java/com/ipsos/common/service/PluginMenuService.java b/plugins/plugin-common/src/main/java/com/ipsos/common/service/PluginMenuService.java index 2c93e74..f5a4b82 100644 --- a/plugins/plugin-common/src/main/java/com/ipsos/common/service/PluginMenuService.java +++ b/plugins/plugin-common/src/main/java/com/ipsos/common/service/PluginMenuService.java @@ -19,6 +19,4 @@ public abstract class PluginMenuService { return readContent(name); } - - } diff --git a/plugins/plugin-interface/src/main/java/com/ipsos/plugins/xpack/auth/dto/request/XpackBaseTreeRequest.java b/plugins/plugin-interface/src/main/java/com/ipsos/plugins/xpack/auth/dto/request/XpackBaseTreeRequest.java index 0f12fd3..cf2e44a 100644 --- a/plugins/plugin-interface/src/main/java/com/ipsos/plugins/xpack/auth/dto/request/XpackBaseTreeRequest.java +++ b/plugins/plugin-interface/src/main/java/com/ipsos/plugins/xpack/auth/dto/request/XpackBaseTreeRequest.java @@ -17,7 +17,7 @@ public class XpackBaseTreeRequest { private String pid; //now 返回当前条件查询的数据 parent 返回当前数据查询的数据同时递归父节点数据; children 返回当前数据查询的数据同时递归子节点数据 - private String withExtend= PluginSystemConstants.WITH_EXTEND.NOW; + private String withExtend = PluginSystemConstants.WITH_EXTEND.NOW; private String createBy; @@ -27,7 +27,7 @@ public class XpackBaseTreeRequest { public XpackBaseTreeRequest() { } - public XpackBaseTreeRequest(String id,String modelType, String withExtend) { + public XpackBaseTreeRequest(String id, String modelType, String withExtend) { this.id = id; this.modelType = modelType; this.withExtend = withExtend; diff --git a/plugins/plugin-interface/src/main/java/com/ipsos/plugins/xpack/auth/dto/request/XpackSysAuthRequest.java b/plugins/plugin-interface/src/main/java/com/ipsos/plugins/xpack/auth/dto/request/XpackSysAuthRequest.java index 6cb7dbf..29a481b 100644 --- a/plugins/plugin-interface/src/main/java/com/ipsos/plugins/xpack/auth/dto/request/XpackSysAuthRequest.java +++ b/plugins/plugin-interface/src/main/java/com/ipsos/plugins/xpack/auth/dto/request/XpackSysAuthRequest.java @@ -2,11 +2,15 @@ package com.ipsos.plugins.xpack.auth.dto.request; import com.ipsos.plugins.xpack.auth.dto.response.XpackSysAuth; import com.ipsos.plugins.xpack.auth.dto.response.XpackSysAuthDetail; +import lombok.AllArgsConstructor; import lombok.Data; +import lombok.NoArgsConstructor; import java.util.List; @Data +@AllArgsConstructor +@NoArgsConstructor public class XpackSysAuthRequest extends XpackSysAuth { private List authSources; diff --git a/plugins/plugin-interface/src/main/java/com/ipsos/plugins/xpack/auth/entity/XpackSysAuthDetailExample.java b/plugins/plugin-interface/src/main/java/com/ipsos/plugins/xpack/auth/entity/XpackSysAuthDetailExample.java new file mode 100644 index 0000000..4ab2852 --- /dev/null +++ b/plugins/plugin-interface/src/main/java/com/ipsos/plugins/xpack/auth/entity/XpackSysAuthDetailExample.java @@ -0,0 +1,147 @@ +package com.ipsos.plugins.xpack.auth.entity; + +import com.ipsos.common.annotation.PluginResultMap; + +import java.util.ArrayList; +import java.util.List; + +@PluginResultMap +public class XpackSysAuthDetailExample { + protected String orderByClause; + protected List oredCriteria = new ArrayList(); + protected boolean distinct; + + public boolean isDistinct() { + return distinct; + } + + protected XpackSysAuthDetailExample.Criteria createCriteriaInternal() { + return new XpackSysAuthDetailExample.Criteria(); + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + public void setOrderByClause(String a) { + orderByClause = a; + } + + public XpackSysAuthDetailExample.Criteria or() { + XpackSysAuthDetailExample.Criteria var1 = createCriteriaInternal(); + oredCriteria.add(var1); + return var1; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void setDistinct(boolean a) { + distinct = a; + } + + public void or(XpackSysAuthDetailExample.Criteria a) { + oredCriteria.add(a); + } + + public String getOrderByClause() { + return orderByClause; + } + + public XpackSysAuthDetailExample() { + } + + public XpackSysAuthDetailExample.Criteria createCriteria() { + XpackSysAuthDetailExample.Criteria var1 = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(var1); + } + + return var1; + } + public static class Criterion { + private boolean betweenValue; + private boolean listValue; + private String condition; + private Object value; + private Object secondValue; + private String typeHandler; + private boolean noValue; + private boolean singleValue; + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + protected Criterion(String condition, Object value, String var3) { + this.condition = condition; + this.value = value; + this.typeHandler = var3; + if (this.value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value) { + this(condition, value, (String) null); + } + + public String getTypeHandler() { + return typeHandler; + } + + public String getCondition() { + return condition; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, (String) null); + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public Object getValue() { + return value; + } + + public boolean isListValue() { + return listValue; + } + + protected Criterion(String condition) { + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + } + public static class Criteria extends XpackSysAuthDetailExample.GeneratedCriteria { + protected Criteria() { + } + } + protected abstract static class GeneratedCriteria { + protected List criteria = new ArrayList(); + } +} diff --git a/plugins/plugin-interface/src/main/java/com/ipsos/plugins/xpack/auth/entity/XpackSysAuthExample.java b/plugins/plugin-interface/src/main/java/com/ipsos/plugins/xpack/auth/entity/XpackSysAuthExample.java new file mode 100644 index 0000000..d6afb23 --- /dev/null +++ b/plugins/plugin-interface/src/main/java/com/ipsos/plugins/xpack/auth/entity/XpackSysAuthExample.java @@ -0,0 +1,187 @@ +package com.ipsos.plugins.xpack.auth.entity; + +import com.ipsos.common.annotation.PluginResultMap; + +import java.util.ArrayList; +import java.util.List; + +@PluginResultMap +public class XpackSysAuthExample { + protected boolean distinct; + protected String orderByClause; + protected List oredCriteria = new ArrayList(); + + public List getOredCriteria() { + return oredCriteria; + } + + public void setDistinct(boolean a) { + distinct = a; + } + + public String getOrderByClause() { + return orderByClause; + } + + public XpackSysAuthExample.Criteria createCriteria() { + XpackSysAuthExample.Criteria var1 = createCriteriaInternal(); + if (this.oredCriteria.size() == 0) { + oredCriteria.add(var1); + } + + return var1; + } + + + public static String ALLATORIxDEMO(String a) { + int var10000 = (3 ^ 5) << 4; + int var10001 = 5 << 3 ^ 2 ^ 5; + int var10002 = 5 << 4 ^ 5; + int var10003 = (a = (String)a).length(); + char[] var10004 = new char[var10003]; + boolean var10006 = true; + int var5 = var10003 - 1; + var10003 = var10002; + int var3; + var10002 = var3 = var5; + char[] var1 = var10004; + int var4 = var10003; + var10000 = var10002; + + for(int var2 = var10001; var10000 >= 0; var10000 = var3) { + var10001 = var3; + char var6 = a.charAt(var3); + --var3; + var1[var10001] = (char)(var6 ^ var2); + if (var3 < 0) { + break; + } + + var10002 = var3--; + var1[var10002] = (char)(a.charAt(var10002) ^ var4); + } + + return new String(var1); + } + + public static void main(String[] args) { + System.out.println("我操: " + XpackSysAuthExample.ALLATORIxDEMO("K0_!3@'B")); + } + + public XpackSysAuthExample.Criteria or() { + XpackSysAuthExample.Criteria var1 = createCriteriaInternal(); + oredCriteria.add(var1); + return var1; + } + + public XpackSysAuthExample() { + } + + public void setOrderByClause(String a) { + orderByClause = a; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + public boolean isDistinct() { + return distinct; + } + + public void or(XpackSysAuthExample.Criteria a) { + oredCriteria.add(a); + } + + protected XpackSysAuthExample.Criteria createCriteriaInternal() { + return new XpackSysAuthExample.Criteria(); + } + + public static class Criterion { + private boolean betweenValue; + private boolean listValue; + private String condition; + private Object value; + private Object secondValue; + private String typeHandler; + private boolean noValue; + private boolean singleValue; + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + protected Criterion(String condition, Object value, String var3) { + this.condition = condition; + this.value = value; + this.typeHandler = var3; + if (this.value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value) { + this(condition, value, (String) null); + } + + public String getTypeHandler() { + return typeHandler; + } + + public String getCondition() { + return condition; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, (String) null); + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public Object getValue() { + return value; + } + + public boolean isListValue() { + return listValue; + } + + protected Criterion(String condition) { + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + } + + public static class Criteria extends XpackSysAuthExample.GeneratedCriteria { + protected Criteria() { + } + } + + protected abstract static class GeneratedCriteria { + protected List criteria = new ArrayList(); + } +} + diff --git a/plugins/plugin-interface/src/main/java/com/ipsos/plugins/xpack/auth/entity/XpackVAuthModelExample.java b/plugins/plugin-interface/src/main/java/com/ipsos/plugins/xpack/auth/entity/XpackVAuthModelExample.java new file mode 100644 index 0000000..402f7a0 --- /dev/null +++ b/plugins/plugin-interface/src/main/java/com/ipsos/plugins/xpack/auth/entity/XpackVAuthModelExample.java @@ -0,0 +1,186 @@ +package com.ipsos.plugins.xpack.auth.entity; + +import com.ipsos.common.annotation.PluginResultMap; + +import java.util.ArrayList; +import java.util.List; + +@PluginResultMap +public class XpackVAuthModelExample { + protected List oredCriteria = new ArrayList(); + protected boolean distinct; + protected String orderByClause; + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + public boolean isDistinct() { + return distinct; + } + + public void or(XpackVAuthModelExample.Criteria a) { + oredCriteria.add(a); + } + + public void setDistinct(boolean a) { + distinct = a; + } + + public void setOrderByClause(String a) { + orderByClause = a; + } + + public XpackVAuthModelExample() { + } + + protected XpackVAuthModelExample.Criteria createCriteriaInternal() { + return new XpackVAuthModelExample.Criteria(); + } + + public String getOrderByClause() { + return orderByClause; + } + + public XpackVAuthModelExample.Criteria or() { + XpackVAuthModelExample.Criteria var1 = createCriteriaInternal(); + oredCriteria.add(var1); + return var1; + } + + public XpackVAuthModelExample.Criteria createCriteria() { + XpackVAuthModelExample.Criteria var1 = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(var1); + } + + return var1; + } + + public static String ALLATORIxDEMO(String a) { + int var10000 = 5 << 4 ^ 4 << 1; + int var10001 = 4 << 3 ^ 2 ^ 5; + int var10002 = 5 << 4 ^ 3 << 1; + int var10003 = (a = (String)a).length(); + char[] var10004 = new char[var10003]; + boolean var10006 = true; + int var5 = var10003 - 1; + var10003 = var10002; + int var3; + var10002 = var3 = var5; + char[] var1 = var10004; + int var4 = var10003; + var10000 = var10002; + + for(int var2 = var10001; var10000 >= 0; var10000 = var3) { + var10001 = var3; + char var6 = a.charAt(var3); + --var3; + var1[var10001] = (char)(var6 ^ var2); + if (var3 < 0) { + break; + } + + var10002 = var3--; + var1[var10002] = (char)(a.charAt(var10002) ^ var4); + } + + return new String(var1); + } + + public static void main(String[] args) { + String u = XpackVAuthModelExample.ALLATORIxDEMO("2B&S\tN2\u0007?I"); + System.out.println("我操: " + u); + } + + public List getOredCriteria() { + return oredCriteria; + } + + public static class Criterion { + private boolean betweenValue; + private boolean listValue; + private String condition; + private Object value; + private Object secondValue; + private String typeHandler; + private boolean noValue; + private boolean singleValue; + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + protected Criterion(String condition, Object value, String var3) { + this.condition = condition; + this.value = value; + this.typeHandler = var3; + if (this.value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value) { + this(condition, value, (String) null); + } + + public String getTypeHandler() { + return typeHandler; + } + + public String getCondition() { + return condition; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, (String) null); + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public Object getValue() { + return value; + } + + public boolean isListValue() { + return listValue; + } + + protected Criterion(String condition) { + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + } + + public static class Criteria extends XpackVAuthModelExample.GeneratedCriteria { + protected Criteria() { + } + } + + protected abstract static class GeneratedCriteria { + protected List criteria = new ArrayList(); + } +} diff --git a/plugins/plugin-interface/src/main/java/com/ipsos/plugins/xpack/dept/entity/XpackSysDeptExample.java b/plugins/plugin-interface/src/main/java/com/ipsos/plugins/xpack/dept/entity/XpackSysDeptExample.java new file mode 100644 index 0000000..6c1a9bf --- /dev/null +++ b/plugins/plugin-interface/src/main/java/com/ipsos/plugins/xpack/dept/entity/XpackSysDeptExample.java @@ -0,0 +1,167 @@ +package com.ipsos.plugins.xpack.dept.entity; + +import com.ipsos.common.annotation.PluginResultMap; +import com.ipsos.plugins.xpack.auth.entity.XpackVAuthModelExample; +import com.ipsos.plugins.xpack.role.entity.XpackSysRoleExample; + +import java.util.ArrayList; +import java.util.List; + +@PluginResultMap +public class XpackSysDeptExample { + protected boolean distinct; + protected String orderByClause; + protected List oredCriteria = new ArrayList(); + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + public boolean isDistinct() { + return distinct; + } + + public String getOrderByClause() { + return orderByClause; + } + + public XpackSysDeptExample() { + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void setOrderByClause(String a) { + orderByClause = a; + } + + public void setDistinct(boolean a) { + distinct = a; + } + + public XpackSysDeptExample.Criteria or() { + XpackSysDeptExample.Criteria var1 = createCriteriaInternal(); + oredCriteria.add(var1); + return var1; + } + + protected XpackSysDeptExample.Criteria createCriteriaInternal() { + return new XpackSysDeptExample.Criteria(); + } + + public void or(XpackSysDeptExample.Criteria a) { + oredCriteria.add(a); + } + + public XpackSysDeptExample.Criteria createCriteria() { + XpackSysDeptExample.Criteria var1 = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(var1); + } + return var1; + } + + public static class Criterion { + private boolean betweenValue; + private boolean listValue; + private String condition; + private Object value; + private Object secondValue; + private String typeHandler; + private boolean noValue; + private boolean singleValue; + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + protected Criterion(String condition, Object value, String var3) { + this.condition = condition; + this.value = value; + this.typeHandler = var3; + if (this.value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value) { + this(condition, value, (String) null); + } + + public String getTypeHandler() { + return typeHandler; + } + + public String getCondition() { + return condition; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, (String) null); + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public Object getValue() { + return value; + } + + public boolean isListValue() { + return listValue; + } + + protected Criterion(String condition) { + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + } + + public static class Criteria extends XpackSysDeptExample.GeneratedCriteria { + protected Criteria() { + } + } + + protected abstract static class GeneratedCriteria { + protected List criteria = new ArrayList(); + + protected void addCriterion(String condition, Object value, String column) { + if (value == null) { + throw new RuntimeException((new StringBuilder()).insert(0, "Value for").append(column).append("cannot be null").toString()); + } else { + criteria.add(new XpackSysDeptExample.Criterion(condition, value)); + } + } + public XpackSysDeptExample.Criteria andDeptIdIn(List ids) { + addCriterion("dept_id in", ids, "deptId"); + return (XpackSysDeptExample.Criteria) this; + } + public XpackSysDeptExample.Criteria andPidEqualTo(Long value) { + addCriterion("pid = ", value, "pid"); + return (XpackSysDeptExample.Criteria) this; + } + } +} diff --git a/plugins/plugin-interface/src/main/java/com/ipsos/plugins/xpack/role/entity/XpackSysRoleExample.java b/plugins/plugin-interface/src/main/java/com/ipsos/plugins/xpack/role/entity/XpackSysRoleExample.java new file mode 100644 index 0000000..aed609e --- /dev/null +++ b/plugins/plugin-interface/src/main/java/com/ipsos/plugins/xpack/role/entity/XpackSysRoleExample.java @@ -0,0 +1,188 @@ +package com.ipsos.plugins.xpack.role.entity; + +import com.ipsos.common.annotation.PluginResultMap; + +import java.util.ArrayList; +import java.util.List; + +@PluginResultMap +public class XpackSysRoleExample { + protected boolean distinct; + protected List oredCriteria = new ArrayList(); + protected String orderByClause; + + public XpackSysRoleExample.Criteria or() { + XpackSysRoleExample.Criteria var1 = createCriteriaInternal(); + oredCriteria.add(var1); + return var1; + } + + public List getOredCriteria() { + return oredCriteria; + } + + protected XpackSysRoleExample.Criteria createCriteriaInternal() { + return new XpackSysRoleExample.Criteria(); + } + + public XpackSysRoleExample() { + } + + public boolean isDistinct() { + return distinct; + } + + public void or(XpackSysRoleExample.Criteria a) { + oredCriteria.add(a); + } + + public String getOrderByClause() { + return orderByClause; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + public void setOrderByClause(String a) { + orderByClause = a; + } + + public XpackSysRoleExample.Criteria createCriteria() { + XpackSysRoleExample.Criteria var1 = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(var1); + } + + return var1; + } + + public static String ALLATORIxDEMO(String a) { + int var10000 = (2 ^ 5) << 4 ^ 3 << 1; + int var10001 = 2 << 3 ^ 3 ^ 5; + int var10002 = 2 << 3 ^ 2 ^ 5; + int var10003 = (a = (String)a).length(); + char[] var10004 = new char[var10003]; + boolean var10006 = true; + int var5 = var10003 - 1; + var10003 = var10002; + int var3; + var10002 = var3 = var5; + char[] var1 = var10004; + int var4 = var10003; + var10001 = var10000; + var10000 = var10002; + + for(int var2 = var10001; var10000 >= 0; var10000 = var3) { + var10001 = var3; + char var6 = a.charAt(var3); + --var3; + var1[var10001] = (char)(var6 ^ var2); + if (var3 < 0) { + break; + } + + var10002 = var3--; + var1[var10002] = (char)(a.charAt(var10002) ^ var4); + } + + return new String(var1); + } + + public static void main(String[] args) { + System.out.println("我操: " + XpackSysRoleExample.ALLATORIxDEMO("s\u0013g\u0002^\u0012")); + } + + public void setDistinct(boolean a) { + distinct = a; + } + + public static class Criterion { + private boolean betweenValue; + private boolean listValue; + private String condition; + private Object value; + private Object secondValue; + private String typeHandler; + private boolean noValue; + private boolean singleValue; + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + protected Criterion(String condition, Object value, String var3) { + this.condition = condition; + this.value = value; + this.typeHandler = var3; + if (this.value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value) { + this(condition, value, (String) null); + } + + public String getTypeHandler() { + return typeHandler; + } + + public String getCondition() { + return condition; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, (String) null); + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public Object getValue() { + return value; + } + + public boolean isListValue() { + return listValue; + } + + protected Criterion(String condition) { + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + } + + public static class Criteria extends XpackSysRoleExample.GeneratedCriteria { + protected Criteria() { + } + } + + protected abstract static class GeneratedCriteria { + protected List criteria = new ArrayList(); + + } +} +