crud/main/resources/com/mapper/RoleMapper.xml

25 lines
756 B
XML

<?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.mapper.RoleMapper">
<select id="findAll" resultType="com.domain.Role">
select * from sys_role
</select>
<insert id="save">
insert into sys_role values(null ,#{roleName},#{roleDesc})
</insert>
<select id="findRoleByUserId" resultType="role">
select * from sys_user_role ur,sys_role r
where ur.roleId=r.id and ur.userId=#{id}
</select>
<delete id="del">
delete from sys_user where id=#{id}
</delete>
<delete id="delUserRoleRel">
delete from sys_user_rol where roleId=#{id}
</delete>
</mapper>