We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
1.4.10
实际sql如下: 其中user_tag_151 为动态表名 SELECT tag.*, (SELECT COUNT(1) FROM user_tag_151 t1 WHERE t1.tag_id = tag.tag_id) AS tag_count FROM tag;
代码写法: MPJLambdaWrapper tagMPJLambdaWrapperX = new MPJLambdaWrapper() .selectAll(TagDO.class) .selectSub(UserTagDO.class, w -> w.selectCount(UserTagDO::getTagId, TagRespDTO::getTagMarkCount) .setTableName(name -> name + "_151" ), UserTagDO::getTagId)
控制台打印sql中,子查询中的表并未拼接 '_151' 异常提示表不存在
但是使用leftJoin 动态设置表名却是可以的 MPJLambdaWrapper userDOMPJLambdaWrapper = new MPJLambdaWrapper() .selectAll(TagDO.class) .selectCount(UserTagDO::getTagId,TagRespDTO::getTagMarkCount) .leftJoin(UserTagDO.class, on -> on .eq(UserTagDO::getTagId, TagDO::getTagId) .setTableName(name -> name + "_151")) .groupBy(TagDO::getTagId);
子查询 selectSub 是还不支持动态表名吗?
The text was updated successfully, but these errors were encountered:
下个版本加上
Sorry, something went wrong.
fix [115](#115)
152cd6c
cd68b2e
No branches or pull requests
当前使用版本(必填,否则不予处理)
1.4.10
实际sql如下: 其中user_tag_151 为动态表名
SELECT
tag.*,
(SELECT COUNT(1) FROM user_tag_151 t1 WHERE t1.tag_id = tag.tag_id) AS tag_count
FROM tag;
代码写法:
MPJLambdaWrapper tagMPJLambdaWrapperX = new MPJLambdaWrapper()
.selectAll(TagDO.class)
.selectSub(UserTagDO.class, w -> w.selectCount(UserTagDO::getTagId, TagRespDTO::getTagMarkCount)
.setTableName(name -> name + "_151" ), UserTagDO::getTagId)
控制台打印sql中,子查询中的表并未拼接 '_151' 异常提示表不存在
但是使用leftJoin 动态设置表名却是可以的
MPJLambdaWrapper userDOMPJLambdaWrapper = new MPJLambdaWrapper()
.selectAll(TagDO.class)
.selectCount(UserTagDO::getTagId,TagRespDTO::getTagMarkCount)
.leftJoin(UserTagDO.class, on -> on
.eq(UserTagDO::getTagId, TagDO::getTagId)
.setTableName(name -> name + "_151"))
.groupBy(TagDO::getTagId);
子查询 selectSub 是还不支持动态表名吗?
The text was updated successfully, but these errors were encountered: