| | |
| | | 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) ; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | 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) ; |
| | | } |
| | | } |
| | | } |
| | | } |