From b81e59b6ef96ac100109f7662365ff3bec805a2d Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期三, 11 十二月 2024 17:01:43 +0800
Subject: [PATCH] pipIrr-web-temp增加删除日统计水量(漏损、取水口、农户)
---
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStLossAmountDay.java | 18 ++++
pipIrr-platform/pipIrr-web/pipIrr-web-temp/src/main/java/com/dy/pipIrrTemp/delSome/DelSomeClientAmountSv.java | 31 +++++++
pipIrr-platform/pipIrr-global/src/main/resources/mapper/Temp4DeleteMapper.xml | 42 ++++++++++
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStClientAmountDay.java | 18 ++++
pipIrr-platform/pipIrr-web/pipIrr-web-temp/src/main/java/com/dy/pipIrrTemp/delSome/DelSomeIntakeAmountSv.java | 32 ++++++++
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoTmp/DeleteMapper.java | 29 +++++++
pipIrr-platform/pipIrr-web/pipIrr-web-temp/src/main/java/com/dy/pipIrrTemp/delSome/DelSomeCtrl.java | 3
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStIntakeAmountDay.java | 18 ++++
pipIrr-platform/pipIrr-web/pipIrr-web-temp/src/main/java/com/dy/pipIrrTemp/delSome/DelSomeLossAmountSv.java | 30 +++++++
9 files changed, 221 insertions(+), 0 deletions(-)
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoTmp/DeleteMapper.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoTmp/DeleteMapper.java
index bf158f7..017e23b 100644
--- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoTmp/DeleteMapper.java
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoTmp/DeleteMapper.java
@@ -15,6 +15,15 @@
public interface DeleteMapper extends BaseMapper<Object> {
/**
+ * 鏌ヨ鍏ㄩ儴婕忔崯鏃ョ粺璁�
+ *
+ * @return 瀹炰綋闆嗗悎
+ */
+ List<VoStLossAmountDay> selectAllStLossDay();
+
+ int deleteStLossDayById(Long id);
+
+ /**
* 鏌ヨ鍏ㄩ儴婕忔崯鏈堢粺璁�
*
* @return 瀹炰綋闆嗗悎
@@ -34,6 +43,16 @@
/**
+ * 鏌ヨ鍏ㄩ儴鍙栨按鍙f棩缁熻
+ *
+ * @return 瀹炰綋闆嗗悎
+ */
+ List<VoStIntakeAmountDay> selectAllStIntakeDay();
+
+ int deleteStIntakeDayById(Long id);
+
+
+ /**
* 鏌ヨ鍏ㄩ儴鍙栨按鍙f湀缁熻
*
* @return 瀹炰綋闆嗗悎
@@ -57,6 +76,16 @@
*
* @return 瀹炰綋闆嗗悎
*/
+ List<VoStClientAmountDay> selectAllStClientDay();
+
+ int deleteStClientDayById(Long id);
+
+
+ /**
+ * 鏌ヨ鍏ㄩ儴鍐滄埛鏈堢粺璁�
+ *
+ * @return 瀹炰綋闆嗗悎
+ */
List<VoStClientAmountMonth> selectAllStClientMonth();
int deleteStClientMonthById(Long id);
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStClientAmountDay.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStClientAmountDay.java
new file mode 100644
index 0000000..a85815d
--- /dev/null
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStClientAmountDay.java
@@ -0,0 +1,18 @@
+package com.dy.pipIrrGlobal.voTmp;
+
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @Author: liurunyu
+ * @Date: 2024/12/11 11:20
+ * @Description
+ */
+@Data
+public class VoStClientAmountDay {
+ public Long id ;
+ public Long clientId ;
+ public Date dt ;
+ public Double amount ;
+}
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStIntakeAmountDay.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStIntakeAmountDay.java
new file mode 100644
index 0000000..e4df3a9
--- /dev/null
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStIntakeAmountDay.java
@@ -0,0 +1,18 @@
+package com.dy.pipIrrGlobal.voTmp;
+
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @Author: liurunyu
+ * @Date: 2024/12/11 11:20
+ * @Description
+ */
+@Data
+public class VoStIntakeAmountDay {
+ public Long id ;
+ public Long intakeId ;
+ public Date dt ;
+ public Double amount ;
+}
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStLossAmountDay.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStLossAmountDay.java
new file mode 100644
index 0000000..709d18e
--- /dev/null
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStLossAmountDay.java
@@ -0,0 +1,18 @@
+package com.dy.pipIrrGlobal.voTmp;
+
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @Author: liurunyu
+ * @Date: 2024/12/11 11:20
+ * @Description
+ */
+@Data
+public class VoStLossAmountDay {
+ public Long id ;
+ public Long intakeId ;
+ public Date dt ;
+ public Double amount ;
+}
diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/Temp4DeleteMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/Temp4DeleteMapper.xml
index 60f1e56..7abeae4 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/Temp4DeleteMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/Temp4DeleteMapper.xml
@@ -2,6 +2,20 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dy.pipIrrGlobal.daoTmp.DeleteMapper">
<!-- 婕忔崯缁熻鐩稿叧 -->
+ <select id="selectAllStLossDay" resultType="com.dy.pipIrrGlobal.voTmp.VoStLossAmountDay">
+ select id as id,
+ intake_id as intakeId ,
+ dt as dt,
+ loss_amount as amount
+ from rm_loss_day
+ order by intake_id DESC, id DESC
+ </select>
+
+ <delete id="deleteStLossDayById" parameterType="java.lang.Long">
+ delete from rm_loss_day
+ where id = #{id,jdbcType=BIGINT}
+ </delete>
+
<select id="selectAllStLossMonth" resultType="com.dy.pipIrrGlobal.voTmp.VoStLossAmountMonth">
select id as id,
intake_id as intakeId ,
@@ -34,6 +48,20 @@
<!-- 鍙栨按鍙g粺璁$浉鍏� -->
+ <select id="selectAllStIntakeDay" resultType="com.dy.pipIrrGlobal.voTmp.VoStIntakeAmountDay">
+ select id as id,
+ intake_id as intakeId ,
+ dt as dt,
+ amount as amount
+ from rm_intake_amount_day
+ order by intake_id DESC, id DESC
+ </select>
+
+ <delete id="deleteStIntakeDayById" parameterType="java.lang.Long">
+ delete from rm_intake_amount_day
+ where id = #{id,jdbcType=BIGINT}
+ </delete>
+
<select id="selectAllStIntakeMonth" resultType="com.dy.pipIrrGlobal.voTmp.VoStIntakeAmountMonth">
select id as id,
intake_id as intakeId ,
@@ -66,6 +94,20 @@
<!-- 鍐滄埛缁熻鐩稿叧 -->
+ <select id="selectAllStClientDay" resultType="com.dy.pipIrrGlobal.voTmp.VoStClientAmountDay">
+ select id as id,
+ client_id as clientId ,
+ dt as dt,
+ amount as amount
+ from rm_client_amount_day
+ order by client_id DESC, id DESC
+ </select>
+
+ <delete id="deleteStClientDayById" parameterType="java.lang.Long">
+ delete from rm_client_amount_day
+ where id = #{id,jdbcType=BIGINT}
+ </delete>
+
<select id="selectAllStClientMonth" resultType="com.dy.pipIrrGlobal.voTmp.VoStClientAmountMonth">
select id as id,
client_id as clientId ,
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-temp/src/main/java/com/dy/pipIrrTemp/delSome/DelSomeClientAmountSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-temp/src/main/java/com/dy/pipIrrTemp/delSome/DelSomeClientAmountSv.java
index 185b9dd..8f3b788 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-temp/src/main/java/com/dy/pipIrrTemp/delSome/DelSomeClientAmountSv.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-temp/src/main/java/com/dy/pipIrrTemp/delSome/DelSomeClientAmountSv.java
@@ -1,6 +1,7 @@
package com.dy.pipIrrTemp.delSome;
import com.dy.pipIrrGlobal.daoTmp.DeleteMapper;
+import com.dy.pipIrrGlobal.voTmp.VoStClientAmountDay;
import com.dy.pipIrrGlobal.voTmp.VoStClientAmountMonth;
import com.dy.pipIrrGlobal.voTmp.VoStClientAmountYear;
import lombok.extern.slf4j.Slf4j;
@@ -26,6 +27,31 @@
@Autowired
private void setDao(DeleteMapper dao){
this.dao = dao;
+ }
+
+ public void delStClientDay(){
+ VoStClientAmountDay first = null ;
+ List<VoStClientAmountDay> list = dao.selectAllStClientDay() ;
+ if(list != null && list.size() > 0){
+ for(VoStClientAmountDay vo : list){
+ if(first == null){
+ first = vo ;
+ }else{
+ if(first.clientId.longValue() != vo.clientId.longValue()){
+ //鍐滄埛鍙樹簡
+ first = vo ;
+ }else{
+ if(!first.dt.equals(vo.dt)) {
+ //鏃ユ湡鍙樹簡
+ first = vo ;
+ }else{
+ //鍚屼竴涓啘鎴峰悓鏃ユ湡
+ doDelStClientDay(vo.id) ;
+ }
+ }
+ }
+ }
+ }
}
public void delStClientMonth(){
@@ -84,6 +110,11 @@
}
}
@Transactional
+ int doDelStClientDay(Long id){
+ return dao.deleteStClientDayById(id) ;
+ }
+
+ @Transactional
int doDelStClientMonth(Long id){
return dao.deleteStClientMonthById(id) ;
}
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-temp/src/main/java/com/dy/pipIrrTemp/delSome/DelSomeCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-temp/src/main/java/com/dy/pipIrrTemp/delSome/DelSomeCtrl.java
index ec3ee9d..dd71b08 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-temp/src/main/java/com/dy/pipIrrTemp/delSome/DelSomeCtrl.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-temp/src/main/java/com/dy/pipIrrTemp/delSome/DelSomeCtrl.java
@@ -46,6 +46,7 @@
@GetMapping(path = "deleteSomeStatisticLossAmount")
@SsoAop()
public BaseResponse<Boolean> deleteSomeStatisticLossAmount(){
+ this.lossAmountSv.delStLossDay();
this.lossAmountSv.delStLossMonth();
this.lossAmountSv.delStLossYear();
return BaseResponseUtils.buildSuccess(true);
@@ -58,6 +59,7 @@
@GetMapping(path = "deleteSomeStatisticIntakeAmount")
@SsoAop()
public BaseResponse<Boolean> deleteSomeStatisticIntakeAmount(){
+ this.intakeAmountSv.delStIntakeDay();
this.intakeAmountSv.delStIntakeMonth();
this.intakeAmountSv.delStIntakeYear();
return BaseResponseUtils.buildSuccess(true);
@@ -70,6 +72,7 @@
@GetMapping(path = "deleteSomeStatisticClientAmount")
@SsoAop()
public BaseResponse<Boolean> deleteSomeStatisticClientAmount(){
+ this.clientAmountSv.delStClientDay();
this.clientAmountSv.delStClientMonth();
this.clientAmountSv.delStClientYear();
return BaseResponseUtils.buildSuccess(true);
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-temp/src/main/java/com/dy/pipIrrTemp/delSome/DelSomeIntakeAmountSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-temp/src/main/java/com/dy/pipIrrTemp/delSome/DelSomeIntakeAmountSv.java
index 4c79d6e..fccec44 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-temp/src/main/java/com/dy/pipIrrTemp/delSome/DelSomeIntakeAmountSv.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-temp/src/main/java/com/dy/pipIrrTemp/delSome/DelSomeIntakeAmountSv.java
@@ -1,6 +1,7 @@
package com.dy.pipIrrTemp.delSome;
import com.dy.pipIrrGlobal.daoTmp.DeleteMapper;
+import com.dy.pipIrrGlobal.voTmp.VoStIntakeAmountDay;
import com.dy.pipIrrGlobal.voTmp.VoStIntakeAmountMonth;
import com.dy.pipIrrGlobal.voTmp.VoStIntakeAmountYear;
import lombok.extern.slf4j.Slf4j;
@@ -25,6 +26,31 @@
@Autowired
private void setDao(DeleteMapper dao){
this.dao = dao;
+ }
+
+ public void delStIntakeDay(){
+ VoStIntakeAmountDay first = null ;
+ List<VoStIntakeAmountDay> list = dao.selectAllStIntakeDay() ;
+ if(list != null && list.size() > 0){
+ for(VoStIntakeAmountDay vo : list){
+ if(first == null){
+ first = vo ;
+ }else{
+ if(first.intakeId.longValue() != vo.intakeId.longValue()){
+ //鍙栨按鍙e彉浜�
+ first = vo ;
+ }else{
+ if(first.dt.equals(vo.dt)) {
+ //鏃ユ湡鍙樹簡
+ first = vo ;
+ }else{
+ //鍚屼竴涓彇姘村彛鍚屾棩鏈�
+ doDelStIntakeDay(vo.id) ;
+ }
+ }
+ }
+ }
+ }
}
public void delStIntakeMonth(){
@@ -82,6 +108,12 @@
}
}
}
+
+ @Transactional
+ int doDelStIntakeDay(Long id){
+ return dao.deleteStIntakeDayById(id) ;
+ }
+
@Transactional
int doDelStIntakeMonth(Long id){
return dao.deleteStIntakeMonthById(id) ;
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-temp/src/main/java/com/dy/pipIrrTemp/delSome/DelSomeLossAmountSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-temp/src/main/java/com/dy/pipIrrTemp/delSome/DelSomeLossAmountSv.java
index aa71944..849d552 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-temp/src/main/java/com/dy/pipIrrTemp/delSome/DelSomeLossAmountSv.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-temp/src/main/java/com/dy/pipIrrTemp/delSome/DelSomeLossAmountSv.java
@@ -1,6 +1,7 @@
package com.dy.pipIrrTemp.delSome;
import com.dy.pipIrrGlobal.daoTmp.DeleteMapper;
+import com.dy.pipIrrGlobal.voTmp.VoStLossAmountDay;
import com.dy.pipIrrGlobal.voTmp.VoStLossAmountMonth;
import com.dy.pipIrrGlobal.voTmp.VoStLossAmountYear;
import lombok.extern.slf4j.Slf4j;
@@ -25,6 +26,31 @@
@Autowired
private void setDao(DeleteMapper dao){
this.dao = dao;
+ }
+
+ public void delStLossDay(){
+ VoStLossAmountDay first = null ;
+ List<VoStLossAmountDay> list = dao.selectAllStLossDay() ;
+ if(list != null && list.size() > 0){
+ for(VoStLossAmountDay vo : list){
+ if(first == null){
+ first = vo ;
+ }else{
+ if(first.intakeId.longValue() != vo.intakeId.longValue()){
+ //鍙栨按鍙e彉浜�
+ first = vo ;
+ }else{
+ if(!first.dt.equals(vo.dt)) {
+ //鏃ユ湡鍙樹簡
+ first = vo ;
+ }else{
+ //鍚屼竴涓彇姘村彛鍚屾棩鏈�
+ doDelStLossDay(vo.id) ;
+ }
+ }
+ }
+ }
+ }
}
public void delStLossMonth(){
@@ -83,6 +109,10 @@
}
}
@Transactional
+ int doDelStLossDay(Long id){
+ return dao.deleteStLossDayById(id) ;
+ }
+ @Transactional
int doDelStLossMonth(Long id){
return dao.deleteStLossMonthById(id) ;
}
--
Gitblit v1.8.0