Jelajahi Sumber

群聊发送完课

吴树波 1 bulan lalu
induk
melakukan
a9b240e5d5

+ 107 - 0
fs-company/src/main/java/com/fs/course/controller/FsCourseFinishTempController.java

@@ -0,0 +1,107 @@
+package com.fs.course.controller;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.core.security.SecurityUtils;
+import com.fs.course.domain.FsCourseFinishTemp;
+import com.fs.core.security.LoginUser;
+import com.fs.course.service.IFsCourseFinishTempService;
+import com.fs.course.vo.FsCourseFinishTempListVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 完课模板Controller
+ *
+ * @author fs
+ * @date 2024-12-19
+ */
+@RestController
+@RequestMapping("/course/courseFinishTemp")
+public class FsCourseFinishTempController extends BaseController
+{
+    @Autowired
+    private IFsCourseFinishTempService fsCourseFinishTempService;
+
+    /**
+     * 查询完课模板列表
+     */
+    @PreAuthorize("@ss.hasPermi('courseFinishTemp:course:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsCourseFinishTemp fsCourseFinishTemp)
+    {
+        startPage();
+
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        fsCourseFinishTemp.setCompanyId(loginUser.getCompany().getCompanyId());
+        List<FsCourseFinishTempListVO> list = fsCourseFinishTempService.selectFsCourseFinishTempListVO(fsCourseFinishTemp);
+        return getDataTable(list);
+    }
+
+
+    /**
+     * 导出完课模板列表
+     */
+    @PreAuthorize("@ss.hasPermi('courseFinishTemp:course:export')")
+    @Log(title = "完课模板", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsCourseFinishTemp fsCourseFinishTemp)
+    {
+        List<FsCourseFinishTemp> list = fsCourseFinishTempService.selectFsCourseFinishTempList(fsCourseFinishTemp);
+        ExcelUtil<FsCourseFinishTemp> util = new ExcelUtil<FsCourseFinishTemp>(FsCourseFinishTemp.class);
+        return util.exportExcel(list, "完课模板数据");
+    }
+
+    /**
+     * 获取完课模板详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('courseFinishTemp:course:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+//        return AjaxResult.success(fsCourseFinishTempService.selectFsCourseFinishTempById(id));
+        return AjaxResult.success(fsCourseFinishTempService.selectFsCourseFinishTempByIdVO(id));
+    }
+
+    /**
+     * 新增完课模板
+     */
+    @PreAuthorize("@ss.hasPermi('courseFinishTemp:course:add')")
+    @Log(title = "完课模板", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsCourseFinishTemp fsCourseFinishTemp)
+    {
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        fsCourseFinishTemp.setCompanyId(loginUser.getCompany().getCompanyId());
+        return toAjax(fsCourseFinishTempService.insertFsCourseFinishTemp(fsCourseFinishTemp));
+    }
+
+    /**
+     * 修改完课模板
+     */
+    @PreAuthorize("@ss.hasPermi('courseFinishTemp:course:edit')")
+    @Log(title = "完课模板", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsCourseFinishTemp fsCourseFinishTemp)
+    {
+        return toAjax(fsCourseFinishTempService.updateFsCourseFinishTemp(fsCourseFinishTemp));
+    }
+
+    /**
+     * 删除完课模板
+     */
+    @PreAuthorize("@ss.hasPermi('courseFinishTemp:course:remove')")
+    @Log(title = "完课模板", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(fsCourseFinishTempService.deleteFsCourseFinishTempByIds(ids));
+    }
+}

+ 23 - 21
fs-qw-task/src/main/java/com/fs/app/taskService/impl/SopLogsTaskServiceImpl.java

@@ -2,14 +2,13 @@ package com.fs.app.taskService.impl;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.alibaba.fastjson.JSONObject;
 import com.fs.app.taskService.SopLogsTaskService;
 import com.fs.common.core.domain.R;
 import com.fs.common.exception.base.BaseException;
 import com.fs.common.utils.BatchUtils;
 import com.fs.common.utils.PubFun;
 import com.fs.common.utils.StringUtils;
-import com.fs.common.utils.date.DateUtil;
 import com.fs.company.domain.CompanyUser;
 import com.fs.company.service.ICompanyUserService;
 import com.fs.course.config.CourseConfig;
@@ -1624,27 +1623,30 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
                     continue;
                 }
 
