فهرست منبع

处理isc_exception业务逻辑

车车 4 ماه پیش
والد
کامیت
4f1091e727

+ 92 - 95
yudao-module-iscs/src/main/java/cn/iocoder/yudao/module/iscs/controller/admin/exception/ExceptionController.java

@@ -1,95 +1,92 @@
-package cn.iocoder.yudao.module.iscs.controller.admin.exception;
-
-import org.springframework.web.bind.annotation.*;
-import jakarta.annotation.Resource;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.security.access.prepost.PreAuthorize;
-import io.swagger.v3.oas.annotations.tags.Tag;
-import io.swagger.v3.oas.annotations.Parameter;
-import io.swagger.v3.oas.annotations.Operation;
-
-import jakarta.validation.constraints.*;
-import jakarta.validation.*;
-import jakarta.servlet.http.*;
-import java.util.*;
-import java.io.IOException;
-
-import cn.iocoder.yudao.framework.common.pojo.PageParam;
-import cn.iocoder.yudao.framework.common.pojo.PageResult;
-import cn.iocoder.yudao.framework.common.pojo.CommonResult;
-import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
-import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
-
-import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
-
-import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
-import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
-
-import cn.iocoder.yudao.module.iscs.controller.admin.exception.vo.*;
-import cn.iocoder.yudao.module.iscs.dal.dataobject.exception.ExceptionDO;
-import cn.iocoder.yudao.module.iscs.service.exception.ExceptionService;
-
-@Tag(name = "管理后台 - 异常记录")
-@RestController
-@RequestMapping("/iscs/exception")
-@Validated
-public class ExceptionController {
-
-    @Resource
-    private ExceptionService exceptionService;
-
-    @PostMapping("/insertException")
-    @Operation(summary = "创建异常记录")
-    @PreAuthorize("@ss.hasPermission('iscs:exception:create')")
-    public CommonResult<Long> insertException(@Valid @RequestBody ExceptionSaveReqVO createReqVO) {
-        return success(exceptionService.createException(createReqVO));
-    }
-
-    @PutMapping("/updateException")
-    @Operation(summary = "更新异常记录")
-    @PreAuthorize("@ss.hasPermission('iscs:exception:update')")
-    public CommonResult<Boolean> updateException(@Valid @RequestBody ExceptionSaveReqVO updateReqVO) {
-        exceptionService.updateException(updateReqVO);
-        return success(true);
-    }
-
-    @DeleteMapping("/deleteExceptionList")
-    @Parameter(name = "ids", description = "编号", required = true)
-    @Operation(summary = "批量删除异常记录")
-                @PreAuthorize("@ss.hasPermission('iscs:exception:delete')")
-    public CommonResult<Boolean> deleteExceptionList(@RequestParam("ids") List<Long> ids) {
-        exceptionService.deleteExceptionListByIds(ids);
-        return success(true);
-    }
-
-    @GetMapping("/selectExceptionById")
-    @Operation(summary = "获得异常记录")
-    @Parameter(name = "id", description = "编号", required = true, example = "1024")
-    @PreAuthorize("@ss.hasPermission('iscs:exception:query')")
-    public CommonResult<ExceptionRespVO> selectExceptionById(@RequestParam("id") Long id) {
-        ExceptionDO exception = exceptionService.getException(id);
-        return success(BeanUtils.toBean(exception, ExceptionRespVO.class));
-    }
-
-    @GetMapping("/getExceptionPage")
-    @Operation(summary = "获得异常记录分页")
-    @PreAuthorize("@ss.hasPermission('iscs:exception:query')")
-    public CommonResult<PageResult<ExceptionRespVO>> getExceptionPage(@Valid ExceptionPageReqVO pageReqVO) {
-        PageResult<ExceptionDO> pageResult = exceptionService.getExceptionPage(pageReqVO);
-        return success(BeanUtils.toBean(pageResult, ExceptionRespVO.class));
-    }
-
-    @GetMapping("/exportExceptionExcel")
-    @Operation(summary = "导出异常记录 Excel")
-    @PreAuthorize("@ss.hasPermission('iscs:exception:export')")
-    @ApiAccessLog(operateType = EXPORT)
-    public void exportExceptionExcel(@Valid ExceptionPageReqVO pageReqVO,
-              HttpServletResponse response) throws IOException {
-        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
-        List<ExceptionDO> list = exceptionService.getExceptionPage(pageReqVO).getList();
-        // 导出 Excel
-        ExcelUtils.write(response, "异常记录.xls", "数据", ExceptionRespVO.class,
-                        BeanUtils.toBean(list, ExceptionRespVO.class));
-    }
-
-}
+package cn.iocoder.yudao.module.iscs.controller.admin.exception;
+
+import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
+import cn.iocoder.yudao.module.iscs.controller.admin.exception.vo.ExceptionPageReqVO;
+import cn.iocoder.yudao.module.iscs.controller.admin.exception.vo.ExceptionRespVO;
+import cn.iocoder.yudao.module.iscs.controller.admin.exception.vo.ExceptionSaveReqVO;
+import cn.iocoder.yudao.module.iscs.service.exception.ExceptionService;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.annotation.Resource;
+import jakarta.servlet.http.HttpServletResponse;
+import jakarta.validation.Valid;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.io.IOException;
+import java.util.List;
+
+import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
+import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
+
+@Tag(name = "管理后台 - 异常记录")
+@RestController
+@RequestMapping("/iscs/exception")
+@Validated
+public class ExceptionController {
+
+    @Resource
+    private ExceptionService exceptionService;
+
+    @PostMapping("/insertException")
+    @Operation(summary = "创建异常记录")
+    @PreAuthorize("@ss.hasPermission('iscs:exception:create')")
+    public CommonResult<Long> insertException(@Valid @RequestBody ExceptionSaveReqVO createReqVO) {
+        return success(exceptionService.createException(createReqVO));
+    }
+
+    @PutMapping("/updateException")
+    @Operation(summary = "结束异常")
+    @PreAuthorize("@ss.hasPermission('iscs:exception:update')")
+    public CommonResult<Boolean> updateException(@Valid @RequestBody ExceptionSaveReqVO updateReqVO) {
+        exceptionService.updateException(updateReqVO);
+        return success(true);
+    }
+
+    @DeleteMapping("/deleteExceptionList")
+    @Parameter(name = "ids", description = "编号", required = true)
+    @Operation(summary = "批量删除异常记录")
+                @PreAuthorize("@ss.hasPermission('iscs:exception:delete')")
+    public CommonResult<Boolean> deleteExceptionList(@RequestParam("ids") List<Long> ids) {
+        exceptionService.deleteExceptionListByIds(ids);
+        return success(true);
+    }
+
+    @GetMapping("/selectExceptionById")
+    @Operation(summary = "获得异常记录")
+    @Parameter(name = "id", description = "编号", required = true, example = "1024")
+    @PreAuthorize("@ss.hasPermission('iscs:exception:query')")
+    public CommonResult<ExceptionRespVO> selectExceptionById(@RequestParam("id") Long id) {
+        ExceptionRespVO exception = exceptionService.getException(id);
+        return success(exception);
+    }
+
+    @GetMapping("/getExceptionPage")
+    @Operation(summary = "获得异常记录分页")
+    @PreAuthorize("@ss.hasPermission('iscs:exception:query')")
+    public CommonResult<PageResult<ExceptionRespVO>> getExceptionPage(@Valid ExceptionPageReqVO pageReqVO) {
+        PageResult<ExceptionRespVO> pageResult = exceptionService.getExceptionPage(pageReqVO);
+        return success(pageResult);
+    }
+
+    @GetMapping("/exportExceptionExcel")
+    @Operation(summary = "导出异常记录 Excel")
+    @PreAuthorize("@ss.hasPermission('iscs:exception:export')")
+    @ApiAccessLog(operateType = EXPORT)
+    public void exportExceptionExcel(@Valid ExceptionPageReqVO pageReqVO,
+              HttpServletResponse response) throws IOException {
+        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+        List<ExceptionRespVO> list = exceptionService.getExceptionPage(pageReqVO).getList();
+        // 导出 Excel
+        ExcelUtils.write(response, "异常记录.xls", "数据", ExceptionRespVO.class,
+                        BeanUtils.toBean(list, ExceptionRespVO.class));
+    }
+
+}

