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}