|
@@ -1,6 +1,7 @@
|
|
package com.huimv.production.service.impl;
|
|
package com.huimv.production.service.impl;
|
|
|
|
|
|
import com.huimv.production.domain.MPigPigpenTemperature;
|
|
import com.huimv.production.domain.MPigPigpenTemperature;
|
|
|
|
+import com.huimv.production.domain.MSowEntity;
|
|
import com.huimv.production.repo.MPigPigpenTemperatureRepository;
|
|
import com.huimv.production.repo.MPigPigpenTemperatureRepository;
|
|
import com.huimv.production.result.Result;
|
|
import com.huimv.production.result.Result;
|
|
import com.huimv.production.result.ResultStatus;
|
|
import com.huimv.production.result.ResultStatus;
|
|
@@ -8,7 +9,9 @@ import com.huimv.production.service.MPigPigpenTemperatureService;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
+import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
|
|
|
|
@Service
|
|
@Service
|
|
public class MPigPigpenTemperatureServiceImpl implements MPigPigpenTemperatureService {
|
|
public class MPigPigpenTemperatureServiceImpl implements MPigPigpenTemperatureService {
|
|
@@ -58,12 +61,19 @@ public class MPigPigpenTemperatureServiceImpl implements MPigPigpenTemperatureSe
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public Result findAll() {
|
|
|
|
|
|
+ public Result findAll(String name ,Integer pageNum , Integer pageSize) {
|
|
try {
|
|
try {
|
|
- List<MPigPigpenTemperature> all = rep.findAll();
|
|
|
|
- return new Result(10000, ResultStatus.findSuccess,all);
|
|
|
|
|
|
+ Map map = new HashMap();
|
|
|
|
+ Integer startPage = (pageNum-1) * pageSize;
|
|
|
|
+
|
|
|
|
+ int size = rep.findAll().size() ;
|
|
|
|
+ List<MPigPigpenTemperature> all = rep.findAll(name,startPage,pageSize);
|
|
|
|
+ map.put("total",size);
|
|
|
|
+ map.put("totalPageNum",(size + pageSize - 1) / pageSize);
|
|
|
|
+ map.put("data",all);
|
|
|
|
+ return new Result(10000,"查询成功",map);
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
- return new Result(10001, ResultStatus.findFailed,null);
|
|
|
|
|
|
+ return new Result(10001,"查询失败",null);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|