+ 21 - 4
yudao-module-iscs/src/main/java/cn/iocoder/yudao/module/iscs/controller/admin/exception/vo/ExceptionPageReqVO.java

@@ -1,10 +1,11 @@
 package cn.iocoder.yudao.module.iscs.controller.admin.exception.vo;
 
-import lombok.*;
-import java.util.*;
-import io.swagger.v3.oas.annotations.media.Schema;
 import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import com.baomidou.mybatisplus.annotation.TableField;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
 import org.springframework.format.annotation.DateTimeFormat;
+
 import java.time.LocalDateTime;
 
 import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@@ -52,4 +53,20 @@ public class ExceptionPageReqVO extends PageParam {
     @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
     private LocalDateTime[] createTime;
 
-}
+    @Schema(description = "异常发生时间")
+    @TableField(exist = false)
+    private String startRaiseTime;
+
+    @Schema(description = "异常发生时间")
+    @TableField(exist = false)
+    private String endRaiseTime;
+
+    @Schema(description = "异常处理时间")
+    @TableField(exist = false)
+    private String startHandleTime;
+
+    @Schema(description = "异常处理时间")
+    @TableField(exist = false)
+    private String endHandleTime;
+
+}

+ 25 - 5
yudao-module-iscs/src/main/java/cn/iocoder/yudao/module/iscs/controller/admin/exception/vo/ExceptionRespVO.java

@@ -1,11 +1,11 @@
 package cn.iocoder.yudao.module.iscs.controller.admin.exception.vo;
 
+import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
+import com.alibaba.excel.annotation.ExcelProperty;
 import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.*;
-import java.util.*;
-import org.springframework.format.annotation.DateTimeFormat;
+import lombok.Data;
+
 import java.time.LocalDateTime;
-import com.alibaba.excel.annotation.*;
 
 @Schema(description = "管理后台 - 异常记录 Response VO")
 @Data
@@ -20,14 +20,26 @@ public class ExceptionRespVO {
     @ExcelProperty("异常种类(1-锁控柜 2-物资柜)")
     private String exceptionCategory;
 
+    @Schema(description = "异常种类(1-锁控柜 2-物资柜)")
+    @ExcelProperty("异常种类(1-锁控柜 2-物资柜)")
+    private String exceptionCategoryName;
+
     @Schema(description = "异常类型(字典exception_type)", example = "1")
     @ExcelProperty("异常类型(字典exception_type)")
     private String exceptionType;
 
+    @Schema(description = "异常类型", example = "1")
+    @ExcelProperty("异常类型")
+    private String exceptionTypeName;
+
     @Schema(description = "异常等级")
     @ExcelProperty("异常等级")
     private String exceptionLevel;
 
+    @Schema(description = "异常等级")
+    @ExcelProperty("异常等级")
+    private String exceptionLevelName;
+
     @Schema(description = "异常描述", example = "随便")
     @ExcelProperty("异常描述")
     private String exceptionDescription;
@@ -36,6 +48,10 @@ public class ExceptionRespVO {
     @ExcelProperty("来源ID")
     private Long sourceId;
 
+    @Schema(description = "来源", example = "4696")
+    @ExcelProperty("来源")
+    private String sourceName;
+
     @Schema(description = "异常发生时间")
     @ExcelProperty("异常发生时间")
     private LocalDateTime raiseTime;
@@ -44,6 +60,10 @@ public class ExceptionRespVO {
     @ExcelProperty("引发人ID")
     private Long raiser;
 
+    @Schema(description = "引发人")
+    @ExcelProperty("引发人")
+    private Long raiserName;
+
     @Schema(description = "参数ID")
     @ExcelProperty("参数ID")
     private Long parameters;
@@ -64,4 +84,4 @@ public class ExceptionRespVO {
     @ExcelProperty("创建时间")
     private LocalDateTime createTime;
 
-}
+}

+ 10 - 5
yudao-module-iscs/src/main/java/cn/iocoder/yudao/module/iscs/dal/mysql/exception/ExceptionMapper.java

@@ -1,13 +1,14 @@
 package cn.iocoder.yudao.module.iscs.dal.mysql.exception;
 
-import java.util.*;
-
 import cn.iocoder.yudao.framework.common.pojo.PageResult;
-import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
 import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
+import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
+import cn.iocoder.yudao.module.iscs.controller.admin.exception.vo.ExceptionPageReqVO;
+import cn.iocoder.yudao.module.iscs.controller.admin.exception.vo.ExceptionRespVO;
 import cn.iocoder.yudao.module.iscs.dal.dataobject.exception.ExceptionDO;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import org.apache.ibatis.annotations.Mapper;
-import cn.iocoder.yudao.module.iscs.controller.admin.exception.vo.*;
+import org.apache.ibatis.annotations.Param;
 
 /**
  * 异常记录 Mapper
@@ -34,4 +35,8 @@ public interface ExceptionMapper extends BaseMapperX<ExceptionDO> {
                 .orderByDesc(ExceptionDO::getId));
     }
 
-}
+    ExceptionRespVO getException(@Param(value = "id") Long id);
+
+    Page<ExceptionRespVO> getExceptionPage(Page page, @Param(value = "vo") ExceptionPageReqVO vo);
+
+}

+ 65 - 63
yudao-module-iscs/src/main/java/cn/iocoder/yudao/module/iscs/service/exception/ExceptionService.java

@@ -1,63 +1,65 @@
-package cn.iocoder.yudao.module.iscs.service.exception;
-
-import java.util.*;
-import jakarta.validation.*;
-import cn.iocoder.yudao.module.iscs.controller.admin.exception.vo.*;
-import cn.iocoder.yudao.module.iscs.dal.dataobject.exception.ExceptionDO;
-import cn.iocoder.yudao.framework.common.pojo.PageResult;
-import cn.iocoder.yudao.framework.common.pojo.PageParam;
-import com.baomidou.mybatisplus.extension.service.IService;
-
-/**
- * 异常记录 Service 接口
- *
- * @author 芋道源码
- */
-public interface ExceptionService extends IService<ExceptionDO> {
-
-    /**
-     * 创建异常记录
-     *
-     * @param createReqVO 创建信息
-     * @return 编号
-     */
-    Long createException(@Valid ExceptionSaveReqVO createReqVO);
-
-    /**
-     * 更新异常记录
-     *
-     * @param updateReqVO 更新信息
-     */
-    void updateException(@Valid ExceptionSaveReqVO updateReqVO);
-
-    /**
-     * 删除异常记录
-     *
-     * @param id 编号
-     */
-    void deleteException(Long id);
-
-    /**
-    * 批量删除异常记录
-    *
-    * @param ids 编号
-    */
-    void deleteExceptionListByIds(List<Long> ids);
-
-    /**
-     * 获得异常记录
-     *
-     * @param id 编号
-     * @return 异常记录
-     */
-    ExceptionDO getException(Long id);
-
-    /**
-     * 获得异常记录分页
-     *
-     * @param pageReqVO 分页查询
-     * @return 异常记录分页
-     */
-    PageResult<ExceptionDO> getExceptionPage(ExceptionPageReqVO pageReqVO);
-
-}
+package cn.iocoder.yudao.module.iscs.service.exception;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.module.iscs.controller.admin.exception.vo.ExceptionPageReqVO;
+import cn.iocoder.yudao.module.iscs.controller.admin.exception.vo.ExceptionRespVO;
+import cn.iocoder.yudao.module.iscs.controller.admin.exception.vo.ExceptionSaveReqVO;
+import cn.iocoder.yudao.module.iscs.dal.dataobject.exception.ExceptionDO;
+import com.baomidou.mybatisplus.extension.service.IService;
+import jakarta.validation.Valid;
+
+import java.util.List;
+
+/**
+ * 异常记录 Service 接口
+ *
+ * @author 芋道源码
+ */
+public interface ExceptionService extends IService<ExceptionDO> {
+
+    /**
+     * 创建异常记录
+     *
+     * @param createReqVO 创建信息
+     * @return 编号
+     */
+    Long createException(@Valid ExceptionSaveReqVO createReqVO);
+
+    /**
+     * 更新异常记录
+     *
+     * @param updateReqVO 更新信息
+     */
+    void updateException(@Valid ExceptionSaveReqVO updateReqVO);
+
+    /**
+     * 删除异常记录
+     *
+     * @param id 编号
+     */
+    void deleteException(Long id);
+
+    /**
+    * 批量删除异常记录
+    *
+    * @param ids 编号
+    */
+    void deleteExceptionListByIds(List<Long> ids);
+
+    /**
+     * 获得异常记录
+     *
+     * @param id 编号
+     * @return 异常记录
+     */
+    ExceptionRespVO getException(Long id);
+
+    /**
+     * 获得异常记录分页
+     *
+     * @param pageReqVO 分页查询
+     * @return 异常记录分页
+     */
+    PageResult<ExceptionRespVO> getExceptionPage(ExceptionPageReqVO pageReqVO);
+
+}

+ 11 - 4
yudao-module-iscs/src/main/java/cn/iocoder/yudao/module/iscs/service/exception/ExceptionServiceImpl.java

@@ -4,9 +4,11 @@ import cn.hutool.core.collection.CollUtil;
 import cn.iocoder.yudao.framework.common.pojo.PageResult;
 import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
 import cn.iocoder.yudao.module.iscs.controller.admin.exception.vo.ExceptionPageReqVO;
+import cn.iocoder.yudao.module.iscs.controller.admin.exception.vo.ExceptionRespVO;
 import cn.iocoder.yudao.module.iscs.controller.admin.exception.vo.ExceptionSaveReqVO;
 import cn.iocoder.yudao.module.iscs.dal.dataobject.exception.ExceptionDO;
 import cn.iocoder.yudao.module.iscs.dal.mysql.exception.ExceptionMapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import jakarta.annotation.Resource;
 import org.springframework.stereotype.Service;
@@ -75,13 +77,18 @@ public class ExceptionServiceImpl extends ServiceImpl<ExceptionMapper, Exception
     }
 
     @Override
-    public ExceptionDO getException(Long id) {
-        return exceptionMapper.selectById(id);
+    public ExceptionRespVO getException(Long id) {
+        return exceptionMapper.getException(id);
     }
 
     @Override
-    public PageResult<ExceptionDO> getExceptionPage(ExceptionPageReqVO pageReqVO) {
-        return exceptionMapper.selectPage(pageReqVO);
+    public PageResult<ExceptionRespVO> getExceptionPage(ExceptionPageReqVO pageReqVO) {
+        Page<ExceptionDO> page = new Page<ExceptionDO>().setCurrent(pageReqVO.getPageNo()).setSize(pageReqVO.getPageSize());
+        Page<ExceptionRespVO> exceptionPage = exceptionMapper.getExceptionPage(page, pageReqVO);
+        PageResult<ExceptionRespVO> respVOPageResult = new PageResult<>();
+        respVOPageResult.setList(exceptionPage.getRecords());
+        respVOPageResult.setTotal(exceptionPage.getTotal());
+        return respVOPageResult;
     }
 
 }

+ 75 - 1
yudao-module-iscs/src/main/resources/mapper/ExceptionMapper.xml

@@ -9,4 +9,78 @@
         文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
      -->
 
-</mapper>
+    <select id="getException"
+            resultType="cn.iocoder.yudao.module.iscs.controller.admin.exception.vo.ExceptionRespVO">
+        SELECT
+            e.*,
+            d.label AS exception_category_name,
+            CASE WHEN e.exception_category = 1 THEN l.loto_name WHEN e.exception_category = 2 THEN m.cabinet_name END AS source_name,
+            dd.label AS exception_type_name,
+            ddd.label AS exception_level_name,
+            u.nickname AS raiser_name
+        FROM
+            isc_exception e
+                LEFT JOIN system_dict_data d ON e.exception_category = d.value AND d.dict_type = 'classification_of_exceptions'
+                LEFT JOIN isc_loto_station l ON l.id = e.source_id
+                LEFT JOIN isc_materials_cabinet m ON m.cabinet_id = e.source_id
+                LEFT JOIN system_dict_data dd ON e.exception_type = dd.value AND dd.dict_type = 'type_of_exception'
+                LEFT JOIN system_dict_data ddd ON e.exception_level = ddd.value AND ddd.dict_type = 'severity_level'
+                LEFT JOIN system_users u ON u.id = e.raiser
+        where e.id = #{id}
+    </select>
+    <select id="getExceptionPage"
+            resultType="cn.iocoder.yudao.module.iscs.controller.admin.exception.vo.ExceptionRespVO">
+        select a.* from (
+        SELECT
+        e.*,
+        d.label AS exception_category_name,
+        CASE WHEN e.exception_category = 1 THEN l.loto_name WHEN e.exception_category = 2 THEN m.cabinet_name END AS source_name,
+        dd.label AS exception_type_name,
+        ddd.label AS exception_level_name,
+        u.nickname AS raiser_name
+        FROM
+        isc_exception e
+        LEFT JOIN sys_dict_data d ON e.exception_category = d.value AND d.dict_type =
+        'classification_of_exceptions'
+        LEFT JOIN isc_loto_station l ON l.id = e.source_id
+        LEFT JOIN isc_materials_cabinet m ON m.cabinet_id = e.source_id
+        LEFT JOIN system_dict_data dd ON e.exception_type = dd.value AND dd.dict_type = 'type_of_exception'
+        LEFT JOIN system_dict_data ddd ON e.exception_level = ddd.value AND ddd.dict_type = 'severity_level'
+        LEFT JOIN system_users u ON u.id = e.raiser
+        <where>
+            <if test="vo.exceptionCategory != null and vo.exceptionCategory.trim != ''">
+                and e.exception_category = #{vo.exceptionCategory}
+            </if>
+            <if test="vo.exceptionType != null and vo.exceptionType.trim != ''">
+                and e.exception_type = #{vo.exceptionType}
+            </if>
+            <if test="vo.exceptionLevel != null and vo.exceptionLevel.trim != ''">
+                and e.exception_level = #{vo.exceptionLevel}
+            </if>
+            <if test="vo.raiserName != null and vo.raiserName.trim != ''">
+                and u.nick_name like concat('%',#{vo.raiserName},'%')
+            </if>
+            <if test="vo.startRaiseTime != null and vo.startRaiseTime.trim != ''">
+                and e.raise_time &gt;= #{vo.startRaiseTime}
+            </if>
+            <if test="vo.endRaiseTime != null and vo.endRaiseTime.trim != ''">
+                and e.raise_time &lt;= #{vo.endRaiseTime}
+            </if>
+            <if test="vo.startHandleTime != null and vo.startHandleTime.trim != ''">
+                and e.handle_time &gt;= #{vo.startHandleTime}
+            </if>
+            <if test="vo.endHandleTime != null and vo.endHandleTime.trim != ''">
+                and e.handle_time &lt;= #{vo.endHandleTime}
+            </if>
+            <if test="vo.status != null and vo.status.trim != ''">
+                and e.status = #{vo.status}
+            </if>
+        </where>) a
+        <where>
+            <if test="vo.sourceName != null and vo.sourceName.trim != ''">
+                and a.source_name like concat('%',#{vo.sourceName},'%')
+            </if>
+        </where>
+        order by a.id desc
+    </select>
+</mapper>