MPJLambdaWrapper
https://mybatisplusjoin.com/pages/quickstart/js.html
MPJLambdaWrapper<ProProjectNodeIntentionEntity> wrapper = new MPJLambdaWrapper<ProProjectNodeIntentionEntity>();
wrapper.selectAll(ProProjectNodeIntentionEntity.class);
wrapper.select(ProProject::getProjectName);
wrapper.select(BsCompany::getCompanyName);
wrapper.leftJoin(ProProject.class,ProProject::getProjectId,ProProjectNodeIntentionEntity::getProjectId);
wrapper.leftJoin(BsCompany.class,BsCompany::getCompanyId,ProProjectNodeIntentionEntity::getCompanyId);
wrapper.eq(ProProjectNodeIntentionEntity::getId,id);
return R.ok(proProjectNodeIntentionMapper.selectJoinList(ProProjectNodeIntentionEntity.class,wrapper));
MPJLambdaWrapper<ProProjectNodeIntentionEntity> wrapper = new MPJLambdaWrapper<ProProjectNodeIntentionEntity>();
wrapper.selectAll(ProProjectNodeIntentionEntity.class);
wrapper.select(ProProject::getProjectName);
wrapper.select(BsCompany::getCompanyName);
wrapper.selectAs(ProProject::getCity,"newCity");
wrapper.selectAs(BsCompany::getContacts,"newContacts");
wrapper.leftJoin(ProProject.class,ProProject::getProjectId,ProProjectNodeIntentionEntity::getProjectId);
wrapper.leftJoin(BsCompany.class,BsCompany::getCompanyId,ProProjectNodeIntentionEntity::getCompanyId);
wrapper.eq(ProProjectNodeIntentionEntity::getDelFlag,"0");
wrapper.eq(ProProjectNodeIntentionEntity::getCompanyId,map.get("companyId").toString());
if(null != map.get("id") && StrUtil.isNotBlank(map.get("id").toString())) {
wrapper.eq(ProProjectNodeIntentionEntity::getId,Long.valueOf(map.get("id").toString()));
}
wrapper.orderByDesc(ProProjectNodeIntentionEntity::getCreateTime);
return R.ok(proProjectNodeIntentionMapper.selectJoinMaps(wrapper).stream().map(MapUtil::toCamelCaseMap).collect(Collectors.toList()));
//return R.ok(proProjectNodeIntentionMapper.selectJoinList(ProProjectNodeIntentionEntity.class,wrapper));
择善人而交,择善书而读,择善言而听,择善行而从。