数据探索数据列 / 指标增加百分比,dashboard日期和日期范围默认T-1

dev
zhenghuang 4 years ago
parent 86acd806c8
commit 0ad6d4eb49

@ -1,140 +0,0 @@
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<String> MODEL_TYPES;
@Autowired
private XpackSysAuthMapper sysAuthMapper;
@Autowired
private XpackSysAuthDetailMapper sysAuthDetailMapper;
@Autowired
private XpackExtSysAuthDetailMapper extSysAuthDetailMapper;
@Autowired
private XpackExtVAuthModelMapper extVAuthModelMapper;
@Autowired
private XpackExtSysAuthMapper extSysAuthMapper;
public Map<String, List<XpackSysAuthDetailDTO>> 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<XpackVAuthModelDTO> 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<String> authIds;
if (CollectionUtils.isEmpty(authIds = vAuthIds(request.getAuthSource(), request.getAuthSourceType(), userId, isAdmin))) {
throw new RuntimeException("i18n_auth_source_be_canceled");
} else {
List<String> 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<XpackSysAuthDetail> searchAuthDetailsModel(String authType) {
return extSysAuthDetailMapper.searchAuthTypeModel(authType);
}
public List<PluginSysMenu> 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<PluginSysMenu>() {
{
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<XpackVAuthModel>) 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;
}
}

@ -1,359 +0,0 @@
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.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 transactionDefinition;
private static final Integer e = 0;
@Resource
private DataSourceTransactionManager C;
@Autowired(required = false)
private XpackSysDeptMapper m;
public int batchDelete(List<XpackDeleteDept> a) {
TransactionStatus transactionStatus = C.getTransaction(transactionDefinition);
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<XpackSysDept> nodesTreeByCondition(XpackGridRequest a) {
List<PluginSimpleTreeNode> 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("dept_sort");
return m.selectByExample(sysDeptExample);
}
}
public List<PluginSysMenu> 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<XpackDeptTreeNode> searchTree(Long a) {
List<XpackSysDept> 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(transactionDefinition);
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<XpackSysDept> 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(transactionDefinition);
XpackSysDept var3 = (XpackSysDept) PluginCommonUtil.copyBean(new XpackSysDept(), a);
if (a.isTop()) {
var3.setPid(DEPT_ROOT_PID);
}
List<XpackSysDept> 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(transactionDefinition);
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<XpackSysDept> 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<PluginSimpleTreeNode> getAllNodes() {
return c.allNodes();
}
// $FF: synthetic method
private List<Long> buildPluginSimpleTreeNodes(List<PluginSimpleTreeNode> allTreeNodes, List<PluginSimpleTreeNode> searchTreeNodes) {
Map allTreeNodeMaps = allTreeNodes.stream().collect(Collectors.toMap(PluginSimpleTreeNode::getId, (ax) -> ax));
return (List) searchTreeNodes.parallelStream().flatMap((ax) -> {
ArrayList var2 = new ArrayList();
Long var3;
for (PluginSimpleTreeNode var10000 = ax; var10000 != null; var10000 = ax = (PluginSimpleTreeNode) allTreeNodeMaps.get(var3)) {
var2.add(ax.getId());
var3 = ax.getPid();
}
return var2.stream();
}).distinct().collect(Collectors.toList());
}
// $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<PluginSimpleTreeNode> 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;
}
}

@ -1,169 +0,0 @@
package com.ipsos.plugins.xpack.impl;
import com.ipsos.common.dto.PluginSysMenu;
import com.ipsos.common.entity.XpackGridExample;
import com.ipsos.common.entity.XpackGridRequest;
import com.ipsos.common.util.PluginCommonUtil;
import com.ipsos.plugins.xpack.mapper.role.XpackExtRoleMapper;
import com.ipsos.plugins.xpack.mapper.role.XpackSysRoleMapper;
import com.ipsos.plugins.xpack.role.dto.response.XpackRoleDto;
import com.ipsos.plugins.xpack.role.entity.XpackSysRole;
import com.ipsos.plugins.xpack.role.service.RoleXpackService;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import javax.annotation.Resource;
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;
@Service
public class RoleXpackDefaultService extends RoleXpackService {
@Autowired
private DataSourceTransactionManager transactionManager;
@Autowired
private XpackExtRoleMapper extRoleMapper;
@Autowired
private XpackSysRoleMapper sysRoleMapper;
@Autowired
TransactionDefinition transactionDefinition;
public void delete(Long a) {
TransactionStatus var2 = transactionManager.getTransaction(transactionDefinition);
try {
extRoleMapper.deleteMenuMapping(a);
extRoleMapper.deleteUserMapping(a);
sysRoleMapper.deleteByPrimaryKey(a);
transactionManager.commit(var2);
} catch (Exception var3) {
transactionManager.rollback(var2);
throw new RuntimeException(var3);
}
}
public List menus() {
PluginSysMenu var1 = roleDel();
PluginSysMenu var2 = roleEdit();
PluginSysMenu var3 = roleForm();
PluginSysMenu var4 = roleRead();
PluginSysMenu var5 = roleAdd();
ArrayList menus;
(menus = new ArrayList()).add(var1);
menus.add(var2);
menus.add(var3);
menus.add(var4);
menus.add(var5);
return menus;
}
public void update(XpackRoleDto roleDto) {
XpackSysRole role = (XpackSysRole)PluginCommonUtil.copyBean(new XpackSysRole(), roleDto);
Long time = System.currentTimeMillis();
role.setUpdateTime(time);
sysRoleMapper.updateByPrimaryKey(role);
}
public List query(XpackGridRequest request) {
XpackGridExample example = request.convertExample();
return (List) extRoleMapper.query(example).stream().map((ax) -> {
return (XpackRoleDto)PluginCommonUtil.copyBean(new XpackRoleDto(), ax);
}).collect(Collectors.toList());
}
public InputStream readContent(String a) {
return a.getClass().getClassLoader().getResourceAsStream((new StringBuilder()).insert(0, "static/").append(a).toString());
}
public void save(XpackRoleDto a) {
XpackSysRole role = PluginCommonUtil.copyBean(new XpackSysRole(), a);
Long time = System.currentTimeMillis();
role.setCreateTime(time);
role.setUpdateTime(time);
sysRoleMapper.insert(role);
}
// $FF: synthetic method
private PluginSysMenu roleAdd() {
PluginSysMenu var1 = new PluginSysMenu();
var1.setIcon((String)null);
var1.setTitle("创建角色");
var1.setMenuId(21L);
var1.setPid(5L);
var1.setHidden(false);
var1.setPermission("role:add");
var1.setType(2);
var1.setMenuSort(999);
return var1;
}
public List allRoles() {
return extRoleMapper.queryAll();
}
// $FF: synthetic method
private PluginSysMenu roleEdit() {
PluginSysMenu var1 = new PluginSysMenu();
var1.setIcon((String)null);
var1.setTitle("编辑角色");
var1.setMenuId(23L);
var1.setPid(5L);
var1.setHidden(false);
var1.setPermission("role:edit");
var1.setType(2);
var1.setMenuSort(999);
return var1;
}
// $FF: synthetic method
private PluginSysMenu roleForm() {
PluginSysMenu var1 = new PluginSysMenu();
var1.setIcon((String)null);
var1.setTitle("角色表单");
var1.setMenuId(38L);
var1.setPid(1L);
var1.setHidden(true);
var1.setComponent("SystemRoleForm");
var1.setName("system-role-form");
var1.setPath("role-form");
var1.setType(1);
var1.setMenuSort(999);
return var1;
}
// $FF: synthetic method
private PluginSysMenu roleRead() {
PluginSysMenu var1 = new PluginSysMenu();
var1.setIcon("role");
var1.setTitle("角色管理");
var1.setMenuId(5L);
var1.setPid(1L);
var1.setHidden(false);
var1.setComponent("SystemRole");
var1.setName("system-role");
var1.setPath("role");
var1.setPermission("role:read");
var1.setType(1);
var1.setSubCount(3);
var1.setMenuSort(2);
return var1;
}
// $FF: synthetic method
private PluginSysMenu roleDel() {
PluginSysMenu var1 = new PluginSysMenu();
var1.setIcon((String)null);
var1.setTitle("删除角色");
var1.setMenuId(22L);
var1.setPid(5L);
var1.setHidden(false);
var1.setPermission("role:del");
var1.setType(2);
var1.setMenuSort(999);
return var1;
}
}

@ -1,13 +0,0 @@
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<String> authIds);
List<XpackSysAuthDetail> searchAuthTypeModel(@Param("authTypeModel") String authTypeModel);
}

@ -1,54 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ipsos.plugins.xpack.mapper.auth.XpackExtSysAuthDetailMapper">
<select id="searchAuthTypeModel" resultMap="com.ipsos.plugins.xpack.mapper.auth.XpackSysAuthDetailMapper.BaseResultMap">
select
sys_auth_detail.privilege_name ,
sys_auth_detail.privilege_type ,
sys_auth_detail.privilege_value
from sys_auth_detail where sys_auth_detail.auth_id =#{authTypeModel} order by sys_auth_detail.privilege_type desc
</select>
<insert id="copyAuthModel">
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}
</insert>
<update id="authDetailsChange">
UPDATE sys_auth_detail
SET privilege_value = #{privilegeValue}
<where>
auth_id in
<foreach collection='authIds' item='authId' open='(' separator=',' close=')'>#{authId}</foreach>
<if test="privilegeValue == 1">
and privilege_type &lt;= #{privilegeType}
</if>
<if test="privilegeValue == 0">
and privilege_type &gt;= #{privilegeType}
</if>
</where>
</update>
</mapper>

@ -1,14 +0,0 @@
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<XpackSysAuthDetailDTO> search(XpackSysAuthRequest authRequest);
}

@ -1,81 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ipsos.plugins.xpack.mapper.auth.XpackExtSysAuthMapper">
<resultMap id="BaseResultMapAuthDetailDTO" type="com.ipsos.plugins.xpack.auth.dto.response.XpackSysAuthDetailDTO">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="auth_id" jdbcType="VARCHAR" property="authId" />
<result column="privilege_name" jdbcType="VARCHAR" property="privilegeName" />
<result column="privilege_type" jdbcType="INTEGER" property="privilegeType" />
<result column="privilege_value" jdbcType="INTEGER" property="privilegeValue" />
<result column="privilege_extend" jdbcType="VARCHAR" property="privilegeExtend" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="create_user" jdbcType="VARCHAR" property="createUser" />
<result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
<result column="auth_source" jdbcType="VARCHAR" property="authSource" />
<result column="auth_source_type" jdbcType="VARCHAR" property="authSourceType" />
<result column="auth_target" jdbcType="VARCHAR" property="authTarget" />
<result column="auth_target_type" jdbcType="VARCHAR" property="authTargetType" />
</resultMap>
<select id="search" resultMap="BaseResultMapAuthDetailDTO">
select
sys_auth.id,
sys_auth.auth_source,
sys_auth.auth_source_type,
sys_auth.auth_target,
sys_auth.auth_target_type,
sys_auth.auth_time,
sys_auth.auth_details,
sys_auth.auth_user,
sys_auth.update_time,
sys_auth_detail.auth_id,
sys_auth_detail.privilege_name ,
sys_auth_detail.privilege_type ,
sys_auth_detail.privilege_value ,
sys_auth_detail.privilege_extend
from sys_auth left join sys_auth_detail on sys_auth.id = sys_auth_detail.auth_id
<where>
sys_auth_detail.auth_id is not null
<if test="authSources != null and authSources.size > 0">
and sys_auth.auth_source in
<foreach collection="authSources" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="authTargets != null and authTargets.size > 0">
and sys_auth.auth_target in
<foreach collection="authTargets" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="authSource != null">
and sys_auth.auth_source=#{authSource}
</if>
<if test="authSourceType != null">
and sys_auth.auth_source_type=#{authSourceType}
</if>
<if test="authTarget != null">
and sys_auth.auth_target=#{authTarget}
</if>
<if test="authTargetType != null">
and sys_auth.auth_target_type=#{authTargetType}
</if>
</where>
order by sys_auth_detail.privilege_type desc
</select>
<select id="authExist" resultType="Boolean">
select if(count(1)=0,0,1) from sys_auth where auth_source=#{authSource} and auth_target=#{authTarget}
</select>
<select id="findAuthId" resultType="String">
select id from sys_auth where auth_source=#{authSource} and auth_source_type=#{authSourceType} and auth_target=#{authTarget} and auth_target_type=#{authTargetType} limit 1
</select>
</mapper>

@ -1,9 +0,0 @@
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<XpackVAuthModelDTO> searchTree(XpackBaseTreeRequest baseTreeRequest);
}

