Commit 8a9d3fc4ad7c7b00bbde29fe2c738bae98b4c93c
1 parent
10156008
工单 我发起的查询修改
Showing
2 changed files
with
118 additions
and
1 deletions
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/mysql/maininfo/MainInfoExtMapper.java
| ... | ... | @@ -248,6 +248,122 @@ public interface MainInfoExtMapper extends BaseMapperX<MainInfoDO> { |
| 248 | 248 | //------------------------------------------------------------------------------------------------------- |
| 249 | 249 | @Select({ |
| 250 | 250 | "<script>", |
| 251 | + "SELECT ", | |
| 252 | + "res.* ", | |
| 253 | + " FROM ( ", | |
| 254 | + " SELECT ", | |
| 255 | + "m.*,", | |
| 256 | + "t.ID_ AS task_id,", | |
| 257 | + /*"t.NAME_ AS task_name,", | |
| 258 | + "t.task_def_key_ AS task_key,",*/ | |
| 259 | + "'' AS task_name,", | |
| 260 | + "'' AS task_key,", | |
| 261 | + "pd.NAME_ AS process_definition_name,", | |
| 262 | + "t.START_TIME_ ,", | |
| 263 | + "t.END_TIME_,", | |
| 264 | + "pd.KEY_,", | |
| 265 | + "ROW_NUMBER() OVER (", | |
| 266 | + "PARTITION BY m.order_no", | |
| 267 | + "ORDER BY t.START_TIME_ DESC, t.ID_ DESC", | |
| 268 | + ") AS rn", | |
| 269 | + "FROM act_hi_taskinst t", | |
| 270 | + "LEFT JOIN act_re_procdef pd ON t.PROC_DEF_ID_ = pd.ID_", | |
| 271 | + "LEFT JOIN act_hi_procinst pi ON t.PROC_INST_ID_ = pi.PROC_INST_ID_", | |
| 272 | + "LEFT JOIN workorder_main_info m ON t.PROC_INST_ID_ = m.process_instance_id", | |
| 273 | + "WHERE pi.START_USER_ID_ = #{query.userId}", | |
| 274 | + " <if test='query.key != null'>", | |
| 275 | + " AND pd.KEY_ = #{query.key}", | |
| 276 | + " </if>", | |
| 277 | + " <if test='query.startTime != null'>", | |
| 278 | + " <![CDATA[ AND t.START_TIME_ >= #{query.startTime} ]]>", | |
| 279 | + " </if>", | |
| 280 | + " <if test='query.endTime != null'>", | |
| 281 | + " <![CDATA[ AND t.END_TIME_ <= #{query.endTime} ]]>", | |
| 282 | + " </if>", | |
| 283 | + " <if test='query.busiLine != null'>", | |
| 284 | + " AND m.busi_line = #{query.busiLine}", | |
| 285 | + " </if>", | |
| 286 | + " <if test=\"query.orderNo != null and query.orderNo != ''\">", | |
| 287 | + " AND m.order_no LIKE CONCAT('%', #{query.orderNo}, '%')", | |
| 288 | + " </if>", | |
| 289 | + " <if test=\"query.orderName != null and query.orderName != ''\">", | |
| 290 | + " AND m.order_name LIKE CONCAT('%', #{query.orderName}, '%')", | |
| 291 | + " </if>", | |
| 292 | + " <if test=\"query.remark != null and query.remark != ''\">", | |
| 293 | + " AND m.remark LIKE CONCAT('%', #{query.remark}, '%')", | |
| 294 | + " </if>", | |
| 295 | + " <if test=\"query.roadName != null and query.roadName != ''\">", | |
| 296 | + " AND m.road_name LIKE CONCAT('%', #{query.roadName}, '%')", | |
| 297 | + " </if>", | |
| 298 | + " <if test=\"query.streetName != null and query.streetName != ''\">", | |
| 299 | + " AND m.street_name = #{query.streetName}", | |
| 300 | + " <!-- 若需模糊匹配,改为:AND m.street_name LIKE CONCAT('%', #{query.streetName}, '%') -->", | |
| 301 | + " </if>", | |
| 302 | + " <if test='query.curingLevelId != null'>", | |
| 303 | + " AND m.curing_level_id = #{query.curingLevelId}", | |
| 304 | + " </if>", | |
| 305 | + " <if test='query.taskId != null'>", | |
| 306 | + " AND t.ID_ = #{query.taskId}", | |
| 307 | + " </if>", | |
| 308 | + ") res ", | |
| 309 | + " WHERE res.rn = 1", | |
| 310 | + "ORDER BY res.START_TIME_ DESC", | |
| 311 | + "</script>" | |
| 312 | + }) | |
| 313 | + @Results({ | |
| 314 | + @Result(column = "id", property = "id"), | |
| 315 | + @Result(column = "busi_line", property = "busiLine"), | |
| 316 | + @Result(column = "order_no", property = "orderNo"), | |
| 317 | + @Result(column = "order_name", property = "orderName"), | |
| 318 | + @Result(column = "source_id", property = "sourceId"), | |
| 319 | + @Result(column = "source_name", property = "sourceName"), | |
| 320 | + @Result(column = "road_id", property = "roadId"), | |
| 321 | + @Result(column = "road_name", property = "roadName"), | |
| 322 | + @Result(column = "street_id", property = "streetId"), | |
| 323 | + @Result(column = "street_name", property = "streetName"), | |
| 324 | + @Result(column = "curing_level_id", property = "curingLevelId"), | |
| 325 | + @Result(column = "curing_level_name", property = "curingLevelName"), | |
| 326 | + @Result(column = "commit_date", property = "commitDate"), | |
| 327 | + @Result(column = "finish_date", property = "finishDate"), | |
| 328 | + @Result(column = "pressing_type", property = "pressingType"), | |
| 329 | + @Result(column = "user_id", property = "userId"), | |
| 330 | + @Result(column = "user_name", property = "userName"), | |
| 331 | + @Result(column = "company_id", property = "companyId"), | |
| 332 | + @Result(column = "lat_lon_type", property = "latLonType"), | |
| 333 | + @Result(column = "lat", property = "lat"), | |
| 334 | + @Result(column = "lon", property = "lon"), | |
| 335 | + @Result(column = "lon_lat_address", property = "lonLatAddress"), | |
| 336 | + @Result(column = "third_work_no", property = "thirdWorkNo"), | |
| 337 | + @Result(column = "third_push_state", property = "thirdPushState"), | |
| 338 | + @Result(column = "buz_status", property = "buzStatus"), | |
| 339 | + @Result(column = "status", property = "status"), | |
| 340 | + @Result(column = "process_instance_id", property = "processInstanceId"), | |
| 341 | + @Result(column = "remark", property = "remark"), | |
| 342 | + @Result(column = "handle_result", property = "handleResult"), | |
| 343 | + @Result(column = "creator", property = "creator"), | |
| 344 | + @Result(column = "create_time", property = "createTime"), | |
| 345 | + @Result(column = "updater", property = "updater"), | |
| 346 | + @Result(column = "update_time", property = "updateTime"), | |
| 347 | + @Result(column = "deleted", property = "deleted"), | |
| 348 | + | |
| 349 | + @Result(column = "task_id", property = "taskId"), | |
| 350 | + @Result(column = "task_name", property = "taskName"), | |
| 351 | + @Result(column = "task_key", property = "taskKey"), | |
| 352 | + @Result(column = "process_definition_name", property = "processDefinitionName"), | |
| 353 | + @Result(column = "START_TIME_", property = "startTime"), | |
| 354 | + @Result(column = "END_TIME_", property = "endTime"), | |
| 355 | + @Result(column = "KEY_", property = "key_") | |
| 356 | + }) | |
| 357 | + IPage<MainInfoExtDO> selectMyStartUniquePage(IPage<MainInfoExtDO> page, @Param("query") MainInfoHasTaskPageReqVO reqVO); | |
| 358 | + | |
| 359 | + default PageResult<MainInfoExtDO> selectWorkOrderUniqueMyPage(PageParam pageParam, @Param("query") MainInfoHasTaskPageReqVO reqVO) { | |
| 360 | + IPage<MainInfoExtDO> mpPage = MyBatisUtils.buildPage(pageParam); | |
| 361 | + mpPage = selectMyStartUniquePage(mpPage, reqVO); | |
| 362 | + return new PageResult<>(mpPage.getRecords(), mpPage.getTotal()); | |
| 363 | + } | |
| 364 | + //------------------------------------------------------------------------------------------------------- | |
| 365 | + @Select({ | |
| 366 | + "<script>", | |
| 251 | 367 | "SELECT", |
| 252 | 368 | "m.*,", |
| 253 | 369 | "t.ID_ AS task_id,", | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/service/garden/BpmGardenServiceImpl.java
| ... | ... | @@ -410,7 +410,8 @@ public class BpmGardenServiceImpl implements BpmGardenService{ |
| 410 | 410 | taskBuzReqVO.setUserId(SecurityFrameworkUtils.getLoginUserId()); |
| 411 | 411 | //TODO 先写死 |
| 412 | 412 | //taskBuzReqVO.setKey(BpmCommonConstant.BPM_GARDEN_INSPECT_WO); |
| 413 | - PageResult<MainInfoExtDO> pageResult = workOrderExtMapper.selectWorkOrderMyPage(pageVO,taskBuzReqVO); | |
| 413 | + //selectWorkOrderUniqueMyPage 个性化 去重 按工单唯一处理 | |
| 414 | + PageResult<MainInfoExtDO> pageResult = workOrderExtMapper.selectWorkOrderUniqueMyPage(pageVO,taskBuzReqVO); | |
| 414 | 415 | return AppGardenTaskConvert.INSTANCE.buildBuziTaskPage(pageResult,attachmentMapper); |
| 415 | 416 | } |
| 416 | 417 | @Override | ... | ... |