<?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="cn.autoform.fw.mapper.UserManMapper" >
|
<cache eviction="FIFO" flushInterval="60000" size="512" readOnly="true"/>
|
<select id="findByUsername" resultType="cn.autoform.bean.User" parameterType="cn.autoform.bean.User" useCache="true">
|
select * from user where username = #{username}
|
</select>
|
|
<insert id = "insert" parameterType="cn.autoform.bean.User" flushCache="true">
|
insert into user(id,username,password,email,lastPasswordResetDate) values (#{id},#{username},#{password},#{email},current_timestamp())
|
</insert>
|
|
<select id="findRolesByUserID" resultType="java.lang.String" parameterType="cn.autoform.bean.User" useCache="true">
|
select
|
tb2.role
|
from
|
user tb0 inner join rolemanagement tb1
|
on tb0.id = tb1.user_id
|
inner join role tb2
|
on tb1.role_id = tb2.id
|
where tb0.id = #{id}
|
</select>
|
|
<select id="findAll" resultType="cn.autoform.bean.User" useCache="true">
|
select * from user
|
</select>
|
|
</mapper>
|