Browse Source

调整看课记录,我的看课记录,两个导出,答题记录数量问题

yfh 3 tuần trước cách đây
mục cha
commit
7827a16275

+ 4 - 4
fs-company/src/main/java/com/fs/company/controller/course/FsCourseWatchLogController.java

@@ -65,7 +65,7 @@ public class FsCourseWatchLogController extends BaseController
         startPage();
         LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
         param.setCompanyId( loginUser.getCompany().getCompanyId());
-        List<FsCourseWatchLogListVO> list = fsCourseWatchLogService.selectFsCourseWatchLogListVO(param);
+        List<FsCourseWatchLogListVO> list = fsCourseWatchLogService.selectFsCourseWatchLogListVOexport(param);
         return getDataTable(list);
     }
 
@@ -111,7 +111,7 @@ public class FsCourseWatchLogController extends BaseController
         startPage();
         LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
         param.setCompanyUserId( loginUser.getUser().getUserId());
-        List<FsCourseWatchLogListVO> list = fsCourseWatchLogService.selectFsCourseWatchLogListVO(param);
+        List<FsCourseWatchLogListVO> list = fsCourseWatchLogService.selectFsCourseWatchLogListVOexport(param);
         return getDataTable(list);
     }
 
@@ -226,7 +226,7 @@ public class FsCourseWatchLogController extends BaseController
     {
         LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
         param.setCompanyId( loginUser.getCompany().getCompanyId());
-        List<FsCourseWatchLogListVO> list = fsCourseWatchLogService.selectFsCourseWatchLogListVO(param);
+        List<FsCourseWatchLogListVO> list = fsCourseWatchLogService.selectFsCourseWatchLogListVOexport(param);
         ExcelUtil<FsCourseWatchLogListVO> util = new ExcelUtil<FsCourseWatchLogListVO>(FsCourseWatchLogListVO.class);
         return util.exportExcel(list, "短链课程看课记录数据");
     }
@@ -242,7 +242,7 @@ public class FsCourseWatchLogController extends BaseController
         LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
         param.setCompanyId( loginUser.getCompany().getCompanyId());
         param.setCompanyUserId( loginUser.getUser().getUserId());
-        List<FsCourseWatchLogListVO> list = fsCourseWatchLogService.selectFsCourseWatchLogListVO(param);
+        List<FsCourseWatchLogListVO> list = fsCourseWatchLogService.selectFsCourseWatchLogListVOexport(param);
         ExcelUtil<FsCourseWatchLogListVO> util = new ExcelUtil<FsCourseWatchLogListVO>(FsCourseWatchLogListVO.class);
         return util.exportExcel(list, "短链课程看课记录数据");
     }

+ 20 - 8
fs-service/src/main/java/com/fs/course/mapper/FsCourseTrafficLogMapper.java

@@ -115,18 +115,30 @@ public interface FsCourseTrafficLogMapper
     List<FsCourseTrafficLogListVO> selectTrafficNew(FsCourseTrafficLogParam param);
 
     @Select("<script>" +
-            "SELECT COALESCE(sum(internet_traffic), 0) FROM fs_course_traffic_log " +
-            "WHERE status =0" +
-            "<if test='createTime != null'>AND create_time &lt;= #{createTime}</if> " +
+            "SELECT log_id FROM fs_course_traffic_log " +
+            "WHERE status = 0 " +
+            "<if test='createTime != null'>" +
+            "  AND create_time &lt; DATE_ADD(#{createTime,jdbcType=TIMESTAMP}, INTERVAL 1 SECOND)" +
+            "</if>" +
+            " AND log_id > #{lastId} " +
+            " ORDER BY log_id ASC " +
+            " LIMIT #{batchSize}" +
             "</script>")
-    Long findRecordsNumBYD( @Param("createTime") Date createTime);
+    List<Long> findRecordsByIdsPaged(
+            @Param("createTime") Date createTime,
+            @Param("lastId") Long lastId,
+            @Param("batchSize") int batchSize);
+
 
     @Select("<script>" +
-            "SELECT log_id FROM fs_course_traffic_log " +
-            "WHERE status =0" +
-            "<if test='createTime != null'>AND create_time &lt;= #{createTime}</if> " +
+            "SELECT COALESCE(SUM(internet_traffic), 0) FROM fs_course_traffic_log " +
+            "WHERE log_id IN " +
+            "<foreach item='id' collection='ids' open='(' separator=',' close=')'>" +
+            "#{id}" +
+            "</foreach>" +
             "</script>")
