he2802 4 anni fa
parent
commit
4c3c8361bf

+ 3 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/service/impl/InformServiceImpl.java

@@ -252,7 +252,8 @@ public class InformServiceImpl extends ServiceImpl<InformMapper, Inform> impleme
             InformUserQueryBo informUserQueryBo = new InformUserQueryBo();
             informUserQueryBo.setInformId(informVo.getInformId());
             List<Long> userId = new ArrayList<>();
-            for (InformUserVo informUserVo : iInformUserService.queryUserList(informUserQueryBo)) {
+            List<InformUserVo> list = iInformUserService.queryUserList(informUserQueryBo);
+            for (InformUserVo informUserVo : list) {
                 userId.add(informUserVo.getUserId());
             }
             //初始化需要得到的数组
@@ -263,7 +264,7 @@ public class InformServiceImpl extends ServiceImpl<InformMapper, Inform> impleme
                 array[i] = userId.get(i);
             }
             informVo.setUserId(array);
-
+            break;
         }
         return informVos;
     }

+ 4 - 4
zhongzheng-system/src/main/resources/mapper/modules/inform/InformUserMapper.xml

@@ -38,13 +38,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         SELECT
             iu.id,
             iu.user_id,
-            (SELECT u.realname FROM `user` u where iu.user_id=u.user_id) as realname,
-            (SELECT u.telphone FROM `user` u where iu.user_id=u.user_id) as telphone,
-            (SELECT u.id_card FROM `user` u where iu.user_id=u.user_id) as id_card,
+            u.realname,
+            u.telphone,
+            u.id_card,
             iu.send_time,
             iu.send_status
         FROM
-            inform_user iu
+            inform_user iu LEFT JOIN `user` u on iu.user_id = u.user_id
         WHERE
             1 =1
         <if test="informId != null and informId != ''">