Prechádzať zdrojové kódy

feat: 看课统计接口

xdd 2 týždňov pred
rodič
commit
a614ada107
17 zmenil súbory, kde vykonal 1534 pridanie a 0 odobranie
  1. 70 0
      fs-admin/src/main/java/com/fs/stats/SalesWatchStatisController.java
  2. 104 0
      fs-service-system/src/main/java/com/fs/statis/domain/FsStatisEveryDayWatch.java
  3. 107 0
      fs-service-system/src/main/java/com/fs/statis/domain/FsStatisPeriodWatch.java
  4. 101 0
      fs-service-system/src/main/java/com/fs/statis/domain/FsStatisSalerWatch.java
  5. 30 0
      fs-service-system/src/main/java/com/fs/statis/dto/StatsWatchLogPageListDTO.java
  6. 91 0
      fs-service-system/src/main/java/com/fs/statis/mapper/FsStatisEveryDayWatchMapper.java
  7. 104 0
      fs-service-system/src/main/java/com/fs/statis/mapper/FsStatisPeriodWatchMapper.java
  8. 85 0
      fs-service-system/src/main/java/com/fs/statis/mapper/FsStatisSalerWatchMapper.java
  9. 47 0
      fs-service-system/src/main/java/com/fs/statis/service/FsStatisEveryDayWatchService.java
  10. 56 0
      fs-service-system/src/main/java/com/fs/statis/service/FsStatisPeriodWatchService.java
  11. 54 0
      fs-service-system/src/main/java/com/fs/statis/service/FsStatisSalerWatchService.java
  12. 71 0
      fs-service-system/src/main/java/com/fs/statis/service/impl/FsStatisEveryDayWatchServiceImpl.java
  13. 82 0
      fs-service-system/src/main/java/com/fs/statis/service/impl/FsStatisPeriodWatchServiceImpl.java
  14. 89 0
      fs-service-system/src/main/java/com/fs/statis/service/impl/FsStatisSalerWatchServiceImpl.java
  15. 182 0
      fs-service-system/src/main/resources/mapper/statis/FsStatisEveryDayMapper.xml
  16. 146 0
      fs-service-system/src/main/resources/mapper/statis/FsStatisPeriodWatchMapper.xml
  17. 115 0
      fs-service-system/src/main/resources/mapper/statis/FsStatisSalerWatchMapper.xml

+ 70 - 0
fs-admin/src/main/java/com/fs/stats/SalesWatchStatisController.java

@@ -0,0 +1,70 @@
+package com.fs.stats;
+
+import com.fs.common.core.domain.R;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.statis.domain.FsStatisPeriodWatch;
+import com.fs.statis.domain.FsStatisSalerWatch;
+import com.fs.statis.dto.StatsWatchLogPageListDTO;
+import com.fs.statis.service.FsStatisEveryDayWatchService;
+import com.fs.statis.service.FsStatisPeriodWatchService;
+import com.fs.statis.service.FsStatisSalerWatchService;
+import lombok.AllArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * 看课统计接口
+ */
+@RestController
+@RequestMapping("/stats/")
+@AllArgsConstructor
+public class SalesWatchStatisController {
+
+    @Autowired
+    private FsStatisSalerWatchService fsStatisSalerWatchService;
+
+    @Autowired
+    private FsStatisPeriodWatchService fsStatisPeriodWatchService;
+
+    @Autowired
+    private FsStatisEveryDayWatchService fsStatisEveryDayWatchService;
+
+    /**
+     * 销售完播统计查询
+     * @param param param
+     * @return R
+     */
+    @PostMapping("/seller/pageList")
+    public R sellerQueryList(@RequestBody StatsWatchLogPageListDTO param){
+        List<FsStatisSalerWatch> list = fsStatisSalerWatchService.queryList(param);
+        return R.ok().put("data",list);
+    }
+
+    /**
+     * 训练营完播统计查询
+     * @param param param
+     * @return R
+     */
+    @PostMapping("/period/pageList")
+    public R periodQueryList(@RequestBody StatsWatchLogPageListDTO param){
+        List<FsStatisPeriodWatch> list = fsStatisPeriodWatchService.queryList(param);
+        return R.ok().put("data", list);
+    }
+
+    /**
+     * 每日完播统计查询
+     * @param param param
+     * @return R
+     */
+    @PostMapping("/everyDay/pageList")
+    public R everyDayQueryList(@RequestBody StatsWatchLogPageListDTO param){
+        List<FsStatisSalerWatch> list = fsStatisEveryDayWatchService.queryList(param);
+        return R.ok().put("data", list);
+    }
+
+}

+ 104 - 0
fs-service-system/src/main/java/com/fs/statis/domain/FsStatisEveryDayWatch.java

@@ -0,0 +1,104 @@
+package com.fs.statis.domain;
+
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import java.time.LocalDateTime; // 使用 java.time 替代 java.util.Date
+
+/**
+ * 每日统计数据实体类
+ * 对应表 fs_statis_every_day_watch
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@Builder
+public class FsStatisEveryDayWatch {
+
+    /**
+     * 主键ID
+     */
+    private Integer id;
+
+    /**
+     * 数据日期
+     */
+    private LocalDateTime dataDate;
+
+    /**
+     * 训练营id
+     */
+    private Integer periodId;
+
+    /**
+     * 训练营人数
+     */
+    private Integer periodNum;
+
+    /**
+     * 未报名人数
+     */
+    private Integer notRegNum;
+
+    /**
+     * 已报名人数
+     */
+    private Integer registeredNum;
+
+    /**
+     * 报名率
+     */
+    private Float regRate;
+
+    /**
+     * 完课率
+     */
+    private Float completedRate;
+
+    /**
+     * 未上线-总数
+     */
+    private Integer offlineTotal;
+
+    /**
+     * 未上线-未参与
+     */
+    private Integer offlineNotRegNum;
+
+    /**
+     * 未上线-未观看
+     */
+    private Integer offlineNotWatchNum;
+
+    /**
+     * 已上线-总数
+     */
+    private Integer onlineTotal;
+
+    /**
+     * 已上线-上线率
+     */
+    private Float onlineRate;
+
+    /**
+     * 已上线-完播率
+     */
+    private Float onlineCompletedRate;
+
+    /**
+     * 已上线-未完播
+     */
+    private Integer onlineNotCompRateNum;
+
+    /**
+     * 已上线-已完播
+     */
+    private Integer onlineCompletedNum;
+
+    /**
+     * 销售id
+     */
+    private Integer companyUserId;
+
+}

+ 107 - 0
fs-service-system/src/main/java/com/fs/statis/domain/FsStatisPeriodWatch.java

@@ -0,0 +1,107 @@
+package com.fs.statis.domain;
+
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import java.util.Date; // 或者使用 java.time.LocalDateTime
+
+/**
+ * fs_statis_period_watch表 实体类
+ *
+ * @author AutoGenerator
+ * @since now
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@Builder
+public class FsStatisPeriodWatch {
+
+    /**
+     * 主键ID (虽然注释中没有,但通常id为主键)
+     */
+    private Integer id;
+
+    /**
+     * 训练营id
+     */
+    private Integer periodId;
+
+    /**
+     * 训练营人数
+     */
+    private Integer periodNum;
+
+    /**
+     * 未报名人数
+     */
+    private Integer notRegNum;
+
+    /**
+     * 已报名人数
+     */
+    private Integer registeredNum;
+
+    /**
+     * 报名率
+     */
+    private Float regRate;
+
+    /**
+     * 完课率
+     */
+    private Float watchCompletedRate;
+
+    /**
+     * 未上线-总数
+     */
+    private Integer offlineTotal;
+
+    /**
+     * 未上线-未参与
+     */
+    private Integer offlineNotRegNum;
+
+    /**
+     * 未上线-未观看
+     */
+    private Integer offlineNotWatchNum;
+
+    /**
+     * 已上线-总数
+     */
+    private Integer onlineTotal;
+
+    /**
+     * 已上线-上线率
+     */
+    private Float onlineRate;
+
+    /**
+     * 已上线-上线完播率
+     */
+    private Float onlineWatchCompletedRate;
+
+    /**
+     * 已上线-未完播
+     */
+    private Integer onlineWatchNotCompleted;
+
+    /**
+     * 已上线-已完播
+     */
+    private Integer onlineWatchCompleted;
+
+    /**
+     * 数据日期
+     */
+    private Date dataDate;
+
+
+    /**
+     * 销售id
+     */
+    private Long companyUserId;
+
+}

