Commit 680ff92daa3f41b9818218ea05f4863c587c05e1

Authored by 颜惠青
1 parent 8a9d3fc4

工单 我的已办的查询修改

urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/mysql/maininfo/MainInfoExtMapper.java
... ... @@ -31,6 +31,127 @@ import java.util.List;
31 31 */
32 32 @Mapper
33 33 public interface MainInfoExtMapper extends BaseMapperX<MainInfoDO> {
  34 +
  35 + @Select({
  36 + "<script>",
  37 + " SELECT ",
  38 + "res.* ",
  39 + " FROM (",
  40 + "SELECT",
  41 + " m.*,",
  42 + " t.ID_ AS task_id,",
  43 + /*"t.NAME_ AS task_name,",
  44 + "t.task_def_key_ AS task_key,",*/
  45 + " '' AS task_name,",
  46 + " '' AS task_key,",
  47 + " pd.NAME_ AS process_definition_name,",
  48 + " t.START_TIME_,",
  49 + " t.END_TIME_,",
  50 + " pd.KEY_,",
  51 + " ROW_NUMBER() OVER (",
  52 + " PARTITION BY m.order_no",
  53 + " ORDER BY t.START_TIME_ DESC, t.ID_ DESC",
  54 + " ) AS rn ",
  55 + "FROM act_hi_taskinst t",
  56 + "LEFT JOIN act_re_procdef pd ON t.PROC_DEF_ID_ = pd.ID_",
  57 + "LEFT JOIN workorder_main_info m ON t.PROC_INST_ID_ = m.process_instance_id AND m.deleted = 0",
  58 + "WHERE 1=1",
  59 + " AND t.END_TIME_ IS NOT NULL",
  60 + " <if test='query.userId != null'>",
  61 + " AND t.ASSIGNEE_ = #{query.userId}",
  62 + " </if>",
  63 + " <if test='query.key != null'>",
  64 + " AND pd.KEY_ = #{query.key}",
  65 + " </if>",
  66 + " <if test='query.startTime != null'>",
  67 + " <![CDATA[ AND t.START_TIME_ >= #{query.startTime} ]]>",
  68 + " </if>",
  69 + " <if test='query.endTime != null'>",
  70 + " <![CDATA[ AND t.END_TIME_ <= #{query.endTime} ]]>",
  71 + " </if>",
  72 + " <if test='query.busiLine != null'>",
  73 + " AND m.busi_line = #{query.busiLine}",
  74 + " </if>",
  75 + " <if test=\"query.orderNo != null and query.orderNo != ''\">",
  76 + " AND m.order_no LIKE CONCAT('%', #{query.orderNo}, '%')",
  77 + " </if>",
  78 + " <if test=\"query.orderName != null and query.orderName != ''\">",
  79 + " AND m.order_name LIKE CONCAT('%', #{query.orderName}, '%')",
  80 + " </if>",
  81 + " <if test=\"query.remark != null and query.remark != ''\">",
  82 + " AND m.remark LIKE CONCAT('%', #{query.remark}, '%')",
  83 + " </if>",
  84 + " <if test=\"query.roadName != null and query.roadName != ''\">",
  85 + " AND m.road_name LIKE CONCAT('%', #{query.roadName}, '%')",
  86 + " </if>",
  87 + " <if test=\"query.streetName != null and query.streetName != ''\">",
  88 + " AND m.street_name = #{query.streetName}",
  89 + " <!-- 若需模糊匹配,改为:AND m.street_name LIKE CONCAT('%', #{query.streetName}, '%') -->",
  90 + " </if>",
  91 + " <if test='query.curingLevelId != null'>",
  92 + " AND m.curing_level_id = #{query.curingLevelId}",
  93 + " </if>",
  94 + " <if test='query.taskId != null'>",
  95 + " AND t.ID_ = #{query.taskId}",
  96 + " </if>",
  97 + " ) res ",
  98 + " WHERE res.rn = 1 ",
  99 + " ORDER BY res.END_TIME_ desc",
  100 + "</script>"
  101 + })
  102 + @Results({
  103 + @Result(column = "id", property = "id"),
  104 + @Result(column = "busi_line", property = "busiLine"),
  105 + @Result(column = "order_no", property = "orderNo"),
  106 + @Result(column = "order_name", property = "orderName"),
  107 + @Result(column = "source_id", property = "sourceId"),
  108 + @Result(column = "source_name", property = "sourceName"),
  109 + @Result(column = "road_id", property = "roadId"),
  110 + @Result(column = "road_name", property = "roadName"),
  111 + @Result(column = "street_id", property = "streetId"),
  112 + @Result(column = "street_name", property = "streetName"),
  113 + @Result(column = "curing_level_id", property = "curingLevelId"),
  114 + @Result(column = "curing_level_name", property = "curingLevelName"),
  115 + @Result(column = "commit_date", property = "commitDate"),
  116 + @Result(column = "finish_date", property = "finishDate"),
  117 + @Result(column = "pressing_type", property = "pressingType"),
  118 + @Result(column = "user_id", property = "userId"),
  119 + @Result(column = "user_name", property = "userName"),
  120 + @Result(column = "company_id", property = "companyId"),
  121 + @Result(column = "lat_lon_type", property = "latLonType"),
  122 + @Result(column = "lat", property = "lat"),
  123 + @Result(column = "lon", property = "lon"),
  124 + @Result(column = "lon_lat_address", property = "lonLatAddress"),
  125 + @Result(column = "third_work_no", property = "thirdWorkNo"),
  126 + @Result(column = "third_push_state", property = "thirdPushState"),
  127 + @Result(column = "buz_status", property = "buzStatus"),
  128 + @Result(column = "status", property = "status"),
  129 + @Result(column = "process_instance_id", property = "processInstanceId"),
  130 + @Result(column = "remark", property = "remark"),
  131 + @Result(column = "handle_result", property = "handleResult"),
  132 + @Result(column = "creator", property = "creator"),
  133 + @Result(column = "create_time", property = "createTime"),
  134 + @Result(column = "updater", property = "updater"),
  135 + @Result(column = "update_time", property = "updateTime"),
  136 + @Result(column = "deleted", property = "deleted"),
  137 +
  138 + @Result(column = "task_id", property = "taskId"),
  139 + @Result(column = "task_name", property = "taskName"),
  140 + @Result(column = "task_key", property = "taskKey"),
  141 + @Result(column = "process_definition_name", property = "processDefinitionName"),
  142 + @Result(column = "START_TIME_", property = "startTime"),
  143 + @Result(column = "END_TIME_", property = "endTime"),
  144 + @Result(column = "KEY_", property = "key_")
  145 + })
  146 + IPage<MainInfoExtDO> selectDoneExtUniquePage(IPage<MainInfoExtDO> page, @Param("query") MainInfoHasTaskPageReqVO reqVO);
  147 +
  148 + default PageResult<MainInfoExtDO> selectWorkOrderDoneUniquePage(PageParam pageParam, @Param("query") MainInfoHasTaskPageReqVO reqVO) {
  149 + IPage<MainInfoExtDO> mpPage = MyBatisUtils.buildPage(pageParam);
  150 + mpPage = selectDoneExtUniquePage(mpPage, reqVO);
  151 + return new PageResult<>(mpPage.getRecords(), mpPage.getTotal());
  152 + }
  153 +
  154 + //--------------------------------------------------------------------------------------------------
34 155 @Select({
35 156 "<script>",
36 157 "SELECT",
... ...
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/garden/BpmGardenServiceImpl.java
... ... @@ -444,7 +444,8 @@ public class BpmGardenServiceImpl implements BpmGardenService{
444 444 taskBuzReqVO.setUserId(SecurityFrameworkUtils.getLoginUserId());
445 445 //TODO 先写死
446 446 //taskBuzReqVO.setKey(BpmCommonConstant.BPM_GARDEN_INSPECT_WO);
447   - PageResult<MainInfoExtDO> pageResult = workOrderExtMapper.selectWorkOrderDonePage(pageVO,taskBuzReqVO);
  447 + //已办改为获取最新一条数据
  448 + PageResult<MainInfoExtDO> pageResult = workOrderExtMapper.selectWorkOrderDoneUniquePage(pageVO,taskBuzReqVO);
448 449 return AppGardenTaskConvert.INSTANCE.buildBuziTaskPage(pageResult,attachmentMapper);
449 450 }
450 451  
... ...