Jelajahi Sumber

更新注释

xdd 1 bulan lalu
induk
melakukan
316f16c2a3

+ 8 - 2
fs-company/src/main/java/com/fs/qw/QwQwWorkTaskController.java

@@ -2,6 +2,7 @@ package com.fs.qw;
 
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.fs.common.annotation.Log;
+import com.fs.common.constant.HttpStatus;
 import com.fs.common.core.controller.BaseController;
 import com.fs.common.core.domain.AjaxResult;
 import com.fs.common.core.page.TableDataInfo;
@@ -15,6 +16,7 @@ import com.fs.qw.domain.QwWorkTask;
 import com.fs.qw.param.QwWorkTaskListParam;
 import com.fs.qw.service.IQwWorkTaskService;
 import com.fs.qw.vo.QwWorkTaskListVO;
+import com.github.pagehelper.PageInfo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
@@ -45,7 +47,6 @@ public class QwQwWorkTaskController extends BaseController
     @GetMapping("/list")
     public TableDataInfo list(QwWorkTaskListParam qwWorkTask)
     {
-        startPage();
         LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
         qwWorkTask.setCompanyId(loginUser.getCompany().getCompanyId());
         if(ObjectUtils.isNull(qwWorkTask.getCompanyUserId())) {
@@ -55,7 +56,12 @@ public class QwQwWorkTaskController extends BaseController
         for (QwWorkTaskListVO qwWorkTaskListVO : list) {
             qwWorkTaskListVO.setLogs(fsCourseWatchLogMapper.selectFsCourseWatchLog7DayByExtId(qwWorkTaskListVO.getExtId()));
         }
-        return getDataTable(list);
+        TableDataInfo rspData = new TableDataInfo();
+        rspData.setCode(HttpStatus.SUCCESS);
+        rspData.setMsg("查询成功");
+        rspData.setRows(list);
+        rspData.setTotal(qwWorkTaskService.selectQwWorkTaskListVONewCount(qwWorkTask));
+        return rspData;
     }
 
     /**

+ 2 - 0
fs-service-system/src/main/java/com/fs/qw/mapper/QwWorkTaskMapper.java

@@ -124,4 +124,6 @@ public interface QwWorkTaskMapper extends BaseMapper<QwWorkTask>{
      * @return list
      */
     List<QwWorkTask> selectQwWorkTaskListByMap(@Param("params") Map<String, Object> params);
+
+    Long selectQwWorkTaskListVONewCount(QwWorkTaskListParam qwWorkTask);
 }

+ 3 - 0
fs-service-system/src/main/java/com/fs/qw/param/QwWorkTaskListParam.java

@@ -40,4 +40,7 @@ public class QwWorkTaskListParam {
     private Long companyUserId;
 
     private String title;
+
+    private Long pageNum;
+    private Long pageSize;
 }

+ 1 - 0
fs-service-system/src/main/java/com/fs/qw/service/IQwWorkTaskService.java

