|
@@ -19,6 +19,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<result property="updateBy" column="update_by" />
|
|
<result property="updateBy" column="update_by" />
|
|
<result property="updateTime" column="update_time" />
|
|
<result property="updateTime" column="update_time" />
|
|
<result property="remark" column="remark" />
|
|
<result property="remark" column="remark" />
|
|
|
|
+ <result property="tenantId" column="tenant_id" />
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectRoleVo">
|
|
<sql id="selectRoleVo">
|
|
@@ -42,6 +43,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<if test="status != null and status != ''">
|
|
<if test="status != null and status != ''">
|
|
AND r.status = #{status}
|
|
AND r.status = #{status}
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="tenantId != null and tenantId != '' and tenantId !=0">
|
|
|
|
+ AND r.tenant_id = #{tenantId}
|
|
|
|
+ </if>
|
|
<if test="roleKey != null and roleKey != ''">
|
|
<if test="roleKey != null and roleKey != ''">
|
|
AND r.role_key like concat('%', #{roleKey}, '%')
|
|
AND r.role_key like concat('%', #{roleKey}, '%')
|
|
</if>
|
|
</if>
|
|
@@ -85,12 +89,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
<select id="checkRoleNameUnique" parameterType="String" resultMap="SysRoleResult">
|
|
<select id="checkRoleNameUnique" parameterType="String" resultMap="SysRoleResult">
|
|
<include refid="selectRoleVo"/>
|
|
<include refid="selectRoleVo"/>
|
|
- where r.role_name=#{roleName} limit 1
|
|
|
|
|
|
+ where r.role_name=#{roleName}
|
|
|
|
+ <if test="tenantId != null and tenantId != '' and tenantId !=0">
|
|
|
|
+ AND r.tenant_id = #{tenantId}
|
|
|
|
+ </if>
|
|
|
|
+ limit 1
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="checkRoleKeyUnique" parameterType="String" resultMap="SysRoleResult">
|
|
<select id="checkRoleKeyUnique" parameterType="String" resultMap="SysRoleResult">
|
|
<include refid="selectRoleVo"/>
|
|
<include refid="selectRoleVo"/>
|
|
- where r.role_key=#{roleKey} limit 1
|
|
|
|
|
|
+ where r.role_key=#{roleKey}
|
|
|
|
+ <if test="tenantId != null and tenantId != '' and tenantId !=0">
|
|
|
|
+ AND r.tenant_id = #{tenantId}
|
|
|
|
+ </if>
|
|
|
|
+ limit 1
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<insert id="insertRole" parameterType="com.usky.system.domain.SysRole" useGeneratedKeys="true" keyProperty="roleId">
|
|
<insert id="insertRole" parameterType="com.usky.system.domain.SysRole" useGeneratedKeys="true" keyProperty="roleId">
|
|
@@ -105,6 +117,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<if test="status != null and status != ''">status,</if>
|
|
<if test="status != null and status != ''">status,</if>
|
|
<if test="remark != null and remark != ''">remark,</if>
|
|
<if test="remark != null and remark != ''">remark,</if>
|
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
|
|
|
+ <if test="tenantId != null and tenantId != '' and tenantId !=0">tenant_id,</if>
|
|
create_time
|
|
create_time
|
|
)values(
|
|
)values(
|
|
<if test="roleId != null and roleId != 0">#{roleId},</if>
|
|
<if test="roleId != null and roleId != 0">#{roleId},</if>
|
|
@@ -117,6 +130,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<if test="status != null and status != ''">#{status},</if>
|
|
<if test="status != null and status != ''">#{status},</if>
|
|
<if test="remark != null and remark != ''">#{remark},</if>
|
|
<if test="remark != null and remark != ''">#{remark},</if>
|
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
|
|
|
+ <if test="tenantId != null and tenantId != '' and tenantId !=0">#{tenantId},</if>
|
|
sysdate()
|
|
sysdate()
|
|
)
|
|
)
|
|
</insert>
|
|
</insert>
|