Просмотр исходного кода

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

RuoYi лет назад: 5
Родитель
Сommit
f1bc33e80d

+ 1 - 1
ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysConfigMapper.xml

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

+ 1 - 1
ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysDictTypeMapper.xml

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

+ 2 - 2
ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml

@@ -64,12 +64,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
64 64
 	
65 65
 	<select id="checkPostNameUnique" parameterType="String" resultMap="SysPostResult">
66 66
 		<include refid="selectPostVo"/>
67
-		 where post_name=#{postName}
67
+		 where post_name=#{postName} limit 1
68 68
 	</select>
69 69
 	
70 70
 	<select id="checkPostCodeUnique" parameterType="String" resultMap="SysPostResult">
71 71
 		<include refid="selectPostVo"/>
72
-		 where post_code=#{postCode}
72
+		 where post_code=#{postCode} limit 1
73 73
 	</select>
74 74
 	
75 75
 	<update id="updatePost" parameterType="SysPost">

+ 2 - 2
ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml

@@ -80,12 +80,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
80 80
 	
81 81
 	<select id="checkRoleNameUnique" parameterType="String" resultMap="SysRoleResult">
82 82
 		<include refid="selectRoleVo"/>
83
-		 where r.role_name=#{roleName}
83
+		 where r.role_name=#{roleName} limit 1
84 84
 	</select>
85 85
 	
86 86
 	<select id="checkRoleKeyUnique" parameterType="String" resultMap="SysRoleResult">
87 87
 		<include refid="selectRoleVo"/>
88
-		 where r.role_key=#{roleKey}
88
+		 where r.role_key=#{roleKey} limit 1
89 89
 	</select>
90 90
 	
91 91
  	<insert id="insertRole" parameterType="SysRole" useGeneratedKeys="true" keyProperty="roleId">

+ 1 - 1
ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysRoleMenuMapper.xml

@@ -10,7 +10,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
10 10
 	</resultMap>
11 11
 	
12 12
 	<select id="checkMenuExistRole" resultType="Integer">
13
-	    select count(1) from sys_role_menu where menu_id = #{menuId}  
13
+	    select count(1) from sys_role_menu where menu_id = #{menuId}
14 14
 	</select>
15 15
 
16 16
 	<delete id="deleteRoleMenuByRoleId" parameterType="Long">

+ 3 - 3
ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml

@@ -92,15 +92,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
92 92
 	</select>
93 93
 	
94 94
 	<select id="checkUserNameUnique" parameterType="String" resultType="int">
95
-		select count(1) from sys_user where user_name = #{userName}
95
+		select count(1) from sys_user where user_name = #{userName} limit 1
96 96
 	</select>
97 97
 	
98 98
 	<select id="checkPhoneUnique" parameterType="String" resultMap="SysUserResult">
99
-		select user_id, phonenumber from sys_user where phonenumber = #{phonenumber}
99
+		select user_id, phonenumber from sys_user where phonenumber = #{phonenumber} limit 1
100 100
 	</select>
101 101
 	
102 102
 	<select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult">
103
-		select user_id, email from sys_user where email = #{email}
103
+		select user_id, email from sys_user where email = #{email} limit 1
104 104
 	</select>
105 105
 	
106 106
 	<insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId">