| | |
| | | List<VoIntakeAmountStatistics> list = rmIntakeAmountDayDao.statisticsByIntake(statisticsStartId, statisticsEndId) ; |
| | | if(list != null && list.size() > 0){ |
| | | for(VoIntakeAmountStatistics vo : list){ |
| | | StIntakeAmountMonth po = new StIntakeAmountMonth() ; |
| | | StIntakeAmountMonth po = this.stIntakeAmountMonthDao.selectByIntakeIdAndYearAndMonth(vo.intakeId, statisticsYear, statisticsMonth) ; |
| | | if(po == null){ |
| | | po = new StIntakeAmountMonth() ; |
| | | } |
| | | po.intakeId = vo.intakeId ; |
| | | po.year = statisticsYear ; |
| | | po.month = statisticsMonth ; |
| | | po.amount = vo.amount; |
| | | if(po.id == null) { |
| | | stIntakeAmountMonthDao.insert(po) ; |
| | | }else{ |
| | | stIntakeAmountMonthDao.updateByPrimaryKey(po) ; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | List<VoIntakeAmountStatistics> list = stIntakeAmountMonthDao.statisticsByIntake(statisticsYear) ; |
| | | if(list != null && list.size() > 0){ |
| | | for(VoIntakeAmountStatistics vo : list){ |
| | | StIntakeAmountYear po = new StIntakeAmountYear() ; |
| | | StIntakeAmountYear po = stIntakeAmountYearDao.selectByIntakeIdAndYear(vo.intakeId, statisticsYear) ; |
| | | if(po == null){ |
| | | po = new StIntakeAmountYear() ; |
| | | } |
| | | po.intakeId = vo.intakeId ; |
| | | po.year = statisticsYear ; |
| | | po.amount = vo.amount; |
| | | if(po.id == null){ |
| | | stIntakeAmountYearDao.insert(po) ; |
| | | }else{ |
| | | stIntakeAmountYearDao.updateByPrimaryKey(po) ; |
| | | } |
| | | } |
| | | } |
| | | } |