select sum(JOIN_COUNT) as 'joinNum',sum(WIN_COUNT) as 'winNum',sum(DEFRAY_COUNT) as 'writeOffNum' from mkplat_activity_point where activity_id = #{activityId} and point_id >= #{start} and point_id <![CDATA[<]]> #{end} 请问这种 sql 在 mp 里面除了 xml 还有啥办法吗,selectMaps 有点麻烦,返回值还要把 map 转为对应的对象,能不能直接通过 mybatis plus 返回一个 StatisticsCount 出来
@Override public StatisticsCount count(String activityId, String start, String end) { QueryWrapper<ActivityPointDO> wrapper = Wrappers.query(); wrapper.select("sum(JOIN_COUNT) as 'joinNum'","sum(WIN_COUNT) as 'winNum'","sum(DEFRAY_COUNT) as 'writeOffNum'"). eq("activity_id",activityId). ge("point_id",start). lt("point_id",end); List<Map<String, Object>> maps = this.getBaseMapper().selectMaps(wrapper); } 