Explorar el Código

修复查询用户失败问题

java110 hace 6 años
padre
commit
34dd6259ce

+ 25 - 0
java110-db/src/main/resources/mapper/user/UserServiceDaoImplMapper.xml

@@ -571,6 +571,31 @@
                 #{item}
             </foreach>
         </if>
+
+        <if test="name !=null and name != ''">
+            and u.name= #{name}
+        </if>
+        <if test="userName !=null and userName != ''">
+            and u.name= #{userName}
+        </if>
+        <if test="email !=null and email != ''">
+            and u.email= #{email}
+        </if>
+        <if test="password !=null and password != ''">
+            and u.password= #{password}
+        </if>
+        <if test="locationCd !=null and locationCd != ''">
+            and u.location_cd= #{locationCd}
+        </if>
+        <if test="age !=null and age != ''">
+            and u.age= #{age}
+        </if>
+        <if test="sex !=null and sex != ''">
+            and u.sex= #{sex}
+        </if>
+        <if test="tel !=null and tel != ''">
+            and u.tel= #{tel}
+        </if>
         order by u.create_time desc
         <if test="page != -1 and page != null ">
             limit #{page}, #{row}

+ 1 - 1
service-api/src/main/java/com/java110/api/listener/user/UserLoginListener.java

@@ -67,7 +67,7 @@ public class UserLoginListener extends AbstractServiceApiPlusListener {
         UserDto userDto = new UserDto();
         String errorInfo = "";
         if (reqJson.containsKey("userName")) {
-            if (!ValidatorUtil.isMobile(reqJson.getString("userName"))) {//用户临时秘钥登录
+            if (ValidatorUtil.isMobile(reqJson.getString("userName"))) {//用户临时秘钥登录
                 userDto.setTel(reqJson.getString("userName"));
             } else {
                 userDto.setUserName(reqJson.getString("userName"));