package com.dy.pipIrrTemp.delSome; import com.dy.pipIrrGlobal.daoTmp.DeleteMapper; import com.dy.pipIrrGlobal.voTmp.VoStLossMonth; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.List; /** * @Author: liurunyu * @Date: 2024/12/11 10:54 * @Description */ @Slf4j @Service public class DelSomeSv { private DeleteMapper dao; @Autowired private void setDao(DeleteMapper dao){ this.dao = dao; } public void delStLossMonth(){ VoStLossMonth first = null ; List list = dao.selectAllStLossMonth() ; if(list != null && list.size() > 0){ for(VoStLossMonth vo : list){ if(first == null){ first = vo ; }else{ if(first.intakeId != vo.intakeId){ //取水口变了 first = vo ; }else{ if(first.year != vo.year) { //年度变了 first = vo ; }else{ if(first.month != vo.month){ //月份变了 first = vo ; }else{ //同一个取水口同年同月 doDelStLossMonth(vo.id) ; } } } } } } } @Transactional int doDelStLossMonth(Long id){ return dao.deleteByMainKey(id) ; } }