|
@@ -4,6 +4,7 @@ package com.galaxis.manatee.dao;
|
|
|
import com.galaxis.capsule.util.GalaxisRepository;
|
|
|
import com.galaxis.manatee.entity.chuanyun.data.object.ChuanyunWorkHourDO;
|
|
|
import org.springframework.data.jpa.repository.Query;
|
|
|
+import org.springframework.data.repository.query.Param;
|
|
|
import org.springframework.stereotype.Repository;
|
|
|
|
|
|
import java.time.LocalDateTime;
|
|
@@ -39,6 +40,27 @@ public interface ChuanyunWorkHourDao extends GalaxisRepository<ChuanyunWorkHourD
|
|
|
nativeQuery = true)
|
|
|
List<ChuanyunWorkHourDO> getSelfWorkHour(String userId);
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取离职人员每天每个项目工时
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Query(value="SELECT\n" +
|
|
|
+ "\tchuanyun_day_log.project_id,\n" +
|
|
|
+ " chuanyun_day_log.project_type,\n" +
|
|
|
+ " chuanyun_log.user_id,\n" +
|
|
|
+ " chuanyun_day_log.day_log_date,\n" +
|
|
|
+ " chuanyun_day_log.hours_worked,\n" +
|
|
|
+ " chuanyun_log.`status`,\n" +
|
|
|
+ " chuanyun_day_log.object_id\n" +
|
|
|
+ "FROM\n" +
|
|
|
+ "\tchuanyun_log\n" +
|
|
|
+ "LEFT JOIN chuanyun_day_log ON chuanyun_log.object_id = chuanyun_day_log.parent_object_id\n" +
|
|
|
+ "WHERE\n" +
|
|
|
+ "\tLENGTH(chuanyun_log.user_id) != CHAR_LENGTH(chuanyun_log.user_id)\n" +
|
|
|
+ " AND project_id!=''",nativeQuery = true)
|
|
|
+ List<ChuanyunWorkHourDO> getQuitSelfWorkHour();
|
|
|
+
|
|
|
/**
|
|
|
* 根据用户Id获取用户最近一个月日志明细,并按日期拍
|
|
|
* @param userId
|
|
@@ -84,4 +106,31 @@ public interface ChuanyunWorkHourDao extends GalaxisRepository<ChuanyunWorkHourD
|
|
|
"chuanyun_day_log.day_log_date",
|
|
|
nativeQuery = true)
|
|
|
ChuanyunWorkHourDO getDayWorkHour(String userId,LocalDateTime day);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 离职人员每天工时
|
|
|
+ * @param userId
|
|
|
+ * @param dayLogDate
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Query(value="SELECT\n" +
|
|
|
+ "\tchuanyun_day_log.project_id,\n" +
|
|
|
+ "\tchuanyun_day_log.project_type,\n" +
|
|
|
+ "\tchuanyun_log.user_id,\n" +
|
|
|
+ "\tchuanyun_day_log.day_log_date,\n" +
|
|
|
+ "\tSUM(\n" +
|
|
|
+ "\t\tchuanyun_day_log.hours_worked\n" +
|
|
|
+ "\t) AS hours_worked,\n" +
|
|
|
+ "\tchuanyun_log.`status`,\n" +
|
|
|
+ "\tchuanyun_day_log.object_id\n" +
|
|
|
+ "FROM\n" +
|
|
|
+ "\tchuanyun_log\n" +
|
|
|
+ "LEFT JOIN chuanyun_day_log ON chuanyun_log.object_id = chuanyun_day_log.parent_object_id\n" +
|
|
|
+ "WHERE\n" +
|
|
|
+ "chuanyun_log.user_id = ?1 AND chuanyun_day_log.day_log_date=?2 \n" +
|
|
|
+ "GROUP BY\n" +
|
|
|
+ "\tchuanyun_log.user_id,\n" +
|
|
|
+ "\tchuanyun_day_log.day_log_date",nativeQuery = true)
|
|
|
+ ChuanyunWorkHourDO getQuitDayWorkHour(@Param("userId")String userId,@Param("dayLogDate")LocalDateTime dayLogDate);
|
|
|
+
|
|
|
}
|