Просмотр исходного кода

增加缺少的is_delete字段

jiakai 3 месяцев назад
Родитель
Сommit
41edc19218

+ 7 - 0
authentication/src/main/java/com/jzg/entity/SysRolePerms.java

@@ -1,6 +1,8 @@
 package com.jzg.entity;
 
+import com.alibaba.excel.annotation.ExcelIgnore;
 import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableLogic;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 
@@ -23,4 +25,9 @@ public class SysRolePerms {
 
     @TableField(exist = false)
     private String sysCode;
+
+    @ExcelIgnore
+    @Schema(description = "是否删除")
+    @TableLogic
+    private Integer isDelete;
 }

+ 8 - 4
commons/src/main/java/com/jzg/commons/entity/po/SysArea.java

@@ -1,9 +1,8 @@
 package com.jzg.commons.entity.po;
 
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
+import com.alibaba.excel.annotation.ExcelIgnore;
+import com.baomidou.mybatisplus.annotation.*;
+import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 
@@ -59,6 +58,11 @@ public class SysArea implements Serializable {
     @TableField(exist = false)
     private String allName;
 
+    @ExcelIgnore
+    @Schema(description = "是否删除")
+    @TableLogic
+    private Integer isDelete;
+
     @TableField(exist = false)
     private static final long serialVersionUID = 1L;
 

+ 7 - 0
commons/src/main/java/com/jzg/commons/entity/po/SysOrganizationUserLink.java

@@ -1,8 +1,10 @@
 package com.jzg.commons.entity.po;
 
 
+import com.alibaba.excel.annotation.ExcelIgnore;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 
@@ -20,4 +22,9 @@ public class SysOrganizationUserLink implements Serializable {
 
     private String organizationId;
 
+    @ExcelIgnore
+    @Schema(description = "是否删除")
+    @TableLogic
+    private Integer isDelete;
+
 }

+ 7 - 0
commons/src/main/java/com/jzg/commons/entity/report/po/ReportSearchConfiguration.java

@@ -1,7 +1,9 @@
 package com.jzg.commons.entity.report.po;
 
+import com.alibaba.excel.annotation.ExcelIgnore;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
 import com.baomidou.mybatisplus.annotation.TableName;
 import java.io.Serializable;
 import java.util.Date;
@@ -79,6 +81,11 @@ public class ReportSearchConfiguration implements Serializable {
     @Schema(description = "创建用户id")
     private String createUserId;
 
+    @ExcelIgnore
+    @Schema(description = "是否删除")
+    @TableLogic
+    private Integer isDelete;
+
 
     @Override
     public boolean equals(Object that) {

+ 7 - 0
commons/src/main/java/com/jzg/commons/entity/report/po/ReportUploadExcelTask.java

@@ -1,7 +1,9 @@
 package com.jzg.commons.entity.report.po;
 
+import com.alibaba.excel.annotation.ExcelIgnore;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.v3.oas.annotations.media.Schema;
@@ -96,6 +98,11 @@ public class ReportUploadExcelTask implements Serializable {
     @Schema(description = "导入时间")
     private Double uploadMinutes;
 
+    @ExcelIgnore
+    @Schema(description = "是否删除")
+    @TableLogic
+    private Integer isDelete;
+
 
     @Override
     public boolean equals(Object that) {

+ 6 - 0
commons/src/main/java/com/jzg/commons/entity/system/po/SysSystemBusPerms.java

@@ -1,7 +1,9 @@
 package com.jzg.commons.entity.system.po;
 
+import com.alibaba.excel.annotation.ExcelIgnore;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.jzg.commons.entity.system.vo.SysSystemBusPermsVo;
 import com.jzg.commons.util.idgen.IdGenerate;
@@ -60,6 +62,10 @@ public class SysSystemBusPerms implements Serializable {
     @Schema(description = "账号互通")
     private Integer accountLinking;
 
+    @ExcelIgnore
+    @Schema(description = "是否删除")
+    @TableLogic
+    private Integer isDelete;
 
 
     public SysSystemBusPerms(SysSystemBusPermsVo sysSystemBusPermsVo) {

+ 17 - 13
consoleStatistics/src/main/resources/mapper/ReportCompanyDataManageMapper.xml

@@ -15,9 +15,9 @@
                     SUM( fee.total_premium )
                 FROM
                     ins_orders io
-                        LEFT JOIN ins_fee_orders fee ON io.id = fee.order_no
+                        LEFT JOIN ins_fee_orders fee ON io.id = fee.order_no AND fee.is_delete = 0
                 WHERE
-                    io.company_id = b.company_id
+                    io.company_id = b.company_id AND io.is_delete = 0
             ) AS sumCompanyPremium,
             SUM( fee.total_premium ) AS sumPremium,
             SUM( CASE WHEN b.product_id = '0330' AND b.parent_id IS NULL THEN fee.total_premium ELSE 0 END ) AS djPremium,
@@ -40,7 +40,8 @@
                 FROM
                     ins_orders
                 WHERE
-                    entry_status IN ( 1, 2 ) UNION ALL
+                    entry_status IN ( 1, 2 ) AND is_delete = 0
+                UNION ALL
                 SELECT
                     id,
                     agreement_id,
@@ -56,10 +57,11 @@
                 WHERE
                     entry_status = 3
                   AND audit_status = 1
+                  AND is_delete = 0
             ) b
-                LEFT JOIN ptl_agreement ptl ON b.agreement_id = ptl.id
-                LEFT JOIN esm_ins_company eic ON eic.id = ptl.partner_company_id
-                LEFT JOIN ins_fee_orders fee ON b.id = fee.order_no
+                LEFT JOIN ptl_agreement ptl ON b.agreement_id = ptl.id AND ptl.is_delete = 0
+                LEFT JOIN esm_ins_company eic ON eic.id = ptl.partner_company_id AND eic.is_delete = 0
+                LEFT JOIN ins_fee_orders fee  ON b.id = fee.order_no AND fee.is_delete = 0
         GROUP BY
             b.company_id,
             b.company_name,
@@ -83,9 +85,9 @@
                     SUM( fee.total_premium )
                 FROM
                     ins_orders io
-                        LEFT JOIN ins_fee_orders fee ON io.id = fee.order_no
+                        LEFT JOIN ins_fee_orders fee ON io.id = fee.order_no AND fee.is_delete = 0
                 WHERE
-                    io.company_id = b.company_id
+                    io.company_id = b.company_id AND io.is_delete = 0
             ) AS sumCompanyPremium,
             SUM( fee.total_premium ) AS sumPremium,
             SUM( CASE WHEN b.product_id = '0330' AND b.parent_id IS NULL THEN fee.total_premium ELSE 0 END ) AS djPremium,
@@ -108,7 +110,8 @@
                 FROM
                     ins_orders
                 WHERE
-                    entry_status IN ( 1, 2 ) UNION ALL
+                    entry_status IN ( 1, 2 )  AND is_delete = 0
+                UNION ALL
                 SELECT
                     id,
                     agreement_id,
@@ -124,10 +127,11 @@
                 WHERE
                     entry_status = 3
                   AND audit_status = 1
+                  AND is_delete = 0
             ) b
-                LEFT JOIN ptl_agreement ptl ON b.agreement_id = ptl.id
-                LEFT JOIN esm_ins_company eic ON eic.id = ptl.partner_company_id
-                LEFT JOIN ins_fee_orders fee ON b.id = fee.order_no
+                LEFT JOIN ptl_agreement ptl ON b.agreement_id = ptl.id AND ptl.is_delete = 0
+                LEFT JOIN esm_ins_company eic ON eic.id = ptl.partner_company_id AND eic.is_delete = 0
+                LEFT JOIN ins_fee_orders fee ON b.id = fee.order_no AND fee.is_delete = 0
         GROUP BY
             b.company_id,
             b.company_name,
@@ -137,4 +141,4 @@
             b.company_id,
             ptl.partner_company_id
     </select>
-</mapper>
+</mapper>

+ 180 - 163
consoleStatistics/src/main/resources/mapper/ReportSearchConfigurationMapper.xml

@@ -3,113 +3,118 @@
         PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.jzg.console.mapper.ReportSearchConfigurationMapper">
+
     <select id="getSearchConfigurationList"
             resultType="com.jzg.commons.entity.report.dto.ReportSearchConfigurationDto">
         SELECT
-            b.search_key AS 'key',
-            b.search_name AS label,
-            b.show_type AS inputType,
-            CASE
-                WHEN (SELECT select_type FROM report_page_set_search_param
-                      WHERE report_configuration_id = a.report_configuration_id
-                        AND router_path_key = #{ routerPath }) IS NOT NULL THEN
-                (SELECT select_type FROM report_page_set_search_param
-                 WHERE report_configuration_id = a.report_configuration_id
-                   AND router_path_key = #{ routerPath })
-                ELSE a.select_type
-            END AS selectType,
-            b.search_sql AS searchSql,
-            b.id AS id,
-            a.show_flag AS showFlag,
-            CASE
-            WHEN (
-            SELECT COUNT(0)
-            FROM report_page_set_search_param
-            WHERE report_configuration_id = a.report_configuration_id
-            AND router_path_key = #{ routerPath }
-            ) > 0 THEN true
-            ELSE false
-            END AS defaultFlag,
-            CASE
-            WHEN (
-            SELECT COUNT(0)
-            FROM report_page_select_disable
-            WHERE report_configuration_id = a.report_configuration_id
-            AND router_path_key = #{ routerPath }
-            ) > 0 THEN true
-            ELSE false
-            END AS selectFlag,
-            false AS isShowDelIcon
+        b.search_key AS 'key',
+        b.search_name AS label,
+        b.show_type AS inputType,
+        CASE
+        WHEN (SELECT select_type FROM report_page_set_search_param
+        WHERE report_configuration_id = a.report_configuration_id
+        AND router_path_key = #{ routerPath } AND is_delete = 0) IS NOT NULL THEN
+        (SELECT select_type FROM report_page_set_search_param
+        WHERE report_configuration_id = a.report_configuration_id
+        AND router_path_key = #{ routerPath } AND is_delete = 0)
+        ELSE a.select_type
+        END AS selectType,
+        b.search_sql AS searchSql,
+        b.id AS id,
+        a.show_flag AS showFlag,
+        CASE
+        WHEN (
+        SELECT COUNT(0)
+        FROM report_page_set_search_param
+        WHERE report_configuration_id = a.report_configuration_id
+        AND router_path_key = #{ routerPath } AND is_delete = 0 ) > 0 THEN true
+        ELSE false
+        END AS defaultFlag,
+        CASE
+        WHEN (
+        SELECT COUNT(0)
+        FROM report_page_select_disable
+        WHERE report_configuration_id = a.report_configuration_id
+        AND router_path_key = #{ routerPath } AND is_delete = 0 ) > 0 THEN true
+        ELSE false
+        END AS selectFlag,
+        false AS isShowDelIcon
         FROM
-            report_page_set_search_param a
-        LEFT JOIN report_search_configuration b ON a.report_configuration_id = b.id
-         WHERE
-             a.router_path_key = 'common'
-        ORDER BY
-            a.sort
+        report_page_set_search_param a
+        LEFT JOIN report_search_configuration b
+        ON a.report_configuration_id = b.id AND b.is_delete = 0
+        <where>
+            AND a.is_delete = 0
+            <if test="routerPath != null and routerPath != ''">
+                AND a.router_path_key = 'common'
+            </if>
+        </where>
+        ORDER BY a.sort
     </select>
 
     <select id="selectDictListByCode" resultType="com.jzg.commons.entity.report.dto.ReportDictDto">
         SELECT
-            p.VALUE AS value,
-            p.label AS label
+        p.VALUE AS value,
+        p.label AS label
         FROM
-            sys_dict p
-            LEFT JOIN sys_dict_type c ON p.type_code = c.dict_code
-        WHERE
-            c.dict_code = #{distCode}
-        ORDER BY
-            p.sort
+        sys_dict p
+        LEFT JOIN sys_dict_type c ON p.type_code = c.dict_code AND c.is_delete = 0
+        <where>
+            AND p.is_delete = 0
+            <if test="distCode != null and distCode != ''">
+                AND c.dict_code = #{distCode}
+            </if>
+        </where>
+        ORDER BY p.sort
     </select>
+
     <select id="getSecondLevelAreaList" resultType="com.jzg.commons.entity.po.SysArea">
-        SELECT
-            *
-        FROM
-            sys_area
-        WHERE
-            `level` IN (1,2)
+        SELECT *
+        FROM sys_area
+        <where>
+            AND is_delete = 0
+            AND `level` IN (1,2)
+        </where>
     </select>
+
     <select id="getDeptListByUserId" resultType="com.jzg.commons.entity.po.SysDept">
-        SELECT
-            *
-        FROM
-            sys_dept
-        WHERE
-            system_code =(
-                SELECT
-                    sys_code
-                FROM
-                    sys_system
-                WHERE
-                    user_id = #{userId}
+        SELECT *
+        FROM sys_dept
+        <where>
+            AND is_delete = 0
+            AND system_code = (
+            SELECT sys_code
+            FROM sys_system
+            WHERE user_id = #{userId}
+            AND is_delete = 0
             )
-        order by id
+        </where>
+        ORDER BY id
     </select>
+
     <select id="queryCompanyListByUserId" resultType="com.jzg.commons.entity.report.dto.ReportDictDto">
         SELECT
-            id AS VALUE,
-	        NAME AS label
-        FROM
-            esm_ins_company
-        WHERE
-            id IN (
-                SELECT
-                    bus_id
-                FROM
-                    sys_system_bus_perms_link
-                WHERE
-                    perms_id =(
-                        SELECT
-                            p.id
-                        FROM
-                            sys_system_bus_perms p
-                            LEFT JOIN sys_system ss ON p.system_code = ss.sys_code
-                        WHERE
-                            ss.user_id = #{userId}
-                    )
-                    AND bus_code = 'quoteCompany'
+        id AS VALUE,
+        NAME AS label
+        FROM esm_ins_company
+        <where>
+            AND is_delete = 0
+            AND id IN (
+            SELECT bus_id
+            FROM sys_system_bus_perms_link
+            WHERE is_delete = 0
+            AND bus_code = 'quoteCompany'
+            AND perms_id = (
+            SELECT p.id
+            FROM sys_system_bus_perms p
+            LEFT JOIN sys_system ss ON p.system_code = ss.sys_code AND ss.is_delete = 0
+            WHERE p.is_delete = 0
+            AND ss.user_id = #{userId}
+            )
             )
+        </where>
     </select>
+
     <select id="getPartnerCompanyListByCompanyId" resultType="com.jzg.commons.entity.report.dto.ReportDictDto">
         WITH RECURSIVE company_hierarchy AS (
             SELECT
@@ -117,90 +122,93 @@
                 name,
                 parent_id,
                 1 AS level
-            FROM
-               esm_ins_company
-            WHERE
-                id = #{companyId}
-                AND is_delete = 0
+            FROM esm_ins_company
+            WHERE id = #{companyId}
+              AND is_delete = 0
             UNION ALL
-                SELECT
-                    c.id,
-                    c.name,
-                    c.parent_id,
-                    ch.level + 1 AS level
-                FROM
-                   esm_ins_company c
-                   INNER JOIN  company_hierarchy ch ON c.parent_id = ch.id
-                WHERE
-                   c.is_delete = 0
-                   AND ch.level <![CDATA[< ]]>  3
+            SELECT
+                c.id,
+                c.name,
+                c.parent_id,
+                ch.level + 1 AS level
+            FROM esm_ins_company c
+                     INNER JOIN company_hierarchy ch ON c.parent_id = ch.id
+            WHERE c.is_delete = 0
+              AND ch.level <![CDATA[< ]]> 3
         )
         SELECT
-            id as value,
-            name as label,
+            id AS value,
+            name AS label,
             parent_id,
             level
-        FROM
-        company_hierarchy
-        WHERE
-        level = 3;
+        FROM company_hierarchy
+        WHERE level = 3
     </select>
+
     <select id="getSearchDefaultList"
             resultType="com.jzg.commons.entity.report.dto.ReportSearchConfigurationDto">
         SELECT
-            b.search_key AS 'key',
-            b.search_name AS label,
-            b.show_type AS inputType,
-            b.select_type AS selectType,
-            b.search_sql AS searchSql,
-            b.id AS id,
-            a.show_flag AS showFlag,
-            true  as   defaultFlag,
-            true  as  selectFlag,
-            false AS isShowDelIcon
-        FROM
-            report_page_set_search_param a
-                LEFT JOIN report_search_configuration b ON a.report_configuration_id = b.id
-        WHERE
-            a.router_path_key = #{ routerKey }
-        ORDER BY
-            a.sort
+        b.search_key AS 'key',
+        b.search_name AS label,
+        b.show_type AS inputType,
+        b.select_type AS selectType,
+        b.search_sql AS searchSql,
+        b.id AS id,
+        a.show_flag AS showFlag,
+        true AS defaultFlag,
+        true AS selectFlag,
+        false AS isShowDelIcon
+        FROM report_page_set_search_param a
+        LEFT JOIN report_search_configuration b
+        ON a.report_configuration_id = b.id
+        AND b.is_delete = 0
+        <where>
+            AND a.is_delete = 0
+            <if test="routerKey != null and routerKey != ''">
+                AND a.router_path_key = #{ routerKey }
+            </if>
+        </where>
+        ORDER BY a.sort
     </select>
 
-    <select id="getUserIdByUserName"
-            resultType="java.lang.String">
-        SELECT
-            id
-        FROM
-            sys_user
-        WHERE
-            mobile = #{ userId }
+    <select id="getUserIdByUserName" resultType="java.lang.String">
+        SELECT id
+        FROM sys_user
+        <where>
+            AND is_delete = 0
+            AND account_status = 1
+            <if test="userId != null and userId != ''">
+                AND mobile = #{ userId }
+            </if>
+        </where>
     </select>
 
     <select id="getUserByUserId" resultType="java.lang.String">
-        SELECT
-            sys_code
-        FROM
-            sys_system
-        WHERE
-            user_id = (
-                SELECT
-                    id
-                FROM
-                    sys_user
-                WHERE
-                    mobile = #{ userId }
-                )
+        SELECT sys_code
+        FROM sys_system
+        <where>
+            AND is_delete = 0
+            AND user_id = (
+            SELECT id
+            FROM sys_user
+            WHERE is_delete = 0
+            AND account_status = 1
+            AND mobile = #{ userId }
+            )
+        </where>
     </select>
 
     <select id="getUserByPhone" resultType="java.lang.String">
-        SELECT
-            sys_code
-        FROM
-            sys_system
-        WHERE
-            user_id =  #{ userId }
+        SELECT sys_code
+        FROM sys_system
+        <where>
+            AND is_delete = 0
+            <if test="userId != null">
+                AND user_id = #{userId}
+            </if>
+        </where>
     </select>
+
     <select id="getUserListBySystemCode" resultType="com.jzg.commons.entity.report.dto.UserTreeDto">
         WITH RECURSIVE org_hierarchy AS (
             SELECT
@@ -215,10 +223,12 @@
                 CAST(o.id AS CHAR) AS org_path
             FROM sys_organization o
                      LEFT JOIN sys_user_jzg_info u ON o.manager_id = u.id AND u.is_delete = 0
-            WHERE o.system_code = #{systemCode}
-              AND o.is_delete = 0
+            WHERE o.is_delete = 0
+              AND o.system_code = #{systemCode}
               AND u.id != 'admin'
+
         UNION ALL
+
         SELECT
             o.id AS org_id,
             o.name AS org_name,
@@ -232,10 +242,10 @@
         FROM sys_organization o
                  INNER JOIN org_hierarchy oh ON o.dept_id = oh.org_id
                  LEFT JOIN sys_user_jzg_info u ON o.manager_id = u.id AND u.is_delete = 0
-        WHERE o.system_code = #{systemCode}
-          AND o.is_delete = 0
+        WHERE o.is_delete = 0
+          AND o.system_code = #{systemCode}
           AND u.id != 'admin'
-       )
+        )
         SELECT DISTINCT
             p.id as id,
             p.name as name,
@@ -273,9 +283,12 @@
                      0 AS is_manager,
                      oh.org_path AS hierarchy_path
                  FROM sys_organization_user_link ul
-                          INNER JOIN sys_user_jzg_info u ON ul.user_id = u.id AND u.is_delete = 0
+                          INNER JOIN sys_user_jzg_info u
+                                     ON ul.user_id = u.id
+                                         AND u.is_delete = 0
                           INNER JOIN org_hierarchy oh ON ul.organization_id = oh.org_id
                  WHERE ul.user_id != CAST(oh.manager_id AS CHAR)
+                   AND ul.is_delete = 0
 
                  UNION ALL
                  SELECT
@@ -313,12 +326,16 @@
                      oh.org_path AS hierarchy_path,
                      oh.parent_org_id
                      FROM sys_organization_user_link ul
-                     INNER JOIN sys_user_jzg_info u ON ul.user_id = u.id AND u.is_delete = 0
+                     INNER JOIN sys_user_jzg_info u
+                     ON ul.user_id = u.id
+                     AND u.is_delete = 0
                      INNER JOIN org_hierarchy oh ON ul.organization_id = oh.org_id
-                     WHERE ul.user_id != CAST(oh.manager_id AS CHAR) AND oh.parent_org_id IS NOT NULL
+                     WHERE ul.user_id != CAST(oh.manager_id AS CHAR)
+                     AND oh.parent_org_id IS NOT NULL
+                     AND ul.is_delete = 0
                      ) sub
                      INNER JOIN org_hierarchy oh ON sub.parent_org_id = oh.org_id
              ) p
         ORDER BY p.hierarchy_path, p.is_manager DESC;
     </select>
-</mapper>
+</mapper>

+ 38 - 27
consoleStatistics/src/main/resources/mapper/ReportUploadExcelTaskMapper.xml

@@ -1,39 +1,50 @@
 <?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.jzg.console.mapper.ReportUploadExcelTaskMapper">
+
+    <!-- 根据用户ID更新已读状态 -->
     <update id="updateStatusByUserId">
-        update  report_upload_excel_task
-        set  read_status =1
-        where upload_user_id =#{userId}
-        and read_status=0
+        update report_upload_excel_task
+        set read_status = 1
+        <where>
+            and is_delete = 0
+            and upload_user_id = #{userId}
+            and read_status = 0
+        </where>
     </update>
 
+    <!-- 分页查询任务列表 -->
     <select id="getPageTaskList" resultType="com.jzg.commons.entity.report.dto.ReportUploadExcelTaskDto">
-         select
-             *
-         from
-             report_upload_excel_task
-         <where>
-             <if test="vo.uploadUserId !=null and vo.uploadUserId !=''">
-                 AND  upload_user_id  =#{ vo.uploadUserId }
-             </if>
-             <if test="vo.taskStatus !=null">
-                 AND   task_status  =#{ vo.taskStatus }
-             </if>
-             <if test="vo.readStatus !=null">
-                 AND  read_status  =#{ vo.readStatus }
-             </if>
-         </where>
-          order by  upload_date desc
+        select
+        *
+        from
+        report_upload_excel_task
+        <where>
+            and is_delete = 0
+            <if test="vo.uploadUserId != null and vo.uploadUserId != ''">
+                AND upload_user_id = #{vo.uploadUserId}
+            </if>
+            <if test="vo.taskStatus != null">
+                AND task_status = #{vo.taskStatus}
+            </if>
+            <if test="vo.readStatus != null">
+                AND read_status = #{vo.readStatus}
+            </if>
+        </where>
+        order by upload_date desc
     </select>
+
+    <!-- 查询未读消息数量 -->
     <select id="getTaskMessageNoReadCount" resultType="java.lang.Integer">
         select
-            count(0)
+        count(0)
         from
-            report_upload_excel_task
-        where
-            upload_user_id  =#{ userId }
-            and
-            read_status = 0
+        report_upload_excel_task
+        <where>
+            and is_delete = 0
+            AND upload_user_id = #{userId}
+            AND read_status = 0
+        </where>
     </select>
-</mapper>
+
+</mapper>