mirror of
https://github.com/yangzongzhuan/RuoYi.git
synced 2025-10-19 12:07:41 +00:00
优化部分查询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>
|
||||
|
@@ -55,7 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</select>
|
||||
|
||||
<select id="countDictDataByType" resultType="Integer">
|
||||
select count(*) from sys_dict_data where dict_type=#{dictType}
|
||||
select count(1) from sys_dict_data where dict_type=#{dictType}
|
||||
</select>
|
||||
|
||||
<delete id="deleteDictDataById" parameterType="Long">
|
||||
|
@@ -80,7 +80,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</select>
|
||||
|
||||
<select id="selectCountMenuByParentId" resultType="Integer">
|
||||
select count(*) from sys_menu where parent_id=#{menuId}
|
||||
select count(1) from sys_menu where parent_id=#{menuId}
|
||||
</select>
|
||||
|
||||
<select id="checkMenuNameUnique" parameterType="String" resultMap="MenuResult">
|
||||
|
@@ -14,7 +14,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</delete>
|
||||
|
||||
<select id="selectCountRoleMenuByMenuId" resultType="Integer">
|
||||
select count(*) from sys_role_menu where menu_id=#{menuId}
|
||||
select count(1) from sys_role_menu where menu_id=#{menuId}
|
||||
</select>
|
||||
|
||||
<delete id="deleteRoleMenu" parameterType="Long">
|
||||
|
@@ -83,7 +83,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</select>
|
||||
|
||||
<select id="checkLoginNameUnique" parameterType="String" resultType="int">
|
||||
select count(*) from sys_user where login_name=#{loginName}
|
||||
select count(1) from sys_user where login_name=#{loginName}
|
||||
</select>
|
||||
|
||||
<select id="checkPhoneUnique" parameterType="String" resultMap="UserResult">
|
||||
|
@@ -14,7 +14,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</delete>
|
||||
|
||||
<select id="countUserPostById" resultType="Integer">
|
||||
select count(*) from sys_user_post where post_id=#{postId}
|
||||
select count(1) from sys_user_post where post_id=#{postId}
|
||||
</select>
|
||||
|
||||
<delete id="deleteUserPost" parameterType="Long">
|
||||
|
@@ -14,7 +14,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</delete>
|
||||
|
||||
<select id="countUserRoleByRoleId" resultType="Integer">
|
||||
select count(*) from sys_user_role where role_id=#{roleId}
|
||||
select count(1) from sys_user_role where role_id=#{roleId}
|
||||
</select>
|
||||
|
||||
<delete id="deleteUserRole" parameterType="Long">
|
||||
|
Reference in New Issue
Block a user