+ 101 - 0
fs-service-system/src/main/java/com/fs/statis/domain/FsStatisSalerWatch.java

@@ -0,0 +1,101 @@
+package com.fs.statis.domain;
+
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+
+/**
+ * 销售观看统计实体类
+ */
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+@Builder
+public class FsStatisSalerWatch {
+
+    /**
+     * 主键ID
+     */
+    private Integer id;
+
+    /**
+     * 部门
+     */
+    private Integer deptId;
+
+    /**
+     * 销售id
+     */
+    private Integer companyUserId;
+
+    /**
+     * 训练营人数
+     */
+    private Integer trainCampNum;
+
+    /**
+     * 未报名人数
+     */
+    private Integer notRegisteredNum;
+
+    /**
+     * 已报名人数
+     */
+    private Integer registeredNum;
+
+    /**
+     * 报名率
+     */
+    private Float regRate;
+
+    /**
+     * 完课率
+     */
+    private Float finishedRate;
+
+    /**
+     * 未上线-总数
+     */
+    private Integer offlineTotal;
+
+    /**
+     * 未上线-未参与
+     */
+    private Integer offlineNotPart; // 注意:原SQL中 'offine_not_part' 可能有拼写错误,这里修正为 offlineNotPart
+
+    /**
+     * 未上线-未观看 (原SQL注释为'为观看',推测应为'未观看')
+     */
+    private Integer offlineNotWatched;
+
+    /**
+     * 已上线-总数
+     */
+    private Integer onlineTotal;
+
+    /**
+     * 已上线-上线率
+     */
+    private Float onlineOnlineRate;
+
+    /**
+     * 已上线-完播率
+     */
+    private Float onlinePlaybackCompleRate;
+
+    /**
+     * 已上线-未完播
+     */
+    private Integer onlineIncompletePlayback;
+
+    /**
+     * 已上线-已完播
+     */
+    private Integer onlineCompletePlayback;
+
+    /**
+     * 训练营id
+     */
+    private Integer periodId;
+}

+ 30 - 0
fs-service-system/src/main/java/com/fs/statis/dto/StatsWatchLogPageListDTO.java

@@ -0,0 +1,30 @@
+package com.fs.statis.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+@Data
+public class StatsWatchLogPageListDTO implements Serializable {
+
+    /**
+     * 员工列表
+     */
+    private List<String> userIds;
+
+    /**
+     * 开始时间
+     */
+    private String startDate;
+    /**
+     * 结束世界
+     */
+    private String endDate;
+
+    /**
+     * 营期列表
+     */
+    private List<String> periodList;
+
+}

+ 91 - 0
fs-service-system/src/main/java/com/fs/statis/mapper/FsStatisEveryDayWatchMapper.java

@@ -0,0 +1,91 @@
+package com.fs.statis.mapper;
+
+import com.fs.statis.domain.FsStatisEveryDayWatch;
+import com.fs.statis.domain.FsStatisSalerWatch;
+import com.fs.statis.dto.StatsWatchLogPageListDTO;
+import org.apache.ibatis.annotations.Insert;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Options;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+import org.apache.ibatis.annotations.Update;
+import java.util.List;
+
+/**
+ * 每日统计数据Mapper接口
+ */
+@Mapper
+public interface FsStatisEveryDayWatchMapper {
+
+    /**
+     * 根据主键ID查询每日统计数据
+     * @param id 主键ID
+     * @return 每日统计数据对象,如果不存在则返回null
+     */
+    @Select("SELECT id, data_date AS dataDate, period_id AS periodId, period_num AS periodNum, " +
+            "not_reg_num AS notRegNum, registered_num AS registeredNum, reg_rate AS regRate, " +
+            "completed_rate AS completedRate, offline_total AS offlineTotal, " +
+            "offline_not_reg_num AS offlineNotRegNum, offline_not_watch_num AS offlineNotWatchNum, " +
+            "online_total AS onlineTotal, online_rate AS onlineRate, " +
+            "online_completed_rate AS onlineCompletedRate, online_not_comp_rate_num AS onlineNotCompRateNum, " +
+            "online_completed_num AS onlineCompletedNum, company_user_id AS companyUserId " +
+            "FROM fs_statis_every_day_watch WHERE id = #{id}")
+    FsStatisEveryDayWatch findById(@Param("id") Integer id);
+
+    /**
+     * 新增每日统计数据
+     * @param fsStatisEveryDayWatch 待插入的每日统计数据对象
+     * @return 影响的行数
+     */
+    @Insert("INSERT INTO fs_statis_every_day_watch (id, data_date, period_id, period_num, not_reg_num, " +
+            "registered_num, reg_rate, completed_rate, offline_total, offline_not_reg_num, " +
+            "offline_not_watch_num, online_total, online_rate, online_completed_rate, " +
+            "online_not_comp_rate_num, online_completed_num, company_user_id) " +
+            "VALUES (#{id}, #{dataDate}, #{periodId}, #{periodNum}, #{notRegNum}, #{registeredNum}, " +
+            "#{regRate}, #{completedRate}, #{offlineTotal}, #{offlineNotRegNum}, #{offlineNotWatchNum}, " +
+            "#{onlineTotal}, #{onlineRate}, #{onlineCompletedRate}, #{onlineNotCompRateNum}, " +
+            "#{onlineCompletedNum}, #{companyUserId})")
+    int insert(FsStatisEveryDayWatch fsStatisEveryDayWatch);
+
+    /**
+     * 更新每日统计数据
+     * @param fsStatisEveryDayWatch 待更新的每日统计数据对象 (必须包含ID)
+     * @return 影响的行数
+     */
+    @Update("UPDATE fs_statis_every_day_watch SET " +
+            "data_date = #{dataDate}, " +
+            "period_id = #{periodId}, " +
+            "period_num = #{periodNum}, " +
+            "not_reg_num = #{notRegNum}, " +
+            "registered_num = #{registeredNum}, " +
+            "reg_rate = #{regRate}, " +
+            "completed_rate = #{completedRate}, " +
+            "offline_total = #{offlineTotal}, " +
+            "offline_not_reg_num = #{offlineNotRegNum}, " +
+            "offline_not_watch_num = #{offlineNotWatchNum}, " +
+            "online_total = #{onlineTotal}, " +
+            "online_rate = #{onlineRate}, " +
+            "online_completed_rate = #{onlineCompletedRate}, " +
+            "online_not_comp_rate_num = #{onlineNotCompRateNum}, " +
+            "online_completed_num = #{onlineCompletedNum}, " +
+            "company_user_id = #{companyUserId} " +
+            "WHERE id = #{id}")
+    int update(FsStatisEveryDayWatch fsStatisEveryDayWatch);
+
+    /**
+     * 查询所有每日统计数据 (示例,根据需要添加更多查询方法)
+     * @return 每日统计数据列表
+     */
+    @Select("SELECT id, data_date AS dataDate, period_id AS periodId, period_num AS periodNum, " +
+            "not_reg_num AS notRegNum, registered_num AS registeredNum, reg_rate AS regRate, " +
+            "completed_rate AS completedRate, offline_total AS offlineTotal, " +
+            "offline_not_reg_num AS offlineNotRegNum, offline_not_watch_num AS offlineNotWatchNum, " +
+            "online_total AS onlineTotal, online_rate AS onlineRate, " +
+            "online_completed_rate AS onlineCompletedRate, online_not_comp_rate_num AS onlineNotCompRateNum, " +
+            "online_completed_num AS onlineCompletedNum, company_user_id AS companyUserId " +
+            "FROM fs_statis_every_day_watch")
+    List<FsStatisEveryDayWatch> findAll();
+
+    List<FsStatisSalerWatch> queryList(StatsWatchLogPageListDTO param);
+
+}

