|
|
@ -65,6 +65,9 @@ |
|
|
|
-- 自连接,通过 father_id 关联父角色 |
|
|
|
LEFT JOIN role father ON r.father_id = father.id |
|
|
|
<where> |
|
|
|
<if test="roleName != null and roleName != ''"> |
|
|
|
r.role_name LIKE CONCAT('%', #{roleName}, '%') |
|
|
|
</if> |
|
|
|
<!-- 判断 market 是否不为总部且 markets 不为空 --> |
|
|
|
<if test="markets != null and markets.size() > 0 and '总部' not in markets"> |
|
|
|
AND r.market IN |
|
|
@ -72,9 +75,6 @@ |
|
|
|
#{market} |
|
|
|
</foreach> |
|
|
|
</if> |
|
|
|
<if test="roleName != null and roleName != ''"> |
|
|
|
r.role_name LIKE CONCAT('%', #{roleName}, '%') |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
ORDER BY r.priority DESC |
|
|
|
</select> |
|
|
|