@ -1,95 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ipsos.plugins.xpack.mapper.auth.XpackExtVAuthModelMapper">
<resultMap id="BaseResultMapDTO" type="com.ipsos.plugins.xpack.auth.dto.response.XpackVAuthModelDTO">
<result column="id" jdbcType="VARCHAR" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="label" jdbcType="VARCHAR" property="label" />
<result column="pid" jdbcType="VARCHAR" property="pid" />
<result column="node_type" jdbcType="VARCHAR" property="nodeType" />
<result column="model_type" jdbcType="VARCHAR" property="modelType" />
<result column="model_inner_type" jdbcType="VARCHAR" property="modelInnerType" />
<result column="auth_type" jdbcType="VARCHAR" property="authType" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="children_count" property="childrenCount"/>
<result column="leaf" property="leaf"/>
</resultMap>
<!-- 函数嵌套会导致循环调用函数 导致查询速度变慢 所有预先经需要嵌套查询的函数分解查询-->
<select id="searchTree" resultMap="BaseResultMapDTO">
SELECT
auth.id, auth.`name`, auth.`label`,
auth.pid, auth.node_type, auth.model_type,
auth.model_inner_type, auth.auth_type, auth.create_by,
authCount.children_count AS children_count,
IF
(( authCount.children_count > 0 ), 0, 1 ) AS leaf
FROM (select get_grant_auths (#{modelType},#{createBy}) c_auth_ids) t1,
( SELECT * FROM (select GET_V_AUTH_MODEL_WITH_PARENT(get_grant_auths (#{modelType},#{createBy}),#{modelType}) c_auth_parent_ids) t2,
<if test="withExtend == 'parent' and id != null">
(select GET_V_AUTH_MODEL_WITH_PARENT(#{id},#{modelType}) c_model_parent_ids) tmp,
</if>
<if test="withExtend == 'children' and id != null">
(select GET_V_AUTH_MODEL_WITH_CHILDREN(#{id},#{modelType}) c_model_children_ids) tmc,
</if>
<if test="name != null and name !='' and withExtend == 'parent'">
(select GET_V_AUTH_MODEL_WITH_PARENT ( (select GROUP_CONCAT(id) from
v_auth_model where model_type = #{modelType} and `name` like CONCAT('%', #{name},'%')) ,#{modelType}) c_model_parent_seartch_ids) tmsc,
</if>
v_auth_model
<where>
model_type = #{modelType}
<if test="1== withAuth">
and FIND_IN_SET(v_auth_model.id,c_auth_parent_ids)
</if>
<if test="pid !=null">
and v_auth_model.pid = #{pid}
</if>
<if test="withExtend == null and id != null">
and v_auth_model.id = #{id}
</if>
<if test="withExtend == 'parent' and id != null">
and FIND_IN_SET(v_auth_model.id,c_model_parent_ids)
</if>
<if test="withExtend == 'children' and id != null">
and FIND_IN_SET(v_auth_model.id,c_model_children_ids)
</if>
<if test="name != null and name !='' and withExtend == 'parent'">
and FIND_IN_SET(v_auth_model.id,c_model_parent_seartch_ids)
</if>
<if test="name != null and name =='' and withExtend == 'parent'">
and v_auth_model.pid = '0'
</if>
</where>
) auth
LEFT JOIN (
SELECT
count( 1 ) AS `children_count`,
`authTemp`.`pid` AS `pid`
FROM
( SELECT * FROM (select GET_V_AUTH_MODEL_WITH_PARENT(get_grant_auths (#{modelType},#{createBy}),#{modelType}) cids3) t3,v_auth_model
<where>
model_type = #{modelType}
<if test="1== withAuth">
and FIND_IN_SET(v_auth_model.id,cids3)
</if>
</where>
) authTemp
GROUP BY
authTemp.pid
) authCount ON
auth.id = authCount.pid
<where>
<if test="1== withAuth">
(authCount.children_count>0 or FIND_IN_SET(auth.id,c_auth_ids) )
</if>
</where>
</select>
</mapper>

@ -1,31 +0,0 @@
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<XpackSysAuthDetail> 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);
}

@ -1,291 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ipsos.plugins.xpack.mapper.auth.XpackSysAuthDetailMapper">
<resultMap id="BaseResultMap" type="com.ipsos.plugins.xpack.auth.dto.response.XpackSysAuthDetail">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="auth_id" jdbcType="VARCHAR" property="authId" />
<result column="privilege_name" jdbcType="VARCHAR" property="privilegeName" />
<result column="privilege_type" jdbcType="INTEGER" property="privilegeType" />
<result column="privilege_value" jdbcType="INTEGER" property="privilegeValue" />
<result column="privilege_extend" jdbcType="VARCHAR" property="privilegeExtend" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="create_user" jdbcType="VARCHAR" property="createUser" />
<result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, auth_id, privilege_name, privilege_type, privilege_value, privilege_extend, remark,
create_user, create_time, update_time
</sql>
<select id="selectByExample" parameterType="com.ipsos.plugins.xpack.auth.entity.XpackSysAuthDetailExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from sys_auth_detail
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from sys_auth_detail
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from sys_auth_detail
where id = #{id,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.ipsos.plugins.xpack.auth.entity.XpackSysAuthDetailExample">
delete from sys_auth_detail
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ipsos.plugins.xpack.auth.dto.response.XpackSysAuthDetail">
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>
<insert id="insertSelective" parameterType="com.ipsos.plugins.xpack.auth.dto.response.XpackSysAuthDetail">
insert into sys_auth_detail
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="authId != null">
auth_id,
</if>
<if test="privilegeName != null">
privilege_name,
</if>
<if test="privilegeType != null">
privilege_type,
</if>
<if test="privilegeValue != null">
privilege_value,
</if>
<if test="privilegeExtend != null">
privilege_extend,
</if>
<if test="remark != null">
remark,
</if>
<if test="createUser != null">
create_user,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="authId != null">
#{authId,jdbcType=VARCHAR},
</if>
<if test="privilegeName != null">
#{privilegeName,jdbcType=VARCHAR},
</if>
<if test="privilegeType != null">
#{privilegeType,jdbcType=INTEGER},
</if>
<if test="privilegeValue != null">
#{privilegeValue,jdbcType=INTEGER},
</if>
<if test="privilegeExtend != null">
#{privilegeExtend,jdbcType=VARCHAR},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="createUser != null">
#{createUser,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=BIGINT},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=BIGINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ipsos.plugins.xpack.auth.entity.XpackSysAuthDetailExample" resultType="java.lang.Long">
select count(*) from sys_auth_detail
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update sys_auth_detail
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.authId != null">
auth_id = #{record.authId,jdbcType=VARCHAR},
</if>
<if test="record.privilegeName != null">
privilege_name = #{record.privilegeName,jdbcType=VARCHAR},
</if>
<if test="record.privilegeType != null">
privilege_type = #{record.privilegeType,jdbcType=INTEGER},
</if>
<if test="record.privilegeValue != null">
privilege_value = #{record.privilegeValue,jdbcType=INTEGER},
</if>
<if test="record.privilegeExtend != null">
privilege_extend = #{record.privilegeExtend,jdbcType=VARCHAR},
</if>
<if test="record.remark != null">
remark = #{record.remark,jdbcType=VARCHAR},
</if>
<if test="record.createUser != null">
create_user = #{record.createUser,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=BIGINT},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=BIGINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
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}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.ipsos.plugins.xpack.auth.dto.response.XpackSysAuthDetail">
update sys_auth_detail
<set>
<if test="authId != null">
auth_id = #{authId,jdbcType=VARCHAR},
</if>
<if test="privilegeName != null">
privilege_name = #{privilegeName,jdbcType=VARCHAR},
</if>
<if test="privilegeType != null">
privilege_type = #{privilegeType,jdbcType=INTEGER},
</if>
<if test="privilegeValue != null">
privilege_value = #{privilegeValue,jdbcType=INTEGER},
</if>
<if test="privilegeExtend != null">
privilege_extend = #{privilegeExtend,jdbcType=VARCHAR},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="createUser != null">
create_user = #{createUser,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=BIGINT},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.ipsos.plugins.xpack.auth.dto.response.XpackSysAuthDetail">
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}
</update>
</mapper>

@ -1,30 +0,0 @@
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<XpackSysAuth> selectByExample(XpackSysAuthExample example);
long countByExample(XpackSysAuthExample example);
int updateByExampleSelective(@Param("record") XpackSysAuth record, @Param("example") XpackSysAuthExample example);
}

@ -1,276 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ipsos.plugins.xpack.mapper.auth.XpackSysAuthMapper">
<resultMap id="BaseResultMap" type="com.ipsos.plugins.xpack.auth.dto.response.XpackSysAuth">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="auth_source" jdbcType="VARCHAR" property="authSource" />
<result column="auth_source_type" jdbcType="VARCHAR" property="authSourceType" />
<result column="auth_target" jdbcType="VARCHAR" property="authTarget" />
<result column="auth_target_type" jdbcType="VARCHAR" property="authTargetType" />
<result column="auth_time" jdbcType="BIGINT" property="authTime" />
<result column="auth_details" jdbcType="VARCHAR" property="authDetails" />
<result column="auth_user" jdbcType="VARCHAR" property="authUser" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, auth_source, auth_source_type, auth_target, auth_target_type, auth_time, auth_details,
auth_user, update_time
</sql>
<select id="selectByExample" parameterType="com.ipsos.plugins.xpack.auth.entity.XpackSysAuthExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from sys_auth
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from sys_auth
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from sys_auth
where id = #{id,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.ipsos.plugins.xpack.auth.entity.XpackSysAuthExample">
delete from sys_auth
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ipsos.plugins.xpack.auth.dto.response.XpackSysAuth">
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>
<insert id="insertSelective" parameterType="com.ipsos.plugins.xpack.auth.dto.response.XpackSysAuth">
insert into sys_auth
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="authSource != null">
auth_source,
</if>
<if test="authSourceType != null">
auth_source_type,
</if>
<if test="authTarget != null">
auth_target,
</if>
<if test="authTargetType != null">
auth_target_type,
</if>
<if test="authTime != null">
auth_time,
</if>
<if test="authDetails != null">
auth_details,
</if>
<if test="authUser != null">
auth_user,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="authSource != null">
#{authSource,jdbcType=VARCHAR},
</if>
<if test="authSourceType != null">
#{authSourceType,jdbcType=VARCHAR},
</if>
<if test="authTarget != null">
#{authTarget,jdbcType=VARCHAR},
</if>
<if test="authTargetType != null">
#{authTargetType,jdbcType=VARCHAR},
</if>
<if test="authTime != null">
#{authTime,jdbcType=BIGINT},
</if>
<if test="authDetails != null">
#{authDetails,jdbcType=VARCHAR},
</if>
<if test="authUser != null">
#{authUser,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ipsos.plugins.xpack.auth.entity.XpackSysAuthExample" resultType="java.lang.Long">
select count(*) from sys_auth
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update sys_auth
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.authSource != null">
auth_source = #{record.authSource,jdbcType=VARCHAR},
</if>
<if test="record.authSourceType != null">
auth_source_type = #{record.authSourceType,jdbcType=VARCHAR},
</if>
<if test="record.authTarget != null">
auth_target = #{record.authTarget,jdbcType=VARCHAR},
</if>
<if test="record.authTargetType != null">
auth_target_type = #{record.authTargetType,jdbcType=VARCHAR},
</if>
<if test="record.authTime != null">
auth_time = #{record.authTime,jdbcType=BIGINT},
</if>
<if test="record.authDetails != null">
auth_details = #{record.authDetails,jdbcType=VARCHAR},
</if>
<if test="record.authUser != null">
auth_user = #{record.authUser,jdbcType=VARCHAR},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
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}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.ipsos.plugins.xpack.auth.dto.response.XpackSysAuth">
update sys_auth
<set>
<if test="authSource != null">
auth_source = #{authSource,jdbcType=VARCHAR},
</if>
<if test="authSourceType != null">
auth_source_type = #{authSourceType,jdbcType=VARCHAR},
</if>
<if test="authTarget != null">
auth_target = #{authTarget,jdbcType=VARCHAR},
</if>
<if test="authTargetType != null">
auth_target_type = #{authTargetType,jdbcType=VARCHAR},
</if>
<if test="authTime != null">
auth_time = #{authTime,jdbcType=BIGINT},
</if>
<if test="authDetails != null">
auth_details = #{authDetails,jdbcType=VARCHAR},
</if>
<if test="authUser != null">
auth_user = #{authUser,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.ipsos.plugins.xpack.auth.dto.response.XpackSysAuth">
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}
</update>
</mapper>

@ -1,23 +0,0 @@
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<XpackVAuthModel> selectByExample(XpackVAuthModelExample var1);
}

@ -1,223 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ipsos.plugins.xpack.mapper.auth.XpackVAuthModelMapper">
<resultMap id="BaseResultMap" type="com.ipsos.plugins.xpack.auth.dto.response.XpackVAuthModel">
<result column="id" jdbcType="VARCHAR" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="label" jdbcType="VARCHAR" property="label" />
<result column="pid" jdbcType="VARCHAR" property="pid" />
<result column="node_type" jdbcType="VARCHAR" property="nodeType" />
<result column="model_type" jdbcType="VARCHAR" property="modelType" />
<result column="model_inner_type" jdbcType="VARCHAR" property="modelInnerType" />
<result column="auth_type" jdbcType="VARCHAR" property="authType" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, `name`, `label`, pid, node_type, model_type, model_inner_type, auth_type, create_by
</sql>
<select id="selectByExample" parameterType="com.ipsos.plugins.xpack.auth.entity.XpackVAuthModelExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from v_auth_model
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<delete id="deleteByExample" parameterType="com.ipsos.plugins.xpack.auth.entity.XpackVAuthModelExample">
delete from v_auth_model
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ipsos.plugins.xpack.auth.dto.response.XpackVAuthModel">
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>
<insert id="insertSelective" parameterType="com.ipsos.plugins.xpack.auth.dto.response.XpackVAuthModel">
insert into v_auth_model
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="name != null">
`name`,
</if>
<if test="label != null">
`label`,
</if>
<if test="pid != null">
pid,
</if>
<if test="nodeType != null">
node_type,
</if>
<if test="modelType != null">
model_type,
</if>
<if test="modelInnerType != null">
model_inner_type,
</if>
<if test="authType != null">
auth_type,
</if>
<if test="createBy != null">
create_by,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="label != null">
#{label,jdbcType=VARCHAR},
</if>
<if test="pid != null">
#{pid,jdbcType=VARCHAR},
</if>
<if test="nodeType != null">
#{nodeType,jdbcType=VARCHAR},
</if>
<if test="modelType != null">
#{modelType,jdbcType=VARCHAR},
</if>
<if test="modelInnerType != null">
#{modelInnerType,jdbcType=VARCHAR},
</if>
<if test="authType != null">
#{authType,jdbcType=VARCHAR},
</if>
<if test="createBy != null">
#{createBy,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ipsos.plugins.xpack.auth.entity.XpackVAuthModelExample" resultType="java.lang.Long">
select count(*) from v_auth_model
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update v_auth_model
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.name != null">
`name` = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.label != null">
`label` = #{record.label,jdbcType=VARCHAR},
</if>
<if test="record.pid != null">
pid = #{record.pid,jdbcType=VARCHAR},
</if>
<if test="record.nodeType != null">
node_type = #{record.nodeType,jdbcType=VARCHAR},
</if>
<if test="record.modelType != null">
model_type = #{record.modelType,jdbcType=VARCHAR},
</if>
<if test="record.modelInnerType != null">
model_inner_type = #{record.modelInnerType,jdbcType=VARCHAR},
</if>
<if test="record.authType != null">
auth_type = #{record.authType,jdbcType=VARCHAR},
</if>
<if test="record.createBy != null">
create_by = #{record.createBy,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
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}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
</mapper>

@ -1,29 +0,0 @@
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<PluginSimpleTreeNode> allNodes();
@Delete({"<script> delete from sys_dept where dept_id in <foreach collection='ids' item='id' open='(' separator=',' close=')'>#{id}</foreach> </script>"})
int batchDelete(@Param("ids") List<Long> var1);
List<PluginSimpleTreeNode> 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({"<script> update sys_user set dept_id = 0 where dept_id in <foreach collection='ids' item='id' open='(' separator=',' close=')'>#{id}</foreach> </script>"})
int updateUserDeptId(@Param("ids") List<Long> var1);
@Update({" update sys_dept set sub_count = sub_count+1 where dept_id = #{deptId} "})
int incrementalSubcount(@Param("deptId") Long var1);
}

@ -1,48 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.ipsos.plugins.xpack.mapper.dept.XpackExtDeptMapper">
<resultMap id="simpleNode" type="com.ipsos.common.dto.PluginSimpleTreeNode">
<id property="id" column="id" javaType="java.lang.Long" />
<result property="pid" column="pid" javaType="java.lang.Long"/>
</resultMap>
<sql id="gridCondition">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<select id="allNodes" resultMap="simpleNode">
select dept_id as id, pid from sys_dept
</select>
<select id="nodesByExample" parameterType="com.ipsos.common.entity.XpackGridExample" resultMap="simpleNode">
select dept_id as id, pid from sys_dept
<include refid="gridCondition" />
</select>
</mapper>

@ -1,31 +0,0 @@
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<XpackSysDept> 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);
}

@ -1,275 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ipsos.plugins.xpack.mapper.dept.XpackSysDeptMapper">
<resultMap id="BaseResultMap" type="com.ipsos.plugins.xpack.dept.dto.response.XpackSysDept">
<id column="dept_id" jdbcType="BIGINT" property="deptId" />
<result column="pid" jdbcType="BIGINT" property="pid" />
<result column="sub_count" jdbcType="INTEGER" property="subCount" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="dept_sort" jdbcType="INTEGER" property="deptSort" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
<result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
dept_id, pid, sub_count, `name`, dept_sort, create_by, update_by, create_time, update_time
</sql>
<select id="selectByExample" parameterType="com.ipsos.plugins.xpack.dept.entity.XpackSysDeptExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from sys_dept
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from sys_dept
where dept_id = #{deptId,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from sys_dept
where dept_id = #{deptId,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.ipsos.plugins.xpack.dept.entity.XpackSysDeptExample">
delete from sys_dept
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ipsos.plugins.xpack.dept.dto.response.XpackSysDept">
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>
<insert id="insertSelective" parameterType="com.ipsos.plugins.xpack.dept.dto.response.XpackSysDept">
insert into sys_dept
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="deptId != null">
dept_id,
</if>
<if test="pid != null">
pid,
</if>
<if test="subCount != null">
sub_count,
</if>
<if test="name != null">
`name`,
</if>
<if test="deptSort != null">
dept_sort,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="updateBy != null">
update_by,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="deptId != null">
#{deptId,jdbcType=BIGINT},
</if>
<if test="pid != null">
#{pid,jdbcType=BIGINT},
</if>
<if test="subCount != null">
#{subCount,jdbcType=INTEGER},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="deptSort != null">
#{deptSort,jdbcType=INTEGER},
</if>
<if test="createBy != null">
#{createBy,jdbcType=VARCHAR},
</if>
<if test="updateBy != null">
#{updateBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=BIGINT},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=BIGINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ipsos.plugins.xpack.dept.entity.XpackSysDeptExample" resultType="java.lang.Long">
select count(*) from sys_dept
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update sys_dept
<set>
<if test="record.deptId != null">
dept_id = #{record.deptId,jdbcType=BIGINT},
</if>
<if test="record.pid != null">
pid = #{record.pid,jdbcType=BIGINT},
</if>
<if test="record.subCount != null">
sub_count = #{record.subCount,jdbcType=INTEGER},
</if>
<if test="record.name != null">
`name` = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.deptSort != null">
dept_sort = #{record.deptSort,jdbcType=INTEGER},
</if>
<if test="record.createBy != null">
create_by = #{record.createBy,jdbcType=VARCHAR},
</if>
<if test="record.updateBy != null">
update_by = #{record.updateBy,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=BIGINT},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=BIGINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
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}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.ipsos.plugins.xpack.dept.dto.response.XpackSysDept">
update sys_dept
<set>
<if test="pid != null">
pid = #{pid,jdbcType=BIGINT},
</if>
<if test="subCount != null">
sub_count = #{subCount,jdbcType=INTEGER},
</if>
<if test="name != null">
`name` = #{name,jdbcType=VARCHAR},
</if>
<if test="deptSort != null">
dept_sort = #{deptSort,jdbcType=INTEGER},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=VARCHAR},
</if>
<if test="updateBy != null">
update_by = #{updateBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=BIGINT},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=BIGINT},
</if>
</set>
where dept_id = #{deptId,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ipsos.plugins.xpack.dept.dto.response.XpackSysDept">
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}
</update>
</mapper>

@ -1,15 +0,0 @@
package com.ipsos.plugins.xpack.mapper.role;
import com.ipsos.common.entity.XpackGridExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface XpackExtRoleMapper {
int deleteUserMapping(@Param("roleId") Long roleId);
List query(XpackGridExample example);
List queryAll();
int deleteMenuMapping(@Param("roleId") Long roleId);
}

@ -1,73 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.ipsos.plugins.xpack.mapper.role.XpackExtRoleMapper">
<resultMap id="xpackRoleItemMap" type="com.ipsos.plugins.xpack.role.dto.response.XpackRoleItemDto">
<id property="id" column="id"/>
<result property="name" column="name"/>
</resultMap>
<sql id="gridCondition">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<select id="query" parameterType="com.ipsos.common.entity.XpackGridExample" resultMap="com.ipsos.plugins.xpack.mapper.role.XpackSysRoleMapper.BaseResultMap">
select r.*
from sys_role r
<if test="_parameter != null">
<include refid="gridCondition" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
<if test="orderByClause == null">
order by r.update_time desc
</if>
</select>
<delete id="deleteMenuMapping">
delete from sys_roles_menus where role_id = #{roleId}
</delete>
<delete id="deleteUserMapping">
delete from sys_users_roles where role_id = #{roleId}
</delete>
<select id="queryAll" resultMap="xpackRoleItemMap">
select role_id as id, name from sys_role
</select>
</mapper>

@ -1,30 +0,0 @@
package com.ipsos.plugins.xpack.mapper.role;
import com.ipsos.plugins.xpack.role.entity.XpackSysRole;
import com.ipsos.plugins.xpack.role.entity.XpackSysRoleExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface XpackSysRoleMapper {
int updateByPrimaryKeySelective(XpackSysRole role);
long countByExample(XpackSysRoleExample example);
int insertSelective(XpackSysRole role);
int updateByExample(@Param("record") XpackSysRole record, @Param("example") XpackSysRoleExample example);
int deleteByPrimaryKey(Long roleId);
int insert(XpackSysRole sysRole);
int deleteByExample(XpackSysRoleExample example);
List selectByExample(XpackSysRoleExample example);
int updateByPrimaryKey(XpackSysRole role);
int updateByExampleSelective(@Param("record") XpackSysRole record, @Param("example") XpackSysRoleExample example);
XpackSysRole selectByPrimaryKey(Long roleId);
}

@ -1,243 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ipsos.plugins.xpack.mapper.role.XpackSysRoleMapper">
<resultMap id="BaseResultMap" type="com.ipsos.plugins.xpack.role.entity.XpackSysRole">
<id column="role_id" jdbcType="BIGINT" property="roleId" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
<result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
role_id, `name`, description, create_by, update_by, create_time, update_time
</sql>
<select id="selectByExample" parameterType="com.ipsos.plugins.xpack.role.entity.XpackSysRoleExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from sys_role
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from sys_role
where role_id = #{roleId,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from sys_role
where role_id = #{roleId,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.ipsos.plugins.xpack.role.entity.XpackSysRoleExample">
delete from sys_role
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ipsos.plugins.xpack.role.entity.XpackSysRole">
insert into sys_role (role_id, `name`, description,
create_by, update_by, create_time,
update_time)
values (#{roleId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR},
#{createBy,jdbcType=VARCHAR}, #{updateBy,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT},
#{updateTime,jdbcType=BIGINT})
</insert>
<insert id="insertSelective" parameterType="com.ipsos.plugins.xpack.role.entity.XpackSysRole">
insert into sys_role
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="roleId != null">
role_id,
</if>
<if test="name != null">
`name`,
</if>
<if test="description != null">
description,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="updateBy != null">
update_by,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="roleId != null">
#{roleId,jdbcType=BIGINT},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="description != null">
#{description,jdbcType=VARCHAR},
</if>
<if test="createBy != null">
#{createBy,jdbcType=VARCHAR},
</if>
<if test="updateBy != null">
#{updateBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=BIGINT},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=BIGINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ipsos.plugins.xpack.role.entity.XpackSysRoleExample" resultType="java.lang.Long">
select count(*) from sys_role
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update sys_role
<set>
<if test="record.roleId != null">
role_id = #{record.roleId,jdbcType=BIGINT},
</if>
<if test="record.name != null">
`name` = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.description != null">
description = #{record.description,jdbcType=VARCHAR},
</if>
<if test="record.createBy != null">
create_by = #{record.createBy,jdbcType=VARCHAR},
</if>
<if test="record.updateBy != null">
update_by = #{record.updateBy,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=BIGINT},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=BIGINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update sys_role
set role_id = #{record.roleId,jdbcType=BIGINT},
`name` = #{record.name,jdbcType=VARCHAR},
description = #{record.description,jdbcType=VARCHAR},
create_by = #{record.createBy,jdbcType=VARCHAR},
update_by = #{record.updateBy,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.ipsos.plugins.xpack.role.entity.XpackSysRole">
update sys_role
<set>
<if test="name != null">
`name` = #{name,jdbcType=VARCHAR},
</if>
<if test="description != null">
description = #{description,jdbcType=VARCHAR},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=VARCHAR},
</if>
<if test="updateBy != null">
update_by = #{updateBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=BIGINT},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=BIGINT},
</if>
</set>
where role_id = #{roleId,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ipsos.plugins.xpack.role.entity.XpackSysRole">
update sys_role
set `name` = #{name,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR},
create_by = #{createBy,jdbcType=VARCHAR},
update_by = #{updateBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT}
where role_id = #{roleId,jdbcType=BIGINT}
</update>
</mapper>

Binary file not shown.

@ -280,15 +280,15 @@ export default {
//
const chart = this.myChart
this.setBackGroundBorder()
if (
option.series &&
option.series.length > 0 &&
option.series[0].type === 'gauge'
) {
if (option.series[0].data && option.series[0].data.length > 0) {
option.series[0].max = option.series[0].data[0].value
}
}
// if (
// option.series &&
// option.series.length > 0 &&
// option.series[0].type === 'gauge'
// ) {
// if (option.series[0].data && option.series[0].data.length > 0) {
// option.series[0].max = option.series[0].data[0].value
// }
// }
console.log('哈哈哈', option)
setTimeout(chart.setOption(option, true), 500)
window.onresize = function() {

@ -174,7 +174,6 @@ export default {
const yAxis = JSON.parse(this.chart.yaxis)
if (yAxis && yAxis.length > 0) {
yAxis.forEach((item) => {
console.log(11, item)
if (item.summary == 'ratio') {
this.chart.data.tableRow.forEach((tableRow) => {
console.log(33, tableRow)
@ -183,8 +182,6 @@ export default {
}
})
}
console.log(321123, yAxis)
console.log(123123, this.chart)
datas = JSON.parse(JSON.stringify(this.chart.data.tableRow))
if (this.chart.type === 'table-info') {
//
@ -340,7 +337,7 @@ export default {
) {
const values = data.map((item) => {
let a = item[column.property]
if (a.indexOf('%') >= 0) {
if (a.indexOf && a.indexOf('%') >= 0) {
a = a.replace('%', '')
isRatio = true
}
@ -361,6 +358,8 @@ export default {
? means[columnIndex].toFixed(2)
: means[columnIndex]
if (isRatio) {
means[columnIndex] =
means[columnIndex] > 100 ? 100 : means[columnIndex]
means[columnIndex] += '%'
}
} else {

Loading…
Cancel
Save