根据不同用户渲染不同的界面

   1      先引入工具类

 

public class Tree {
   /**
    * 节点ID
    */
   private String id;
   /**
    * 显示节点文本
    */
   private String text;
   /**
    * 节点状态,open closed
    */
   private Map state;
   /**
    * 节点是否被选中 true false
    */
   private boolean checked = false;
   /**
    * 节点属性
    */
   private Map attributes;

   /**
    * 节点的子节点
    */
   private List> children = new ArrayList>();

   /**
    * 父ID
    */
   private String parentId;
   /**
    * 是否有父节点
    */
   private boolean hasParent = false;
   /**
    * 是否有子节点
    */
   private boolean hasChildren = false;

   public String getId() {
      return id;
   }

   public void setId(String id) {
      this.id = id;
   }

   public String getText() {
      return text;
   }

   public void setText(String text) {
      this.text = text;
   }

   public Map getState() {
      return state;
   }

   public void setState(Map state) {
      this.state = state;
   }

   public boolean isChecked() {
      return checked;
   }

   public void setChecked(boolean checked) {
      this.checked = checked;
   }

   public Map getAttributes() {
      return attributes;
   }

   public void setAttributes(Map attributes) {
      this.attributes = attributes;
   }

   public List> getChildren() {
      return children;
   }

   public void setChildren(List> children) {
      this.children = children;
   }

   public boolean isHasParent() {
      return hasParent;
   }

   public void setHasParent(boolean isParent) {
      this.hasParent = isParent;
   }

   public boolean isHasChildren() {
      return hasChildren;
   }

   public void setChildren(boolean isChildren) {
      this.hasChildren = isChildren;
   }

   public String getParentId() {
      return parentId;
   }

   public void setParentId(String parentId) {
      this.parentId = parentId;
   }

   public Tree(String id, String text, Map state, boolean checked, Map attributes,
            List> children, boolean isParent, boolean isChildren, String parentID) {
      super();
      this.id = id;
      this.text = text;
      this.state = state;
      this.checked = checked;
      this.attributes = attributes;
      this.children = children;
      this.hasParent = isParent;
      this.hasChildren = isChildren;
      this.parentId = parentID;
   }

   public Tree() {
      super();
   }

   @Override
   public String toString() {

      return JSON.toJSONString(this);
   }

}

注: 需要在pom文件中引入json

 


   com.alibaba
   fastjson

2   service

 

//根据ids 查询多条权限
List queryAuthorityByIds(String ids);

 

3   serviceimpl

 

//根据ids查询多条权限
@Override
public List queryAuthorityByIds(String ids) {
    return authorityMapper.queryAuthorityByIds(ids);
}
 

4   dao 

 

//根据Authorityids 查询多条权限
List queryAuthorityByIds(String ids);

 

5   mapper