Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

join一对多查询dto自动包装成一对多属性结构 #126

Closed
tom055 opened this issue Apr 11, 2024 · 2 comments
Closed

join一对多查询dto自动包装成一对多属性结构 #126

tom055 opened this issue Apr 11, 2024 · 2 comments

Comments

@tom055
Copy link

tom055 commented Apr 11, 2024

DTO

@Getter
@Setter
public class DeviceRuleNotifyDto {
    //规则表
    DeviceRulePo deviceRulePo;
    //通知表
    List<NotifyTemplatePo> notifyTemplatePos;
}

service

MPJLambdaWrapper<DeviceRuleNotifyDto> baseJoin = new MPJLambdaWrapper<DeviceRuleNotifyDto>()
                .selectAssociation("t", DeviceRulePo.class, DeviceRuleNotifyDto::getDeviceRulePo)
                .selectCollection(NotifyTemplatePo.class, DeviceRuleNotifyDto::getNotifyTemplatePos)
                .leftJoin(DeviceRuleNotifyPo.class, DeviceRuleNotifyPo::getRuleId, DeviceRulePo::getId)
                .leftJoin(NotifyTemplatePo.class, NotifyTemplatePo::getId, DeviceRuleNotifyPo::getNotifyTemplateId);
        MPJLambdaWrapper wrapper = wrapper(baseJoin, queryParam);
        return getBaseMapper().selectJoinOne(DeviceRuleNotifyDto.class,wrapper);

你好 大佬 能查询到数据,但dto无法接数据,请问这个要如何解决呢

@Umenezumi
Copy link

最后你是如何解决的?

@tom055
Copy link
Author

tom055 commented Apr 23, 2024

@Umenezumi 手动解决

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants