forest/src/main/java/mapper/RoleMapper.xml

29 lines
1.4 KiB
XML
Raw Normal View History

2019-11-16 09:58:40 +08:00
<?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.rymcu.vertical.mapper.RoleMapper">
<resultMap id="BaseResultMap" type="com.rymcu.vertical.entity.Role">
<!--
WARNING - @mbg.generated
-->
2019-11-16 20:11:38 +08:00
<id column="id" jdbcType="INTEGER" property="idRole"/>
<result column="name" jdbcType="VARCHAR" property="name"/>
<result column="input_code" jdbcType="VARCHAR" property="inputCode"/>
<result column="created_time" jdbcType="TIMESTAMP" property="createdTime"/>
<result column="updated_time" jdbcType="TIMESTAMP" property="updatedTime"/>
<result column="status" jdbcType="INTEGER" property="status"/>
2019-11-16 09:58:40 +08:00
</resultMap>
<resultMap id="RoleDTOResultMap" type="com.rymcu.vertical.dto.RoleDTO">
2019-11-16 20:11:38 +08:00
<id column="id" property="id"></id>
<result column="name" property="name"/>
<result column="input_code" property="inputCode"/>
<result column="menu_ids" property="menuIds"/>
2019-11-16 09:58:40 +08:00
</resultMap>
2019-11-16 20:11:38 +08:00
<select id="selectRoleByIdUser" resultMap="BaseResultMap">
select sr.* from vertical_user_role sur left join vertical_role sr on sur.id_role = sr.id where id_user = #{id}
2019-11-16 09:58:40 +08:00
</select>
2019-11-16 20:11:38 +08:00
<select id="selectRoleByInputCode" resultMap="BaseResultMap">
select * from vertical_role where input_code = #{inputCode}
2019-11-16 09:58:40 +08:00
</select>
2019-11-16 20:11:38 +08:00
2019-11-16 09:58:40 +08:00
</mapper>