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

pull/197/head
RuoYi 2020-08-05 14:21:31 +08:00
parent 4a64a9269a
commit c0c62001a9
7 changed files with 11 additions and 11 deletions

View File

@ -61,7 +61,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="checkConfigKeyUnique" parameterType="String" resultMap="SysConfigResult">
<include refid="selectConfigVo"/>
where config_key = #{configKey}
where config_key = #{configKey} limit 1
</select>
<insert id="insertConfig" parameterType="SysConfig">

View File

@ -65,7 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="checkDeptNameUnique" resultMap="SysDeptResult">
<include refid="selectDeptVo"/>
where dept_name=#{deptName} and parent_id = #{parentId}
where dept_name=#{deptName} and parent_id = #{parentId} limit 1
</select>
<select id="selectDeptById" parameterType="Long" resultMap="SysDeptResult">

View File

@ -57,7 +57,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="checkDictTypeUnique" parameterType="String" resultMap="SysDictTypeResult">
<include refid="selectDictTypeVo"/>
where dict_type = #{dictType}
where dict_type = #{dictType} limit 1
</select>
<delete id="deleteDictTypeById" parameterType="Long">

View File

@ -123,7 +123,7 @@
<select id="checkMenuNameUnique" parameterType="SysMenu" resultMap="SysMenuResult">
<include refid="selectMenuVo"/>
where menu_name=#{menuName} and parent_id = #{parentId}
where menu_name=#{menuName} and parent_id = #{parentId} limit 1
</select>
<update id="updateMenu" parameterType="SysMenu">

View File

@ -56,12 +56,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="checkPostNameUnique" parameterType="String" resultMap="SysPostResult">
<include refid="selectPostVo"/>
where post_name=#{postName}
where post_name=#{postName} limit 1
</select>
<select id="checkPostCodeUnique" parameterType="String" resultMap="SysPostResult">
<include refid="selectPostVo"/>
where post_code=#{postCode}
where post_code=#{postCode} limit 1
</select>
<delete id="deletePostByIds" parameterType="Long">

View File

@ -70,12 +70,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="checkRoleNameUnique" parameterType="String" resultMap="SysRoleResult">
<include refid="selectRoleVo"/>
where r.role_name=#{roleName}
where r.role_name=#{roleName} limit 1
</select>
<select id="checkRoleKeyUnique" parameterType="String" resultMap="SysRoleResult">
<include refid="selectRoleVo"/>
where r.role_key=#{roleKey}
where r.role_key=#{roleKey} limit 1
</select>
<delete id="deleteRoleById" parameterType="Long">

View File

@ -134,15 +134,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="checkLoginNameUnique" parameterType="String" resultType="int">
select count(1) from sys_user where login_name=#{loginName}
select count(1) from sys_user where login_name=#{loginName} limit 1
</select>
<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 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 id="selectUserById" parameterType="Long" resultMap="SysUserResult">