+ 104 - 0
fs-service-system/src/main/java/com/fs/statis/mapper/FsStatisPeriodWatchMapper.java

@@ -0,0 +1,104 @@
+package com.fs.statis.mapper;
+
+import com.fs.statis.domain.FsStatisPeriodWatch;
+import com.fs.statis.dto.StatsWatchLogPageListDTO;
+import org.apache.ibatis.annotations.Insert;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+import org.apache.ibatis.annotations.Update;
+import org.apache.ibatis.annotations.Delete;
+
+import java.util.List;
+
+/**
+ * fs_statis_period_watch表 Mapper 接口
+ *
+ * @author AutoGenerator
+ * @since now
+ */
+@Mapper
+public interface FsStatisPeriodWatchMapper {
+
+    /**
+     * 根据主键查询数据
+     *
+     * @param id 主键
+     * @return 实体对象
+     */
+    @Select("SELECT id, period_id, period_num, not_reg_num, registered_num, reg_rate, " +
+            "watch_completed_rate, offline_total, offline_not_reg_num, offline_not_watch_num, " +
+            "online_total, online_rate, online_watch_completed_rate, online_watch_not_completed, " +
+            "online_watch_completed, data_date " +
+            "FROM fs_statis_period_watch WHERE id = #{id}")
+    FsStatisPeriodWatch selectById(@Param("id") Integer id);
+
+    /**
+     * 新增数据
+     *
+     * @param fsStatisPeriodWatch 实体对象
+     * @return 影响行数
+     */
+    @Insert("INSERT INTO fs_statis_period_watch (id, period_id, period_num, not_reg_num, registered_num, " +
+            "reg_rate, watch_completed_rate, offline_total, offline_not_reg_num, offline_not_watch_num, " +
+            "online_total, online_rate, online_watch_completed_rate, online_watch_not_completed, " +
+            "online_watch_completed, data_date) " +
+            "VALUES (#{id}, #{periodId}, #{periodNum}, #{notRegNum}, #{registeredNum}, #{regRate}, " +
+            "#{watchCompletedRate}, #{offlineTotal}, #{offlineNotRegNum}, #{offlineNotWatchNum}, " +
+            "#{onlineTotal}, #{onlineRate}, #{onlineWatchCompletedRate}, #{onlineWatchNotCompleted}, " +
+            "#{onlineWatchCompleted}, #{dataDate})")
+    // 如果id是自增的,可以加上 @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn="id")
+    int insert(FsStatisPeriodWatch fsStatisPeriodWatch);
+
+    /**
+     * 根据主键更新数据
+     *
+     * @param fsStatisPeriodWatch 实体对象
+     * @return 影响行数
+     */
+    @Update("<script>" +
+            "UPDATE fs_statis_period_watch " +
+            "<set>" +
+            "  <if test='periodId != null'>period_id = #{periodId},</if>" +
+            "  <if test='periodNum != null'>period_num = #{periodNum},</if>" +
+            "  <if test='notRegNum != null'>not_reg_num = #{notRegNum},</if>" +
+            "  <if test='registeredNum != null'>registered_num = #{registeredNum},</if>" +
+            "  <if test='regRate != null'>reg_rate = #{regRate},</if>" +
+            "  <if test='watchCompletedRate != null'>watch_completed_rate = #{watchCompletedRate},</if>" +
+            "  <if test='offlineTotal != null'>offline_total = #{offlineTotal},</if>" +
+            "  <if test='offlineNotRegNum != null'>offline_not_reg_num = #{offlineNotRegNum},</if>" +
+            "  <if test='offlineNotWatchNum != null'>offline_not_watch_num = #{offlineNotWatchNum},</if>" +
+            "  <if test='onlineTotal != null'>online_total = #{onlineTotal},</if>" +
+            "  <if test='onlineRate != null'>online_rate = #{onlineRate},</if>" +
+            "  <if test='onlineWatchCompletedRate != null'>online_watch_completed_rate = #{onlineWatchCompletedRate},</if>" +
+            "  <if test='onlineWatchNotCompleted != null'>online_watch_not_completed = #{onlineWatchNotCompleted},</if>" +
+            "  <if test='onlineWatchCompleted != null'>online_watch_completed = #{onlineWatchCompleted},</if>" +
+            "  <if test='dataDate != null'>data_date = #{dataDate},</if>" +
+            "</set>" +
+            "WHERE id = #{id}" +
+            "</script>")
+    int updateById(FsStatisPeriodWatch fsStatisPeriodWatch);
+
+    /**
+     * 根据主键删除数据
+     *
+     * @param id 主键
+     * @return 影响行数
+     */
+    @Delete("DELETE FROM fs_statis_period_watch WHERE id = #{id}")
+    int deleteById(@Param("id") Integer id);
+
+    /**
+     * 查询所有数据
+     *
+     * @return 实体对象列表
+     */
+    @Select("SELECT id, period_id, period_num, not_reg_num, registered_num, reg_rate, " +
+            "watch_completed_rate, offline_total, offline_not_reg_num, offline_not_watch_num, " +
+            "online_total, online_rate, online_watch_completed_rate, online_watch_not_completed, " +
+            "online_watch_completed, data_date " +
+            "FROM fs_statis_period_watch")
+    List<FsStatisPeriodWatch> selectAll();
+
+    List<FsStatisPeriodWatch> queryList(StatsWatchLogPageListDTO param);
+}

+ 85 - 0
fs-service-system/src/main/java/com/fs/statis/mapper/FsStatisSalerWatchMapper.java

@@ -0,0 +1,85 @@
+package com.fs.statis.mapper;
+
+import com.fs.statis.domain.FsStatisSalerWatch;
+import com.fs.statis.dto.StatsWatchLogPageListDTO;
+import org.apache.ibatis.annotations.Delete;
+import org.apache.ibatis.annotations.Insert;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Options;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+import org.apache.ibatis.annotations.Update;
+
+import java.util.List;
+
+/**
+ * 销售观看统计Mapper接口
+ */
+@Mapper
+public interface FsStatisSalerWatchMapper {
+
+    /**
+     * 根据ID查询销售观看统计
+     * @param id 主键ID
+     * @return 销售观看统计对象
+     */
+    @Select("SELECT * FROM fs_statis_saler_watch WHERE id = #{id}")
+    FsStatisSalerWatch findById(@Param("id") Integer id);
+
+    /**
+     * 查询所有销售观看统计
+     * @return 销售观看统计列表
+     */
+    @Select("SELECT * FROM fs_statis_saler_watch")
+    List<FsStatisSalerWatch> findAll();
+
+    /**
+     * 新增销售观看统计
+     * @param fsStatisSalerWatch 销售观看统计对象
+     * @return 受影响的行数
+     */
+    @Insert("INSERT INTO fs_statis_saler_watch (dept_id, company_user_id, train_camp_num, not_registered_num, " +
+            "registered_num, reg_rate, finished_rate, offline_total, offline_not_part, offline_not_watched, " +
+            "online_total, online_online_rate, online_playback_comple_rate, online_incomplete_playback, " +
+            "online_complete_playback) " +
+            "VALUES (#{deptId}, #{companyUserId}, #{trainCampNum}, #{notRegisteredNum}, #{registeredNum}, " +
+            "#{regRate}, #{finishedRate}, #{offlineTotal}, #{offlineNotPart}, #{offlineNotWatched}, #{onlineTotal}, " +
+            "#{onlineOnlineRate}, #{onlinePlaybackCompleRate}, #{onlineIncompletePlayback}, #{onlineCompletePlayback})")
+    @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
+    int insert(FsStatisSalerWatch fsStatisSalerWatch);
+
+    /**
+     * 更新销售观看统计
+     * @param fsStatisSalerWatch 销售观看统计对象
+     * @return 受影响的行数
+     */
+    @Update("UPDATE fs_statis_saler_watch SET " +
+            "dept_id = #{deptId}, " +
+            "company_user_id = #{companyUserId}, " +
+            "train_camp_num = #{trainCampNum}, " +
+            "not_registered_num = #{notRegisteredNum}, " +
+            "registered_num = #{registeredNum}, " +
+            "reg_rate = #{regRate}, " +
+            "finished_rate = #{finishedRate}, " +
+            "offline_total = #{offlineTotal}, " +
+            "offline_not_part = #{offlineNotPart}, " +
+            "offline_not_watched = #{offlineNotWatched}, " +
+            "online_total = #{onlineTotal}, " +
+            "online_online_rate = #{onlineOnlineRate}, " +
+            "online_playback_comple_rate = #{onlinePlaybackCompleRate}, " +
+            "online_incomplete_playback = #{onlineIncompletePlayback}, " +
+            "online_complete_playback = #{onlineCompletePlayback} " +
+            "WHERE id = #{id}")
+    int update(FsStatisSalerWatch fsStatisSalerWatch);
+
+    /**
+     * 根据ID删除销售观看统计
+     * @param id 主键ID
+     * @return 受影响的行数
+     */
+    @Delete("DELETE FROM fs_statis_saler_watch WHERE id = #{id}")
+    int deleteById(@Param("id") Integer id);
+
+    List<FsStatisSalerWatch> queryList(StatsWatchLogPageListDTO param);
+
+}

+ 47 - 0
fs-service-system/src/main/java/com/fs/statis/service/FsStatisEveryDayWatchService.java

@@ -0,0 +1,47 @@
+package com.fs.statis.service;
+
+import com.fs.statis.domain.FsStatisEveryDayWatch;
+import com.fs.statis.domain.FsStatisSalerWatch;
+import com.fs.statis.dto.StatsWatchLogPageListDTO;
+
+import java.util.List;
+
+/**
+ * 每日统计数据服务接口
+ */
+public interface FsStatisEveryDayWatchService {
+
+    /**
+     * 根据主键ID查询每日统计数据
+     *
+     * @param id 主键ID
+     * @return 每日统计数据对象,如果不存在则返回null
+     */
+    FsStatisEveryDayWatch findById(Integer id);
+
+    /**
+     * 新增每日统计数据
+     *
+     * @param fsStatisEveryDayWatch 待插入的每日统计数据对象
+     * @return 影响的行数,通常是1表示成功
+     */
+    int create(FsStatisEveryDayWatch fsStatisEveryDayWatch);
+
+    /**
+     * 更新每日统计数据
+     *
+     * @param fsStatisEveryDayWatch 待更新的每日统计数据对象 (必须包含ID)
+     * @return 影响的行数,通常是1表示成功,0表示未找到对应记录
+     */
+    int update(FsStatisEveryDayWatch fsStatisEveryDayWatch);
+
+    /**
+     * 查询所有每日统计数据
+     *
+     * @return 每日统计数据列表
+     */
+    List<FsStatisEveryDayWatch> findAll();
+
+    List<FsStatisSalerWatch> queryList(StatsWatchLogPageListDTO param);
+
+}

+ 56 - 0
fs-service-system/src/main/java/com/fs/statis/service/FsStatisPeriodWatchService.java

@@ -0,0 +1,56 @@
+package com.fs.statis.service; // 假设Service接口放在此包下
+
+import com.fs.statis.domain.FsStatisPeriodWatch;
+import com.fs.statis.dto.StatsWatchLogPageListDTO;
+
+import java.util.List;
+
+/**
+ * 训练营周期统计数据服务接口
+ * 对应表 fs_statis_period_watch
+ */
+public interface FsStatisPeriodWatchService {
+
+    /**
+     * 根据主键ID查询训练营周期统计数据
+     *
+     * @param id 主键ID
+     * @return 训练营周期统计数据对象,如果不存在则返回null
+     */
+    FsStatisPeriodWatch findById(Integer id);
+
+    /**
+     * 新增训练营周期统计数据
+     *
+     * @param fsStatisPeriodWatch 待插入的训练营周期统计数据对象
+     * @return 影响的行数,通常是1表示成功
+     */
+    int create(FsStatisPeriodWatch fsStatisPeriodWatch);
+
+    /**
+     * 根据主键更新训练营周期统计数据
+     * (只会更新实体中非null的字段)
+     *
+     * @param fsStatisPeriodWatch 待更新的训练营周期统计数据对象 (必须包含ID)
+     * @return 影响的行数,通常是1表示成功,0表示未找到对应记录或未更新任何字段
+     */
+    int updateById(FsStatisPeriodWatch fsStatisPeriodWatch);
+
+    /**
+     * 根据主键ID删除训练营周期统计数据
+     *
+     * @param id 主键ID
+     * @return 影响的行数
+     */
+    int deleteById(Integer id);
+
+    /**
+     * 查询所有训练营周期统计数据
+     *
+     * @return 训练营周期统计数据列表
+     */
+    List<FsStatisPeriodWatch> findAll();
+
+    List<FsStatisPeriodWatch> queryList(StatsWatchLogPageListDTO param);
+
+}

+ 54 - 0
fs-service-system/src/main/java/com/fs/statis/service/FsStatisSalerWatchService.java

@@ -0,0 +1,54 @@
+package com.fs.statis.service;
+
+import com.fs.statis.domain.FsStatisSalerWatch;
+import com.fs.statis.dto.StatsWatchLogPageListDTO;
+
+import java.util.List;
+
+/**
+ * 销售观看统计服务接口
+ */
+public interface FsStatisSalerWatchService {
+
+    /**
+     * 根据ID查询销售观看统计
+     *
+     * @param id 主键ID
+     * @return 销售观看统计对象,如果不存在则返回null
+     */
+    FsStatisSalerWatch getById(Integer id);
+
+    /**
+     * 查询所有销售观看统计
+     *
+     * @return 销售观看统计列表
+     */
+    List<FsStatisSalerWatch> getAll();
+
+    /**
+     * 新增销售观看统计
+     *
+     * @param fsStatisSalerWatch 待新增的销售观看统计对象
+     * @return 返回带有生成ID的销售观看统计对象
+     */
+    FsStatisSalerWatch create(FsStatisSalerWatch fsStatisSalerWatch);
+
+    /**
+     * 更新销售观看统计
+     *
+     * @param fsStatisSalerWatch 待更新的销售观看统计对象 (ID必须存在)
+     * @return 返回更新后的销售观看统计对象,如果更新失败或对象不存在则可能返回null或抛出异常
+     */
+    FsStatisSalerWatch update(FsStatisSalerWatch fsStatisSalerWatch);
+
+    /**
+     * 根据ID删除销售观看统计
+     *
+     * @param id 主键ID
+     * @return 删除成功返回true,否则返回false
+     */
+    boolean deleteById(Integer id);
+
+    List<FsStatisSalerWatch> queryList(StatsWatchLogPageListDTO param);
+
+}

+ 71 - 0
fs-service-system/src/main/java/com/fs/statis/service/impl/FsStatisEveryDayWatchServiceImpl.java

