init sqserver不支持limit

highway
zhaoxiaolin 1 year ago
parent 8f52b50f92
commit 26ce694217

@ -131,15 +131,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<select id="checkUserNameUnique" parameterType="String" resultMap="SysUserResult"> <select id="checkUserNameUnique" parameterType="String" resultMap="SysUserResult">
select user_id, user_name from sys_user where user_name = #{userName} and del_flag = '0' limit 1 select top 1 user_id, user_name from sys_user where user_name = #{userName} and del_flag = '0'
</select> </select>
<select id="checkPhoneUnique" parameterType="String" resultMap="SysUserResult"> <select id="checkPhoneUnique" parameterType="String" resultMap="SysUserResult">
select user_id, phonenumber from sys_user where phonenumber = #{phonenumber} and del_flag = '0' limit 1 select top 1 user_id, phonenumber from sys_user where phonenumber = #{phonenumber} and del_flag = '0'
</select> </select>
<select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult"> <select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult">
select user_id, email from sys_user where email = #{email} and del_flag = '0' limit 1 select top 1 user_id, email from sys_user where email = #{email} and del_flag = '0'
</select> </select>
<insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId"> <insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">

@ -65,8 +65,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<select id="checkConfigKeyUnique" parameterType="String" resultMap="SysConfigResult"> <select id="checkConfigKeyUnique" parameterType="String" resultMap="SysConfigResult">
<include refid="selectConfigVo"/> select top 1 config_id, config_name, config_key, config_value, config_type, create_by,
where config_key = #{configKey} limit 1 create_time, update_by, update_time, remark
from sys_config
where config_key = #{configKey}
</select> </select>
<insert id="insertConfig" parameterType="SysConfig"> <insert id="insertConfig" parameterType="SysConfig">

@ -69,7 +69,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="hasChildByDeptId" parameterType="Long" resultType="int"> <select id="hasChildByDeptId" parameterType="Long" resultType="int">
select count(1) from sys_dept select count(1) from sys_dept
where del_flag = '0' and parent_id = #{deptId} limit 1 where del_flag = '0' and parent_id = #{deptId}
</select> </select>
<select id="selectChildrenDeptById" parameterType="Long" resultMap="SysDeptResult"> <select id="selectChildrenDeptById" parameterType="Long" resultMap="SysDeptResult">
@ -81,8 +81,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<select id="checkDeptNameUnique" resultMap="SysDeptResult"> <select id="checkDeptNameUnique" resultMap="SysDeptResult">
<include refid="selectDeptVo"/> select top 1 d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader,
where dept_name=#{deptName} and parent_id = #{parentId} and del_flag = '0' limit 1 d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time
from sys_dept d
where dept_name=#{deptName} and parent_id = #{parentId} and del_flag = '0'
</select> </select>
<insert id="insertDept" parameterType="SysDept"> <insert id="insertDept" parameterType="SysDept">

@ -56,8 +56,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<select id="checkDictTypeUnique" parameterType="String" resultMap="SysDictTypeResult"> <select id="checkDictTypeUnique" parameterType="String" resultMap="SysDictTypeResult">
<include refid="selectDictTypeVo"/> select top 1 dict_id, dict_name, dict_type, status, create_by, create_time, remark
where dict_type = #{dictType} limit 1 from sys_dict_type
where dict_type = #{dictType}
</select> </select>
<delete id="deleteDictTypeById" parameterType="Long"> <delete id="deleteDictTypeById" parameterType="Long">

@ -128,8 +128,11 @@
</select> </select>
<select id="checkMenuNameUnique" parameterType="SysMenu" resultMap="SysMenuResult"> <select id="checkMenuNameUnique" parameterType="SysMenu" resultMap="SysMenuResult">
<include refid="selectMenuVo"/> select top 1 menu_id, menu_name, parent_id, order_num, path,
where menu_name=#{menuName} and parent_id = #{parentId} limit 1 component, query, is_frame, is_cache, menu_type,
visible, status, isnull(perms,'') as perms, icon, create_time
from sys_menu
where menu_name=#{menuName} and parent_id = #{parentId}
</select> </select>
<update id="updateMenu" parameterType="SysMenu"> <update id="updateMenu" parameterType="SysMenu">

