Commit c81864ce064a90c624efb14cb6fac45685a7c27d
1 parent
a40dbdb170
Exists in
master
and in
8 other branches
platform permission
add return pageinfo
Showing 4 changed files with 36 additions and 1 deletions
- platform-biz-service/src/main/java/com/lyms/platform/permission/dao/UsersMapper.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/UsersServiceImpl.java
- platform-biz-service/src/main/resources/mainOrm/Users.xml
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/UsersController.java
platform-biz-service/src/main/java/com/lyms/platform/permission/dao/UsersMapper.java
View file @
c81864c
platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/UsersServiceImpl.java
View file @
c81864c
| ... | ... | @@ -31,8 +31,12 @@ |
| 31 | 31 | |
| 32 | 32 | @Override |
| 33 | 33 | public List<Users> queryUsers2(UsersQuery query) { |
| 34 | + if (query.getNeed() != null) { | |
| 35 | + query.mysqlBuild(usersMapper.queryUsersCount2(query)); | |
| 36 | + } | |
| 34 | 37 | return usersMapper.queryUsers2(query); |
| 35 | 38 | } |
| 39 | + | |
| 36 | 40 | |
| 37 | 41 | @Override |
| 38 | 42 | public Users getUsersByLoginCenterId(Integer id) { |
platform-biz-service/src/main/resources/mainOrm/Users.xml
View file @
c81864c
| ... | ... | @@ -217,6 +217,37 @@ |
| 217 | 217 | </select> |
| 218 | 218 | |
| 219 | 219 | |
| 220 | + | |
| 221 | + <select id="queryUsersCount2" resultType="int" parameterType="com.lyms.platform.permission.model.UsersQuery"> | |
| 222 | + select count(DISTINCT u.id) | |
| 223 | + from users u LEFT JOIN user_role_maps ur | |
| 224 | + on u.id = ur.user_id | |
| 225 | + where 1=1 | |
| 226 | + <if test="keyword != null and keyword != ''"> | |
| 227 | + and name like CONCAT(#{keyword}, '%') | |
| 228 | + </if> | |
| 229 | + <if test="ksId != null and ksId != ''"> | |
| 230 | + and u.ks_id = #{ksId,jdbcType=INTEGER} | |
| 231 | + </if> | |
| 232 | + <if test="orgId != null and orgId != ''"> | |
| 233 | + and u.org_id = #{orgId,jdbcType=INTEGER} | |
| 234 | + </if> | |
| 235 | + <if test="deptId != null and deptId != ''"> | |
| 236 | + and u.dept_id = #{deptId,jdbcType=INTEGER} | |
| 237 | + </if> | |
| 238 | + <if test="roleId != null and roleId != ''"> | |
| 239 | + and ur.role_id = #{roleId,jdbcType=INTEGER} | |
| 240 | + </if> | |
| 241 | + <if test="yn != null and yn != ''"> | |
| 242 | + and u.yn = #{yn,jdbcType=INTEGER} | |
| 243 | + and ur.yn = #{yn,jdbcType=INTEGER} | |
| 244 | + </if> | |
| 245 | + <if test="type != null and type != ''"> | |
| 246 | + and u.type = #{type,jdbcType=INTEGER} | |
| 247 | + </if> | |
| 248 | + </select> | |
| 249 | + | |
| 250 | + | |
| 220 | 251 | <select id="queryUsersCount" resultType="int" parameterType="com.lyms.platform.permission.model.UsersQuery"> |
| 221 | 252 | select count(1) from users |
| 222 | 253 | <include refid="UsersCondition" /> |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/UsersController.java
View file @
c81864c