mybatisPlus实现倒序拼接字符串

目录

  • 倒序拼接字符串
  • 把sql用字符串拼接好后直接取出使用

倒序拼接字符串
@ApiOperation("分页查询")@GetMapping(value = "https://www.it610.com/list")public ActionResult list(@RequestParam Map params) {List list = Arrays.asList(new String[]{"create_time"}); return new ActionResult(StatusCode.SUCCESS, iUmsMemberService.selectPage(new Query<>(params),new EntityWrapper().eq("deleted", 0).orderDesc(list))); }

【mybatisPlus实现倒序拼接字符串】等同于
SELECT id AS id,member_level_id AS memberLevelId,username, FROM ums_member WHERE (deleted = 0) ORDER BY create_time DESC LIMIT 0,5


把sql用字符串拼接好后直接取出使用
/*** 查询sql* @param sql* @return*/Object aa(@Param(value = "https://www.it610.com/article/sql") String sql);

${sql}

以上为个人经验,希望能给大家一个参考,也希望大家多多支持脚本之家。

    推荐阅读