提交 a2cad16e 作者: 张开石

1、修改统计日志接口逻辑,先查统计信息,再查人

父级 dbdf56ae
...@@ -22,14 +22,12 @@ public interface MeetingInfoMapper extends BaseMapper<MeetingInfo> { ...@@ -22,14 +22,12 @@ public interface MeetingInfoMapper extends BaseMapper<MeetingInfo> {
* @param startTime * @param startTime
* @param endTime * @param endTime
* @param dateList * @param dateList
* @param userIdList
* @return * @return
*/ */
@MapKey("host_uid") @MapKey("host_uid")
List<Map<String, String>> statistics(@Param("startTime") String startTime, List<Map<String, String>> statistics(@Param("startTime") String startTime,
@Param("endTime") String endTime, @Param("endTime") String endTime,
@Param("dateList") List<String> dateList, @Param("dateList") List<String> dateList);
@Param("userIdList") List<String> userIdList);
// List<MeetingInfo> selectList(MeetingInfoVO vo); // List<MeetingInfo> selectList(MeetingInfoVO vo);
......
...@@ -46,9 +46,11 @@ public interface SysUserSysMapper extends BaseMapper<SysUserSync> { ...@@ -46,9 +46,11 @@ public interface SysUserSysMapper extends BaseMapper<SysUserSync> {
* 获取用户信息 * 获取用户信息
* *
* @param searchValue * @param searchValue
* @param userIdList
* @return * @return
*/ */
@MapKey("userId") @MapKey("userId")
List<Map<String, String>> selectParamByUserIdList(@Param("tenantId") String tenantId, List<Map<String, String>> selectParamByUserIdList(@Param("tenantId") String tenantId,
@Param("searchValue") String searchValue); @Param("searchValue") String searchValue,
@Param("userIdList") List<String> userIdList);
} }
...@@ -275,12 +275,15 @@ public class MeetingInfoServiceImpl extends ServiceImpl<MeetingInfoMapper, Meeti ...@@ -275,12 +275,15 @@ public class MeetingInfoServiceImpl extends ServiceImpl<MeetingInfoMapper, Meeti
List<String> dateList = DateUtil.rangeToList(createTimeStart, createTimeEnd, DateField.DAY_OF_YEAR).stream() List<String> dateList = DateUtil.rangeToList(createTimeStart, createTimeEnd, DateField.DAY_OF_YEAR).stream()
.map(date -> DateUtil.format(date, "yyyy-MM-dd")) .map(date -> DateUtil.format(date, "yyyy-MM-dd"))
.collect(Collectors.toList()); .collect(Collectors.toList());
List<Map<String, String>> userInfoList = sysUserSysMapper.selectParamByUserIdList(permissionTenantId, searchValue);
List<String> userIdList = userInfoList.stream().map(map -> map.get("userId")).collect(Collectors.toList());
// 获取统计信息
String startTime = DateUtil.format(createTimeStart, "yyyy-MM-dd"); String startTime = DateUtil.format(createTimeStart, "yyyy-MM-dd");
String endTime = DateUtil.format(createTimeEnd, "yyyy-MM-dd"); String endTime = DateUtil.format(createTimeEnd, "yyyy-MM-dd");
List<Map<String, String>> statisticsList = meetingInfoMapper.statistics(startTime, endTime, dateList, userIdList); List<Map<String, String>> statisticsList = meetingInfoMapper.statistics(startTime, endTime, dateList);
// 获取用户信息
List<String> userIdList = statisticsList.stream().map(map -> map.get("userId")).distinct().collect(Collectors.toList());
List<Map<String, String>> userInfoList = sysUserSysMapper.selectParamByUserIdList(permissionTenantId, searchValue, userIdList);
for (Map<String, String> userInfo : userInfoList) { for (Map<String, String> userInfo : userInfoList) {
String userId = userInfo.get("userId"); String userId = userInfo.get("userId");
......
...@@ -55,12 +55,6 @@ ...@@ -55,12 +55,6 @@
userid userid
where where
userid.tid COLLATE utf8mb4_general_ci = t.host_uid COLLATE utf8mb4_general_ci userid.tid COLLATE utf8mb4_general_ci = t.host_uid COLLATE utf8mb4_general_ci
<if test="userIdList.size > 0">
and userid.wid in
<foreach item="userId" collection="userIdList" open="(" separator="," close=")" index="index">
#{userId}
</foreach>
</if>
GROUP BY t.host_uid, userid.wid GROUP BY t.host_uid, userid.wid
</select> </select>
......
...@@ -161,6 +161,12 @@ ...@@ -161,6 +161,12 @@
<if test="searchValue != null and searchValue != ''"> <if test="searchValue != null and searchValue != ''">
and (sys_user_sync.user_id like concat('%',#{searchValue},'%') or sys_user_sync.name like concat('%',#{searchValue},'%') or sys_user_sync_category.name like concat('%',#{searchValue},'%')) and (sys_user_sync.user_id like concat('%',#{searchValue},'%') or sys_user_sync.name like concat('%',#{searchValue},'%') or sys_user_sync_category.name like concat('%',#{searchValue},'%'))
</if> </if>
<if test="userIdList.size() > 0">
and sys_user_sync.user_id in
<foreach collection="userIdList" item="userId" open="(" separator="," close=")" index="index">
#{userId}
</foreach>
</if>
</where> </where>
</select> </select>
</mapper> </mapper>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论