|
@@ -3,7 +3,9 @@ package com.galaxis.manatee.dao;
|
|
|
|
|
|
import com.galaxis.capsule.util.GalaxisRepository;
|
|
|
import com.galaxis.manatee.entity.chuanyun.data.object.ChuanyunMemberCostDO;
|
|
|
+import com.galaxis.manatee.entity.chuanyun.data.object.ChuanyunProjectCostDO;
|
|
|
import org.springframework.data.jpa.repository.Query;
|
|
|
+import org.springframework.data.repository.query.Param;
|
|
|
import org.springframework.stereotype.Repository;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
@@ -19,34 +21,40 @@ public interface ChuanyunMemberCostDao extends GalaxisRepository<ChuanyunMemberC
|
|
|
* 获取项目人员总工时总成本
|
|
|
* @return
|
|
|
*/
|
|
|
- @Query(value="SELECT chuanyun_self_cost.object_id," +
|
|
|
- "SUM(chuanyun_self_cost.total_hour) AS total_hour," +
|
|
|
- "SUM(chuanyun_self_cost.cost) AS cost," +
|
|
|
- "chuanyun_self_cost.project_type," +
|
|
|
- "chuanyun_self_cost.project_id," +
|
|
|
- "chuanyun_self_cost.status," +
|
|
|
- "chuanyun_self_cost.user_id," +
|
|
|
- "chuanyun_self_cost.monthly_total_hour AS person_days"+
|
|
|
- " FROM chuanyun_self_cost " +
|
|
|
- "GROUP BY chuanyun_self_cost.project_id," +
|
|
|
- "chuanyun_self_cost.status," +
|
|
|
- "chuanyun_self_cost.user_id",
|
|
|
+ @Query(value="SELECT SUM(chuanyun_self_work_hour.standard_work_hour) AS total_hour,chuanyun_self_work_hour.user_id," +
|
|
|
+ "SUM(chuanyun_self_work_hour.standard_work_hour)/8 AS person_days,chuanyun_self_work_hour.project_id," +
|
|
|
+ "chuanyun_self_work_hour.project_type,chuanyun_self_work_hour.`status` ,chuanyun_self_work_hour.object_id \n" +
|
|
|
+ "FROM chuanyun_self_work_hour where project_id!='' GROUP BY chuanyun_self_work_hour.project_id,chuanyun_self_work_hour.user_id,chuanyun_self_work_hour.project_type," +
|
|
|
+ "chuanyun_self_work_hour.`status`",
|
|
|
nativeQuery = true)
|
|
|
List<ChuanyunMemberCostDO> getMemberCost();
|
|
|
|
|
|
/**
|
|
|
+ * 获取审核中数据
|
|
|
+ * @param projectId
|
|
|
+ * @param projectType
|
|
|
+ * @param userId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Query(value="SELECT SUM(chuanyun_self_work_hour.standard_work_hour) AS total_hour,chuanyun_self_work_hour.user_id," +
|
|
|
+ "SUM(chuanyun_self_work_hour.standard_work_hour)/8 AS person_days,chuanyun_self_work_hour.project_id," +
|
|
|
+ "chuanyun_self_work_hour.project_type,chuanyun_self_work_hour.`status` ,chuanyun_self_work_hour.object_id \n" +
|
|
|
+ "FROM chuanyun_self_work_hour WHERE project_id=?1 AND project_type = ?2 AND user_id=?3 and `status`=2 " +
|
|
|
+ "GROUP BY chuanyun_self_work_hour.project_id,chuanyun_self_work_hour.user_id,chuanyun_self_work_hour.project_type," +
|
|
|
+ "chuanyun_self_work_hour.`status`",
|
|
|
+ nativeQuery = true)
|
|
|
+ ChuanyunMemberCostDO getProcessProjectMemberCost(@Param("projectId")String projectId, @Param("projectType")String projectType,@Param("userId")String userId);
|
|
|
+
|
|
|
+ /**
|
|
|
* 根据项目ID和人员ID获取工时成本数据
|
|
|
* @param userId 用户ID
|
|
|
* @param projectId 项目Id
|
|
|
* @param status 项目流程状态
|
|
|
* @return 人员-项目工时
|
|
|
*/
|
|
|
- ChuanyunMemberCostDO findByUserIdAndProjectIdAndStatus(String userId,String projectId,String status);
|
|
|
+ ChuanyunMemberCostDO findByUserIdAndProjectIdAndProjectTypeAndStatus(String userId,String projectId,String projectType,String status);
|
|
|
|
|
|
- /**
|
|
|
- * 删除审核中数据
|
|
|
- * @param status
|
|
|
- */
|
|
|
@Transactional
|
|
|
- void deleteAllByStatus(String status);
|
|
|
+ void deleteByProjectIdAndUserIdAndProjectTypeAndStatus(String projectId,String userId,String projectType,String status);
|
|
|
+
|
|
|
}
|