|
|
@@ -24,6 +24,8 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
|
24
|
24
|
import com.github.pagehelper.PageHelper;
|
|
25
|
25
|
import com.github.pagehelper.PageInfo;
|
|
26
|
26
|
|
|
|
27
|
+import org.apache.commons.lang.StringUtils;
|
|
|
28
|
+
|
|
27
|
29
|
import io.swagger.annotations.Api;
|
|
28
|
30
|
import io.swagger.annotations.ApiImplicitParam;
|
|
29
|
31
|
import io.swagger.annotations.ApiImplicitParams;
|
|
|
@@ -63,20 +65,18 @@ public class StorageDeviceInputController {
|
|
63
|
65
|
public PageInfo<StorageDeviceinput> getList(HttpServletRequest request,Integer pageNum, Integer pageSize, String deviceName, Integer deviceType ,String orgName) throws Exception{
|
|
64
|
66
|
StorageDeviceinputExample storageDeviceinputExample=new StorageDeviceinputExample();
|
|
65
|
67
|
StorageDeviceinputExample.Criteria criteria=storageDeviceinputExample.createCriteria();
|
|
66
|
|
- if(ParameterUtil.isnotnull(deviceType)){
|
|
|
68
|
+ if(deviceType!=null){
|
|
67
|
69
|
criteria.andDeviceTypeEqualTo(deviceType);
|
|
68
|
70
|
}
|
|
69
|
|
- if(ParameterUtil.isnotnull(deviceName)){
|
|
|
71
|
+ if(StringUtils.isNotBlank(deviceName)){
|
|
70
|
72
|
criteria.andDeviceNameLike(deviceName);
|
|
71
|
73
|
}
|
|
72
|
74
|
|
|
73
|
75
|
//排序
|
|
74
|
|
- storageDeviceinputExample.setOrderByClause("FIELD(status,0,1),input_time desc,id desc");
|
|
75
|
|
-
|
|
76
|
|
- if (pageNum!=null && pageSize!=null) {
|
|
77
|
|
- PageHelper.startPage(pageNum, pageSize);
|
|
78
|
|
- }
|
|
|
76
|
+ //storageDeviceinputExample.setOrderByClause("FIELD(status,0,1),input_time desc,id desc");
|
|
|
77
|
+ storageDeviceinputExample.setOrderByClause("id desc");
|
|
79
|
78
|
|
|
|
79
|
+ PageHelper.startPage(pageNum, pageSize);
|
|
80
|
80
|
List<StorageDeviceinput> list = deviceInputService.queryByDevice(storageDeviceinputExample);
|
|
81
|
81
|
for (StorageDeviceinput storageDeviceinput : list) {
|
|
82
|
82
|
if(orgName!=null){
|
|
|
@@ -90,6 +90,7 @@ public class StorageDeviceInputController {
|
|
90
|
90
|
|
|
91
|
91
|
}
|
|
92
|
92
|
}
|
|
|
93
|
+
|
|
93
|
94
|
PageInfo<StorageDeviceinput> pageInfo = new PageInfo<StorageDeviceinput>(list);
|
|
94
|
95
|
return pageInfo;
|
|
95
|
96
|
}
|