提交 51fa66f6 编写于 作者: R RuoYi

唯一限制条件只返回单条数据

上级 3b61ed56
...@@ -61,7 +61,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -61,7 +61,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="checkConfigKeyUnique" parameterType="String" resultMap="SysConfigResult"> <select id="checkConfigKeyUnique" parameterType="String" resultMap="SysConfigResult">
<include refid="selectConfigVo"/> <include refid="selectConfigVo"/>
where config_key = #{configKey} where config_key = #{configKey} limit 1
</select> </select>
<insert id="insertConfig" parameterType="SysConfig"> <insert id="insertConfig" parameterType="SysConfig">
......
...@@ -64,7 +64,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -64,7 +64,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} where del_flag = '0' and parent_id = #{deptId} limit 1
</select> </select>
<select id="selectChildrenDeptById" parameterType="Long" resultMap="SysDeptResult"> <select id="selectChildrenDeptById" parameterType="Long" resultMap="SysDeptResult">
......
...@@ -57,7 +57,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -57,7 +57,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="checkDictTypeUnique" parameterType="String" resultMap="SysDictTypeResult"> <select id="checkDictTypeUnique" parameterType="String" resultMap="SysDictTypeResult">
<include refid="selectDictTypeVo"/> <include refid="selectDictTypeVo"/>
where dict_type = #{dictType} where dict_type = #{dictType} limit 1
</select> </select>
<delete id="deleteDictTypeById" parameterType="Long"> <delete id="deleteDictTypeById" parameterType="Long">
......
...@@ -118,7 +118,7 @@ ...@@ -118,7 +118,7 @@
<select id="checkMenuNameUnique" parameterType="SysMenu" resultMap="SysMenuResult"> <select id="checkMenuNameUnique" parameterType="SysMenu" resultMap="SysMenuResult">
<include refid="selectMenuVo"/> <include refid="selectMenuVo"/>
where menu_name=#{menuName} and parent_id = #{parentId} where menu_name=#{menuName} and parent_id = #{parentId} limit 1
</select> </select>
<update id="updateMenu" parameterType="SysMenu"> <update id="updateMenu" parameterType="SysMenu">
......
...@@ -64,12 +64,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -64,12 +64,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="checkPostNameUnique" parameterType="String" resultMap="SysPostResult"> <select id="checkPostNameUnique" parameterType="String" resultMap="SysPostResult">
<include refid="selectPostVo"/> <include refid="selectPostVo"/>
where post_name=#{postName} where post_name=#{postName} limit 1
</select> </select>
<select id="checkPostCodeUnique" parameterType="String" resultMap="SysPostResult"> <select id="checkPostCodeUnique" parameterType="String" resultMap="SysPostResult">
<include refid="selectPostVo"/> <include refid="selectPostVo"/>
where post_code=#{postCode} where post_code=#{postCode} limit 1
</select> </select>
<update id="updatePost" parameterType="SysPost"> <update id="updatePost" parameterType="SysPost">
......
...@@ -80,12 +80,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -80,12 +80,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="checkRoleNameUnique" parameterType="String" resultMap="SysRoleResult"> <select id="checkRoleNameUnique" parameterType="String" resultMap="SysRoleResult">
<include refid="selectRoleVo"/> <include refid="selectRoleVo"/>
where r.role_name=#{roleName} where r.role_name=#{roleName} limit 1
</select> </select>
<select id="checkRoleKeyUnique" parameterType="String" resultMap="SysRoleResult"> <select id="checkRoleKeyUnique" parameterType="String" resultMap="SysRoleResult">
<include refid="selectRoleVo"/> <include refid="selectRoleVo"/>
where r.role_key=#{roleKey} where r.role_key=#{roleKey} limit 1
</select> </select>
<insert id="insertRole" parameterType="SysRole" useGeneratedKeys="true" keyProperty="roleId"> <insert id="insertRole" parameterType="SysRole" useGeneratedKeys="true" keyProperty="roleId">
......
...@@ -10,7 +10,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -10,7 +10,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<select id="checkMenuExistRole" resultType="Integer"> <select id="checkMenuExistRole" resultType="Integer">
select count(1) from sys_role_menu where menu_id = #{menuId} select count(1) from sys_role_menu where menu_id = #{menuId}
</select> </select>
<delete id="deleteRoleMenuByRoleId" parameterType="Long"> <delete id="deleteRoleMenuByRoleId" parameterType="Long">
......
...@@ -92,15 +92,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -92,15 +92,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<select id="checkUserNameUnique" parameterType="String" resultType="int"> <select id="checkUserNameUnique" parameterType="String" resultType="int">
select count(1) from sys_user where user_name = #{userName} select count(1) from sys_user where user_name = #{userName} limit 1
</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} select user_id, phonenumber from sys_user where phonenumber = #{phonenumber} limit 1
</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} select user_id, email from sys_user where email = #{email} limit 1
</select> </select>
<insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId"> <insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册