Mybatis 标签使用。




	
	
	
	
		
		
		
		
		 
	
	
	
		
		
		
		
		
		
		
	


其实就是返回类型为其引用的id的   标签所定义的。

往这个标签定义的 ‘类’ 的 list 属性中设置值, 如何设置值? 还要根据其 select="selectAuthority"  , 把值查询出来。

 

Mybatis 标签使用。_第1张图片

 

 

package com.sailod.shiro.dto;

import java.util.List;

/**
 * 查询菜单用到dto
 * 
 *
 */
public class HtAuthorityMenuDTO {
	

	private String name;
	
	private Long htAuthorityId;
	
	private Long currentUserId;
	
	private List htAuthorityDTO;

	public Long getHtAuthorityId() {
		return htAuthorityId;
	}

	public void setHtAuthorityId(Long htAuthorityId) {
		this.htAuthorityId = htAuthorityId;
	}

	

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public List getHtAuthorityDTO() {
		return htAuthorityDTO;
	}

	public void setHtAuthorityDTO(List htAuthorityDTO) {
		this.htAuthorityDTO = htAuthorityDTO;
	}

	public Long getCurrentUserId() {
		return currentUserId;
	}

	public void setCurrentUserId(Long currentUserId) {
		this.currentUserId = currentUserId;
	}
	
	
}


 

package com.sailod.shiro.dto;

/**
 * 查询菜单用到dto
 * 
 *
 */
public class HtAuthorityDTO {
	
	//这个权限的主键
	private Long htAuthorityId;
	//父菜单的主键
	private Long pid;
	
	private String name;
	
	private String url;
	//类型
	private String type;
	
	private String permission;
	
	private Long currUserId;
	
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public Long getHtAuthorityId() {
		return htAuthorityId;
	}

	public void setHtAuthorityId(Long htAuthorityId) {
		this.htAuthorityId = htAuthorityId;
	}

	public Long getPid() {
		return pid;
	}

	public void setPid(Long pid) {
		this.pid = pid;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getPermission() {
		return permission;
	}

	public void setPermission(String permission) {
		this.permission = permission;
	}

	public Long getCurrUserId() {
		return currUserId;
	}

	public void setCurrUserId(Long currUserId) {
		this.currUserId = currUserId;
	}

	
	
	
}


 

 

 

 低效率 collection:

 

Mybatis 标签使用。_第2张图片

 

 

 

高效率collection,  

1 查询用联合查询

2

Mybatis 标签使用。_第3张图片

你可能感兴趣的:(Java,JavaWeb)