@@ -82,6 +82,7 @@ public interface IQwWorkTaskService extends IService<QwWorkTask>{
 
     List<QwWorkTaskListVO> selectQwWorkTaskListVO(QwWorkTaskListParam qwWorkTask);
     List<QwWorkTaskListVO> selectQwWorkTaskListVONew(QwWorkTaskListParam qwWorkTask);
+    Long selectQwWorkTaskListVONewCount(QwWorkTaskListParam qwWorkTask);
 
     /**
      * 根据特定课程逻辑(可能与课程编号4或第四阶段相关)添加企微任务。

+ 5 - 0
fs-service-system/src/main/java/com/fs/qw/service/impl/QwWorkTaskServiceImpl.java

@@ -294,6 +294,11 @@ public class QwWorkTaskServiceImpl extends ServiceImpl<QwWorkTaskMapper, QwWorkT
         return list;
     }
 
+    @Override
+    public Long selectQwWorkTaskListVONewCount(QwWorkTaskListParam qwWorkTask) {
+        return qwWorkTaskMapper.selectQwWorkTaskListVONewCount(qwWorkTask);
+    }
+
     @Override
     public void addQwWorkByCourse4() {
         List<QwSop> qwSops = qwSopMapper.selectQwSopByIsRating();

+ 3 - 0
fs-service-system/src/main/java/com/fs/qw/vo/QwWorkTaskListVO.java

@@ -49,4 +49,7 @@ public class QwWorkTaskListVO implements Serializable {
     private String companyUserName;
 
     private String title;
+
+    private Long pageNum;
+    private Long pageSize;
 }

+ 33 - 11
fs-service-system/src/main/resources/mapper/qw/QwWorkTaskMapper.xml

@@ -43,19 +43,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where id = #{id}
     </select>
     <select id="selectQwWorkTaskListVONew" resultType="com.fs.qw.vo.QwWorkTaskListVO">
-        select t.* from qw_work_task t
+        SELECT t.*
+        FROM qw_work_task t
+        INNER JOIN (
+        SELECT t_inner.id
+        FROM qw_work_task t_inner
         <where>
-            DATE(t.create_time) = CURDATE()
-            <if test="extId != null "> and t.ext_id = #{extId}</if>
-            <if test="qwUserId != null "> and t.qw_user_id = #{qwUserId}</if>
-            <if test="type != null "> and t.type = #{type}</if>
-            <if test="status != null "> and t.status = #{status}</if>
-            <if test="score != null "> and t.score = #{score}</if>
-            <if test="sopId != null  and sopId != ''"> and t.sop_id = #{sopId}</if>
-            <if test="companyId != null "> and t.company_id = #{companyId}</if>
-            <if test="companyUserId != null "> and t.company_user_id = #{companyUserId}</if>
+            DATE(t_inner.create_time) = CURDATE()
+            <if test="extId != null "> and t_inner.ext_id = #{extId}</if>
+            <if test="qwUserId != null "> and t_inner.qw_user_id = #{qwUserId}</if>
+            <if test="type != null "> and t_inner.type = #{type}</if>
+            <if test="status != null "> and t_inner.status = #{status}</if>
+            <if test="score != null "> and t_inner.score = #{score}</if>
+            <if test="sopId != null  and sopId != ''"> and t_inner.sop_id = #{sopId}</if>
+            <if test="companyId != null "> and t_inner.company_id = #{companyId}</if>
+            <if test="companyUserId != null "> and t_inner.company_user_id = #{companyUserId}</if>
         </where>
-        order by t.score desc,t.id desc
+        ORDER BY t_inner.score DESC, t_inner.id DESC
+        LIMIT ${(pageNum-1)*pageSize}, ${pageSize}
+        ) AS filtered_ids ON t.id = filtered_ids.id
+        ORDER BY t.score DESC, t.id DESC
     </select>
 
     <select id="selectQwWorkTaskListByMap" resultType="com.fs.qw.domain.QwWorkTask">
@@ -68,6 +75,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
           and qwt.company_user_id = #{params.companyUserId}
           and qwt.status = 0
     </select>
+    <select id="selectQwWorkTaskListVONewCount" resultType="java.lang.Long">
+        select count(1) from qw_work_task t
+        <where>
+            DATE(t.create_time) = CURDATE()
+            <if test="extId != null "> and t.ext_id = #{extId}</if>
+            <if test="qwUserId != null "> and t.qw_user_id = #{qwUserId}</if>
+            <if test="type != null "> and t.type = #{type}</if>
+            <if test="status != null "> and t.status = #{status}</if>
+            <if test="score != null "> and t.score = #{score}</if>
+            <if test="sopId != null  and sopId != ''"> and t.sop_id = #{sopId}</if>
+            <if test="companyId != null "> and t.company_id = #{companyId}</if>
+            <if test="companyUserId != null "> and t.company_user_id = #{companyUserId}</if>
+        </where>
+        order by t.score desc,t.id desc
+    </select>
 
     <insert id="insertQwWorkTask" parameterType="QwWorkTask" useGeneratedKeys="true" keyProperty="id">
         insert into qw_work_task