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

30 lines
1.5 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"/>
2019-12-05 17:29:39 +08:00
<result column="weights" jdbcType="TINYINT" property="weights"/>
2019-11-16 20:11:38 +08:00
<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>
2019-12-05 17:29:39 +08:00
<update id="updateStatus">
update vertical_role set status = #{status},updated_time = sysdate() where id = #{idRole}
</update>
2019-12-05 20:02:13 +08:00
<update id="update">
update vertical_role set name = #{name}, input_code = ${inputCode}, weights = #{weights}, updated_time = sysdate() where id = #{idRole}
</update>
2019-11-16 09:58:40 +08:00
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>