@ -63,13 +63,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<select id="checkPostNameUnique" parameterType="String" resultMap="SysPostResult"> <select id="checkPostNameUnique" parameterType="String" resultMap="SysPostResult">
<include refid="selectPostVo"/> select top 1 post_id, post_code, post_name, post_sort,
where post_name=#{postName} limit 1 status, create_by, create_time, remark
from sys_post
where post_name=#{postName}
</select> </select>
<select id="checkPostCodeUnique" parameterType="String" resultMap="SysPostResult"> <select id="checkPostCodeUnique" parameterType="String" resultMap="SysPostResult">
<include refid="selectPostVo"/> select top 1 post_id, post_code, post_name, post_sort,
where post_code=#{postCode} limit 1 status, create_by, create_time, remark
from sys_post
where post_code=#{postCode}
</select> </select>
<update id="updatePost" parameterType="SysPost"> <update id="updatePost" parameterType="SysPost">

@ -84,13 +84,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<select id="checkRoleNameUnique" parameterType="String" resultMap="SysRoleResult"> <select id="checkRoleNameUnique" parameterType="String" resultMap="SysRoleResult">
<include refid="selectRoleVo"/> select distinct r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.menu_check_strictly, r.dept_check_strictly,
where r.role_name=#{roleName} and r.del_flag = '0' limit 1 r.status, r.del_flag, r.create_time, r.remark
from sys_role r
left join sys_user_role ur on ur.role_id = r.role_id
left join sys_user u on u.user_id = ur.user_id
left join sys_dept d on u.dept_id = d.dept_id
where r.role_name=#{roleName} and r.del_flag = '0'
</select> </select>
<select id="checkRoleKeyUnique" parameterType="String" resultMap="SysRoleResult"> <select id="checkRoleKeyUnique" parameterType="String" resultMap="SysRoleResult">
<include refid="selectRoleVo"/> select distinct r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.menu_check_strictly, r.dept_check_strictly,
where r.role_key=#{roleKey} and r.del_flag = '0' limit 1 r.status, r.del_flag, r.create_time, r.remark
from sys_role r
left join sys_user_role ur on ur.role_id = r.role_id
left join sys_user u on u.user_id = ur.user_id
left join sys_dept d on u.dept_id = d.dept_id
where r.role_key=#{roleKey} and r.del_flag = '0'
</select> </select>
<insert id="insertRole" parameterType="SysRole" useGeneratedKeys="true" keyProperty="roleId"> <insert id="insertRole" parameterType="SysRole" useGeneratedKeys="true" keyProperty="roleId">

@ -131,15 +131,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<select id="checkUserNameUnique" parameterType="String" resultMap="SysUserResult"> <select id="checkUserNameUnique" parameterType="String" resultMap="SysUserResult">
select user_id, user_name from sys_user where user_name = #{userName} and del_flag = '0' limit 1 select top 1 user_id, user_name from sys_user where user_name = #{userName} and del_flag = '0'
</select> </select>
<select id="checkPhoneUnique" parameterType="String" resultMap="SysUserResult"> <select id="checkPhoneUnique" parameterType="String" resultMap="SysUserResult">
select user_id, phonenumber from sys_user where phonenumber = #{phonenumber} and del_flag = '0' limit 1 select top 1 user_id, phonenumber from sys_user where phonenumber = #{phonenumber} and del_flag = '0'
</select> </select>
<select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult"> <select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult">
select user_id, email from sys_user where email = #{email} and del_flag = '0' limit 1 select top 1 user_id, email from sys_user where email = #{email} and del_flag = '0'
</select> </select>
<insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId"> <insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">

@ -131,15 +131,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<select id="checkUserNameUnique" parameterType="String" resultMap="SysUserResult"> <select id="checkUserNameUnique" parameterType="String" resultMap="SysUserResult">
select user_id, user_name from sys_user where user_name = #{userName} and del_flag = '0' limit 1 select top 1 user_id, user_name from sys_user where user_name = #{userName} and del_flag = '0'
</select> </select>
<select id="checkPhoneUnique" parameterType="String" resultMap="SysUserResult"> <select id="checkPhoneUnique" parameterType="String" resultMap="SysUserResult">
select user_id, phonenumber from sys_user where phonenumber = #{phonenumber} and del_flag = '0' limit 1 select top 1 user_id, phonenumber from sys_user where phonenumber = #{phonenumber} and del_flag = '0'
</select> </select>
<select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult"> <select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult">
select user_id, email from sys_user where email = #{email} and del_flag = '0' limit 1 select top 1 user_id, email from sys_user where email = #{email} and del_flag = '0'
</select> </select>
<insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId"> <insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">

Loading…
Cancel
Save