Commit b6ced151544c237538520162de39b992e36aa55d

Authored by wangqian
1 parent 322d4a01

app首页统计修改

urbanops-module-garden/src/main/resources/mapper/homepage/HomepageSummaryMapper.xml
@@ -415,24 +415,40 @@ @@ -415,24 +415,40 @@
415 <select id="queryPendingTaskDetails" resultType="com.zteits.urbanops.module.garden.controller.app.homepage.vo.TaskDetailsRspVo" > 415 <select id="queryPendingTaskDetails" resultType="com.zteits.urbanops.module.garden.controller.app.homepage.vo.TaskDetailsRspVo" >
416 SELECT taskName, busiDateTime, pressingType 416 SELECT taskName, busiDateTime, pressingType
417 FROM ( 417 FROM (
418 - SELECT a.plan_name as taskName,a.create_time as busiDateTime,null as pressingType 418 + SELECT
  419 + a.plan_name as taskName,c.begin_time as busiDateTime,null as pressingType
419 from garden_inspection_plan a 420 from garden_inspection_plan a
420 - INNER JOIN garden_inspection_plan_role b on a.batch_no=b.batch_no  
421 - where a.finish_state in(1,3) and a.dept_id = #{deptId}  
422 - AND b.role_id IN  
423 - <foreach collection='roleIds' item='roleId' open='(' close=')' separator=','>  
424 - #{roleId}  
425 - </foreach>  
426 - union all  
427 - SELECT a.plan_name as taskName,a.create_time as busiDateTime, null as pressingType  
428 - from garden_maintain_plan a  
429 - INNER JOIN garden_maintain_plan_role b on a.batch_no=b.batch_no  
430 - where a.finish_state in(1,3) and a.dept_id = #{deptId}  
431 - AND b.role_id IN  
432 - <foreach collection='roleIds' item='roleId' open='(' close=')' separator=','>  
433 - #{roleId}  
434 - </foreach> 421 + INNER JOIN garden_inspection_plan_role b on a.batch_no=b.batch_no
  422 + inner join garden_inspection_plan_detail c on a.batch_no=c.batch_no
  423 + where a.deleted = b.deleted and a.deleted = 0
  424 + and c.finish_state = 1
  425 + and c.begin_time &lt;= NOW()
  426 + AND c.end_time >= NOW()
  427 + and a.dept_id = #{deptId}
  428 + AND b.role_id IN
  429 + <foreach collection='roleIds' item='roleId' open='(' close=')' separator=','>
  430 + #{roleId}
  431 + </foreach>
  432 +
  433 + union all
  434 +
  435 + SELECT
  436 + a.plan_name as taskName,a.create_time as busiDateTime, null as pressingType
  437 + from garden_maintain_plan a
  438 + INNER JOIN garden_maintain_plan_role b on a.batch_no=b.batch_no
  439 + inner join garden_maintain_plan_detail c on a.batch_no=c.batch_no
  440 + where a.deleted=b.deleted and a.deleted = 0
  441 + and c.finish_state = 1
  442 + and c.begin_time &lt;= NOW()
  443 + AND c.end_time >= NOW()
  444 + and a.dept_id = #{deptId}
  445 + AND b.role_id IN
  446 + <foreach collection='roleIds' item='roleId' open='(' close=')' separator=','>
  447 + #{roleId}
  448 + </foreach>
  449 +
435 union all 450 union all
  451 +
436 SELECT 452 SELECT
437 m.order_name as taskName ,m.create_time as busiDateTime , m.pressing_type as pressingType 453 m.order_name as taskName ,m.create_time as busiDateTime , m.pressing_type as pressingType
438 FROM act_ru_task t 454 FROM act_ru_task t
@@ -482,7 +498,7 @@ @@ -482,7 +498,7 @@
482 FROM 498 FROM
483 garden_maintain_plan_detail a 499 garden_maintain_plan_detail a
484 INNER JOIN garden_maintain_plan_role b ON a.batch_no = b.batch_no 500 INNER JOIN garden_maintain_plan_role b ON a.batch_no = b.batch_no
485 - WHERE a.finish_state IN (1, 3) and a.dept_id = #{deptId} -- 1:未完成;3:已过期 501 + WHERE a.deleted = 0 and a.finish_state = 1 and a.dept_id = #{deptId} -- 1:未完成;3:已过期
486 <if test="beginTime != null and beginTime != ''"> 502 <if test="beginTime != null and beginTime != ''">
487 AND a.begin_time &lt;= #{beginTime} 503 AND a.begin_time &lt;= #{beginTime}
488 </if> 504 </if>
@@ -499,7 +515,7 @@ @@ -499,7 +515,7 @@
499 FROM 515 FROM
500 garden_inspection_plan_detail a 516 garden_inspection_plan_detail a
501 INNER JOIN garden_inspection_plan_role b ON a.batch_no = b.batch_no 517 INNER JOIN garden_inspection_plan_role b ON a.batch_no = b.batch_no
502 - WHERE a.finish_state IN (1, 3) and a.dept_id = #{deptId} -- 1:未完成;3:已过期 518 + WHERE a.deleted = 0 and a.finish_state = 1 and a.dept_id = #{deptId} -- 1:未完成;3:已过期
503 <if test="beginTime != null and beginTime != ''"> 519 <if test="beginTime != null and beginTime != ''">
504 AND a.begin_time &lt;= #{beginTime} 520 AND a.begin_time &lt;= #{beginTime}
505 </if> 521 </if>