本文整理汇总了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";
}
示例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";
}
示例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);
}
示例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());
}
示例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);
}
示例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());
}
示例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());
}
示例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);
}
示例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);
}
示例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);
}