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);
}
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.