From d885ffc9f9ed909b0f7cb27da26e8b8fff1f89ea Mon Sep 17 00:00:00 2001
From: fuliqi <fuliqi@qq.com>
Date: 星期五, 24 十一月 2023 20:26:09 +0800
Subject: [PATCH] 20:25 我的待办分页查询条件修改,处置表单 修改

---
 ycl-platform/src/main/java/com/ycl/mapper/caseHandler/DisposeRecordMapper.java            |    3 
 ycl-platform/src/main/java/com/ycl/vo/MyBacklogVO.java                                    |   12 +++
 ycl-platform/src/main/java/com/ycl/dto/dispatch/UploadDisposingResultParam.java           |    6 +
 ycl-platform/src/main/java/com/ycl/controller/caseHandler/BaseCaseController.java         |    2 
 ycl-platform/src/main/java/com/ycl/entity/caseHandler/BaseCase.java                       |    3 
 ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/DisposeRecordServiceImpl.java |   75 +++++++++++++++++--------
 ycl-platform/src/main/resources/mapper/caseHandler/DisposeRecordMapper.xml                |   32 +++++++++-
 ycl-platform/src/main/java/com/ycl/service/caseHandler/IDisposeRecordService.java         |    3 
 ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/BaseCaseServiceImpl.java      |   25 +++++++-
 ycl-platform/src/main/java/com/ycl/controller/caseHandler/DisposeRecordController.java    |   12 +++
 10 files changed, 135 insertions(+), 38 deletions(-)

diff --git a/ycl-platform/src/main/java/com/ycl/controller/caseHandler/BaseCaseController.java b/ycl-platform/src/main/java/com/ycl/controller/caseHandler/BaseCaseController.java
index 139f112..af1e87f 100644
--- a/ycl-platform/src/main/java/com/ycl/controller/caseHandler/BaseCaseController.java
+++ b/ycl-platform/src/main/java/com/ycl/controller/caseHandler/BaseCaseController.java
@@ -34,6 +34,7 @@
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.core.context.SecurityContextHolder;
@@ -57,6 +58,7 @@
 @RestController
 @RequestMapping("/base_case")
 @Api(tags = "妗堜欢姹�")