+                List<QwGroupChatUser> qwGroupChatUserList = qwGroupChatUserService.selectUserIsChat(externalContact.getExternalUserId());
+                if(!qwGroupChatUserList.isEmpty()){
+                    FsCourseFinishTemp finishSopTemp = fsCourseFinishTempMapper.selectFsCourseFinishTempChatSopByCompanyUserId(finishLog.getCompanyUserId(), finishLog.getVideoId());
+                    if(finishSopTemp != null){
+                        List<SopUserLogs> sopLogsList = sopUserLogsMapper.selectSopUserLogByChatIds(PubFun.listToNewList(qwGroupChatUserList, QwGroupChatUser::getChatId));
+                        List<QwGroupChat> qwGroupChatList = qwGroupChatService.selectQwGroupChatByChatIds(PubFun.listToNewList(sopLogsList, SopUserLogs::getChatId).toArray(new String[0]));
+                        Map<String, QwGroupChat> groupChatMap = PubFun.listToMapByGroupObject(qwGroupChatList, QwGroupChat::getChatId);
+                        sopLogsList.forEach(e -> {
+                            QwGroupChat groupChat = groupChatMap.get(e.getChatId());
+                            if(groupChat != null){
+                                e.setChatName(groupChat.getName());
+                            }
+                        });
+                        List<QwSopLogs> qwSopLogs = buildSopLogsChat(finishLog, finishSopTemp, externalContact, sopLogsList);
+                        sopLogsToInsert.addAll(qwSopLogs);
+                    }
+                }
+
                 // 查询完课模板信息
                 FsCourseFinishTemp finishTemp = fsCourseFinishTempMapper.selectFsCourseFinishTempByCompanyUserId(finishLog.getCompanyUserId(), finishLog.getVideoId());
                 if (finishTemp == null) {
 //                    log.warn("完课模板不存在: " + finishLog.getCompanyUserId() + ", " + finishLog.getVideoId());
                     continue;
                 }
-                List<QwGroupChatUser> qwGroupChatUserList = qwGroupChatUserService.selectUserIsChat(externalContact.getExternalUserId());
-                if(!qwGroupChatUserList.isEmpty()){
-                    List<SopUserLogs> sopLogsList = sopUserLogsMapper.selectSopUserLogByChatIds(PubFun.listToNewList(qwGroupChatUserList, QwGroupChatUser::getChatId));
-                    List<QwGroupChat> qwGroupChatList = qwGroupChatService.selectQwGroupChatByChatIds(PubFun.listToNewList(sopLogsList, SopUserLogs::getChatId).toArray(new String[0]));
-                    Map<String, QwGroupChat> groupChatMap = PubFun.listToMapByGroupObject(qwGroupChatList, QwGroupChat::getChatId);
-                    sopLogsList.forEach(e -> {
-                        QwGroupChat groupChat = groupChatMap.get(e.getChatId());
-                        if(groupChat != null){
-                            e.setChatName(groupChat.getName());
-                        }
-                    });
-                    List<QwSopLogs> qwSopLogs = buildSopLogsChat(finishLog, externalContact, sopLogsList);
-                    sopLogsToInsert.addAll(qwSopLogs);
-                }
-
                 // 构建 sopLogs 对象
                 QwSopLogs sopLogs = buildSopLogs(finishLog, externalContact, finishTemp);
                 if (sopLogs == null) {
@@ -1693,7 +1695,7 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
         }
     }
 