-    List<Long> findRecordsNumByIds( @Param("createTime") Date createTime);
+    Long sumTrafficByIds(@Param("ids") List<Long> ids);
+
 
     @Update("<script>" +
             "UPDATE fs_course_traffic_log SET status = #{status} WHERE log_id IN " +

+ 2 - 0
fs-service/src/main/java/com/fs/course/mapper/FsCourseWatchLogMapper.java

@@ -487,4 +487,6 @@ public interface FsCourseWatchLogMapper extends BaseMapper<FsCourseWatchLog> {
             "    (SELECT @streak := 0, @prev_date := NULL) AS vars\n" +
             ") AS streak_data;")
     Long selectByWatchlxDay(@Param("userId") Long userId,@Param("projectId")  Long projectId);
+
+    List<FsCourseWatchLogListVO> selectFsCourseWatchLogListVOexport(@Param("maps") FsCourseWatchLogListParam param);
 }

+ 2 - 0
fs-service/src/main/java/com/fs/course/service/IFsCourseWatchLogService.java

@@ -132,4 +132,6 @@ public interface IFsCourseWatchLogService extends IService<FsCourseWatchLog> {
     FsCourseWatchLog getWatchCourseVideoIsOpen(Long userId, Long videoId);
 
     void scheduleBatchUpdateToDatabaseIsOpen();
+
+    List<FsCourseWatchLogListVO> selectFsCourseWatchLogListVOexport(FsCourseWatchLogListParam param);
 }

+ 8 - 0
fs-service/src/main/java/com/fs/course/service/impl/FsCourseAnswerLogsServiceImpl.java

@@ -190,6 +190,14 @@ public class FsCourseAnswerLogsServiceImpl implements IFsCourseAnswerLogsService
 
     @Override
     public Long selectFsCourseAnswerLogsListVONewCount(FsCourseAnswerLogsParam param) {
+        if(StringUtils.isNotEmpty(param.getUserName())){
+            List<FsUser> fsUsers = fsUserService.selectFsUserListByJointUserNameKey(param.getUserName());
+            if(fsUsers.isEmpty()) {
+                return 0L;
+            }
+            Set<Long> userIds = fsUsers.stream().map(FsUser::getUserId).collect(Collectors.toSet());
+            param.setUserIds(userIds);
+        }
         return fsCourseAnswerLogsMapper.selectFsCourseAnswerLogsListVONewCount(param);
     }
 

+ 47 - 16
fs-service/src/main/java/com/fs/course/service/impl/FsCourseTrafficLogServiceImpl.java

@@ -4,10 +4,12 @@ import java.text.SimpleDateFormat;
 import java.util.*;
 
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.fs.common.exception.CustomException;
 import com.fs.common.utils.DateUtils;
 import com.fs.common.utils.DictUtils;
+import com.fs.common.utils.date.DateUtil;
 import com.fs.company.cache.ICompanyCacheService;
 import com.fs.course.param.FsCourseTrafficLogParam;
 import com.fs.course.param.InternetTrafficParam;
@@ -23,6 +25,7 @@ import org.springframework.stereotype.Service;
 import com.fs.course.mapper.FsCourseTrafficLogMapper;
 import com.fs.course.domain.FsCourseTrafficLog;
 import com.fs.course.service.IFsCourseTrafficLogService;
+import org.springframework.transaction.annotation.Transactional;
 
 /**
  * 短链课程流量记录Service业务层处理
@@ -343,27 +346,55 @@ public class FsCourseTrafficLogServiceImpl implements IFsCourseTrafficLogService
         }
     }
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public void sumTrafficlog() {
+        // 初始化参数
+        int batchSize = 10000;
+        Long lastId = 0L;
+        long totalTraffic = 0L;
+        Date currentDate = DateUtils.addHours(new Date(),-3);
         SysConfig sysConfig = iSysConfigService.selectConfigByConfigKey("redPacket.Traffic.config");
-        Date date = new Date();
-        Long count = fsCourseTrafficLogMapper.findRecordsNumBYD(date);
-        List<Long> ids = fsCourseTrafficLogMapper.findRecordsNumByIds(date);
-        if (count<=0){
-            return;
+
+        // 分批处理
+        while (true) {
+            // 分页查询ID
+            List<Long> ids = fsCourseTrafficLogMapper.findRecordsByIdsPaged(
+                    currentDate, lastId, batchSize);
+            System.out.println(ids);
+
+            if (CollectionUtils.isEmpty(ids)) {
+                break;
+            }
+            // 统计本批次流量
+            Long batchTraffic = fsCourseTrafficLogMapper.sumTrafficByIds(ids);
+            // 批量更新状态
+            int updatedCount = fsCourseTrafficLogMapper.updateStatusByIds(ids, 2);
+
+            totalTraffic += batchTraffic;
+
         }
-        if (ObjectUtils.isEmpty(sysConfig)){
-            sysConfig = new SysConfig();
-            sysConfig.setConfigKey("redPacket.Traffic.config");
-            sysConfig.setConfigName("红包流量配置");
-            sysConfig.setConfigValue("-"+count);
-            iSysConfigService.insertConfig(sysConfig);
-        }else {
-            sysConfig.setConfigValue(String.valueOf((Long.parseLong(sysConfig.getConfigValue())-count)));
-            iSysConfigService.updateConfig(sysConfig);
+        log.info("数据跑完了,数据有:{}",totalTraffic);
+        if (totalTraffic > 0) {
+            updateConfig(sysConfig, totalTraffic);
+        }
+    }
+    private void updateConfig(SysConfig sysConfig, long trafficSum) {
+        try {
+            if (sysConfig == null) {
+                sysConfig = new SysConfig();
+                sysConfig.setConfigKey("redPacket.Traffic.config");
+                sysConfig.setConfigName("红包流量配置");
+                sysConfig.setConfigValue("-" + trafficSum);
+                iSysConfigService.insertConfig(sysConfig);
+            } else {
+                long newValue = Long.parseLong(sysConfig.getConfigValue()) - trafficSum;
+                sysConfig.setConfigValue(String.valueOf(newValue));
+                iSysConfigService.updateConfig(sysConfig);
+            }
+        } catch (NumberFormatException e) {
+            throw new RuntimeException("配置值格式错误", e);
         }
-        fsCourseTrafficLogMapper.updateStatusByIds(ids,2);
     }
-
     private static String formatDuration(long millis) {
         long seconds = millis / 1000;
         long minutes = seconds / 60;

+ 79 - 0
fs-service/src/main/java/com/fs/course/service/impl/FsCourseWatchLogServiceImpl.java

@@ -12,6 +12,7 @@ import com.fs.common.utils.DateUtils;
 import com.fs.common.utils.DictUtils;
 import com.fs.company.cache.ICompanyCacheService;
 import com.fs.company.cache.ICompanyUserCacheService;
+import com.fs.company.domain.Company;
 import com.fs.company.domain.CompanyUser;
 import com.fs.course.config.CourseConfig;
 import com.fs.course.domain.FsCourseFinishTemp;
@@ -29,6 +30,7 @@ import com.fs.his.service.IFsUserService;
 import com.fs.his.utils.ConfigUtil;
 import com.fs.his.vo.OptionsVO;
 import com.fs.qw.Bean.MsgBean;
+import com.fs.qw.cache.IQwExternalContactCacheService;
 import com.fs.qw.cache.IQwUserCacheService;
 import com.fs.qw.domain.QwExternalContact;
 import com.fs.qw.domain.QwExternalContactInfo;
@@ -91,6 +93,8 @@ public class FsCourseWatchLogServiceImpl extends ServiceImpl<FsCourseWatchLogMap
     @Autowired
     RedisCache redisCache;
     @Autowired
+    private IQwExternalContactCacheService qwExternalContactCacheService;
+    @Autowired
     private QwWatchLogMapper qwWatchLogMapper;
     @Autowired
     private FsUserCourseVideoMapper courseVideoMapper;
@@ -999,4 +1003,79 @@ public class FsCourseWatchLogServiceImpl extends ServiceImpl<FsCourseWatchLogMap
                 totalCost,
                 totalCost > 0 ? String.format("%.2f", logs.size() * 1000.0 / totalCost) : "∞");
     }
+
+
+
+    @Override
+    public List<FsCourseWatchLogListVO> selectFsCourseWatchLogListVOexport(FsCourseWatchLogListParam param) {
+
+        List<FsCourseWatchLogListVO> list = fsCourseWatchLogMapper.selectFsCourseWatchLogListVOexport(param);
+        for (FsCourseWatchLogListVO item : list) {
+            // 项目
+            if(ObjectUtils.isNotNull(item.getProject())) {
+                String sysCourseProject = DictUtils.getDictLabel("sys_course_project", String.valueOf(item.getProject()));
+                if(StringUtils.isNotBlank(sysCourseProject)){
+                    item.setProjectName(sysCourseProject);
+                }
+            }
+            // 用户名
+            if(ObjectUtils.isNotNull(item.getUserId())) {
+                FsUser fsUser = fsUserCacheService.selectFsUserById(item.getUserId());
+                if(ObjectUtils.isNotNull(fsUser)){
+                    item.setUserName(String.format("%s_%d",fsUser.getNickname(),fsUser.getUserId()));
+                    item.setFsNickName(fsUser.getNickname());
+                    item.setFsAvatar(fsUser.getAvatar());
+                }
+            }
+            // 公司名
+            if(ObjectUtils.isNotNull(item.getCompanyId())){
+                Company company = companyCacheService.selectCompanyById(Long.valueOf(item.getCompanyId()));
+                if(ObjectUtils.isNotNull(company)){
+                    item.setCompanyName(String.format("%s_%d", company.getCompanyName(), company.getCompanyId()));
+                }
+            }
+
+            // 销售名
+            if(ObjectUtils.isNotNull(item.getCompanyUserId())){
+                CompanyUser companyUser = companyUserCacheService.selectCompanyUserById(item.getCompanyUserId());
+                if(ObjectUtils.isNotNull(companyUser)){
+                    item.setCompanyUserName(String.format("%s_%d", companyUser.getNickName(), companyUser.getUserId()));
+                }
+            }
+
+            // 课程
+            if(ObjectUtils.isNotNull(item.getCourseId())){
+                FsUserCourse course = fsUserCourseCacheService.selectFsUserCourseByCourseId(item.getCourseId());
+                if(ObjectUtils.isNotNull(course)){
+                    item.setCourseName(course.getCourseName());
+                }
+            }
+            // 小节
+            if(ObjectUtils.isNotNull(item.getVideoId())){
+                FsUserCourseVideo fsUserCourseVideo = fsUserCourseVideoCacheService.selectFsUserCourseVideoByVideoId(item.getVideoId());
+                if(ObjectUtils.isNotNull(fsUserCourseVideo)){
+                    item.setVideoName(fsUserCourseVideo.getTitle());
+                }
+            }
+
+            // 企微用户名
+            if(ObjectUtils.isNotNull(item.getQwUserId())){
+                String qwUserName = qwUserCacheService.queryQwUserNameByUserId(item.getQwUserId());
+                if(StringUtils.isNotBlank(qwUserName)){
+                    item.setQwUserName(qwUserName);
+                }
+            }
+
+            // 企微外部联系人
+            if(ObjectUtils.isNotNull(item.getQwExternalContactId())){
+                String qwExternalContactName = qwExternalContactCacheService.selectQwExternalContactById(Long.valueOf(item.getQwExternalContactId()));
+                if(StringUtils.isNotBlank(qwExternalContactName)){
+                    item.setExternalUserName(qwExternalContactName);
+                }
+            }
+
+        }
+        return list;
+    }
+
 }

+ 1 - 0
fs-service/src/main/java/com/fs/course/service/impl/FsUserCourseVideoServiceImpl.java

@@ -1594,6 +1594,7 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
         if(watchCourseVideo != null){
             if(!watchCourseVideo.getCompanyUserId().equals(param.getCompanyUserId())) {
                 //提示
+                log.error("数据库存在销售信息:{},分享得销售信息:{}",watchCourseVideo.getCompanyUserId(),param.getCompanyUserId());
                 return ResponseResult.fail(504, "已看过其他销售分享的此课程,不能重复观看");
             }
 

+ 18 - 4
fs-service/src/main/java/com/fs/course/vo/FsCourseWatchLogListVO.java

@@ -25,21 +25,31 @@ public class FsCourseWatchLogListVO extends BaseEntity
 //    @Excel(name = "会员id")
     private Long userId;
 
+    @Excel(name = "会员名称")
+    private String userName;
+
     /** 小程序昵称 */
