优化部分查询SQL
This commit is contained in:
@ -41,11 +41,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</select>
|
||||
|
||||
<select id="checkDeptExistUser" parameterType="Long" resultType="int">
|
||||
select count(*) from sys_user where dept_id = #{deptId} and del_flag = '0'
|
||||
select count(1) from sys_user where dept_id = #{deptId} and del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id="selectDeptCount" parameterType="Dept" resultType="int">
|
||||
select count(*) from sys_dept
|
||||
select count(1) from sys_dept
|
||||
<where>
|
||||
<if test="deptId != null and deptId != 0"> and dept_id = #{deptId} </if>
|
||||
<if test="parentId != null and parentId != 0"> and parent_id = #{parentId} </if>
|
||||
|
Reference in New Issue
Block a user