Ver código fonte

1.项目费用汇总

WoNiu 4 anos atrás
pai
commit
ab9db069c8

+ 14 - 0
src/main/java/com/galaxis/manatee/dao/ChuanyunReimbursementAmountDao.java

@@ -0,0 +1,14 @@
+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.ChuanyunReimbursementAmountDO;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.stereotype.Repository;
+
+@Repository
+public interface ChuanyunReimbursementAmountDao extends GalaxisRepository<ChuanyunReimbursementAmountDO,String> {
+
+    @Query(value="SELECT SUM(amount),object_id  FROM chuanyun_reimbursement WHERE chuanyun_reimbursement.group_project_id = ?",nativeQuery = true)
+    ChuanyunReimbursementAmountDO getAmount(String projectId);
+}

+ 2 - 0
src/main/java/com/galaxis/manatee/dao/ChuanyunReimbursementDao.java

@@ -26,4 +26,6 @@ public interface ChuanyunReimbursementDao extends GalaxisRepository<ChuanyunReim
     Page<ChuanyunReimbursementDO> findAllByErpFlag(Integer erpFlag, Pageable pageable);
 
     List<ChuanyunReimbursementDO> findAllByGroupProjectId(String projectId);
+
+
 }

+ 25 - 0
src/main/java/com/galaxis/manatee/entity/chuanyun/data/object/ChuanyunReimbursementAmountDO.java

@@ -0,0 +1,25 @@
+package com.galaxis.manatee.entity.chuanyun.data.object;
+
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import lombok.Data;
+import lombok.extern.slf4j.Slf4j;
+import org.hibernate.annotations.GenericGenerator;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import java.math.BigDecimal;
+
+@Slf4j
+@Data
+@Entity
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class ChuanyunReimbursementAmountDO {
+    @Id
+    @GeneratedValue(generator = "idGeneratorChuanyunMemberCost")
+    @GenericGenerator(name ="idGeneratorChuanyunMemberCost" ,strategy="com.galaxis.capsule.util.GalaxisIdGenerator")
+    private Long objectId;
+
+    private BigDecimal amount;
+}