-//    @Excel(name = "小程序昵称")
+    @Excel(name = "小程序昵称")
     private String fsNickName;
 
-    @Excel(name = "客户昵称")
+//    @Excel(name = "客户昵称")
     private String externalUserName;
 
     /** 外部联系人头像 */
-    @Excel(name = "客户头像")
+//    @Excel(name = "客户头像")
     private String externalUserAvatar;
 
     /** 客户头像 */
-//    @Excel(name = "客户头像")
+    @Excel(name = "小程序头像")
     private String fsAvatar;
 
+    /**
+     * 项目
+     */
+    private Integer project;
+    @Excel(name = "项目名称")
+    private String projectName;
+
     @Excel(name = "课程名称")
     private String courseName;
 
@@ -106,4 +116,8 @@ public class FsCourseWatchLogListVO extends BaseEntity
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date qecCreateTime;
 
+    private Long companyUserId;
+    private Long courseId;
+    private Long videoId;
+
 }

+ 3 - 1
fs-service/src/main/resources/application-druid-myhk.yml

@@ -150,4 +150,6 @@ rocketmq:
         group: common-group
         access-key: ak16xj8o92zp984557f83ba2 # 替换为实际的 accessKey
         secret-key: sk2ff1c6b15b74b888 # 替换为实际的 secretKey
