美文网首页商通贷技术分享
mybatis中使用example.setOrderByClau

mybatis中使用example.setOrderByClau

作者: 晚安多巴胺 | 来源:发表于2019-06-25 18:46 被阅读0次
CardQtCheckExample example = new CardQtCheckExample();
example.setOrderByClause("`AFTER_CHECK_TIME` DESC");
example.createCriteria().andCsnEqualTo(csn).andCheckStatusEqualTo(0);
List<CardQtCheck> cardQtChecks = cardQtCheckDao.selectByExample(example);

当有多个排序字段时

// 查询结果先按`index`字段排序,如果相同,则按`AFTER_CHECK_TIME`排序
example.setOrderByClause("`index` ASC,`AFTER_CHECK_TIME` ASC");

相关文章

网友评论

    本文标题:mybatis中使用example.setOrderByClau

    本文链接:https://www.haomeiwen.com/subject/ambxcctx.html