Commit 6f47a7b6 authored by 王夏晖's avatar 王夏晖

修改bug

parent 3a9fe5b5
...@@ -41,11 +41,15 @@ public interface UserRepository extends BaseMapper<SysUser>{ ...@@ -41,11 +41,15 @@ public interface UserRepository extends BaseMapper<SysUser>{
* 查询所有用户 * 查询所有用户
* @return * @return
*/ */
@Select("<script>select a.USER_ID,a.USER_NM,a.USER_TP,b.* from sys_user a left join ${stable} b on a.USER_ID = b.USER_ID where" + @Select("<script>select a.USER_ID,a.USER_NM,a.USER_TP " +
" 1=1" + "<if test=\"stable != null\">,b.*</if> " +
"from sys_user a " +
"<if test=\"stable != null\">left join ${stable} b on a.USER_ID = b.USER_ID </if> " +
"where 1=1" +
"<if test = \"userTp=='1'.toString()\"> and (user_tp = '1' or user_tp = '2')</if>" + "<if test = \"userTp=='1'.toString()\"> and (user_tp = '1' or user_tp = '2')</if>" +
"<if test = \"userTp=='2'.toString()\"> and user_tp = '3'</if>" + "<if test = \"userTp=='2'.toString()\"> and user_tp = '3'</if>" +
"<if test = \"userTp=='3'.toString()\"> and user_tp = '4'</if></script>") "<if test = \"userTp=='3'.toString()\"> and user_tp = '4'</if>" +
"<if test = \"userTp=='5'.toString()\"> and user_tp = '5'</if></script>")
List<Map<String,Object>> listUserAll(@Param("stable") String stable,@Param("userTp") String userTp); List<Map<String,Object>> listUserAll(@Param("stable") String stable,@Param("userTp") String userTp);
} }
...@@ -33,7 +33,7 @@ public class SysUser { ...@@ -33,7 +33,7 @@ public class SysUser {
private String userTp; private String userTp;
private String userNickname; private String userNickName;
private String openid; private String openid;
......
...@@ -135,7 +135,7 @@ public class UserServiceImpl implements UserService { ...@@ -135,7 +135,7 @@ public class UserServiceImpl implements UserService {
flag = 1; flag = 1;
} }
if(UserTpConstant.TP_INSPECTPERSON.equals(userTp)){ if(UserTpConstant.TP_INSPECTPERSON.equals(userTp)){
userRepository.insertSelective(sysUser); flag = userRepository.insertSelective(sysUser);
} }
return flag; return flag;
} catch (Exception e) { } catch (Exception e) {
...@@ -175,6 +175,9 @@ public class UserServiceImpl implements UserService { ...@@ -175,6 +175,9 @@ public class UserServiceImpl implements UserService {
flag = 1; flag = 1;
} }
} }
if (UserTpConstant.TP_INSPECTPERSON.equals(userTp)) {
flag = userRepository.updateByPrimaryKeySelective(sysUser);
}
return flag; return flag;
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
...@@ -339,7 +342,7 @@ public class UserServiceImpl implements UserService { ...@@ -339,7 +342,7 @@ public class UserServiceImpl implements UserService {
@Override @Override
public List<Map<String, Object>> listUserAllByPagination(PageUtil<SysUser> paginationUtility,String userTp) { public List<Map<String, Object>> listUserAllByPagination(PageUtil<SysUser> paginationUtility,String userTp) {
String table = ""; String table = null;
if(userTp!=null && userTp.equals("1")){table = "sys_admins";} if(userTp!=null && userTp.equals("1")){table = "sys_admins";}
if(userTp!=null && userTp.equals("2")){table = "sys_owner";} if(userTp!=null && userTp.equals("2")){table = "sys_owner";}
if(userTp!=null && userTp.equals("3")){table = "sys_principal";} if(userTp!=null && userTp.equals("3")){table = "sys_principal";}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment