|  |  | 
 |  |  |         mtb.name like concat('%', #{name}, '%') | 
 |  |  |       </if> | 
 |  |  |     </trim> | 
 |  |  |     order by mtb.id ASC | 
 |  |  |     order by mtb.id DESC | 
 |  |  |     <trim prefix="limit " > | 
 |  |  |       <if test="start != null and count != null"> | 
 |  |  |         #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER} | 
 |  |  |       </if> | 
 |  |  |     </trim> | 
 |  |  |   </select> | 
 |  |  |  | 
 |  |  |   <select id="selectYearStatistics4OneYear" resultType="com.dy.pipIrrGlobal.voSt.VoStClientAmountYearRecord"> | 
 |  |  | 
 |  |  |     where ctb.deleted != 1 | 
 |  |  |     <trim prefix="and" suffixOverrides="and"> | 
 |  |  |       <if test="year != null"> | 
 |  |  |         cayTb.`year` = #{year,jdbcType=INTEGER} | 
 |  |  |         (cayTb.`year` = #{year,jdbcType=INTEGER} or cayTb.`year` is null) | 
 |  |  |       </if> | 
 |  |  |       <if test="name != null and name != ''"> | 
 |  |  |         and ctb.name like concat('%', #{clientName}, '%') | 
 
 |  |  | 
 |  |  |             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.pageCurr = qo.pageCurr; | 
 |  |  |             rsQrVo.calculateAndSet(itemTotal, params); | 
 |  |  |  | 
 |  |  |             List<VoStClientIdAmountYearRecord> clientIds = stClientAmountYearDao.selectClientIds4YearStatistics(params); | 
 |  |  |             clientIdsJson = JSON.toJSONString(clientIds) ; | 
 |  |  |  | 
 |  |  |             List<VoStClientAmountYearRecords> group = new ArrayList<>(); | 
 |  |  |             int count = 1 ; | 
 |  |  |             for(int year: yearGrp){ |