mybatis-plus-doc
mybatis-plus-doc copied to clipboard
LambdaQueryWrapper 怎么group by 中写select count
LambdaQueryWrapper 怎么group by 中写select count,
new LambdaQueryWrapper<SocialRelationCenterTargetDO>()
.select(SocialRelationCenterTargetDO::getTargetId,"count(1) as sum")
.in(SocialRelationCenterTargetDO::getTargetId, idSet)
.eq(SocialRelationCenterTargetDO::getIdType, idType)
.groupBy(SocialRelationCenterTargetDO::getTargetId)
要查groupby后每个targetId的数量吗,我理解LambdaQueryWrapper支持不了,要自己手写原生sql实现了