|
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.huimv.guowei.admin.common.utils.Result;
|
|
|
import com.huimv.guowei.admin.common.utils.ResultCode;
|
|
|
import com.huimv.guowei.admin.entity.BaseDuckInfo;
|
|
|
+import com.huimv.guowei.admin.entity.DuckHealthInfo;
|
|
|
import com.huimv.guowei.admin.entity.DuckImmunityInfo;
|
|
|
import com.huimv.guowei.admin.mapper.BaseDuckInfoMapper;
|
|
|
import com.huimv.guowei.admin.mapper.DuckImmunityInfoMapper;
|
|
@@ -44,28 +45,21 @@ public class DuckImmunityInfoServiceImpl extends ServiceImpl<DuckImmunityInfoMap
|
|
|
String pageNum = paramsMap.get("pageNum");
|
|
|
String pageSize = paramsMap.get("pageSize");
|
|
|
|
|
|
- Date date = new Date();
|
|
|
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
- String format = sdf.format(date);
|
|
|
- if (StringUtils.isBlank(startDate)) {
|
|
|
- startDate = format + " 00:00:00";
|
|
|
- } else {
|
|
|
- startDate = startDate + " 00:00:00";
|
|
|
- }
|
|
|
- if (StringUtils.isBlank(endDate)) {
|
|
|
- endDate = format + " 23:59:59";
|
|
|
- } else {
|
|
|
- endDate = endDate + " 23:59:59";
|
|
|
- }
|
|
|
if (pageNum == null || "".equals(pageNum)) {
|
|
|
pageNum = "1";
|
|
|
}
|
|
|
if (pageSize == null || "".equals(pageSize)) {
|
|
|
pageSize = "10";
|
|
|
}
|
|
|
+
|
|
|
QueryWrapper<DuckImmunityInfo> queryWrapper = new QueryWrapper<>();
|
|
|
- queryWrapper.eq("duck_id", duckNum).eq("farm_id", farmId)
|
|
|
- .between("health_date", startDate, endDate).orderByAsc("health_date");
|
|
|
+ if (startDate == null || "".equals(startDate)) {
|
|
|
+ queryWrapper.eq("duck_id", duckNum).eq("farm_id", farmId).orderByAsc("health_date");
|
|
|
+ }else {
|
|
|
+ startDate = startDate + " 00:00:00";
|
|
|
+ endDate = endDate + " 23:59:59";
|
|
|
+ queryWrapper.eq("duck_id", duckNum).eq("farm_id", farmId).between("health_date", startDate, endDate).orderByAsc("health_date");
|
|
|
+ }
|
|
|
Page<DuckImmunityInfo> page = new Page<>(Integer.parseInt(pageNum), Integer.parseInt(pageSize));
|
|
|
return new Result(ResultCode.SUCCESS, infoMapper.selectPage(page, queryWrapper));
|
|
|
}
|