From 98c2354955d4044ff1eaaa318efd7143bc6b40e7 Mon Sep 17 00:00:00 2001 From: xuxueli <931591021@qq.com> Date: Wed, 8 May 2019 21:03:58 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=88=97=E8=A1=A8=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E6=A0=B9=E6=8D=AE=E8=A7=92=E8=89=B2=E7=AD=9B=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/xxl/job/admin/controller/UserController.java | 6 +++--- .../main/java/com/xxl/job/admin/dao/XxlJobUserDao.java | 6 ++++-- .../main/resources/mybatis-mapper/XxlJobUserMapper.xml | 6 ++++++ .../src/main/resources/static/js/user.index.1.js | 1 + .../src/main/resources/templates/user/user.index.ftl | 10 ++++++++++ 5 files changed, 24 insertions(+), 5 deletions(-) diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/UserController.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/UserController.java index cb5c500c..4b58f84f 100644 --- a/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/UserController.java +++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/controller/UserController.java @@ -50,11 +50,11 @@ public class UserController { @PermessionLimit(adminuser = true) public Map pageList(@RequestParam(required = false, defaultValue = "0") int start, @RequestParam(required = false, defaultValue = "10") int length, - String username) { + String username, int role) { // page list - List list = xxlJobUserDao.pageList(start, length, username); - int list_count = xxlJobUserDao.pageListCount(start, length, username); + List list = xxlJobUserDao.pageList(start, length, username, role); + int list_count = xxlJobUserDao.pageListCount(start, length, username, role); // package result Map maps = new HashMap(); diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/dao/XxlJobUserDao.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/dao/XxlJobUserDao.java index 821ad41a..e8404947 100644 --- a/xxl-job-admin/src/main/java/com/xxl/job/admin/dao/XxlJobUserDao.java +++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/dao/XxlJobUserDao.java @@ -13,10 +13,12 @@ public interface XxlJobUserDao { public List pageList(@Param("offset") int offset, @Param("pagesize") int pagesize, - @Param("username") String username); + @Param("username") String username, + @Param("role") int role); public int pageListCount(@Param("offset") int offset, @Param("pagesize") int pagesize, - @Param("username") String username); + @Param("username") String username, + @Param("role") int role); public XxlJobUser loadByUserName(@Param("username") String username); diff --git a/xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobUserMapper.xml b/xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobUserMapper.xml index 41813801..4c94b761 100644 --- a/xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobUserMapper.xml +++ b/xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobUserMapper.xml @@ -26,6 +26,9 @@ AND t.username like CONCAT(CONCAT('%', #{username}), '%') + + AND t.role = #{role} + ORDER BY username ASC LIMIT #{offset}, #{pagesize} @@ -38,6 +41,9 @@ AND t.username like CONCAT(CONCAT('%', #{username}), '%') + + AND t.role = #{role} + diff --git a/xxl-job-admin/src/main/resources/static/js/user.index.1.js b/xxl-job-admin/src/main/resources/static/js/user.index.1.js index 1887358b..804640ea 100644 --- a/xxl-job-admin/src/main/resources/static/js/user.index.1.js +++ b/xxl-job-admin/src/main/resources/static/js/user.index.1.js @@ -11,6 +11,7 @@ $(function() { data : function ( d ) { var obj = {}; obj.username = $('#username').val(); + obj.role = $('#role').val(); obj.start = d.start; obj.length = d.length; return obj; diff --git a/xxl-job-admin/src/main/resources/templates/user/user.index.ftl b/xxl-job-admin/src/main/resources/templates/user/user.index.ftl index b31d3387..9cdce209 100644 --- a/xxl-job-admin/src/main/resources/templates/user/user.index.ftl +++ b/xxl-job-admin/src/main/resources/templates/user/user.index.ftl @@ -25,6 +25,16 @@
+
+
+ ${I18n.user_role} + +
+
${I18n.user_username}