简单使用mybatis-plus的${ew.sqlSegment},${ew.sqlSelect},${ew.customSqlSegment}
1、${ew.customSqlSegment} 会直接在前面添加 where
@Select(select * from a ${ew.customSqlSegment})
List<a> getA(@Param(Constants.WRAPPER)QueryWrapper queryWrapper)
2、${ew.sqlSegment} 就只有条件语句
@Select(select * from a where ${ew.sqlSegment})
List<a> getA(@Param(Constants.WRAPPER)QueryWrapper queryWrapper)
3、${ew.sqlSelect} 就是 queryWrapper.select(****) 你所定义需要查询的字段
@Select(select ${ew.sqlSelect} from a )
List<a> getA(@Param(Constants.WRAPPER)QueryWrapper queryWrapper)
还没有评论,来说两句吧...