-
+openIM:
+    secret: openIM123
+    userID: imAdmin

+ 29 - 9
fs-service/src/main/resources/mapper/course/FsCourseAnswerLogsMapper.xml

@@ -152,29 +152,49 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
 
     <select id="selectFsCourseAnswerLogsListVONewCount" resultType="java.lang.Long">
-        select count(1) from fs_course_answer_logs cal
-        left join fs_user_course uc on cal.course_id=uc.course_id
+        SELECT
+        count(1)
+        FROM
+        fs_course_answer_logs cal
+        INNER JOIN (
+        SELECT
+        cal_inner.log_id
+        FROM
+        fs_course_answer_logs cal_inner
+        LEFT JOIN fs_user_course uc_inner ON cal_inner.course_id = uc_inner.course_id
         <where>
             <if test="courseId != null">
-                cal.course_id = #{courseId}
+                cal_inner.course_id = #{courseId}
+            </if>
+            <if test="videoId != null and videoId != '' ">
+                AND cal_inner.video_id = #{videoId}
             </if>
             <if test="companyUserId != null">
-                AND cal.company_user_id = #{companyUserId}
+                AND cal_inner.company_user_id = #{companyUserId}
             </if>
             <if test="companyId != null">
-                AND cal.company_id = #{companyId}
+                AND cal_inner.company_id = #{companyId}
             </if>
             <if test="isRight != null">
-                AND is_right = #{isRight}
+                AND cal_inner.is_right = #{isRight}
             </if>
             <if test="project != null">
-                AND uc.project = #{project}
+                AND uc_inner.project = #{project}
             </if>
             <if test="sTime != null and eTime != null">
-                AND cal.create_time BETWEEN #{sTime} AND #{eTime}
+                AND cal_inner.create_time BETWEEN #{sTime} AND #{eTime}
+            </if>
+            <if test="userIds != null and userIds.size() > 0">
+                and cal_inner.user_id in
+                <foreach collection="userIds"  open="(" close=")" separator="," item="userId" index="index">
+                    #{userId}
+                </foreach>
+            </if>
+            <if test="watchLogId != null">
+                AND cal_inner.watch_log_id = #{watchLogId}
             </if>
-
         </where>
+        ) AS paged_ids ON cal.log_id = paged_ids.log_id
     </select>
 
 </mapper>

+ 96 - 0
fs-service/src/main/resources/mapper/course/FsCourseWatchLogMapper.xml

@@ -726,4 +726,100 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
     </select>
 
