本文整理了Java中com.baomidou.mybatisplus.mapper.Wrapper.orderBy()
方法的一些代码示例,展示了Wrapper.orderBy()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Wrapper.orderBy()
方法的具体详情如下:
包路径:com.baomidou.mybatisplus.mapper.Wrapper
类名称:Wrapper
方法名:orderBy
暂无
代码示例来源:origin: huangjian888/jeeweb-mybatis-springboot
@Override
public Wrapper<T> orderBy(boolean condition, String columns) {
if (columns==null) {
return super.orderBy(condition, columns);
}
String[] columnArr = columns.split(",");
String columnNews = "";
for (String column : columnArr) {
if (!columnNews.isEmpty()) {
columnNews += ",";
}
columnNews += handleColumn(column);
}
return super.orderBy(condition, columnNews);
}
代码示例来源:origin: huangjian888/jeeweb-mybatis-springboot
@Override
public Wrapper<T> orderBy(boolean condition, String columns, boolean isAsc) {
if (columns==null) {
return super.orderBy(condition, columns, isAsc);
}
String[] columnArr = columns.split(",");
String columnNews = "";
for (String column : columnArr) {
if (!columnNews.isEmpty()) {
columnNews += ",";
}
columnNews += handleColumn(column);
}
return super.orderBy(condition, columnNews, isAsc);
}
代码示例来源:origin: huangjian888/jeeweb-mybatis-springboot
@Override
public Wrapper<T> orderBy(String columns) {
if (columns==null) {
return super.orderBy(columns);
}
String[] columnArr = columns.split(",");
String columnNews = "";
for (String column : columnArr) {
if (!columnNews.isEmpty()) {
columnNews += ",";
}
columnNews += handleColumn(column);
}
return super.orderBy(columnNews);
}
}
代码示例来源:origin: huangjian888/jeeweb-mybatis-springboot
public void parseSort(Wrapper<T> wrapper, Queryable queryable) {
cn.jeeweb.core.query.data.Sort sort = queryable.getPageable().getSort();
if (sort != null) {
for (cn.jeeweb.core.query.data.Sort.Order order : sort) {
if (order.getDirection() == cn.jeeweb.core.query.data.Sort.Direction.DESC) {
wrapper.orderBy(order.getProperty(), false);
} else if (order.getDirection() == cn.jeeweb.core.query.data.Sort.Direction.ASC) {
wrapper.orderBy(order.getProperty(), true);
}
}
}
}
代码示例来源:origin: watchdog-framework/watchdog-framework
public void findAllChild(SysResource resource){
EntityWrapper<SysResource> wrapper = new EntityWrapper<>();
wrapper.eq("parent_id",resource.getId()).orderBy("sort");
List<SysResource> resources = this.selectList(wrapper);
resource.setChildren(resources);
if(resources!=null && resources.size()>0){
resources.forEach(this::findAllChild);
}
}
代码示例来源:origin: watchdog-framework/watchdog-framework
@Override
public List<SysResource> list() {
EntityWrapper<SysResource> wrapper = new EntityWrapper<>();
wrapper.eq("parent_id",0)
.or()
.isNull("parent_id")
.orderBy("sort");
List<SysResource> resources = this.selectList(wrapper);
if(resources!=null && resources.size()>0){
resources.forEach(this::findAllChild);
}
return resources;
}
代码示例来源:origin: qq53182347/liugh-parent
/**
* 获取自己的消息列表
* @param pageIndex
* @param pageSize
* @return
* @throws Exception
*/
@GetMapping("/infoList")
public ResponseModel<Page<Notice>> findInfoList(@CurrentUser User user, @RequestParam(name = "pageIndex", defaultValue = "1", required = false) Integer pageIndex,
@RequestParam(name = "pageSize", defaultValue = "10", required = false) Integer pageSize) throws Exception{
return ResponseHelper.buildResponseModel(noticeService.selectPage(new Page<>(pageIndex, pageSize),new EntityWrapper<Notice>().
eq("mobile",user.getMobile()).orderBy("create_time",false)));
}
代码示例来源:origin: watchdog-framework/watchdog-framework
@Override
public List<SysResource> findAllResourceByRoleId(String rid) {
List<SysRoleResource> rps = this.selectList(new EntityWrapper<SysRoleResource>().eq("rid",rid));
if(rps!=null){
List<String> pids = new ArrayList<>();
rps.forEach(v->pids.add(v.getPid()));
if(pids.size()==0){
return null;
}
return resourceService.selectList(new EntityWrapper<SysResource>()
.in("id", pids)
.orderBy("sort",true)
);
}
return null;
}
}
内容来源于网络,如有侵权,请联系作者删除!