use of cn.exrick.common.pojo.DataTablesResult in project xmall by Exrick.
the class ItemController method getItemList.
@RequestMapping(value = "/item/list", method = RequestMethod.GET)
@ApiOperation(value = "分页搜索排序获取商品列表")
public DataTablesResult getItemList(int draw, int start, int length, int cid, @RequestParam("search[value]") String search, @RequestParam("order[0][column]") int orderCol, @RequestParam("order[0][dir]") String orderDir, String searchItem, String minDate, String maxDate) {
// 获取客户端需要排序的列
String[] cols = { "checkbox", "id", "image", "title", "sell_point", "price", "created", "updated", "status" };
String orderColumn = cols[orderCol];
if (orderColumn == null) {
orderColumn = "created";
}
// 获取排序方式 默认为desc(asc)
if (orderDir == null) {
orderDir = "desc";
}
DataTablesResult result = itemService.getItemList(draw, start, length, cid, search, orderColumn, orderDir);
return result;
}
use of cn.exrick.common.pojo.DataTablesResult in project xmall by Exrick.
the class ItemController method getItemSearchList.
@RequestMapping(value = "/item/listSearch", method = RequestMethod.GET)
@ApiOperation(value = "多条件分页搜索排序获取商品列表")
public DataTablesResult getItemSearchList(int draw, int start, int length, int cid, String searchKey, String minDate, String maxDate, @RequestParam("search[value]") String search, @RequestParam("order[0][column]") int orderCol, @RequestParam("order[0][dir]") String orderDir) {
// 获取客户端需要排序的列
String[] cols = { "checkbox", "id", "image", "title", "sell_point", "price", "created", "updated", "status" };
// 默认排序列
String orderColumn = cols[orderCol];
if (orderColumn == null) {
orderColumn = "created";
}
// 获取排序方式 默认为desc(asc)
if (orderDir == null) {
orderDir = "desc";
}
if (!search.isEmpty()) {
searchKey = search;
}
DataTablesResult result = itemService.getItemSearchList(draw, start, length, cid, searchKey, minDate, maxDate, orderColumn, orderDir);
return result;
}
use of cn.exrick.common.pojo.DataTablesResult in project xmall by Exrick.
the class MemberController method getDelMemberList.
@RequestMapping(value = "/member/list/remove", method = RequestMethod.GET)
@ApiOperation(value = "分页多条件搜索已删除会员列表")
public DataTablesResult getDelMemberList(int draw, int start, int length, String searchKey, String minDate, String maxDate, @RequestParam("search[value]") String search, @RequestParam("order[0][column]") int orderCol, @RequestParam("order[0][dir]") String orderDir) {
// 获取客户端需要排序的列
String[] cols = { "checkbox", "id", "username", "sex", "phone", "email", "address", "created", "updated", "state" };
String orderColumn = cols[orderCol];
// 默认排序列
if (orderColumn == null) {
orderColumn = "created";
}
// 获取排序方式 默认为desc(asc)
if (orderDir == null) {
orderDir = "desc";
}
if (!search.isEmpty()) {
searchKey = search;
}
DataTablesResult result = memberService.getRemoveMemberList(draw, start, length, searchKey, minDate, maxDate, orderColumn, orderDir);
return result;
}
use of cn.exrick.common.pojo.DataTablesResult in project xmall by Exrick.
the class SystemController method getShiroList.
@RequestMapping(value = "/sys/shiro/list", method = RequestMethod.GET)
@ApiOperation(value = "获取shiro过滤链配置")
public DataTablesResult getShiroList(@ModelAttribute TbUser tbUser) {
DataTablesResult result = new DataTablesResult();
List<TbShiroFilter> list = systemService.getShiroFilter();
result.setData(list);
result.setSuccess(true);
return result;
}
use of cn.exrick.common.pojo.DataTablesResult in project xmall by Exrick.
the class ItemServiceImpl method getItemList.
@Override
public DataTablesResult getItemList(int draw, int start, int length, int cid, String search, String orderCol, String orderDir) {
DataTablesResult result = new DataTablesResult();
// 分页执行查询返回结果
PageHelper.startPage(start / length + 1, length);
List<TbItem> list = tbItemMapper.selectItemByCondition(cid, "%" + search + "%", orderCol, orderDir);
PageInfo<TbItem> pageInfo = new PageInfo<>(list);
result.setRecordsFiltered((int) pageInfo.getTotal());
result.setRecordsTotal(getAllItemCount().getRecordsTotal());
result.setDraw(draw);
result.setData(list);
return result;
}
Aggregations