From f01bb5966a55bd35754476c11d9c8afa6bc7f659 Mon Sep 17 00:00:00 2001
From: 疯狂的狮子li <15040126243@163.com>
Date: 星期四, 13 五月 2021 21:25:51 +0800
Subject: [PATCH] update 使用 MP 分页工具 重构业务

---
 ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml
index dca0ec0..2e7162f 100644
--- a/ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml
@@ -39,6 +39,29 @@
                  left join sys_dept d on u.dept_id = d.dept_id
     </sql>
 
+    <select id="selectPageRoleList" parameterType="SysRole" resultMap="SysRoleResult">
+        <include refid="selectRoleVo"/>
+        where r.del_flag = '0'
+        <if test="role.roleName != null and role.roleName != ''">
+            AND r.role_name like concat('%', #{role.roleName}, '%')
+        </if>
+        <if test="role.status != null and role.status != ''">
+            AND r.status = #{role.status}
+        </if>
+        <if test="role.roleKey != null and role.roleKey != ''">
+            AND r.role_key like concat('%', #{role.roleKey}, '%')
+        </if>
+        <if test="role.params.beginTime != null and role.params.beginTime != ''"><!-- 寮�濮嬫椂闂存绱� -->
+            and date_format(r.create_time,'%y%m%d') &gt;= date_format(#{role.params.beginTime},'%y%m%d')
+        </if>
+        <if test="role.params.endTime != null and role.params.endTime != ''"><!-- 缁撴潫鏃堕棿妫�绱� -->
+            and date_format(r.create_time,'%y%m%d') &lt;= date_format(#{role.params.endTime},'%y%m%d')
+        </if>
+        <!-- 鏁版嵁鑼冨洿杩囨护 -->
+        ${role.params.dataScope}
+        order by r.role_sort
+    </select>
+
     <select id="selectRoleList" parameterType="SysRole" resultMap="SysRoleResult">
         <include refid="selectRoleVo"/>
         where r.del_flag = '0'

--
Gitblit v1.9.3