当前位置: 首页>>代码示例>>Java>>正文


Java EntityWrapper.orderBy方法代码示例

本文整理汇总了Java中com.baomidou.mybatisplus.mapper.EntityWrapper.orderBy方法的典型用法代码示例。如果您正苦于以下问题:Java EntityWrapper.orderBy方法的具体用法?Java EntityWrapper.orderBy怎么用?Java EntityWrapper.orderBy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.baomidou.mybatisplus.mapper.EntityWrapper的用法示例。


在下文中一共展示了EntityWrapper.orderBy方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: selectPage

import com.baomidou.mybatisplus.mapper.EntityWrapper; //导入方法依赖的package包/类
/**
 * 加载分类信息列表
 * @param pages 分页对象
 * @param param  搜索条件
 * @param model
 * @return
 */
@RequestMapping("/list")
public String selectPage(Page pages, String param, Model model) {
    Page<Type> page;
    EntityWrapper<Type> ex = new EntityWrapper<>();
    if (StringUtils.checkValNotNull(param)) {
        ex.where("type_name like concat('%',{0},'%')", param);
    }
    ex.orderBy("sort", true);
    ex.orderBy("create_time", true);
    page = iTypeService.selectPage(new Page(pages.getCurrent(), pages.getSize()), ex);
    model.addAttribute("page", page);
    return "admin/type/typeTable";
}
 
开发者ID:MIYAOW,项目名称:MI-S,代码行数:21,代码来源:AdminTypeController.java

示例2: selectPage

import com.baomidou.mybatisplus.mapper.EntityWrapper; //导入方法依赖的package包/类
/**
 * 分页加载标签
 * @param pages 分页对象
 * @param param  搜索条件
 * @param model
 * @return
 */
@RequestMapping("/list")
public String selectPage(Page pages, String param, Model model) {
    Page<Tag> page;
    EntityWrapper<Tag> ex = new EntityWrapper<>();
    if (StringUtils.checkValNotNull(param)) {
        ex.where("tag_name like concat('%',{0},'%')", param);
    }
    ex.orderBy("sort", true);
    ex.orderBy("create_time", true);
    page = iTagService.selectPage(new Page(pages.getCurrent(), pages.getSize()), ex);
    model.addAttribute("page", page);
    return "admin/tag/tagTable";
}
 
开发者ID:MIYAOW,项目名称:MI-S,代码行数:21,代码来源:AdminTagController.java

示例3: getAllMenus

import com.baomidou.mybatisplus.mapper.EntityWrapper; //导入方法依赖的package包/类
/**
 * 获取所有菜单(测试用)
 * @return
 */
public List<MenuBriefDTO> getAllMenus(){
    EntityWrapper<Menu> wrapper = new EntityWrapper<>();
    wrapper.where("delFlag = 0");
    wrapper.orderBy("orderNo");
    List<Menu> menus = selectList(wrapper);

    return dozerHelper.mapList(menus,MenuBriefDTO.class);
}
 
开发者ID:liuxx001,项目名称:bird-java,代码行数:13,代码来源:MenuServiceImpl.java

示例4: selectDataGrid

import com.baomidou.mybatisplus.mapper.EntityWrapper; //导入方法依赖的package包/类
@Override
public void selectDataGrid(PageInfo pageInfo) {
    Page<Role> page = new Page<Role>(pageInfo.getNowpage(), pageInfo.getSize());
    
    EntityWrapper<Role> wrapper = new EntityWrapper<Role>();
    wrapper.orderBy(pageInfo.getSort(), pageInfo.getOrder().equalsIgnoreCase("ASC"));
    selectPage(page, wrapper);
    
    pageInfo.setRows(page.getRecords());
    pageInfo.setTotal(page.getTotal());
}
 
开发者ID:TomChen001,项目名称:xmanager,代码行数:12,代码来源:RoleServiceImpl.java

示例5: selectByType

import com.baomidou.mybatisplus.mapper.EntityWrapper; //导入方法依赖的package包/类
public List<Resource> selectByType(Integer type) {
    EntityWrapper<Resource> wrapper = new EntityWrapper<Resource>();
    Resource resource = new Resource();
    wrapper.setEntity(resource);
    wrapper.addFilter("resource_type = {0}", type);
    wrapper.orderBy("seq");
    return resourceMapper.selectList(wrapper);
}
 
开发者ID:TomChen001,项目名称:xmanager,代码行数:9,代码来源:ResourceServiceImpl.java

示例6: selectDataGrid

import com.baomidou.mybatisplus.mapper.EntityWrapper; //导入方法依赖的package包/类
@Override
public void selectDataGrid(PageInfo pageInfo) {
    Page<SysLog> page = new Page<SysLog>(pageInfo.getNowpage(), pageInfo.getSize());
    EntityWrapper<SysLog> wrapper = new EntityWrapper<SysLog>();
    wrapper.orderBy(pageInfo.getSort(), pageInfo.getOrder().equalsIgnoreCase("ASC"));
    selectPage(page, wrapper);
    pageInfo.setRows(page.getRecords());
    pageInfo.setTotal(page.getTotal());
}
 
开发者ID:TomChen001,项目名称:xmanager,代码行数:10,代码来源:SysLogServiceImpl.java

示例7: testEntityWrapperOrderBy

import com.baomidou.mybatisplus.mapper.EntityWrapper; //导入方法依赖的package包/类
/**
 * 测试 EntityWrapper orderBy
 */
@Test
public void testEntityWrapperOrderBy() {
    EntityWrapper entityWrapper = new EntityWrapper();
    entityWrapper.orderBy("id desc");
    System.out.println(entityWrapper.getSqlSegment());
    Assert.assertEquals("ORDER BY id desc", entityWrapper.getSqlSegment());
}
 
开发者ID:baomidou,项目名称:mybatis-plus,代码行数:11,代码来源:EntityWrapperTest.java

示例8: selectAll

import com.baomidou.mybatisplus.mapper.EntityWrapper; //导入方法依赖的package包/类
public List<Role> selectAll() {
    EntityWrapper<Role> wrapper = new EntityWrapper<Role>();
    wrapper.orderBy("seq");
    return roleMapper.selectList(wrapper);
}
 
开发者ID:TomChen001,项目名称:xmanager,代码行数:6,代码来源:RoleServiceImpl.java

示例9: selectAll

import com.baomidou.mybatisplus.mapper.EntityWrapper; //导入方法依赖的package包/类
@Override
public List<Resource> selectAll() {
    EntityWrapper<Resource> wrapper = new EntityWrapper<Resource>();
    wrapper.orderBy("seq");
    return resourceMapper.selectList(wrapper);
}
 
开发者ID:TomChen001,项目名称:xmanager,代码行数:7,代码来源:ResourceServiceImpl.java

示例10: selectTreeGrid

import com.baomidou.mybatisplus.mapper.EntityWrapper; //导入方法依赖的package包/类
@Override
public List<Organization> selectTreeGrid() {
    EntityWrapper<Organization> wrapper = new EntityWrapper<Organization>();
    wrapper.orderBy("seq");
    return organizationMapper.selectList(wrapper);
}
 
开发者ID:TomChen001,项目名称:xmanager,代码行数:7,代码来源:OrganizationServiceImpl.java


注:本文中的com.baomidou.mybatisplus.mapper.EntityWrapper.orderBy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。