-    private List<QwSopLogs> buildSopLogsChat(FsCourseWatchLog finishLog, QwExternalContact externalContact, List<SopUserLogs> sopLogsList) {
+    private List<QwSopLogs> buildSopLogsChat(FsCourseWatchLog finishLog, FsCourseFinishTemp finishTemp, QwExternalContact externalContact, List<SopUserLogs> sopLogsList) {
         return sopLogsList.stream().map(e -> {
             QwSopChatTempSetting setting = new QwSopChatTempSetting();
             DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
@@ -1714,9 +1716,9 @@ public class SopLogsTaskServiceImpl implements SopLogsTaskService {
             sopLogs.setSopId(e.getSopId());
             sopLogs.setExternalUserId(e.getChatId());
             sopLogs.setExternalUserName(e.getChatName());
-            QwSopChatTempSetting.Setting setting1 = new QwSopChatTempSetting.Setting();
-            setting1.setValue("恭喜" + externalContact.getName() + "完成了今天的课程!");
-            setting.setSetting(Collections.singletonList(setting1));
+            JSONObject obj = JSON.parseObject(finishTemp.getSetting());
+            obj.put("value", obj.getString("obj").replace("${name}", externalContact.getName()));
+            setting.setSetting(obj.toJSONString());
             sopLogs.setContentJson(JSON.toJSONString(setting));
             return sopLogs;
         }).collect(Collectors.toList());

+ 5 - 0
fs-service-system/src/main/java/com/fs/course/domain/FsCourseFinishTemp.java

@@ -18,6 +18,9 @@ public class FsCourseFinishTemp extends BaseEntity
     /** $column.columnComment */
     private Long id;
 
+    /** 模板类型 1个人模板2群聊模板 */
+    @Excel(name = "模板名称")
+    private Integer type;
     /** 模板名称 */
     @Excel(name = "模板名称")
     private String name;
@@ -49,4 +52,6 @@ public class FsCourseFinishTemp extends BaseEntity
     /** 删除标志 */
     @Excel(name = "删除标志")
     private Long isDel;
+    @Excel(name = "删除标志")
+    private Integer isAllCompanyUser;
 }

+ 27 - 2
fs-service-system/src/main/java/com/fs/course/mapper/FsCourseFinishTempMapper.java

@@ -1,12 +1,12 @@
 package com.fs.course.mapper;
 
+import java.util.List;
 import com.fs.course.domain.FsCourseFinishTemp;
 import com.fs.course.vo.FsCourseFinishTempListVO;
+import com.fs.course.vo.FsCourseFinishTempVO;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 
-import java.util.List;
-
 /**
  * 完课模板Mapper接口
  *
@@ -23,6 +23,12 @@ public interface FsCourseFinishTempMapper
      */
     public FsCourseFinishTemp selectFsCourseFinishTempById(Long id);
 
+//    @Select("select * from fs_course_finish_temp")
+//    public List<FsCourseFinishTemp> selectFsCourseFinishTempByCompanyList();
+
+    @Select("SELECT * FROM fs_course_finish_temp WHERE id = #{id}")
+    public FsCourseFinishTempVO selectFsCourseFinishTempByIdVO(Long id);
+
     /**
      * 查询完课模板列表
      *
@@ -90,4 +96,23 @@ public interface FsCourseFinishTempMapper
     @Select("select * from fs_course_finish_temp where video_id = #{videoId} " +
             "and find_in_set(#{userId},company_user_ids) and is_del= 0 order by create_time desc  limit 1 ")
     FsCourseFinishTemp selectFsCourseFinishTempByCompanyUserId(@Param("userId") Long companyUserId, @Param("videoId")Long videoId);
+
+    @Select("SELECT *\n" +
+            "FROM fs_course_finish_temp\n" +
+            "WHERE video_id = #{videoId}\n" +
+            "  AND is_del = 0\n" +
+            "  AND (\n" +
+            "    (is_all_company_user = 1 AND company_id = #{companyId})\n" +
+            "    OR\n" +
+            "    ((is_all_company_user != 1 OR is_all_company_user IS NULL) AND FIND_IN_SET(#{userId}, company_user_ids))\n" +
+            "  )\n" +
+            "ORDER BY \n" +
+            "  CASE WHEN (is_all_company_user != 1 OR is_all_company_user IS NULL) THEN 0 ELSE 1 END,\n" +
+            "  COALESCE(update_time, create_time) DESC \n" +
+            "LIMIT 1")
+    FsCourseFinishTemp selectFsCourseFinishTempByCompanyId(@Param("userId") Long companyUserId,@Param("companyId") Long companyId, @Param("videoId")Long videoId);
+
+    @Select("select * from fs_course_finish_temp where type = 2 and video_id = #{videoId} " +
+            "and find_in_set(#{userId},company_user_ids) and is_del= 0 order by create_time desc  limit 1 ")
+    FsCourseFinishTemp selectFsCourseFinishTempChatSopByCompanyUserId(Long companyUserId, Long videoId);
 }

+ 7 - 0
fs-service-system/src/main/java/com/fs/course/service/IFsCourseFinishTempService.java

@@ -3,6 +3,7 @@ package com.fs.course.service;
 import java.util.List;
 import com.fs.course.domain.FsCourseFinishTemp;
 import com.fs.course.vo.FsCourseFinishTempListVO;
+import com.fs.course.vo.FsCourseFinishTempVO;
 
 /**
  * 完课模板Service接口
@@ -19,6 +20,7 @@ public interface IFsCourseFinishTempService
      * @return 完课模板
      */
     public FsCourseFinishTemp selectFsCourseFinishTempById(Long id);
+    public FsCourseFinishTempVO selectFsCourseFinishTempByIdVO(Long id);
 
     /**
      * 查询完课模板列表
@@ -61,4 +63,9 @@ public interface IFsCourseFinishTempService
      * @return 结果
      */
     public int deleteFsCourseFinishTempById(Long id);
+
+    /**
+     * 将所有的CompanyUserId更新为 企业微信账号
+     */
+//    public void updateFsCourseFinishTempByCompanyUserId();
 }

+ 59 - 0
fs-service-system/src/main/java/com/fs/course/service/impl/FsCourseFinishTempServiceImpl.java

@@ -1,18 +1,29 @@
 package com.fs.course.service.impl;
 
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
 import java.util.List;
 import java.util.function.Consumer;
+import java.util.stream.Collectors;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.fs.common.utils.DateUtils;
+import com.fs.common.utils.StringUtils;
+import com.fs.company.domain.CompanyUser;
+import com.fs.company.mapper.CompanyUserMapper;
 import com.fs.course.vo.FsCourseFinishTempListVO;
+import com.fs.course.vo.FsCourseFinishTempVO;
 import com.fs.fastGpt.domain.FastGptChatReplaceWords;
 import com.fs.fastGpt.mapper.FastGptChatReplaceWordsMapper;
 import com.fs.fastgptApi.util.AudioUtils;
 import com.fs.fastgptApi.vo.AudioVO;
+import com.fs.qw.mapper.QwUserMapper;
 import com.fs.qw.vo.QwSopCourseFinishTempSetting;
 import com.fs.qw.vo.QwSopTempSetting;
+import com.fs.qw.vo.QwUserVO;
+import com.fs.voice.utils.StringUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.fs.course.mapper.FsCourseFinishTempMapper;
@@ -34,6 +45,12 @@ public class FsCourseFinishTempServiceImpl implements IFsCourseFinishTempService
     @Autowired
     private FastGptChatReplaceWordsMapper fastGptChatReplaceWordsMapper;
 
+    @Autowired
+    private QwUserMapper qwUserMapper;
+
+    @Autowired
+    private CompanyUserMapper companyUserMapper;
+
     /**
      * 查询完课模板
      *
@@ -46,6 +63,19 @@ public class FsCourseFinishTempServiceImpl implements IFsCourseFinishTempService
         return fsCourseFinishTempMapper.selectFsCourseFinishTempById(id);
     }
 
+    @Override
+    public FsCourseFinishTempVO selectFsCourseFinishTempByIdVO(Long id) {
+        FsCourseFinishTempVO fsCourseFinishTemp = fsCourseFinishTempMapper.selectFsCourseFinishTempByIdVO(id);
+
+        String companyUserIds = fsCourseFinishTemp.getCompanyUserIds();
+        List<String> qwUserIdsList = Arrays.asList(companyUserIds.split(","));
+
+        List<QwUserVO> qwUserByIds = qwUserMapper.getQwUserByIdsNoCropId(qwUserIdsList);
+        fsCourseFinishTemp.setUserSelectList(qwUserByIds);
+
+        return fsCourseFinishTemp;
+    }
+
     /**
      * 查询完课模板列表
      *
@@ -148,6 +178,35 @@ public class FsCourseFinishTempServiceImpl implements IFsCourseFinishTempService
         return fsCourseFinishTempMapper.deleteFsCourseFinishTempById(id);
     }
 
+//    @Override
+//    public void updateFsCourseFinishTempByCompanyUserId() {
+//        List<FsCourseFinishTemp> fsCourseFinishTemps = fsCourseFinishTempMapper.selectFsCourseFinishTempByCompanyList();
+//        fsCourseFinishTemps.forEach(item -> {
+//            List<String> qwUserList = new ArrayList<>();
+//            if (!StringUtil.strIsNullOrEmpty(item.getCompanyUserIds())) {
+//                // 分割 companyUserIds 并清理空格
+//                Arrays.stream(item.getCompanyUserIds().split("\\s*,\\s*"))
+//                        .forEach(userId -> {
+//                            if (!StringUtil.strIsNullOrEmpty(userId)){
+//                                CompanyUser companyUser = companyUserMapper.selectCompanyUserById(Long.valueOf(userId.trim()));
+//                                if (companyUser != null && !StringUtil.strIsNullOrEmpty(companyUser.getQwUserId())) {
+//                                    // 分割 qwUserId 并清理空格
+//                                    List<String> cleanedQwUserIds = Arrays.stream(companyUser.getQwUserId().split("\\s*,\\s*"))
+//                                            .map(String::trim)
+//                                            .filter(s -> !s.isEmpty())  // 过滤空字符串
+//                                            .collect(Collectors.toList());
+//                                    qwUserList.addAll(cleanedQwUserIds);
+//                                }
+//                            }
+//                        });
+//                String join = String.join(",", qwUserList);
+//                item.setCompanyUserIds(join);
+//                fsCourseFinishTempMapper.updateFsCourseFinishTemp(item);
+//
+//            }
+//        });
+//    }
+
 
     @Override
     public List<FsCourseFinishTempListVO> selectFsCourseFinishTempListVO(FsCourseFinishTemp fsCourseFinishTemp) {

+ 56 - 0
fs-service-system/src/main/java/com/fs/course/vo/FsCourseFinishTempVO.java

@@ -0,0 +1,56 @@
+package com.fs.course.vo;
+
+import com.fs.common.annotation.Excel;
+import com.fs.common.core.domain.BaseEntity;
+import com.fs.qw.vo.QwUserVO;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class FsCourseFinishTempVO extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /** $column.columnComment */
+    private Long id;
+
+    /** 模板名称 */
+    @Excel(name = "模板名称")
+    private String name;
+
+    /** 状态 1正常 0停用 */
+    @Excel(name = "状态 1正常 0停用")
+    private Long status;
+
+    /** 规则 */
+    @Excel(name = "规则")
+    private String setting;
+
+    /** 公司id */
+    @Excel(name = "公司id")
+    private Long companyId;
+
+    /** 课程id */
+    @Excel(name = "课程id")
+    private Long courseId;
+
+    /** 小节视频id */
+    @Excel(name = "小节视频id")
+    private Long videoId;
+
+    /** 归属销售id(对多) */
+    @Excel(name = "归属销售id(对多)")
+    private String companyUserIds;
+
+    /** 删除标志 */
+    @Excel(name = "删除标志")
+    private Long isDel;
+
+    /** 是否整销售公司可用 */
+    @Excel(name = "是否整销售公司可用")
+    private Integer isAllCompanyUser;
+
+    private Integer type;
+
+    public List<QwUserVO> userSelectList;
+}

