Commit 9257cea4 authored by 赵啸非's avatar 赵啸非

添加角色列表携带menuIds

parent aaec0c39
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
<result property="createUserName" column="createUserName" /> <result property="createUserName" column="createUserName" />
<result property="lastLoginTime" column="lastLoginTime" /> <result property="lastLoginTime" column="lastLoginTime" />
<result property="lastLoginAddress" column="lastLoginAddress" /> <result property="lastLoginAddress" column="lastLoginAddress" />
<result property="roleIds" column="roleIds" /> <result property="roleId" column="roleId" />
<result property="roleNames" column="roleNames" /> <result property="roleName" column="roleName" />
</resultMap> </resultMap>
<!-- 获取列表 --> <!-- 获取列表 -->
...@@ -91,11 +91,11 @@ ...@@ -91,11 +91,11 @@
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('lastLoginAddress') or colPickMode == 1 and data.containsKey('lastLoginAddress')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('lastLoginAddress') or colPickMode == 1 and data.containsKey('lastLoginAddress')))">
a.lastLoginAddress, a.lastLoginAddress,
</if> </if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('roleIds') or colPickMode == 1 and data.containsKey('roleIds')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('roleId') or colPickMode == 1 and data.containsKey('roleId')))">
a.roleIds, a.roleId,
</if> </if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('roleNames') or colPickMode == 1 and data.containsKey('roleNames')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('roleName') or colPickMode == 1 and data.containsKey('roleName')))">
a.roleNames, a.roleName,
</if> </if>
</trim> </trim>
</sql> </sql>
...@@ -104,8 +104,8 @@ ...@@ -104,8 +104,8 @@
select <include refid="_columnsExt"/> select <include refid="_columnsExt"/>
from ( from (
SELECT SELECT
u.*, group_concat(r.id) AS roleIds, u.*, group_concat(r.id) AS roleId,
group_concat(r. NAME) AS roleNames group_concat(r. NAME) AS roleName
FROM FROM
mortals_xhx_user u mortals_xhx_user u
LEFT JOIN mortals_xhx_role_user ru ON u.id = ru.userId LEFT JOIN mortals_xhx_role_user ru ON u.id = ru.userId
...@@ -120,7 +120,7 @@ ...@@ -120,7 +120,7 @@
<if test="condition != null and !condition.isEmpty()"> <if test="condition != null and !condition.isEmpty()">
<if test="condition.containsKey('roleId')"> <if test="condition.containsKey('roleId')">
<if test="condition.roleId != null"> <if test="condition.roleId != null">
and find_in_set(#{condition.roleId}, a.roleIds) and find_in_set(#{condition.roleId}, a.roleId)
</if> </if>
</if> </if>
</if> </if>
...@@ -135,8 +135,8 @@ ...@@ -135,8 +135,8 @@
select count(1) select count(1)
from ( from (
SELECT SELECT
u.*, group_concat(r.id) AS roleIds, u.*, group_concat(r.id) AS roleId,
group_concat(r. NAME) AS roleNames group_concat(r. NAME) AS roleName
FROM FROM
mortals_xhx_user u mortals_xhx_user u
LEFT JOIN mortals_xhx_role_user ru ON u.id = ru.userId LEFT JOIN mortals_xhx_role_user ru ON u.id = ru.userId
...@@ -151,7 +151,7 @@ ...@@ -151,7 +151,7 @@
<if test="condition != null and !condition.isEmpty()"> <if test="condition != null and !condition.isEmpty()">
<if test="condition.containsKey('roleId')"> <if test="condition.containsKey('roleId')">
<if test="condition.roleId != null"> <if test="condition.roleId != null">
and find_in_set(#{condition.roleId}, a.roleIds) and find_in_set(#{condition.roleId}, a.roleId)
</if> </if>
</if> </if>
</if> </if>
......
...@@ -7,10 +7,16 @@ Content-Type: application/json ...@@ -7,10 +7,16 @@ Content-Type: application/json
{ {
"page":1, "page":1,
"size":10, "size":10,
"roleId":"2", "roleId":"4",
"orConditionList":[ "orConditionList":[
{ {
"loginName":"test" "loginName":"test1"
},
{
"realName":"111"
},
{
"mobile":"13281114856"
} }
] ]
} }
...@@ -22,8 +28,8 @@ Authorization: {{authToken}} ...@@ -22,8 +28,8 @@ Authorization: {{authToken}}
Content-Type: application/json Content-Type: application/json
{ {
"loginName":"test", "loginName":"test1",
"loginPwd":"test", "loginPwd":"test1",
"realName":"测试", "realName":"测试",
"mobile":"13281114856", "mobile":"13281114856",
"roleId": "1", "roleId": "1",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment