| | |
| | | package com.dy.pipIrrStatistics.stClient; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.dy.common.webUtil.QueryResultVo; |
| | | import com.dy.pipIrrGlobal.daoSt.StClientAmountDayMapper ; |
| | | import com.dy.pipIrrGlobal.daoSt.StClientAmountMonthMapper ; |
| | |
| | | rsVo.yearGrp = yearGrp ; |
| | | rsQrVo.obj = rsVo ; |
| | | |
| | | boolean oneYear = yearGrp.size() == 1? true : false ; |
| | | // 生成查询参数 |
| | | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo) ; |
| | | // 获取符合条件的记录数 |
| | | Long itemTotal = stClientAmountYearDao.selectCountYearStatistics(params) ; |
| | | Long itemTotal = 0L ; |
| | | String clientIdsJson = null ; |
| | | if(oneYear){ |
| | | itemTotal = stClientAmountYearDao.selectCountYearStatistics4OneYear(params) ; |
| | | }else{ |
| | | itemTotal = stClientAmountYearDao.selectCountYearStatistics(params) ; |
| | | List<VoStClientIdAmountYearRecord> clientIds = stClientAmountYearDao.selectClientIds4YearStatistics(params); |
| | | clientIdsJson = JSON.toJSONString(clientIds) ; |
| | | } |
| | | |
| | | if(itemTotal != null && itemTotal > 0) { |
| | | rsQrVo.pageSize = qo.pageSize; |
| | |
| | | int count = 1 ; |
| | | for(int year: yearGrp){ |
| | | params.put("year", year); |
| | | List<VoStClientAmountYearRecord> list = stClientAmountYearDao.selectYearStatistics(params); |
| | | List<VoStClientAmountYearRecord> list ; |
| | | if(oneYear){ |
| | | list = stClientAmountYearDao.selectYearStatistics4OneYear(params); |
| | | }else{ |
| | | if(clientIdsJson != null){ |
| | | params.put("clientIdsJson", clientIdsJson); |
| | | } |
| | | list = stClientAmountYearDao.selectYearStatistics(params); |
| | | } |
| | | |
| | | if(group.isEmpty()){ |
| | | this.completion(group, list); |
| | | } |