Commit 3ebb2dca by 刘鑫

fix(ID1004138):博西PEA_V1.0-容量:工程师列只需要回显已加入工作队的数量

1 parent 9b60af50
......@@ -15,41 +15,41 @@ public interface CapacityStatisticDao extends JpaRepository<CapacityTeamStatEnti
" ifnull(sum(a.cap_total),0) cap_total, " +
" ifnull(sum(cap_used),0)+ifnull(sum(cap_used_travel),0) as cap_used, " +
" ifnull(sum(a.cap_left),0) cap_left" +
" FROM capacity_engineer_stat a\n" +
" INNER JOIN org_team_engineer b ON a.engineer_code=b.engineer_code AND b.status=1" +
" FROM capacity_engineer_stat a " +
" INNER JOIN org_team_engineer b ON a.engineer_code=b.engineer_code AND b.status=1 " +
" INNER JOIN v_engineer_skill v ON a.engineer_code = v.engineer_code" +
" WHERE b.team_id= :teamId " +
" AND a.workday= :date" +
" GROUP BY a.workday, v.layer_id, v.layer", nativeQuery = true)
List<Object[]> sumTeamCapacity(String date, String teamId);
@Query(value = "SELECT a.workday, " +
" v.layer_id, " +
" v.layer, " +
" count(distinct a.engineer_code) engineer_count, " +
@Query(value = "SELECT a.workday, v.layer_id, v.layer, count(distinct a.engineer_code) engineer_count, " +
" sum(a.cap_total) cap_total, " +
" ifnull(sum(cap_used),0)+ifnull(sum(cap_used_travel),0) as cap_used, " +
" sum(a.cap_left) cap_left\n" +
" FROM capacity_engineer_stat a\n" +
" JOIN v_engineer_skill v ON a.engineer_code = v.engineer_code\n" +
" JOIN engineer_info z ON a.engineer_code = z.engineer_code\n" +
" WHERE z.group_id= :groupId AND a.workday= :date \n" +
" GROUP BY a.workday, v.layer_id, v.layer;", nativeQuery = true)
" sum(a.cap_left) cap_left " +
" FROM org_team ot " +
" LEFT JOIN org_group og ON og.group_id = ot.group_id AND og.status = 1 " +
" LEFT JOIN org_team_engineer ote ON ote.team_id = ot.team_id AND ot.status =1 AND ote.status =1 " +
" LEFT JOIN capacity_engineer_stat a ON a.engineer_code = ote.engineer_code " +
" LEFT JOIN v_engineer_skill v ON a.engineer_code = v.engineer_code " +
" LEFT JOIN engineer_info z ON a.engineer_code = z.engineer_code AND z.bean_status = 1 " +
" WHERE ot.group_id= :groupId AND a.workday= :date " +
" GROUP BY a.workday, v.layer_id, v.layer", nativeQuery = true)
List<Object[]> sumGroupCapacity(String date, String groupId);
@Query(value = "SELECT a.workday, " +
" v.layer_id, " +
" v.layer, " +
" count(distinct a.engineer_code) engineer_count, " +
" sum(a.cap_total) cap_total, " +
" ifnull(sum(cap_used),0)+ifnull(sum(cap_used_travel),0) as cap_used, " +
" sum(a.cap_left) cap_left\n" +
" FROM capacity_engineer_stat a\n" +
" JOIN v_engineer_skill v ON a.engineer_code = v.engineer_code\n" +
" JOIN engineer_info z ON a.engineer_code = z.engineer_code\n" +
" JOIN org_group g ON z.group_id = g.group_id\n" +
" WHERE g.branch_id= :branchId AND a.workday= :date \n" +
" GROUP BY a.workday, v.layer_id, v.layer;", nativeQuery = true)
@Query(value = " SELECT a.workday, v.layer_id, v.layer,count(distinct a.engineer_code) engineer_count, \n" +
" sum(a.cap_total) cap_total, \n" +
" ifnull(sum(cap_used),0)+ifnull(sum(cap_used_travel),0) as cap_used, \n" +
" sum(a.cap_left) cap_left \n" +
" FROM org_team ot \n" +
" LEFT JOIN org_group og ON og.group_id = ot.group_id AND og.status = 1\n" +
" LEFT JOIN org_branch ob ON ob.branch_id = og.branch_id AND ob.status = 1\n" +
" LEFT JOIN org_team_engineer ote ON ote.team_id = ot.team_id AND ot.status = 1 AND ote.status =1\n" +
" LEFT JOIN capacity_engineer_stat a ON a.engineer_code = ote.engineer_code \n" +
" LEFT JOIN v_engineer_skill v ON a.engineer_code = v.engineer_code\n" +
" LEFT JOIN engineer_info z ON a.engineer_code = z.engineer_code AND z.bean_status = 1 \n" +
" WHERE ot.branch_id = :branchId AND a.workday= :date \n" +
" GROUP BY a.workday, v.layer_id, v.layer ", nativeQuery = true)
List<Object[]> sumBranchCapacity(String date, String branchId);
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!