Closed kala888 closed 1 year ago
platform和merchant是一对多关系。 做关联count+group的时候,需要格式化结果, groupBy函数不够自然或者存在bug
MPJLambdaWrapper<Merchant> qw = new MPJLambdaWrapper<>(); qw.selectCount(Merchant::getId, CandidateValue::getValue); qw.selectAs(Platform::getName, CandidateValue::getTitle); // qw.groupBy(CandidateValue::getTitle); // 报错 mapper not find by class <CandidateValue> // qw.groupBy(Platform::getName); // 报错, sql 是GROUP BY t.name,应该是title qw.groupBy("title"); // ok,但是不如上面的两种方式自然 qw.leftJoin(Platform.class, Platform::getId, Merchant::getPlatform);
用v1.4.5,qw.groupBy(Platform::getName)好了
platform和merchant是一对多关系。 做关联count+group的时候,需要格式化结果, groupBy函数不够自然或者存在bug