配置数据库、编写SQL语句和基础类
This commit is contained in:
23
src/main/resources/mapper/UserMapper.xml
Normal file
23
src/main/resources/mapper/UserMapper.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?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="top.fjy8018.shiro.mapper.UserMapper">
|
||||
|
||||
<resultMap id="userMap" type="top.fjy8018.shiro.dataobject.User" >
|
||||
<id property="uid" column="uid"/>
|
||||
<result property="username" column="username" />
|
||||
<result property="password" column="password" />
|
||||
<collection property="roles" ofType="top.fjy8018.shiro.dataobject.Role">
|
||||
<id property="rid" column="rid" />
|
||||
<result property="rname" column="rname" />
|
||||
<collection property="permission" ofType="top.fjy8018.shiro.dataobject.Permission">
|
||||
<id property="pid" column="pid" />
|
||||
<result property="name" column="name" />
|
||||
<result property="url" column="url" />
|
||||
</collection>
|
||||
</collection>
|
||||
</resultMap>
|
||||
|
||||
<select id="findByUsername" parameterType="string" resultMap="userMap">
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user