From dfe65c30a3fa372af98e8341ea46b1c4bf7cc725 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期五, 13 十二月 2024 11:35:55 +0800
Subject: [PATCH] 增补属性的json中的顺序
---
pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/statistics/StLossSv.java | 22 ++++++++++++++++++----
1 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/statistics/StLossSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/statistics/StLossSv.java
index a3c517f..8122b02 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/statistics/StLossSv.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/statistics/StLossSv.java
@@ -37,12 +37,19 @@
List<VoIntakeLossStatistics> list = rmLossDayDao.statisticsByIntake(statisticsStartId, statisticsEndId) ;
if(list != null && list.size() > 0){
for(VoIntakeLossStatistics vo : list){
- StLossMonth po = new StLossMonth() ;
+ StLossMonth po = this.stLossMonthDao.selectByIntakeIdAndYearAndMonth(vo.intakeId, statisticsYear, statisticsMonth) ;
+ if(po == null){
+ po = new StLossMonth() ;
+ }
po.intakeId = vo.intakeId ;
po.year = statisticsYear ;
po.month = statisticsMonth ;
po.amount = vo.amount;
- stLossMonthDao.insert(po) ;
+ if(po.id == null) {
+ stLossMonthDao.insert(po);
+ }else{
+ stLossMonthDao.updateByPrimaryKey(po) ;
+ }
}
}
}
@@ -55,11 +62,18 @@
List<VoIntakeLossStatistics> list = stLossMonthDao.statisticsByIntake(statisticsYear) ;
if(list != null && list.size() > 0){
for(VoIntakeLossStatistics vo : list){
- StLossYear po = new StLossYear() ;
+ StLossYear po = this.stLossYearDao.selectByIntakeIdAndYear(vo.intakeId, statisticsYear) ;
+ if(po == null) {
+ po = new StLossYear();
+ }
po.intakeId = vo.intakeId ;
po.year = statisticsYear ;
po.amount = vo.amount;
- stLossYearDao.insert(po) ;
+ if(po.id == null) {
+ stLossYearDao.insert(po);
+ }else{
+ stLossYearDao.updateByPrimaryKey(po) ;
+ }
}
}
}
--
Gitblit v1.8.0