+
+    <select id="selectFsCourseWatchLogListVOexport" resultType="com.fs.course.vo.FsCourseWatchLogListVO">
+        SELECT
+        l.log_id,
+        l.project AS project,
+        l.user_id,
+        l.log_type,
+        SEC_TO_TIME(l.duration) AS duration,
+        l.camp_period_time,
+        l.finish_time,
+        l.send_type,
+        l.create_time,
+        l.update_time,
+        l.last_heartbeat_time,
+        l.company_id,
+        l.company_user_id,
+        l.course_id,
+        l.video_id,
+        l.qw_user_id,
+        l.qw_external_contact_id,
+        qec.create_time as qec_create_time
+        FROM
+        fs_course_watch_log l LEFT JOIN qw_external_contact qec on l.qw_external_contact_id = qec.id
+        left join fs_user u on u.user_id = l.user_id
+        left join company_user cu on cu.user_id = l.company_user_id
+        <where>
+            <if test ='maps.sendType !=null'>
+                and l.send_type = #{maps.sendType}
+            </if>
+            <if test ='maps.userId !=null'>
+                and l.user_id = #{maps.userId}
+            </if>
+            <if test ='maps.qwExternalContactId !=null'>
+                and l.qw_external_contact_id = #{maps.qwExternalContactId}
+            </if>
+            <if test ='maps.qwUserId !=null'>
+                and l.qw_user_id = #{maps.qwUserId}
+            </if>
+            <if test ='maps.courseId !=null'>
+                and l.course_id = #{maps.courseId}
+            </if>
+            <if test ='maps.videoId !=null'>
+                and l.video_id = #{maps.videoId}
+            </if>
+            <if test ='maps.logType !=null'>
+                and l.log_type = #{maps.logType}
+            </if>
+            <if test ='maps.companyId !=null'>
+                and l.company_id = #{maps.companyId}
+            </if>
+            <if test ='maps.companyUserId !=null'>
+                and l.company_user_id = #{maps.companyUserId}
+            </if>
+            <if test ='maps.companyUserName !=null and maps.companyUserName!=""'>
+                and cu.nick_name  like concat('%', #{maps.companyUserName}, '%')
+            </if>
+            <if test ='maps.nickName !=null and maps.nickName!=""'>
+                and u.nick_name  like concat('%', #{maps.nickName}, '%')
+            </if>
+            <if test ='maps.externalUserName !=null and maps.externalUserName!=""'>
+                and qec.name  like concat('%', #{maps.externalUserName}, '%')
+            </if>
+            <if test= 'maps.qecSTime != null '>
+                and DATE(qec.create_time) &gt;= DATE(#{maps.qecSTime})
+            </if>
+            <if test='maps.qecETime != null '>
+                and DATE(qec.create_time) &lt;= DATE(#{maps.qecETime})
+            </if>
+            <if test= 'maps.sTime != null '>
+                and DATE(l.create_time) &gt;= DATE(#{maps.sTime})
+            </if>
+            <if test='maps.eTime != null '>
+                and DATE(l.create_time) &lt;= DATE(#{maps.eTime})
+            </if>
+            <if test= 'maps.scheduleStartTime != null '>
+                and DATE(l.camp_period_time) &gt;= DATE(#{maps.scheduleStartTime})
+            </if>
+            <if test='maps.scheduleEndTime != null '>
+                and DATE(l.camp_period_time) &lt;= DATE(#{maps.scheduleEndTime})
+            </if>
+            <if test= 'maps.upSTime != null '>
+                and DATE(l.update_time) &gt;= DATE(#{maps.upSTime})
+            </if>
+            <if test='maps.upETime != null '>
+                and DATE(l.update_time) &lt;= DATE(#{maps.upETime})
+            </if>
+            <if test="maps.sopIds != null and maps.sopIds.size() > 0">
+                and l.sop_id in
+                <foreach item="sopId" index="index" collection="maps.sopIds" open="(" separator="," close=")">
+                    #{sopId}
+                </foreach>
+            </if>
+        </where>
+        order by l.finish_time desc,l.update_time desc,l.create_time desc
+    </select>
+
 </mapper>

+ 3 - 3
fs-service/src/main/resources/mapper/his/FsUserMapper.xml

@@ -477,7 +477,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 AND u.user_id LIKE CONCAT("%",#{maps.userId},"%")
             </if >
             <if test = "maps.nickname != null and  maps.nickname !='' " >
-                AND u.nickname LIKE CONCAT("%",#{maps.nickname},"%")
+                AND u.nick_name LIKE CONCAT("%",#{maps.nickname},"%")
             </if >
             <if test = "maps.phone != null   and  maps.phone !='' " >
                 AND u.phone LIKE CONCAT("%",#{maps.phone},"%")
@@ -1652,9 +1652,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         LEFT JOIN company_user ON company_user.user_id = ucu.company_user_id
         LEFT JOIN company on company.company_id = company_user.company_id
         <where>
-            1 = 1 and u.nickname is not null
+            1 = 1 and u.nick_name is not null
             <if test = "maps.nickname != null and  maps.nickname !='' " >
-                AND u.nickname LIKE CONCAT("%",#{maps.nickname},"%")
+                AND u.nick_name LIKE CONCAT("%",#{maps.nickname},"%")
             </if >
             <if test = "maps.userId != null and  maps.userId !='' " >
                 AND u.user_id = #{maps.userId}