Commit 464a5ac6 authored by liboyang's avatar liboyang

Springboot+Mybatis制证项目修改服务无法启动错误

parent e19b6c86
......@@ -8,15 +8,15 @@ import java.util.List;
public class SystemRoleEntity {
private long roleId;
private String roleName;
private List<SystemMenuEntity> menuEntityList;
public List<SystemMenuEntity> getMenuEntityList() {
return menuEntityList;
}
public void setMenuEntityList(List<SystemMenuEntity> menuEntityList) {
this.menuEntityList = menuEntityList;
}
// private List<SystemMenuEntity> menuEntityList;
//
// public List<SystemMenuEntity> getMenuEntityList() {
// return menuEntityList;
// }
//
// public void setMenuEntityList(List<SystemMenuEntity> menuEntityList) {
// this.menuEntityList = menuEntityList;
// }
@Id
@Column(name = "ROLE_ID")
......
......@@ -10,15 +10,15 @@ public class SystemUserEntity {
private String username;
private String password;
private String workshop;
private List<SystemRoleEntity> roleEntityList;
public List<SystemRoleEntity> getRoleEntityList() {
return roleEntityList;
}
public void setRoleEntityList(List<SystemRoleEntity> roleEntityList) {
this.roleEntityList = roleEntityList;
}
// private List<SystemRoleEntity> roleEntityList;
//
// public List<SystemRoleEntity> getRoleEntityList() {
// return roleEntityList;
// }
//
// public void setRoleEntityList(List<SystemRoleEntity> roleEntityList) {
// this.roleEntityList = roleEntityList;
// }
@Id
@Column(name = "ID")
......
......@@ -9,7 +9,7 @@ import java.util.Map;
public interface SystemUserMapper {
public List<SystemUserEntity> findAll();
public SystemUserEntity selectByUsernameAndPassword(Map<String,String> map);
// public SystemUserEntity selectByUsernameAndPassword(Map<String,String> map);
}
<?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.yx_project.start.mapper.SystemUserMapper">
<!--用户-->
<resultMap id="UserRoleMenuMap" type="com.yx_project.start.entity.SystemUserEntity">
<id property="id" column="id"/>
<result column="username" property="username"/>
<result column="password" property="password"/>
<result column="workshop" property="workshop"/>
<!--角色集合-->
<collection property="roleEntityList" ofType="SystemRoleEntity" column="id" select="selectAllRole"/>
</resultMap>
<!--角色-->
<resultMap id="RoleMap" type="com.yx_project.start.entity.SystemRoleEntity" >
<id column="roleId" property="roleId" />
<result column="roleName" property="roleName"/>
<!--权限集合-->
<collection property="menuEntityList" ofType="SystemMenuEntity" column="id" select="selectAllMenu"/>
</resultMap>
<!--权限-->
<resultMap id="MenuMap" type="com.yx_project.start.entity.SystemMenuEntity" >
<id column="menuId" property="menuId" />
<result column="menu" property="menu"/>
<result column="menuName" property="menuName"/>
</resultMap>
<!--&lt;!&ndash;用户&ndash;&gt;-->
<!--<resultMap id="UserRoleMenuMap" type="com.yx_project.start.entity.SystemUserEntity">-->
<!--<id property="id" column="id"/>-->
<!--<result column="username" property="username"/>-->
<!--<result column="password" property="password"/>-->
<!--<result column="workshop" property="workshop"/>-->
<!--&lt;!&ndash;角色集合&ndash;&gt;-->
<!--<collection property="roleEntityList" ofType="SystemRoleEntity" column="id" select="selectAllRole"/>-->
<!--</resultMap>-->
<!--&lt;!&ndash;角色&ndash;&gt;-->
<!--<resultMap id="RoleMap" type="com.yx_project.start.entity.SystemRoleEntity" >-->
<!--<id column="roleId" property="roleId" />-->
<!--<result column="roleName" property="roleName"/>-->
<!--&lt;!&ndash;权限集合&ndash;&gt;-->
<!--<collection property="menuEntityList" ofType="SystemMenuEntity" column="id" select="selectAllMenu"/>-->
<!--</resultMap>-->
<!--&lt;!&ndash;权限&ndash;&gt;-->
<!--<resultMap id="MenuMap" type="com.yx_project.start.entity.SystemMenuEntity" >-->
<!--<id column="menuId" property="menuId" />-->
<!--<result column="menu" property="menu"/>-->
<!--<result column="menuName" property="menuName"/>-->
<!--</resultMap>-->
<select id="findAll" resultType="SystemUserEntity">
select * from "SYSTEM_USER"
</select>
<!--根据角色id查询权限(先从角色权限关联表查询角色id相等,在查询权限id,根据权限id在权限表里查询权限)-->
<select id="selectAllMenu" resultType="com.yx_project.start.entity.SystemMenuEntity" parameterType="java.lang.Integer">
select menuId,menuName from SYSTEM_MENU where menuId in (select SYSTEM_ROLE_MENU.ROLE_MENU_ID from SYSTEM_ROLE_MENU where SYSTEM_ROLE_MENU.ROLE_ID=#{id})
</select>
<!--&lt;!&ndash;根据角色id查询权限(先从角色权限关联表查询角色id相等,在查询权限id,根据权限id在权限表里查询权限)&ndash;&gt;-->
<!--<select id="selectAllMenu" resultType="com.yx_project.start.entity.SystemMenuEntity" parameterType="java.lang.Integer">-->
<!--select menuId,menuName from SYSTEM_MENU where menuId in (select SYSTEM_ROLE_MENU.ROLE_MENU_ID from SYSTEM_ROLE_MENU where SYSTEM_ROLE_MENU.ROLE_ID=#{id})-->
<!--</select>-->
<!--查询所有角色-->
<select id="selectAllRole" resultMap="RoleMap" parameterType="java.lang.Integer">
select roleId,roleName from SYSTEM_ROLE where roleId in (select "SYSTEM_USER".ROLE_ID from "SYSTEM_USER" where "SYSTEM_USER".id=#{id})
</select>
<!--&lt;!&ndash;查询所有角色&ndash;&gt;-->
<!--<select id="selectAllRole" resultMap="RoleMap" parameterType="java.lang.Integer">-->
<!--select roleId,roleName from SYSTEM_ROLE where roleId in (select "SYSTEM_USER".ROLE_ID from "SYSTEM_USER" where "SYSTEM_USER".id=#{id})-->
<!--</select>-->
<!--通过用户名密码查询用户-->
<select id="selectByUsernameAndPassword" resultMap="UserRoleMenuMap" parameterType="Map">
select * from user where username=#{username} AND password = #{password}
</select>
<!--&lt;!&ndash;通过用户名密码查询用户&ndash;&gt;-->
<!--<select id="selectByUsernameAndPassword" resultMap="UserRoleMenuMap" parameterType="Map">-->
<!--select * from user where username=#{username} AND password = #{password}-->
<!--</select>-->
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment