Skip to content

Commit

Permalink
Optimize query list in DeptMapper.xml
Browse files Browse the repository at this point in the history
  • Loading branch information
wtune authored Jan 10, 2020
1 parent 08efe48 commit 073c92d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
and simple_name like CONCAT('%',#{condition},'%') or full_name like CONCAT('%',#{condition},'%')
</if>
<if test="deptId != null and deptId != ''">
and (dept_id = #{deptId} or dept_id in ( select dept_id from sys_dept where pids like CONCAT('%$[', #{deptId}, '$]%') escape '$' ))
and (dept_id = #{deptId} or pids like CONCAT('%$[', #{deptId}, '$]%') escape '$')
</if>
order by sort ASC
</select>
Expand All @@ -92,7 +92,7 @@
and simple_name like ('%' || #{condition} || '%') or full_name like ('%' || #{condition} || '%')
</if>
<if test="deptId != null and deptId != ''">
and (dept_id = #{deptId} or dept_id in ( select dept_id from sys_dept where pids like '%[' || #{deptId} || ']%' ))
and (dept_id = #{deptId} or pids like '%[' || #{deptId} || ']%')
</if>
order by sort ASC
</select>
Expand Down

0 comments on commit 073c92d

Please sign in to comment.