|
@@ -5,6 +5,7 @@
|
|
<sql id="includeUserRole">
|
|
<sql id="includeUserRole">
|
|
ur.id id,
|
|
ur.id id,
|
|
ur.id role_id,
|
|
ur.id role_id,
|
|
|
|
+ ur.role_sign role_sign,
|
|
ur.role_name role_name,
|
|
ur.role_name role_name,
|
|
COALESCE(ur.role_description, '') role_description,
|
|
COALESCE(ur.role_description, '') role_description,
|
|
COALESCE(ur.login_default_page, '') login_default_page,
|
|
COALESCE(ur.login_default_page, '') login_default_page,
|
|
@@ -14,6 +15,7 @@
|
|
<resultMap id="resultMapUserRole" type="java.util.LinkedHashMap">
|
|
<resultMap id="resultMapUserRole" type="java.util.LinkedHashMap">
|
|
<id property="id" column="id" jdbcType="BIGINT" />
|
|
<id property="id" column="id" jdbcType="BIGINT" />
|
|
<result property="role_id" column="role_id" javaType="java.lang.Long"/>
|
|
<result property="role_id" column="role_id" javaType="java.lang.Long"/>
|
|
|
|
+ <result property="role_sign" column="role_sign" />
|
|
<result property="role_name" column="role_name" />
|
|
<result property="role_name" column="role_name" />
|
|
<result property="role_description" column="role_description" />
|
|
<result property="role_description" column="role_description" />
|
|
<result property="login_default_page" column="login_default_page" />
|
|
<result property="login_default_page" column="login_default_page" />
|
|
@@ -27,6 +29,9 @@
|
|
LEFT JOIN sys_user_role_relation urr ON ur.id = urr.role_id
|
|
LEFT JOIN sys_user_role_relation urr ON ur.id = urr.role_id
|
|
LEFT JOIN sys_user us ON us.id = urr.user_id
|
|
LEFT JOIN sys_user us ON us.id = urr.user_id
|
|
<where>
|
|
<where>
|
|
|
|
+ <if test="role_sign != null and role_sign != ''">
|
|
|
|
+ AND ur.role_sign = #{role_sign}
|
|
|
|
+ </if>
|
|
<if test="role_name != null and role_name != ''">
|
|
<if test="role_name != null and role_name != ''">
|
|
AND ur.role_name LIKE CONCAT('%', #{role_name}, '%')
|
|
AND ur.role_name LIKE CONCAT('%', #{role_name}, '%')
|
|
</if>
|
|
</if>
|
|
@@ -41,12 +46,14 @@
|
|
<!-- 获得用户角色 (部分字段) -->
|
|
<!-- 获得用户角色 (部分字段) -->
|
|
<resultMap id="resultMapUserRoleSimple" type="java.util.LinkedHashMap">
|
|
<resultMap id="resultMapUserRoleSimple" type="java.util.LinkedHashMap">
|
|
<result property="role_id" column="role_id" javaType="java.lang.Long" />
|
|
<result property="role_id" column="role_id" javaType="java.lang.Long" />
|
|
|
|
+ <result property="role_sign" column="role_sign" />
|
|
<result property="role_name" column="role_name" />
|
|
<result property="role_name" column="role_name" />
|
|
<result property="login_default_page" column="login_default_page" />
|
|
<result property="login_default_page" column="login_default_page" />
|
|
</resultMap>
|
|
</resultMap>
|
|
<select id="selectRoleByUserId" resultMap="resultMapUserRoleSimple">
|
|
<select id="selectRoleByUserId" resultMap="resultMapUserRoleSimple">
|
|
SELECT
|
|
SELECT
|
|
surr.role_id role_id,
|
|
surr.role_id role_id,
|
|
|
|
+ sur.role_sign role_sign,
|
|
sur.role_name role_name,
|
|
sur.role_name role_name,
|
|
sur.login_default_page login_default_page
|
|
sur.login_default_page login_default_page
|
|
FROM sys_user_role_relation surr
|
|
FROM sys_user_role_relation surr
|
|
@@ -58,10 +65,12 @@
|
|
<!-- 创建 用户角色 -->
|
|
<!-- 创建 用户角色 -->
|
|
<insert id="insertUserRole" parameterType="com.backendsys.entity.System.SysUserRoleDTO" useGeneratedKeys="true" keyProperty="id">
|
|
<insert id="insertUserRole" parameterType="com.backendsys.entity.System.SysUserRoleDTO" useGeneratedKeys="true" keyProperty="id">
|
|
INSERT INTO sys_user_role (role_name
|
|
INSERT INTO sys_user_role (role_name
|
|
|
|
+ <if test="role_sign != null">, role_sign</if>
|
|
<if test="role_description != null">, role_description</if>
|
|
<if test="role_description != null">, role_description</if>
|
|
<if test="sort != null">, sort</if>
|
|
<if test="sort != null">, sort</if>
|
|
<if test="status != null">, status</if>
|
|
<if test="status != null">, status</if>
|
|
) VALUES (#{role_name}
|
|
) VALUES (#{role_name}
|
|
|
|
+ <if test="role_sign != null">, #{role_sign}</if>
|
|
<if test="role_description != null">, #{role_description}</if>
|
|
<if test="role_description != null">, #{role_description}</if>
|
|
<if test="sort != null">, #{sort}</if>
|
|
<if test="sort != null">, #{sort}</if>
|
|
<if test="status != null">, #{status}</if>
|
|
<if test="status != null">, #{status}</if>
|
|
@@ -80,6 +89,7 @@
|
|
<update id="updateUserRole" parameterType="com.backendsys.entity.System.SysUserRoleDTO">
|
|
<update id="updateUserRole" parameterType="com.backendsys.entity.System.SysUserRoleDTO">
|
|
UPDATE sys_user_role SET
|
|
UPDATE sys_user_role SET
|
|
<trim suffixOverrides="," suffix=" ">
|
|
<trim suffixOverrides="," suffix=" ">
|
|
|
|
+ <if test="role_sign != null and role_sign != ''">role_sign = #{role_sign},</if>
|
|
<if test="role_name != null and role_name != ''">role_name = #{role_name},</if>
|
|
<if test="role_name != null and role_name != ''">role_name = #{role_name},</if>
|
|
<if test="role_description != null and role_description != ''">role_description = #{role_description},</if>
|
|
<if test="role_description != null and role_description != ''">role_description = #{role_description},</if>
|
|
<if test="sort != null and sort != ''">sort = #{sort},</if>
|
|
<if test="sort != null and sort != ''">sort = #{sort},</if>
|