@@ -0,0 +1,71 @@
+package com.fs.statis.service.impl;
+
+import com.fs.statis.domain.FsStatisEveryDayWatch;
+import com.fs.statis.domain.FsStatisSalerWatch;
+import com.fs.statis.dto.StatsWatchLogPageListDTO;
+import com.fs.statis.mapper.FsStatisEveryDayWatchMapper;
+import com.fs.statis.service.FsStatisEveryDayWatchService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional; // 引入事务注解
+
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * 每日统计数据服务实现类
+ */
+@Service
+public class FsStatisEveryDayWatchServiceImpl implements FsStatisEveryDayWatchService {
+
+    private final FsStatisEveryDayWatchMapper fsStatisEveryDayWatchMapper;
+
+    /**
+     * 通过构造函数注入Mapper
+     * @param fsStatisEveryDayWatchMapper 每日统计数据Mapper
+     */
+    @Autowired
+    public FsStatisEveryDayWatchServiceImpl(FsStatisEveryDayWatchMapper fsStatisEveryDayWatchMapper) {
+        this.fsStatisEveryDayWatchMapper = fsStatisEveryDayWatchMapper;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public FsStatisEveryDayWatch findById(Integer id) {
+        return fsStatisEveryDayWatchMapper.findById(id);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    @Transactional
+    public int create(FsStatisEveryDayWatch fsStatisEveryDayWatch) {
+        return fsStatisEveryDayWatchMapper.insert(fsStatisEveryDayWatch);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    @Transactional
+    public int update(FsStatisEveryDayWatch fsStatisEveryDayWatch) {
+        return fsStatisEveryDayWatchMapper.update(fsStatisEveryDayWatch);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public List<FsStatisEveryDayWatch> findAll() {
+        return fsStatisEveryDayWatchMapper.findAll();
+    }
+
+    @Override
+    public List<FsStatisSalerWatch> queryList(StatsWatchLogPageListDTO param) {
+        return fsStatisEveryDayWatchMapper.queryList(param);
+    }
+
+}

+ 82 - 0
fs-service-system/src/main/java/com/fs/statis/service/impl/FsStatisPeriodWatchServiceImpl.java

@@ -0,0 +1,82 @@
+package com.fs.statis.service.impl; // 假设Service实现类放在此包下
+
+import com.fs.statis.domain.FsStatisPeriodWatch;
+import com.fs.statis.dto.StatsWatchLogPageListDTO;
+import com.fs.statis.mapper.FsStatisPeriodWatchMapper;
+import com.fs.statis.service.FsStatisPeriodWatchService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * 训练营周期统计数据服务实现类
+ */
+@Service
+public class FsStatisPeriodWatchServiceImpl implements FsStatisPeriodWatchService {
+
+    private final FsStatisPeriodWatchMapper fsStatisPeriodWatchMapper;
+
+    /**
+     * 通过构造函数注入Mapper
+     * @param fsStatisPeriodWatchMapper 训练营周期统计数据Mapper
+     */
+    @Autowired
+    public FsStatisPeriodWatchServiceImpl(FsStatisPeriodWatchMapper fsStatisPeriodWatchMapper) {
+        this.fsStatisPeriodWatchMapper = fsStatisPeriodWatchMapper;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public FsStatisPeriodWatch findById(Integer id) {
+        return fsStatisPeriodWatchMapper.selectById(id);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    @Transactional // 标记此方法需要事务管理
+    public int create(FsStatisPeriodWatch fsStatisPeriodWatch) {
+        // 在这里可以添加业务逻辑,例如参数校验等
+        return fsStatisPeriodWatchMapper.insert(fsStatisPeriodWatch);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    @Transactional // 标记此方法需要事务管理
+    public int updateById(FsStatisPeriodWatch fsStatisPeriodWatch) {
+        // 在这里可以添加业务逻辑,例如检查记录是否存在,或在更新前进行特定校验
+        // 注意:Mapper中的updateById是动态SQL,只更新非null字段
+        return fsStatisPeriodWatchMapper.updateById(fsStatisPeriodWatch);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    @Transactional // 标记此方法需要事务管理
+    public int deleteById(Integer id) {
+        // 在这里可以添加业务逻辑,例如检查关联数据等
+        return fsStatisPeriodWatchMapper.deleteById(id);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public List<FsStatisPeriodWatch> findAll() {
+        return fsStatisPeriodWatchMapper.selectAll();
+    }
+
+    @Override
+    public List<FsStatisPeriodWatch> queryList(StatsWatchLogPageListDTO param) {
+        return fsStatisPeriodWatchMapper.queryList(param);
+    }
+}

+ 89 - 0
fs-service-system/src/main/java/com/fs/statis/service/impl/FsStatisSalerWatchServiceImpl.java

@@ -0,0 +1,89 @@
+package com.fs.statis.service.impl;
+
+import com.fs.statis.domain.FsStatisSalerWatch;
+import com.fs.statis.dto.StatsWatchLogPageListDTO;
+import com.fs.statis.mapper.FsStatisSalerWatchMapper;
+import com.fs.statis.service.FsStatisSalerWatchService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * 销售观看统计服务实现类
+ */
+@Service
+public class FsStatisSalerWatchServiceImpl implements FsStatisSalerWatchService {
+
+    private final FsStatisSalerWatchMapper fsStatisSalerWatchMapper;
+
+    @Autowired
+    public FsStatisSalerWatchServiceImpl(FsStatisSalerWatchMapper fsStatisSalerWatchMapper) {
+        this.fsStatisSalerWatchMapper = fsStatisSalerWatchMapper;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public FsStatisSalerWatch getById(Integer id) {
+        if (id == null) {
+            return null;
+        }
+        return fsStatisSalerWatchMapper.findById(id);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public List<FsStatisSalerWatch> getAll() {
+        return fsStatisSalerWatchMapper.findAll();
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public FsStatisSalerWatch create(FsStatisSalerWatch fsStatisSalerWatch) {
+        if (fsStatisSalerWatch == null) {
+            return null;
+        }
+        fsStatisSalerWatch.setId(null);
+        fsStatisSalerWatchMapper.insert(fsStatisSalerWatch);
+        return fsStatisSalerWatch;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public FsStatisSalerWatch update(FsStatisSalerWatch fsStatisSalerWatch) {
+        if (fsStatisSalerWatch == null || fsStatisSalerWatch.getId() == null) {
+            return null;
+        }
+        int affectedRows = fsStatisSalerWatchMapper.update(fsStatisSalerWatch);
+        if (affectedRows > 0) {
+            return fsStatisSalerWatch;
+        }
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean deleteById(Integer id) {
+        if (id == null) {
+            return false;
+        }
+        int affectedRows = fsStatisSalerWatchMapper.deleteById(id);
+        return affectedRows > 0;
+    }
+
+    @Override
+    public List<FsStatisSalerWatch> queryList(StatsWatchLogPageListDTO param) {
+        return fsStatisSalerWatchMapper.queryList(param);
+    }
+}

+ 182 - 0
fs-service-system/src/main/resources/mapper/statis/FsStatisEveryDayMapper.xml

@@ -0,0 +1,182 @@
+<?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">
+<mapper namespace="com.fs.statis.mapper.FsStatisEveryDayWatchMapper">
+
+    <!-- 结果集映射 -->
+    <resultMap id="BaseResultMap" type="com.fs.statis.domain.FsStatisEveryDayWatch">
+        <id column="id" jdbcType="INTEGER" property="id" />
+        <result column="data_date" jdbcType="TIMESTAMP" property="dataDate" />
+        <result column="period_id" jdbcType="INTEGER" property="periodId" />
+        <result column="period_num" jdbcType="INTEGER" property="periodNum" />
+        <result column="not_reg_num" jdbcType="INTEGER" property="notRegNum" />
+        <result column="registered_num" jdbcType="INTEGER" property="registeredNum" />
+        <result column="reg_rate" jdbcType="REAL" property="regRate" /> <!-- Use REAL or FLOAT for float type -->
+        <result column="completed_rate" jdbcType="REAL" property="completedRate" />
+        <result column="offline_total" jdbcType="INTEGER" property="offlineTotal" />
+        <result column="offline_not_reg_num" jdbcType="INTEGER" property="offlineNotRegNum" />
+        <result column="offline_not_watch_num" jdbcType="INTEGER" property="offlineNotWatchNum" />
+        <result column="online_total" jdbcType="INTEGER" property="onlineTotal" />
+        <result column="online_rate" jdbcType="REAL" property="onlineRate" />
+        <result column="online_completed_rate" jdbcType="REAL" property="onlineCompletedRate" />
+        <result column="online_not_comp_rate_num" jdbcType="INTEGER" property="onlineNotCompRateNum" />
+        <result column="online_completed_num" jdbcType="INTEGER" property="onlineCompletedNum" />
+        <result column="company_user_id" jdbcType="INTEGER" property="companyUserId" />
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        id, data_date, period_id, period_num, not_reg_num, registered_num, reg_rate,
+    completed_rate, offline_total, offline_not_reg_num, offline_not_watch_num,
+    online_total, online_rate, online_completed_rate, online_not_comp_rate_num,
+    online_completed_num, company_user_id
+    </sql>
+
+    <!-- 根据主键查询 -->
+    <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
+        select
+        <include refid="Base_Column_List" />
+        from fs_statis_every_day_watch
+        where id = #{id,jdbcType=INTEGER}
+    </select>
+
+    <!-- 根据主键删除 -->
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+        delete from fs_statis_every_day_watch
+        where id = #{id,jdbcType=INTEGER}
+    </delete>
+
+    <!-- 插入记录 (所有字段) -->
+    <insert id="insert" parameterType="com.fs.statis.domain.FsStatisEveryDayWatch" useGeneratedKeys="true" keyProperty="id">
+        insert into fs_statis_every_day_watch (
+            data_date, period_id, period_num,
+            not_reg_num, registered_num, reg_rate,
+            completed_rate, offline_total, offline_not_reg_num,
+            offline_not_watch_num, online_total, online_rate,
+            online_completed_rate, online_not_comp_rate_num,
+            online_completed_num, company_user_id
+        )
+        values (
+                   #{dataDate,jdbcType=TIMESTAMP}, #{periodId,jdbcType=INTEGER}, #{periodNum,jdbcType=INTEGER},
+                   #{notRegNum,jdbcType=INTEGER}, #{registeredNum,jdbcType=INTEGER}, #{regRate,jdbcType=REAL},
+                   #{completedRate,jdbcType=REAL}, #{offlineTotal,jdbcType=INTEGER}, #{offlineNotRegNum,jdbcType=INTEGER},
+                   #{offlineNotWatchNum,jdbcType=INTEGER}, #{onlineTotal,jdbcType=INTEGER}, #{onlineRate,jdbcType=REAL},
+                   #{onlineCompletedRate,jdbcType=REAL}, #{onlineNotCompRateNum,jdbcType=INTEGER},
+                   #{onlineCompletedNum,jdbcType=INTEGER}, #{companyUserId,jdbcType=INTEGER}
+               )
+    </insert>
+
+    <!-- 选择性插入记录 (只插入非空字段) -->
+    <insert id="insertSelective" parameterType="com.fs.statis.domain.FsStatisEveryDayWatch" useGeneratedKeys="true" keyProperty="id">
+        insert into fs_statis_every_day_watch
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="dataDate != null">data_date,</if>
+            <if test="periodId != null">period_id,</if>
+            <if test="periodNum != null">period_num,</if>
+            <if test="notRegNum != null">not_reg_num,</if>
+            <if test="registeredNum != null">registered_num,</if>
+            <if test="regRate != null">reg_rate,</if>
+            <if test="completedRate != null">completed_rate,</if>
+            <if test="offlineTotal != null">offline_total,</if>
+            <if test="offlineNotRegNum != null">offline_not_reg_num,</if>
+            <if test="offlineNotWatchNum != null">offline_not_watch_num,</if>
+            <if test="onlineTotal != null">online_total,</if>
+            <if test="onlineRate != null">online_rate,</if>
+            <if test="onlineCompletedRate != null">online_completed_rate,</if>
+            <if test="onlineNotCompRateNum != null">online_not_comp_rate_num,</if>
+            <if test="onlineCompletedNum != null">online_completed_num,</if>
+            <if test="companyUserId != null">company_user_id,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="dataDate != null">#{dataDate,jdbcType=TIMESTAMP},</if>
+            <if test="periodId != null">#{periodId,jdbcType=INTEGER},</if>
+            <if test="periodNum != null">#{periodNum,jdbcType=INTEGER},</if>
+            <if test="notRegNum != null">#{notRegNum,jdbcType=INTEGER},</if>
+            <if test="registeredNum != null">#{registeredNum,jdbcType=INTEGER},</if>
+            <if test="regRate != null">#{regRate,jdbcType=REAL},</if>
+            <if test="completedRate != null">#{completedRate,jdbcType=REAL},</if>
+            <if test="offlineTotal != null">#{offlineTotal,jdbcType=INTEGER},</if>
+            <if test="offlineNotRegNum != null">#{offlineNotRegNum,jdbcType=INTEGER},</if>
+            <if test="offlineNotWatchNum != null">#{offlineNotWatchNum,jdbcType=INTEGER},</if>
+            <if test="onlineTotal != null">#{onlineTotal,jdbcType=INTEGER},</if>
+            <if test="onlineRate != null">#{onlineRate,jdbcType=REAL},</if>
+            <if test="onlineCompletedRate != null">#{onlineCompletedRate,jdbcType=REAL},</if>
+            <if test="onlineNotCompRateNum != null">#{onlineNotCompRateNum,jdbcType=INTEGER},</if>
+            <if test="onlineCompletedNum != null">#{onlineCompletedNum,jdbcType=INTEGER},</if>
+            <if test="companyUserId != null">#{companyUserId,jdbcType=INTEGER},</if>
+        </trim>
+    </insert>
+
+    <!-- 根据主键选择性更新 (只更新非空字段) -->
+    <update id="updateByPrimaryKeySelective" parameterType="com.fs.statis.domain.FsStatisEveryDayWatch">
+        update fs_statis_every_day_watch
+        <set>
+            <if test="dataDate != null">data_date = #{dataDate,jdbcType=TIMESTAMP},</if>
+            <if test="periodId != null">period_id = #{periodId,jdbcType=INTEGER},</if>
+            <if test="periodNum != null">period_num = #{periodNum,jdbcType=INTEGER},</if>
+            <if test="notRegNum != null">not_reg_num = #{notRegNum,jdbcType=INTEGER},</if>
+            <if test="registeredNum != null">registered_num = #{registeredNum,jdbcType=INTEGER},</if>
+            <if test="regRate != null">reg_rate = #{regRate,jdbcType=REAL},</if>
+            <if test="completedRate != null">completed_rate = #{completedRate,jdbcType=REAL},</if>
+            <if test="offlineTotal != null">offline_total = #{offlineTotal,jdbcType=INTEGER},</if>
+            <if test="offlineNotRegNum != null">offline_not_reg_num = #{offlineNotRegNum,jdbcType=INTEGER},</if>
+            <if test="offlineNotWatchNum != null">offline_not_watch_num = #{offlineNotWatchNum,jdbcType=INTEGER},</if>
+            <if test="onlineTotal != null">online_total = #{onlineTotal,jdbcType=INTEGER},</if>
+            <if test="onlineRate != null">online_rate = #{onlineRate,jdbcType=REAL},</if>
+            <if test="onlineCompletedRate != null">online_completed_rate = #{onlineCompletedRate,jdbcType=REAL},</if>
+            <if test="onlineNotCompRateNum != null">online_not_comp_rate_num = #{onlineNotCompRateNum,jdbcType=INTEGER},</if>
+            <if test="onlineCompletedNum != null">online_completed_num = #{onlineCompletedNum,jdbcType=INTEGER},</if>
+            <if test="companyUserId != null">company_user_id = #{companyUserId,jdbcType=INTEGER},</if>
+        </set>
+        where id = #{id,jdbcType=INTEGER}
+    </update>
+
+    <!-- 根据主键更新 (所有字段) -->
+    <update id="updateByPrimaryKey" parameterType="com.fs.statis.domain.FsStatisEveryDayWatch">
+        update fs_statis_every_day_watch
+        set data_date = #{dataDate,jdbcType=TIMESTAMP},
+            period_id = #{periodId,jdbcType=INTEGER},
+            period_num = #{periodNum,jdbcType=INTEGER},
+            not_reg_num = #{notRegNum,jdbcType=INTEGER},
+            registered_num = #{registeredNum,jdbcType=INTEGER},
+            reg_rate = #{regRate,jdbcType=REAL},
+            completed_rate = #{completedRate,jdbcType=REAL},
+            offline_total = #{offlineTotal,jdbcType=INTEGER},
+            offline_not_reg_num = #{offlineNotRegNum,jdbcType=INTEGER},
+            offline_not_watch_num = #{offlineNotWatchNum,jdbcType=INTEGER},
+            online_total = #{onlineTotal,jdbcType=INTEGER},
+            online_rate = #{onlineRate,jdbcType=REAL},
+            online_completed_rate = #{onlineCompletedRate,jdbcType=REAL},
+            online_not_comp_rate_num = #{onlineNotCompRateNum,jdbcType=INTEGER},
+            online_completed_num = #{onlineCompletedNum,jdbcType=INTEGER},
+            company_user_id = #{companyUserId,jdbcType=INTEGER}
+        where id = #{id,jdbcType=INTEGER}
+    </update>
+
+    <!-- 查询所有记录 -->
+    <select id="selectAll" resultMap="BaseResultMap">
+        select
+        <include refid="Base_Column_List" />
+        from fs_statis_every_day_watch
+    </select>
+    <select id="queryList" resultType="com.fs.statis.domain.FsStatisSalerWatch">
+        select * from fs_statis_every_day_watch
+        <where>
+            <if test="userIds != null and userIds.length > 0">
+                AND company_user_id IN
+                <foreach collection="userIds" open="(" close=")" separator="," item="item">
+                    ${item}
+                </foreach>
+            </if>
+            <if test="periodList != null and periodList.length > 0">
+                AND period_id IN
+                <foreach collection="periodList" open="(" close=")" separator="," item="item">
+                    ${item}
+                </foreach>
+            </if>
+            <if test="startDate != null and endDate != null">
+                AND data_date BETWEEN #{startDate} AND #{endDate}
+            </if>
+        </where>
+    </select>
+
+</mapper>

+ 146 - 0
fs-service-system/src/main/resources/mapper/statis/FsStatisPeriodWatchMapper.xml

@@ -0,0 +1,146 @@
+<?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">
+<mapper namespace="com.fs.statis.mapper.FsStatisPeriodWatchMapper">
+
+    <!-- 通用查询结果映射 -->
+    <resultMap id="BaseResultMap" type="com.fs.statis.domain.FsStatisPeriodWatch">
+        <id column="id" property="id" jdbcType="INTEGER" />
+        <result column="period_id" property="periodId" jdbcType="INTEGER" />
+        <result column="period_num" property="periodNum" jdbcType="INTEGER" />
+        <result column="not_reg_num" property="notRegNum" jdbcType="INTEGER" />
+        <result column="registered_num" property="registeredNum" jdbcType="INTEGER" />
+        <result column="reg_rate" property="regRate" jdbcType="DECIMAL" />
+        <result column="watch_completed_rate" property="watchCompletedRate" jdbcType="DECIMAL" />
+        <result column="offline_total" property="offlineTotal" jdbcType="INTEGER" />
+        <result column="offline_not_reg_num" property="offlineNotRegNum" jdbcType="INTEGER" />
+        <result column="offline_not_watch_num" property="offlineNotWatchNum" jdbcType="INTEGER" />
+        <result column="online_total" property="onlineTotal" jdbcType="INTEGER" />
+        <result column="online_rate" property="onlineRate" jdbcType="DECIMAL" />
+        <result column="online_watch_completed_rate" property="onlineWatchCompletedRate" jdbcType="DECIMAL" />
+        <result column="online_watch_not_completed" property="onlineWatchNotCompleted" jdbcType="INTEGER" />
+        <result column="online_watch_completed" property="onlineWatchCompleted" jdbcType="INTEGER" />
+        <result column="data_date" property="dataDate" jdbcType="DATE" />
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        id, period_id, period_num, not_reg_num, registered_num, reg_rate,
+        watch_completed_rate, offline_total, offline_not_reg_num, offline_not_watch_num,
+        online_total, online_rate, online_watch_completed_rate, online_watch_not_completed,
+        online_watch_completed, data_date
+    </sql>
+
+    <!-- 根据主键查询数据 -->
+    <select id="selectById" resultMap="BaseResultMap" parameterType="java.lang.Integer">
+        SELECT
+        <include refid="Base_Column_List" />
+        FROM fs_statis_period_watch
+        WHERE id = #{id,jdbcType=INTEGER}
+    </select>
+
+    <!-- 新增数据 -->
+    <insert id="insert" parameterType="com.fs.statis.domain.FsStatisPeriodWatch">
+        INSERT INTO fs_statis_period_watch (
+            id, period_id, period_num, not_reg_num, registered_num, reg_rate,
+            watch_completed_rate, offline_total, offline_not_reg_num, offline_not_watch_num,
+            online_total, online_rate, online_watch_completed_rate, online_watch_not_completed,
+            online_watch_completed, data_date
+        )
+        VALUES (
+                   #{id,jdbcType=INTEGER}, #{periodId,jdbcType=INTEGER}, #{periodNum,jdbcType=INTEGER},
+                   #{notRegNum,jdbcType=INTEGER}, #{registeredNum,jdbcType=INTEGER}, #{regRate,jdbcType=DECIMAL},
+                   #{watchCompletedRate,jdbcType=DECIMAL}, #{offlineTotal,jdbcType=INTEGER},
+                   #{offlineNotRegNum,jdbcType=INTEGER}, #{offlineNotWatchNum,jdbcType=INTEGER},
+                   #{onlineTotal,jdbcType=INTEGER}, #{onlineRate,jdbcType=DECIMAL},
+                   #{onlineWatchCompletedRate,jdbcType=DECIMAL}, #{onlineWatchNotCompleted,jdbcType=INTEGER},
+                   #{onlineWatchCompleted,jdbcType=INTEGER}, #{dataDate,jdbcType=DATE}
+               )
+    </insert>
+
+    <!-- 根据主键更新数据 (动态SQL,只更新非null字段) -->
+    <update id="updateById" parameterType="com.fs.statis.domain.FsStatisPeriodWatch">
+        UPDATE fs_statis_period_watch
+        <set>
+            <if test="periodId != null">
+                period_id = #{periodId,jdbcType=INTEGER},
+            </if>
+            <if test="periodNum != null">
+                period_num = #{periodNum,jdbcType=INTEGER},
+            </if>
+            <if test="notRegNum != null">
+                not_reg_num = #{notRegNum,jdbcType=INTEGER},
+            </if>
+            <if test="registeredNum != null">
+                registered_num = #{registeredNum,jdbcType=INTEGER},
+            </if>
+            <if test="regRate != null">
+                reg_rate = #{regRate,jdbcType=DECIMAL},
+            </if>
+            <if test="watchCompletedRate != null">
+                watch_completed_rate = #{watchCompletedRate,jdbcType=DECIMAL},
+            </if>
+            <if test="offlineTotal != null">
+                offline_total = #{offlineTotal,jdbcType=INTEGER},
+            </if>
+            <if test="offlineNotRegNum != null">
+                offline_not_reg_num = #{offlineNotRegNum,jdbcType=INTEGER},
+            </if>
+            <if test="offlineNotWatchNum != null">
+                offline_not_watch_num = #{offlineNotWatchNum,jdbcType=INTEGER},
+            </if>
+            <if test="onlineTotal != null">
+                online_total = #{onlineTotal,jdbcType=INTEGER},
+            </if>
+            <if test="onlineRate != null">
+                online_rate = #{onlineRate,jdbcType=DECIMAL},
+            </if>
+            <if test="onlineWatchCompletedRate != null">
+                online_watch_completed_rate = #{onlineWatchCompletedRate,jdbcType=DECIMAL},
+            </if>
+            <if test="onlineWatchNotCompleted != null">
+                online_watch_not_completed = #{onlineWatchNotCompleted,jdbcType=INTEGER},
+            </if>
+            <if test="onlineWatchCompleted != null">
+                online_watch_completed = #{onlineWatchCompleted,jdbcType=INTEGER},
+            </if>
+            <if test="dataDate != null">
+                data_date = #{dataDate,jdbcType=DATE},
+            </if>
+        </set>
+        WHERE id = #{id,jdbcType=INTEGER}
+    </update>
+
+    <!-- 根据主键删除数据 -->
+    <delete id="deleteById" parameterType="java.lang.Integer">
+        DELETE FROM fs_statis_period_watch
+        WHERE id = #{id,jdbcType=INTEGER}
+    </delete>
+
+    <!-- 查询所有数据 -->
+    <select id="selectAll" resultMap="BaseResultMap">
+        SELECT
+        <include refid="Base_Column_List" />
+        FROM fs_statis_period_watch
+    </select>
+    <select id="queryList" resultType="com.fs.statis.domain.FsStatisPeriodWatch">
+        select * from fs_statis_period_watch
+        <where>
+            <if test="userIds != null and userIds.length > 0">
+                AND company_user_id IN
+                <foreach collection="userIds" open="(" close=")" separator="," item="item">
+                    ${item}
+                </foreach>
+            </if>
+            <if test="periodList != null and periodList.length > 0">
+                AND period_id IN
+                <foreach collection="periodList" open="(" close=")" separator="," item="item">
+                    ${item}
+                </foreach>
+            </if>
+            <if test="startDate != null and endDate != null">
+                AND data_date BETWEEN #{startDate} AND #{endDate}
+            </if>
+        </where>
+    </select>
+
+</mapper>

+ 115 - 0
fs-service-system/src/main/resources/mapper/statis/FsStatisSalerWatchMapper.xml

@@ -0,0 +1,115 @@
+<?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">
+<mapper namespace="com.fs.statis.mapper.FsStatisSalerWatchMapper"> <!-- 请替换为你的Mapper接口的完整路径 -->
+
+    <!-- 结果映射 -->
+    <resultMap id="BaseResultMap" type="com.fs.statis.domain.FsStatisSalerWatch"> <!-- 请替换为你的Entity的完整路径 -->
+        <id column="id" property="id" jdbcType="INTEGER"/>
+        <result column="dept_id" property="deptId" jdbcType="INTEGER"/>
+        <result column="company_user_id" property="companyUserId" jdbcType="INTEGER"/>
+        <result column="train_camp_num" property="trainCampNum" jdbcType="INTEGER"/>
+        <result column="not_registered_num" property="notRegisteredNum" jdbcType="INTEGER"/>
+        <result column="registered_num" property="registeredNum" jdbcType="INTEGER"/>
+        <result column="reg_rate" property="regRate" jdbcType="FLOAT"/>
+        <result column="finished_rate" property="finishedRate" jdbcType="FLOAT"/>
+        <result column="offline_total" property="offlineTotal" jdbcType="INTEGER"/>
+        <result column="offline_not_part" property="offlineNotPart" jdbcType="INTEGER"/> <!-- 对应修正后的 offlineNotPart -->
+        <result column="offline_not_watched" property="offlineNotWatched" jdbcType="INTEGER"/>
+        <result column="online_total" property="onlineTotal" jdbcType="INTEGER"/>
+        <result column="online_online_rate" property="onlineOnlineRate" jdbcType="FLOAT"/>
+        <result column="online_playback_comple_rate" property="onlinePlaybackCompleRate" jdbcType="FLOAT"/>
+        <result column="online_incomplete_playback" property="onlineIncompletePlayback" jdbcType="INTEGER"/>
+        <result column="online_complete_playback" property="onlineCompletePlayback" jdbcType="INTEGER"/>
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        id, dept_id, company_user_id, train_camp_num, not_registered_num, registered_num,
+        reg_rate, finished_rate, offline_total, offline_not_part, offline_not_watched,
+        online_total, online_online_rate, online_playback_comple_rate,
+        online_incomplete_playback, online_complete_playback
+    </sql>
+
+    <!-- 根据ID查询销售观看统计 -->
+    <select id="findById" resultMap="BaseResultMap" parameterType="java.lang.Integer">
+        SELECT
+        <include refid="Base_Column_List"/>
+        FROM fs_statis_saler_watch
+        WHERE id = #{id,jdbcType=INTEGER}
+    </select>
+
+    <!-- 查询所有销售观看统计 -->
+    <select id="findAll" resultMap="BaseResultMap">
+        SELECT
+        <include refid="Base_Column_List"/>
+        FROM fs_statis_saler_watch
+    </select>
+    <select id="queryList" resultType="com.fs.statis.domain.FsStatisSalerWatch">
+        select * from fs_statis_saler_watch
+        <where>
+            <if test="userIds != null and userIds.length > 0">
+                AND company_user_id IN
+                 <foreach collection="userIds" open="(" close=")" separator="," item="item">
+                     ${item}
+                </foreach>
+            </if>
+            <if test="periodList != null and periodList.length > 0">
+                AND period_id IN
+                <foreach collection="periodList" open="(" close=")" separator="," item="item">
+                    ${item}
+                </foreach>
+            </if>
+            <if test="startDate != null and endDate != null">
+                AND data_date BETWEEN #{startDate} AND #{endDate}
+            </if>
+        </where>
+    </select>
+
+    <!-- 新增销售观看统计 -->
+    <insert id="insert" parameterType="com.fs.statis.domain.FsStatisSalerWatch" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
+        INSERT INTO fs_statis_saler_watch (
+            dept_id, company_user_id, train_camp_num,
+            not_registered_num, registered_num, reg_rate,
+            finished_rate, offline_total, offline_not_part,
+            offline_not_watched, online_total, online_online_rate,
+            online_playback_comple_rate, online_incomplete_playback,
+            online_complete_playback
+        ) VALUES (
+                     #{deptId,jdbcType=INTEGER}, #{companyUserId,jdbcType=INTEGER}, #{trainCampNum,jdbcType=INTEGER},
+                     #{notRegisteredNum,jdbcType=INTEGER}, #{registeredNum,jdbcType=INTEGER}, #{regRate,jdbcType=FLOAT},
+                     #{finishedRate,jdbcType=FLOAT}, #{offlineTotal,jdbcType=INTEGER}, #{offlineNotPart,jdbcType=INTEGER},
+                     #{offlineNotWatched,jdbcType=INTEGER}, #{onlineTotal,jdbcType=INTEGER}, #{onlineOnlineRate,jdbcType=FLOAT},
+                     #{onlinePlaybackCompleRate,jdbcType=FLOAT}, #{onlineIncompletePlayback,jdbcType=INTEGER},
+                     #{onlineCompletePlayback,jdbcType=INTEGER}
+                 )
+    </insert>
+
+    <!-- 更新销售观看统计 -->
+    <update id="update" parameterType="com.fs.statis.domain.FsStatisSalerWatch">
+        UPDATE fs_statis_saler_watch
+        SET
+            dept_id = #{deptId,jdbcType=INTEGER},
+            company_user_id = #{companyUserId,jdbcType=INTEGER},
+            train_camp_num = #{trainCampNum,jdbcType=INTEGER},
+            not_registered_num = #{notRegisteredNum,jdbcType=INTEGER},
+            registered_num = #{registeredNum,jdbcType=INTEGER},
+            reg_rate = #{regRate,jdbcType=FLOAT},
+            finished_rate = #{finishedRate,jdbcType=FLOAT},
+            offline_total = #{offlineTotal,jdbcType=INTEGER},
+            offline_not_part = #{offlineNotPart,jdbcType=INTEGER},
+            offline_not_watched = #{offlineNotWatched,jdbcType=INTEGER},
+            online_total = #{onlineTotal,jdbcType=INTEGER},
+            online_online_rate = #{onlineOnlineRate,jdbcType=FLOAT},
+            online_playback_comple_rate = #{onlinePlaybackCompleRate,jdbcType=FLOAT},
+            online_incomplete_playback = #{onlineIncompletePlayback,jdbcType=INTEGER},
+            online_complete_playback = #{onlineCompletePlayback,jdbcType=INTEGER}
+        WHERE id = #{id,jdbcType=INTEGER}
+    </update>
+
+    <!-- 根据ID删除销售观看统计 -->
+    <delete id="deleteById" parameterType="java.lang.Integer">
+        DELETE FROM fs_statis_saler_watch
+        WHERE id = #{id,jdbcType=INTEGER}
+    </delete>
+
+</mapper>