Commit 464a5ac6 authored by liboyang's avatar liboyang

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

parent e19b6c86
...@@ -8,15 +8,15 @@ import java.util.List; ...@@ -8,15 +8,15 @@ import java.util.List;
public class SystemRoleEntity { public class SystemRoleEntity {
private long roleId; private long roleId;
private String roleName; private String roleName;
private List<SystemMenuEntity> menuEntityList; // private List<SystemMenuEntity> menuEntityList;
//
public List<SystemMenuEntity> getMenuEntityList() { // public List<SystemMenuEntity> getMenuEntityList() {
return menuEntityList; // return menuEntityList;
} // }
//
public void setMenuEntityList(List<SystemMenuEntity> menuEntityList) { // public void setMenuEntityList(List<SystemMenuEntity> menuEntityList) {
this.menuEntityList = menuEntityList; // this.menuEntityList = menuEntityList;
} // }
@Id @Id
@Column(name = "ROLE_ID") @Column(name = "ROLE_ID")
......
...@@ -10,15 +10,15 @@ public class SystemUserEntity { ...@@ -10,15 +10,15 @@ public class SystemUserEntity {
private String username; private String username;
private String password; private String password;
private String workshop; private String workshop;
private List<SystemRoleEntity> roleEntityList; // private List<SystemRoleEntity> roleEntityList;
//
public List<SystemRoleEntity> getRoleEntityList() { // public List<SystemRoleEntity> getRoleEntityList() {
return roleEntityList; // return roleEntityList;
} // }
//
public void setRoleEntityList(List<SystemRoleEntity> roleEntityList) { // public void setRoleEntityList(List<SystemRoleEntity> roleEntityList) {
this.roleEntityList = roleEntityList; // this.roleEntityList = roleEntityList;
} // }
@Id @Id
@Column(name = "ID") @Column(name = "ID")
......
...@@ -9,7 +9,7 @@ import java.util.Map; ...@@ -9,7 +9,7 @@ import java.util.Map;
public interface SystemUserMapper { public interface SystemUserMapper {
public List<SystemUserEntity> findAll(); 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" ?> <?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" > <!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"> <mapper namespace="com.yx_project.start.mapper.SystemUserMapper">
<!--用户--> <!--&lt;!&ndash;用户&ndash;&gt;-->
<resultMap id="UserRoleMenuMap" type="com.yx_project.start.entity.SystemUserEntity"> <!--<resultMap id="UserRoleMenuMap" type="com.yx_project.start.entity.SystemUserEntity">-->
<id property="id" column="id"/> <!--<id property="id" column="id"/>-->
<result column="username" property="username"/> <!--<result column="username" property="username"/>-->
<result column="password" property="password"/> <!--<result column="password" property="password"/>-->
<result column="workshop" property="workshop"/> <!--<result column="workshop" property="workshop"/>-->
<!--角色集合--> <!--&lt;!&ndash;角色集合&ndash;&gt;-->
<collection property="roleEntityList" ofType="SystemRoleEntity" column="id" select="selectAllRole"/> <!--<collection property="roleEntityList" ofType="SystemRoleEntity" column="id" select="selectAllRole"/>-->
</resultMap> <!--</resultMap>-->
<!--角色--> <!--&lt;!&ndash;角色&ndash;&gt;-->
<resultMap id="RoleMap" type="com.yx_project.start.entity.SystemRoleEntity" > <!--<resultMap id="RoleMap" type="com.yx_project.start.entity.SystemRoleEntity" >-->
<id column="roleId" property="roleId" /> <!--<id column="roleId" property="roleId" />-->
<result column="roleName" property="roleName"/> <!--<result column="roleName" property="roleName"/>-->
<!--权限集合--> <!--&lt;!&ndash;权限集合&ndash;&gt;-->
<collection property="menuEntityList" ofType="SystemMenuEntity" column="id" select="selectAllMenu"/> <!--<collection property="menuEntityList" ofType="SystemMenuEntity" column="id" select="selectAllMenu"/>-->
</resultMap> <!--</resultMap>-->
<!--权限--> <!--&lt;!&ndash;权限&ndash;&gt;-->
<resultMap id="MenuMap" type="com.yx_project.start.entity.SystemMenuEntity" > <!--<resultMap id="MenuMap" type="com.yx_project.start.entity.SystemMenuEntity" >-->
<id column="menuId" property="menuId" /> <!--<id column="menuId" property="menuId" />-->
<result column="menu" property="menu"/> <!--<result column="menu" property="menu"/>-->
<result column="menuName" property="menuName"/> <!--<result column="menuName" property="menuName"/>-->
</resultMap> <!--</resultMap>-->
<select id="findAll" resultType="SystemUserEntity"> <select id="findAll" resultType="SystemUserEntity">
select * from "SYSTEM_USER" select * from "SYSTEM_USER"
</select> </select>
<!--根据角色id查询权限(先从角色权限关联表查询角色id相等,在查询权限id,根据权限id在权限表里查询权限)--> <!--&lt;!&ndash;根据角色id查询权限(先从角色权限关联表查询角色id相等,在查询权限id,根据权限id在权限表里查询权限)&ndash;&gt;-->
<select id="selectAllMenu" resultType="com.yx_project.start.entity.SystemMenuEntity" parameterType="java.lang.Integer"> <!--<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 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>-->
<!--查询所有角色--> <!--&lt;!&ndash;查询所有角色&ndash;&gt;-->
<select id="selectAllRole" resultMap="RoleMap" parameterType="java.lang.Integer"> <!--<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 roleId,roleName from SYSTEM_ROLE where roleId in (select "SYSTEM_USER".ROLE_ID from "SYSTEM_USER" where "SYSTEM_USER".id=#{id})-->
</select> <!--</select>-->
<!--通过用户名密码查询用户--> <!--&lt;!&ndash;通过用户名密码查询用户&ndash;&gt;-->
<select id="selectByUsernameAndPassword" resultMap="UserRoleMenuMap" parameterType="Map"> <!--<select id="selectByUsernameAndPassword" resultMap="UserRoleMenuMap" parameterType="Map">-->
select * from user where username=#{username} AND password = #{password} <!--select * from user where username=#{username} AND password = #{password}-->
</select> <!--</select>-->
</mapper> </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