+ 13 - 0
fs-service-system/src/main/java/com/fs/qw/mapper/QwUserMapper.java

@@ -343,4 +343,17 @@ public interface QwUserMapper extends BaseMapper<QwUser>
             "and is_del=0 " +
             "and login_code_url is not null ")
     public List<QwUserByToolDTO> selectQwUserListByTools(@Param("companyId") Long companyId , @Param("userId") Long userId);
+
+
+    @Select("<script>" +
+            "select cu.user_name,cu.nick_name,cu.user_id,qu.qw_user_id ,qu.qw_user_name,qu.id from company_user cu " +
+            "LEFT JOIN  qw_user qu " +
+            "ON qu.company_user_id=cu.user_id  " +
+            "where cu.del_flag = 0 and  cu.qw_user_id is not null " +
+            "AND qu.id IN " +
+            "<foreach collection='qwUserIds' item='id' open='(' separator=',' close=')'> " +
+            "#{id} " +
+            "</foreach> " +
+            "</script>")
+    public List<QwUserVO> getQwUserByIdsNoCropId(@Param("qwUserIds") List<String> qwUserIds);
 }

+ 9 - 17
fs-service-system/src/main/java/com/fs/qw/vo/QwSopChatTempSetting.java

@@ -16,25 +16,17 @@ public class QwSopChatTempSetting implements Serializable,Cloneable{
     private String time;
     private String contentType = "1";
 
-    private List<Setting> setting;
-
-    @Data
-    public static class Setting implements Cloneable {
-        private String contentType = "1";
-        //文本
-        private String value;
-
-        @Override
-        public Setting clone() {
-            try {
-                // TODO: copy mutable state here, so the clone can't change the internals of the original
-                return (Setting) super.clone();
-            } catch (CloneNotSupportedException e) {
-                throw new AssertionError();
-            }
+    private String setting;
+
+    @Override
+    public QwSopChatTempSetting clone() {
+        try {
+            // TODO: copy mutable state here, so the clone can't change the internals of the original
+            return (QwSopChatTempSetting) super.clone();
+        } catch (CloneNotSupportedException e) {
+            throw new AssertionError();
         }
     }
-
 }
 
 

+ 14 - 5
fs-service-system/src/main/resources/mapper/course/FsCourseFinishTempMapper.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper
-PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.fs.course.mapper.FsCourseFinishTempMapper">
 
     <resultMap type="FsCourseFinishTemp" id="FsCourseFinishTempResult">
@@ -17,10 +17,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="companyUserIds"    column="company_user_ids"    />
         <result property="updateTime"    column="update_time"    />
         <result property="isDel"    column="is_del"    />
+        <result property="type"    column="type"    />
+        <result property="isAllCompanyUser"    column="is_all_company_user"    />
     </resultMap>
 
     <sql id="selectFsCourseFinishTempVo">
-        select id, name, status, setting, company_id, create_by, create_time, course_id, video_id, company_user_ids, update_time, is_del from fs_course_finish_temp
+        select * from fs_course_finish_temp
     </sql>
 
     <select id="selectFsCourseFinishTempList" parameterType="FsCourseFinishTemp" resultMap="FsCourseFinishTempResult">
@@ -34,6 +36,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="videoId != null "> and video_id = #{videoId}</if>
             <if test="companyUserIds != null  and companyUserIds != ''"> and company_user_ids = #{companyUserIds}</if>
             <if test="isDel != null "> and is_del = #{isDel}</if>
+            <if test="type != null "> and type = #{type}</if>
+            <if test="isAllCompanyUser != null "> and is_all_company_user = #{isAllCompanyUser}</if>
         </where>
     </select>
 
@@ -56,7 +60,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="companyUserIds != null">company_user_ids,</if>
             <if test="updateTime != null">update_time,</if>
             <if test="isDel != null">is_del,</if>
-         </trim>
+            <if test="type != null">type,</if>
+            <if test="isAllCompanyUser != null">is_all_company_user,</if>
+        </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="name != null">#{name},</if>
             <if test="status != null">#{status},</if>
@@ -69,7 +75,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="companyUserIds != null">#{companyUserIds},</if>
             <if test="updateTime != null">#{updateTime},</if>
             <if test="isDel != null">#{isDel},</if>
-         </trim>
+            <if test="isAllCompanyUser != null">#{isAllCompanyUser},</if>
+        </trim>
     </insert>
 
     <update id="updateFsCourseFinishTemp" parameterType="FsCourseFinishTemp">
@@ -86,6 +93,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="companyUserIds != null">company_user_ids = #{companyUserIds},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="isDel != null">is_del = #{isDel},</if>
+            <if test="type != null">type = #{type},</if>
+            <if test="isAllCompanyUser != null">is_all_company_user = #{isAllCompanyUser},</if>
         </trim>
         where id = #{id}
     </update>