Commit 6d5a09e9 by xiaoyj

设备列表去除分頁

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@21981 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent a30372ce
...@@ -39,19 +39,13 @@ public class DeviceCtroller { ...@@ -39,19 +39,13 @@ public class DeviceCtroller {
* @return * @return
*/ */
@RequestMapping(value = "/indentDevices", method = { RequestMethod.GET, RequestMethod.POST }) @RequestMapping(value = "/indentDevices", method = { RequestMethod.GET, RequestMethod.POST })
public ResultObject indentDevices(HttpServletRequest request,@RequestParam(defaultValue = "1") int pageIndex, public ResultObject indentDevices(HttpServletRequest request,String indentNo) {
@RequestParam(defaultValue = "10") int pageSize, String indentNo) {
if (org.springframework.util.StringUtils.isEmpty(indentNo)) { if (org.springframework.util.StringUtils.isEmpty(indentNo)) {
return new ResultObject(ResultCodeEnum.PARAM_ERROR.getCode(), ResultCodeEnum.PARAM_ERROR.getMsg()); return new ResultObject(ResultCodeEnum.PARAM_ERROR.getCode(), ResultCodeEnum.PARAM_ERROR.getMsg());
} }
Map<String, Object> result = new HashMap<String, Object>(); Map<String, Object> result = new HashMap<String, Object>();
Page page = new Page(pageIndex, pageSize); List<SysDevice> list=deviceService.catIndentDevices(indentNo);
List<SysDevice> list=deviceService.catIndentDevices(indentNo,page); return new ResultObject(ResultCodeEnum.SUCCESS.getCode(),ResultCodeEnum.SUCCESS.getMsg(),list);
com.github.pagehelper.Page<SysDevice> pages = (com.github.pagehelper.Page<SysDevice>) list;
page.setTotalCount((int) pages.getTotal());
result.put("page", page);
result.put("items", list);
return new ResultObject(ResultCodeEnum.SUCCESS.getCode(),ResultCodeEnum.SUCCESS.getMsg(),result);
} }
/** /**
......
...@@ -9,7 +9,7 @@ import java.util.List; ...@@ -9,7 +9,7 @@ import java.util.List;
public interface DeviceService { public interface DeviceService {
List<SysDevice> catIndentDevices(String indentNo, Page page); List<SysDevice> catIndentDevices(String indentNo);
void updateDeviceNo(Integer id, String deviceNo); void updateDeviceNo(Integer id, String deviceNo);
......
...@@ -22,10 +22,7 @@ public class DeviceServiceImpl implements DeviceService{ ...@@ -22,10 +22,7 @@ public class DeviceServiceImpl implements DeviceService{
private SysDeviceMapper sysDeviceMapper; private SysDeviceMapper sysDeviceMapper;
@Override @Override
public List<SysDevice> catIndentDevices(String indentNo, Page page) { public List<SysDevice> catIndentDevices(String indentNo) {
if (page != null) {
PageHelper.startPage(page.getPageIndex(), page.getPageSize(), true);
}
List<SysDevice> list=sysDeviceMapper.catIndentDevices(indentNo); List<SysDevice> list=sysDeviceMapper.catIndentDevices(indentNo);
return list; return list;
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!