|
@@ -24,7 +24,11 @@
|
|
|
|
|
|
<!-- 全查询 -->
|
|
|
<select id="findAll" resultMap="SysRole">
|
|
|
- SELECT * FROM sys_role WHERE del_flag_ = 0 AND tenant_id_ = #{tenantId} ORDER BY upate_time_ DESC
|
|
|
+ SELECT * FROM sys_role WHERE del_flag_ = 0
|
|
|
+ <if test="tenantId != null and tenantId != 0">
|
|
|
+ AND tenant_id_ = #{tenantId}
|
|
|
+ </if>
|
|
|
+ ORDER BY upate_time_ DESC
|
|
|
</select>
|
|
|
|
|
|
<!-- 向数据库增加一条记录 -->
|
|
@@ -65,13 +69,20 @@
|
|
|
|
|
|
<!-- 分页查询 -->
|
|
|
<select id="queryPage" resultMap="SysRole" parameterType="map">
|
|
|
- SELECT * FROM sys_role WHERE del_flag_ = 0 AND tenant_id_ = #{tenantId} ORDER BY update_time_ DESC
|
|
|
+ SELECT * FROM sys_role WHERE del_flag_ = 0
|
|
|
+ <if test="tenantId != null and tenantId != 0">
|
|
|
+ AND tenant_id_ = #{tenantId}
|
|
|
+ </if>
|
|
|
+ ORDER BY update_time_ DESC
|
|
|
<include refid="global.limit"/>
|
|
|
</select>
|
|
|
|
|
|
<!-- 查询当前表的总记录数 -->
|
|
|
<select id="queryCount" resultType="int">
|
|
|
- SELECT COUNT(*) FROM sys_role WHERE del_flag_ = 0 AND tenant_id_ = #{tenantId}
|
|
|
+ SELECT COUNT(*) FROM sys_role WHERE del_flag_ = 0
|
|
|
+ <if test="tenantId != null and tenantId != 0">
|
|
|
+ AND tenant_id_ = #{tenantId}
|
|
|
+ </if>
|
|
|
</select>
|
|
|
|
|
|
<select id="findRoleByUserId" resultMap="SysRole">
|