10月11

详解使用mybatis-plus的${ew.sqlSegment},${ew.sqlSelect},${ew.customSqlSegment}

| |
11:45编程杂谈  From: 本站原创
${ew.customSqlSegment} 会直接在前面添加 where

@Select(select * from a ${ew.customSqlSegment})
List<a> getHeck(@Param(Constants.WRAPPER)QueryWrapper queryWrapper)

${ew.sqlSegment} 就只有条件语句

@Select(select * from a where ${ew.sqlSegment})
List<a> getHeck(@Param(Constants.WRAPPER)QueryWrapper queryWrapper)

${ew.sqlSelect} 就是 queryWrapper.select(****) 你所定义需要查询的字段

@Select(select ${ew.sqlSelect} from a )
List<a> getHeck(@Param(Constants.WRAPPER)QueryWrapper queryWrapper)

来源:Heck's Blog
地址:https://www.heckjj.com/post/656/
转载时须以链接形式注明作者和原始出处及本声明,否则将追究法律责任,谢谢配合!
阅读(1851) | 评论(0) | 引用(0)