+@Slf4j
 public class BaseCaseController extends BaseController {
 
     private IBaseCaseService baseCaseService;
diff --git a/ycl-platform/src/main/java/com/ycl/controller/caseHandler/DisposeRecordController.java b/ycl-platform/src/main/java/com/ycl/controller/caseHandler/DisposeRecordController.java
index d8f2299..38d6fb4 100644
--- a/ycl-platform/src/main/java/com/ycl/controller/caseHandler/DisposeRecordController.java
+++ b/ycl-platform/src/main/java/com/ycl/controller/caseHandler/DisposeRecordController.java
@@ -10,12 +10,16 @@
 import com.ycl.vo.MyBacklogVO;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.format.annotation.DateTimeFormat;
 import org.springframework.security.core.context.SecurityContextHolder;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
+
+import java.time.LocalDateTime;
 
 
 /**
@@ -44,9 +48,13 @@
     @LogSave(operationType = "鎴戠殑寰呭姙", contain = "鏌ヨ")
     public CommonResult searchMyTask(@RequestParam(required = false) String num,
                                      @RequestParam Integer pageSize,
-                                     @RequestParam Integer current) {
+                                     @RequestParam Integer current,
+                                     @RequestParam(required = false) Short source,
+                                     @RequestParam(required = false) Short type,
+                                     @RequestParam(required = false) Short time
+                                     ) {
         AdminUserDetails user = (AdminUserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
-        return CommonResult.success(iDisposeRecordService.listMyTask(new Page<>(current,pageSize),num, user.getUserId()));
+        return CommonResult.success(iDisposeRecordService.listMyTask(new Page<>(current,pageSize),num, user.getUserId(),type,source,time));
     }
 
 }
diff --git a/ycl-platform/src/main/java/com/ycl/dto/dispatch/UploadDisposingResultParam.java b/ycl-platform/src/main/java/com/ycl/dto/dispatch/UploadDisposingResultParam.java
index b1606c2..6855db7 100644
--- a/ycl-platform/src/main/java/com/ycl/dto/dispatch/UploadDisposingResultParam.java
+++ b/ycl-platform/src/main/java/com/ycl/dto/dispatch/UploadDisposingResultParam.java
@@ -5,6 +5,8 @@
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
+import java.util.List;
+
 @Data
 @ApiModel("UploadDisposingResultParam")
 public class UploadDisposingResultParam {
@@ -72,7 +74,7 @@
      * 鐓х墖
      */
     @ApiModelProperty(value = "鐓х墖")
-    private String pic;
+    private List<String> pic;
 
     //鐜板満
 
@@ -105,7 +107,7 @@
      * 鐜板満鎯呭喌鐓х墖
      */
     @ApiModelProperty(value = "鐜板満鎯呭喌鐓х墖")
-    private String situationPic;
+    private List<String> situationPic;
 
     //鏂囦功
     /**
diff --git a/ycl-platform/src/main/java/com/ycl/entity/caseHandler/BaseCase.java b/ycl-platform/src/main/java/com/ycl/entity/caseHandler/BaseCase.java
index fe4001a..13011b2 100644
--- a/ycl-platform/src/main/java/com/ycl/entity/caseHandler/BaseCase.java
+++ b/ycl-platform/src/main/java/com/ycl/entity/caseHandler/BaseCase.java
@@ -141,7 +141,8 @@
     @TableField("state")
     @ApiModelProperty(value = "澶勭悊鐘舵��(0璇姤 1涓婃姤 2绔嬫 3娲鹃仯 4澶勭疆 5鏍告煡 6缁撴)")
     private Integer state;
-
+    @ApiModelProperty(value = "澶勭悊鐘舵�佸悕")
+    private String stateName;
     /**
      * 澶勭悊鎰忚
      */
diff --git a/ycl-platform/src/main/java/com/ycl/mapper/caseHandler/DisposeRecordMapper.java b/ycl-platform/src/main/java/com/ycl/mapper/caseHandler/DisposeRecordMapper.java
index fe68979..e352d2c 100644
--- a/ycl-platform/src/main/java/com/ycl/mapper/caseHandler/DisposeRecordMapper.java
+++ b/ycl-platform/src/main/java/com/ycl/mapper/caseHandler/DisposeRecordMapper.java
@@ -6,6 +6,7 @@
 import com.ycl.vo.MyBacklogVO;
 import org.apache.ibatis.annotations.Param;
 
+import java.time.LocalDateTime;
 import java.util.List;
 
 /**
@@ -18,5 +19,5 @@
  */
 public interface DisposeRecordMapper extends BaseMapper<DisposeRecord> {
 
-    Page<MyBacklogVO> selectMyBackList(Page<MyBacklogVO> page, @Param("id") Long id, @Param("code") String code);
+    Page<MyBacklogVO> selectMyBackList(Page<MyBacklogVO> page, @Param("id") Long id, @Param("code") String code, LocalDateTime alarmTimeStart, LocalDateTime alarmTimeEnd, Short source, Short type);
 }
diff --git a/ycl-platform/src/main/java/com/ycl/service/caseHandler/IDisposeRecordService.java b/ycl-platform/src/main/java/com/ycl/service/caseHandler/IDisposeRecordService.java
index cdd489a..e241be3 100644
--- a/ycl-platform/src/main/java/com/ycl/service/caseHandler/IDisposeRecordService.java
+++ b/ycl-platform/src/main/java/com/ycl/service/caseHandler/IDisposeRecordService.java
@@ -6,6 +6,7 @@
 import com.ycl.entity.caseHandler.DisposeRecord;
 import com.ycl.vo.MyBacklogVO;
 
+import java.time.LocalDateTime;
 import java.util.List;
 
 /**
@@ -18,7 +19,7 @@
  */
 public interface IDisposeRecordService extends IService<DisposeRecord> {
 
-    Page<MyBacklogVO> listMyTask(Page<MyBacklogVO> page, String num, Long userId);
+    Page<MyBacklogVO> listMyTask(Page<MyBacklogVO> page, String num, Long userId, Short type, Short source, Short time);
 
     Boolean saveOrUpdateUpload(UploadDisposingResultParam uploadDisposingResultParam);
 }
diff --git a/ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/BaseCaseServiceImpl.java b/ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/BaseCaseServiceImpl.java
index 5bb0fa8..94ec885 100644
--- a/ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/BaseCaseServiceImpl.java
+++ b/ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/BaseCaseServiceImpl.java
@@ -407,21 +407,40 @@
         LocalDateTime now = LocalDateTime.now();
         if (Objects.nonNull(time) && time == 0) {
             end = now;
-            start = now.plusWeeks(1);
+            start = now.minusWeeks(1);
 
         }
         if (Objects.nonNull(time) && time == 1) {
             end = now;
-            start = now.plusMonths(1);
+            start = now.minusMonths(1);
 
         }
         if (Objects.nonNull(time) && time == 2) {
             end = now;
-            start = now.plusMonths(3);
+            start = now.minusMonths(3);
         }
         Page<BaseCase> baseCasePage = baseCaseMapper.selectBaseCasePage(page, number, communityId, categories, start, end, site, state, streetId);
         if (Objects.isNull(baseCasePage) && CollUtil.isNotEmpty(baseCasePage.getRecords())) {
             List<BaseCase> records = baseCasePage.getRecords();
+            //TODO:灏嗙姸鎬乻tate鏀逛负鐘舵�佸悕stateName
+            records.stream().forEach(baseCase -> {
+                Integer stateInt = baseCase.getState();
+                if (stateInt == 0) {
+                    baseCase.setStateName("璇姤");
+                }else if(stateInt == 1){
+                    baseCase.setStateName("涓婃姤");
+                }else if(stateInt == 2){
+                    baseCase.setStateName("绔嬫");
+                }else if(stateInt == 3){
+                    baseCase.setStateName("娲鹃仯");
+                }else if(stateInt == 4){
+                    baseCase.setStateName("澶勭疆");
+                }else if(stateInt == 5){
+                    baseCase.setStateName("鏍告煡");
+                }else if(stateInt == 6 ){
+                    baseCase.setStateName("缁撴");
+                }
+            });
             Set<Long> caseIds = records.stream().map(BaseCase::getId).collect(Collectors.toSet());
             Map<Long, String> urlMap = imageResourcesService.getUrlMap(caseIds, "01");
             records.stream().forEach(item -> {
diff --git a/ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/DisposeRecordServiceImpl.java b/ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/DisposeRecordServiceImpl.java
index b9c3042..2859546 100644
--- a/ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/DisposeRecordServiceImpl.java
+++ b/ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/DisposeRecordServiceImpl.java
@@ -30,6 +30,7 @@
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
 import java.util.List;
+import java.util.Objects;
 
 /**
  * <p>
@@ -44,12 +45,10 @@
 
     @Resource
     BaseCaseMapper baseCaseMapper;
-
     @Resource
     DisposeRecordMapper disposeRecordMapper;
     @Resource
     WorkflowConfigStepMapper workflowConfigStepMapper;
-
     @Autowired
     IInvestigationService iInvestigationService;
     @Autowired
@@ -64,10 +63,26 @@
     IDisposeRecordService iDisposeRecordService;
     @Autowired
     IImageResourcesService iImageResourcesService;
+    public final static Short LAST_WEEK = 0;
+    public final static Short LAST_MONTH = 1;
+    public final static Short LAST_THREEMONTH = 2;
 
     @Override
-    public Page<MyBacklogVO> listMyTask(Page<MyBacklogVO> page, String num, Long userId) {
-        return disposeRecordMapper.selectMyBackList(page,userId, num);
+    public Page<MyBacklogVO> listMyTask(Page<MyBacklogVO> page, String num, Long userId, Short type, Short source, Short time) {
+        LocalDateTime alarmTimeStart = null;
+        LocalDateTime alarmTimeEnd = null;
+        if (Objects.equals(time, LAST_WEEK)) {
+            alarmTimeStart = LocalDateTime.now().minusDays(7);
+            alarmTimeEnd = LocalDateTime.now();
+        } else if (Objects.equals(time, LAST_MONTH)) {
+            alarmTimeStart = LocalDateTime.now().minusMonths(1);
+            alarmTimeEnd = LocalDateTime.now();
+        } else if (Objects.equals(time, LAST_THREEMONTH)) {
+            alarmTimeStart = LocalDateTime.now().minusMonths(3);
+            alarmTimeEnd = LocalDateTime.now();
+        }
+        //TODO:鍑虹幇杩囦竴娆¢噸澶嶆暟鎹�
+        return disposeRecordMapper.selectMyBackList(page, userId, num, alarmTimeStart, alarmTimeEnd, source, type);
     }
 
     @Override
@@ -76,32 +91,40 @@
         AdminUserDetails user = (AdminUserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
         List<ArrivalSituation> list = iArrivalSituationService.list(new LambdaQueryWrapper<ArrivalSituation>().eq(ArrivalSituation::getBaseCaseId, uploadDisposingResultParam.getCaseId()));
         if (!list.isEmpty()) {
-            //褰撲簨浜�
-            PartyInfo partyInfo = new PartyInfo();
-            BeanUtils.copyProperties(uploadDisposingResultParam, partyInfo);
-            partyInfo.setId(uploadDisposingResultParam.getPartyInfoId());
-            iPartyInfoService.updateById(partyInfo);
-            //璋冩煡鍙栬瘉
-            Investigation investigation = new Investigation();
-            BeanUtils.copyProperties(uploadDisposingResultParam, investigation);
-            investigation.setBaseCaseId(uploadDisposingResultParam.getCaseId());
-            investigation.setPartyId(partyInfo.getId());
-            investigation.setInvestigationTime(LocalDateTime.parse(uploadDisposingResultParam.getInvestigationTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
-            investigation.setId(uploadDisposingResultParam.getInvestigationId());
-            iInvestigationService.updateById(investigation);
+            //TODO:杩濊娌℃湁褰撲簨浜篒D,杩濆缓鎵嶆湁
+            if (uploadDisposingResultParam.getPartyInfoId() != null) {
+                //褰撲簨浜�
+                PartyInfo partyInfo = new PartyInfo();
+                BeanUtils.copyProperties(uploadDisposingResultParam, partyInfo);
+                partyInfo.setId(uploadDisposingResultParam.getPartyInfoId());
+                iPartyInfoService.updateById(partyInfo);
+                //璋冩煡鍙栬瘉
+                Investigation investigation = new Investigation();
+                BeanUtils.copyProperties(uploadDisposingResultParam, investigation);
+                investigation.setBaseCaseId(uploadDisposingResultParam.getCaseId());
+                investigation.setPartyId(partyInfo.getId());
+                //TODO:鏀逛负闆嗗悎鐨勫瓧绗︿覆褰㈠紡
+                investigation.setPic(uploadDisposingResultParam.getPic().toString());
+                //TODO:灏忕▼搴忓墠绔〉闈㈡病鏈夎皟鏌ユ椂闂达紝鏆傛椂涓嶅~
+                //investigation.setInvestigationTime(LocalDateTime.parse(uploadDisposingResultParam.getInvestigationTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
+                investigation.setId(uploadDisposingResultParam.getInvestigationId());
+                iInvestigationService.updateById(investigation);
+            }
             //鍒拌揪
             ArrivalSituation arrivalSituation = new ArrivalSituation();
             BeanUtils.copyProperties(uploadDisposingResultParam, arrivalSituation);
             arrivalSituation.setBaseCaseId(uploadDisposingResultParam.getCaseId());
             arrivalSituation.setArrivalTime(LocalDateTime.parse(uploadDisposingResultParam.getArrivalTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
             arrivalSituation.setId(uploadDisposingResultParam.getArrivalSituationId());
+            //TODO:鏀逛负闆嗗悎鐨勫瓧绗︿覆褰㈠紡
+            arrivalSituation.setSituationPic(uploadDisposingResultParam.getSituationPic().toString());
             iArrivalSituationService.updateById(arrivalSituation);
             //鏂囦功
             String handType = "02";
             ImageResources imageResources = new ImageResources();
             imageResources.setType(handType);
             imageResources.setBelongToId(uploadDisposingResultParam.getCaseId());
-            imageResources.setUrl(StringUtils.joinWith(",", uploadDisposingResultParam.getPic(), uploadDisposingResultParam.getSituationPic()));
+            imageResources.setUrl(StringUtils.joinWith(",", uploadDisposingResultParam.getPic().toString(), uploadDisposingResultParam.getSituationPic().toString()));
             imageResources.setId(uploadDisposingResultParam.getImageResourcesId());
             iImageResourcesService.updateById(imageResources);
             if (uploadDisposingResultParam.getWritCode() != null && uploadDisposingResultParam.getWritType() != null) {
@@ -135,9 +158,13 @@
             BeanUtils.copyProperties(uploadDisposingResultParam, investigation);
             investigation.setBaseCaseId(uploadDisposingResultParam.getCaseId());
             investigation.setCreateTime(LocalDateTime.now());
+            //TODO:鏀逛负闆嗗悎鐨勫瓧绗︿覆褰㈠紡
+            investigation.setPic(uploadDisposingResultParam.getPic().toString());
             investigation.setCreateUser(user.getUserId());
             investigation.setPartyId(partyInfo.getId());
-            investigation.setInvestigationTime(LocalDateTime.parse(uploadDisposingResultParam.getInvestigationTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
+
+            //TODO:鍓嶇椤甸潰娌℃湁璋冩煡鏃堕棿锛屾殏鏃朵笉濉�
+//            investigation.setInvestigationTime(LocalDateTime.parse(uploadDisposingResultParam.getInvestigationTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
             iInvestigationService.save(investigation);
             //鍒拌揪
             ArrivalSituation arrivalSituation = new ArrivalSituation();
@@ -145,6 +172,8 @@
             arrivalSituation.setBaseCaseId(uploadDisposingResultParam.getCaseId());
             arrivalSituation.setCreateTime(LocalDateTime.now());
             arrivalSituation.setCreateUser(user.getUserId());
+            //TODO:鏀逛负闆嗗悎鐨勫瓧绗︿覆褰㈠紡
+            arrivalSituation.setSituationPic(uploadDisposingResultParam.getSituationPic().toString());
             arrivalSituation.setArrivalTime(LocalDateTime.parse(uploadDisposingResultParam.getArrivalTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
             iArrivalSituationService.save(arrivalSituation);
             //鏂囦功
@@ -154,7 +183,7 @@
             imageResources.setBelongToId(uploadDisposingResultParam.getCaseId());
             imageResources.setCreateTime(LocalDateTime.now());
             imageResources.setCreateUser(user.getUserId());
-            imageResources.setUrl(StringUtils.joinWith(",", uploadDisposingResultParam.getPic(), uploadDisposingResultParam.getSituationPic()));
+            imageResources.setUrl(StringUtils.joinWith(",", uploadDisposingResultParam.getPic().toString(), uploadDisposingResultParam.getSituationPic().toString()));
             iImageResourcesService.save(imageResources);
             if (uploadDisposingResultParam.getWritCode() != null && uploadDisposingResultParam.getWritType() != null) {
                 Writ writ = new Writ();
@@ -168,8 +197,8 @@
                 writ.setSendTime(LocalDateTime.parse(uploadDisposingResultParam.getSendTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
                 iWritService.save(writ);
                 imageResources.setUrl(StringUtils
-                        .joinWith(",", uploadDisposingResultParam.getPic()
-                                , uploadDisposingResultParam.getSituationPic()
+                        .joinWith(",", uploadDisposingResultParam.getPic().toString()
+                                , uploadDisposingResultParam.getSituationPic().toString()
                                 , uploadDisposingResultParam.getOriginalPic()
                                 , uploadDisposingResultParam.getOtherPic()
                                 , uploadDisposingResultParam.getRectifiedPic()
@@ -178,8 +207,6 @@
             }
 
             baseCaseService.update(new LambdaUpdateWrapper<BaseCase>().eq(BaseCase::getId, uploadDisposingResultParam.getCaseId()).set(BaseCase::getState, BaseCaseStatus.DISPOSE));
-
-
         }
         String stepName = StepName.CHECK.getName();
         DisposeRecord disposeRecord = new DisposeRecord();
diff --git a/ycl-platform/src/main/java/com/ycl/vo/MyBacklogVO.java b/ycl-platform/src/main/java/com/ycl/vo/MyBacklogVO.java
index 0a190ce..11e5078 100644
--- a/ycl-platform/src/main/java/com/ycl/vo/MyBacklogVO.java
+++ b/ycl-platform/src/main/java/com/ycl/vo/MyBacklogVO.java
@@ -26,7 +26,11 @@
      */
     @ApiModelProperty(value = "浜嬩欢鏉ユ簮(1-瑙嗛 2-鎵嬪姩鐧昏)")
     private Integer eventSource;
-
+    /**
+     * 鏉ユ簮(绀惧尯)
+     */
+    @ApiModelProperty(value = "鏉ユ簮(绀惧尯)")
+    private String source;
     /**
      * 闂绫诲埆锛�1-杩濊 2-杩濆缓锛�
      */
@@ -52,4 +56,10 @@
     @ApiModelProperty(value = "寮�濮嬫椂闂�")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private LocalDateTime limitTime;
+    /**
+     * 鍥剧墖
+     */
+    @ApiModelProperty(value = "鍥剧墖")
+    private String picture;
+
 }
\ No newline at end of file
diff --git a/ycl-platform/src/main/resources/mapper/caseHandler/DisposeRecordMapper.xml b/ycl-platform/src/main/resources/mapper/caseHandler/DisposeRecordMapper.xml
index ab8ce5a..48e4729 100644
--- a/ycl-platform/src/main/resources/mapper/caseHandler/DisposeRecordMapper.xml
+++ b/ycl-platform/src/main/resources/mapper/caseHandler/DisposeRecordMapper.xml
@@ -27,43 +27,69 @@
         select distinct * from (
         SELECT
         t3.event_source,
+        t5.region_name source,
         t3.category,
         t2.step_name,
         t3.`id` caseId,
         t3.`code`,
         t2.create_time,
-        t2.limit_time
+        t2.limit_time,
+        t4.url picture
         FROM
         ums_admin_role_relation t1
         left JOIN ums_dispose_record t2 ON t1.role_id = t2.handler_role_id
         left JOIN ums_base_case t3 ON t2.base_case_id=t3.id
+        left JOIN ums_image_resources t4 ON t2.base_case_id=t4.belong_to_id
+        inner join ums_sccg_region t5 on t5.id = t3.community_id
         <where>
             t1.admin_id = #{id} and t3.`code` is not null
             AND t2.state = 0
             <if test="code!='' and code!=null">
                 and t3.`code` LIKE CONCAT('%',#{code},'%')
             </if>
+            <if test="alarmTimeStart!=null and alarmTimeEnd!=null">
+                and t3.alarm_time <![CDATA[ <= ]]> #{alarmTimeEnd} and t3.alarm_time >= #{alarmTimeStart}
+            </if>
+            <if test="type !=null">
+                and t3.category = #{type}
+            </if>
+            <if test="source !=null">
+                and t5.parent_id = #{source}
+            </if>
         </where>
         union all
         SELECT
         t3.event_source,
+        t5.region_name source,
         t3.category,
         t2.step_name,
         t3.`id` caseId,
         t3.`code`,
         t2.create_time,
-        t2.limit_time
+        t2.limit_time,
+        t4.url picture
         FROM
         ums_dispose_record t2
         LEFT JOIN ums_base_case t3 ON t2.base_case_id = t3.id
+        left JOIN ums_image_resources t4 ON t2.base_case_id=t4.belong_to_id
+        inner join ums_sccg_region t5 on t5.id = t3.community_id
         <where>
             t2.handler_id = #{id}
             AND t2.state = 0
             <if test="code!='' and code!=null">
                 and t3.`code` LIKE CONCAT('%',#{code},'%')
             </if>
+            <if test="alarmTimeStart!=null and alarmTimeEnd!=null">
+                and t3.alarm_time <![CDATA[ <= ]]> #{alarmTimeEnd} and t3.alarm_time >= #{alarmTimeStart}
+            </if>
+            <if test="type !=null">
+                and t3.category = #{type}
+            </if>
+            <if test="source !=null">
+                and t5.parent_id = #{source}
+            </if>
         </where>
         ) as t
-         order by create_time
+         order by create_time desc
     </select>
 </mapper>

--
Gitblit v1.8.0