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 @@ /** * 查询全部取水口日统计 * * @return 实体集合 */ List<VoStIntakeAmountDay> selectAllStIntakeDay(); int deleteStIntakeDayById(Long id); /** * 查询全部取水口月统计 * * @return 实体集合 @@ -57,6 +76,16 @@ * * @return 实体集合 */ List<VoStClientAmountDay> selectAllStClientDay(); int deleteStClientDayById(Long id); /** * 查询全部农户月统计 * * @return 实体集合 */ List<VoStClientAmountMonth> selectAllStClientMonth(); int deleteStClientMonthById(Long id); pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStClientAmountDay.java
New file @@ -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 ; } pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStIntakeAmountDay.java
New file @@ -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 ; } pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voTmp/VoStLossAmountDay.java
New file @@ -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 ; } 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 @@ <!-- 取水口统计相关 --> <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 , 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) ; } 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); 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()){ //取水口变了 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) ; 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()){ //取水口变了 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) ; }