|
@@ -11,6 +11,7 @@ import com.huimv.admin.common.utils.ResultCode;
|
|
|
import com.huimv.admin.entity.ProtData;
|
|
|
import com.huimv.admin.entity.ProtWarningInfo;
|
|
|
import com.huimv.admin.entity.dto.ProCountDto;
|
|
|
+import com.huimv.admin.entity.vo.ProCountVo;
|
|
|
import com.huimv.admin.entity.vo.ProDataVo;
|
|
|
import com.huimv.admin.mapper.ProtDataMapper;
|
|
|
import com.huimv.admin.mapper.ProtWarningInfoMapper;
|
|
@@ -64,17 +65,23 @@ public class ProtDataServiceImpl extends ServiceImpl<ProtDataMapper, ProtData> i
|
|
|
startTime = startTime + " 00:00:00";
|
|
|
endTime = endTime + " 23:59:59";
|
|
|
queryWrapper.between("create_date",startTime, endTime);
|
|
|
-
|
|
|
queryWrapper.eq("loction_type" ,1);
|
|
|
- List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
|
+ List<ProCountVo> protData1 = protDataMapper.listPh(queryWrapper);
|
|
|
proCountDto.setInList(protData1);
|
|
|
|
|
|
- queryWrapper.eq("loction_type" ,2);
|
|
|
- List<ProtData> protData2 = protDataMapper.listPh(queryWrapper);
|
|
|
+ QueryWrapper<ProtData> queryWrapper2 = new QueryWrapper<>();
|
|
|
+ queryWrapper2.eq("farm_id", farmId);
|
|
|
+ queryWrapper2.between("create_date",startTime, endTime);
|
|
|
+ queryWrapper2.eq("loction_type" ,2);
|
|
|
+ List<ProCountVo> protData2 = protDataMapper.listPh(queryWrapper2);
|
|
|
proCountDto.setDealList(protData2);
|
|
|
|
|
|
- queryWrapper.eq("loction_type" ,3);
|
|
|
- List<ProtData> protData3 = protDataMapper.listPh(queryWrapper);
|
|
|
+ QueryWrapper<ProtData> queryWrapper3 = new QueryWrapper<>();
|
|
|
+ queryWrapper3.eq("farm_id", farmId);
|
|
|
+ queryWrapper3.between("create_date",startTime, endTime);
|
|
|
+ queryWrapper3.eq("loction_type" ,3);
|
|
|
+ List<ProCountVo> protData3 = protDataMapper.listPh(queryWrapper3);
|
|
|
+
|
|
|
proCountDto.setOutList(protData3);
|
|
|
|
|
|
|
|
@@ -85,35 +92,44 @@ public class ProtDataServiceImpl extends ServiceImpl<ProtDataMapper, ProtData> i
|
|
|
Calendar dateTime = Calendar.getInstance();
|
|
|
int i = dateTime.get(Calendar.YEAR);
|
|
|
// DateTime dateTime = DateUtil.beginOfYear(new Date());
|
|
|
- queryWrapper.ge("create_date",i );
|
|
|
+ queryWrapper.ge("create_date", i);
|
|
|
queryWrapper.eq("loction_type" ,1);
|
|
|
- List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
|
+ List<ProCountVo> protData1 = protDataMapper.listPh(queryWrapper);
|
|
|
proCountDto.setInList(protData1);
|
|
|
|
|
|
- queryWrapper.eq("loction_type" ,2);
|
|
|
- List<ProtData> protData2 = protDataMapper.listPh(queryWrapper);
|
|
|
+ QueryWrapper<ProtData> queryWrapper2 = new QueryWrapper<>();
|
|
|
+ queryWrapper2.eq("farm_id",farmId).ge("create_date", i);
|
|
|
+ queryWrapper2.eq("loction_type" ,2);
|
|
|
+ List<ProCountVo> protData2 = protDataMapper.listPh(queryWrapper2);
|
|
|
proCountDto.setDealList(protData2);
|
|
|
|
|
|
- queryWrapper.eq("loction_type" ,3);
|
|
|
- List<ProtData> protData3 = protDataMapper.listPh(queryWrapper);
|
|
|
+ QueryWrapper<ProtData> queryWrapper3 = new QueryWrapper<>();
|
|
|
+ queryWrapper3.eq("farm_id",farmId).ge("create_date", i);
|
|
|
+ queryWrapper3.eq("loction_type" ,3);
|
|
|
+ List<ProCountVo> protData3 = protDataMapper.listPh(queryWrapper3);
|
|
|
proCountDto.setOutList(protData3);
|
|
|
|
|
|
|
|
|
+
|
|
|
}
|
|
|
//本月
|
|
|
else if ("2".equals(type)) {
|
|
|
Date timesMonthmorning = DataUill.getTimesMonthmorning();
|
|
|
queryWrapper.ge("create_date", timesMonthmorning);
|
|
|
queryWrapper.eq("loction_type" ,1);
|
|
|
- List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
|
+ List<ProCountVo> protData1 = protDataMapper.listPh(queryWrapper);
|
|
|
proCountDto.setInList(protData1);
|
|
|
|
|
|
- queryWrapper.eq("loction_type" ,2);
|
|
|
- List<ProtData> protData2 = protDataMapper.listPh(queryWrapper);
|
|
|
+ QueryWrapper<ProtData> queryWrapper2 = new QueryWrapper<>();
|
|
|
+ queryWrapper2.eq("farm_id",farmId).ge("create_date", timesMonthmorning);
|
|
|
+ queryWrapper2.eq("loction_type" ,2);
|
|
|
+ List<ProCountVo> protData2 = protDataMapper.listPh(queryWrapper2);
|
|
|
proCountDto.setDealList(protData2);
|
|
|
|
|
|
- queryWrapper.eq("loction_type" ,3);
|
|
|
- List<ProtData> protData3 = protDataMapper.listPh(queryWrapper);
|
|
|
+ QueryWrapper<ProtData> queryWrapper3 = new QueryWrapper<>();
|
|
|
+ queryWrapper3.eq("farm_id",farmId).ge("create_date", timesMonthmorning);
|
|
|
+ queryWrapper3.eq("loction_type" ,3);
|
|
|
+ List<ProCountVo> protData3 = protDataMapper.listPh(queryWrapper3);
|
|
|
proCountDto.setOutList(protData3);
|
|
|
|
|
|
|
|
@@ -123,77 +139,98 @@ public class ProtDataServiceImpl extends ServiceImpl<ProtDataMapper, ProtData> i
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
calendar.set(Calendar.DATE, calendar.get(Calendar.DATE) - 7);
|
|
|
Date dateTime = calendar.getTime();
|
|
|
- queryWrapper.ge("create_date", dateTime);
|
|
|
|
|
|
+ queryWrapper.ge("create_date", dateTime);
|
|
|
queryWrapper.eq("loction_type" ,1);
|
|
|
- List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
|
+ List<ProCountVo> protData1 = protDataMapper.listPh(queryWrapper);
|
|
|
proCountDto.setInList(protData1);
|
|
|
|
|
|
- queryWrapper.eq("loction_type" ,2);
|
|
|
- List<ProtData> protData2 = protDataMapper.listPh(queryWrapper);
|
|
|
+ QueryWrapper<ProtData> queryWrapper2 = new QueryWrapper<>();
|
|
|
+ queryWrapper2.eq("farm_id",farmId).ge("create_date", dateTime);
|
|
|
+ queryWrapper2.eq("loction_type" ,2);
|
|
|
+ List<ProCountVo> protData2 = protDataMapper.listPh(queryWrapper2);
|
|
|
proCountDto.setDealList(protData2);
|
|
|
|
|
|
- queryWrapper.eq("loction_type" ,3);
|
|
|
- List<ProtData> protData3 = protDataMapper.listPh(queryWrapper);
|
|
|
+ QueryWrapper<ProtData> queryWrapper3 = new QueryWrapper<>();
|
|
|
+ queryWrapper3.eq("farm_id",farmId).ge("create_date", dateTime);
|
|
|
+ queryWrapper3.eq("loction_type" ,3);
|
|
|
+ List<ProCountVo> protData3 = protDataMapper.listPh(queryWrapper3);
|
|
|
proCountDto.setOutList(protData3);
|
|
|
|
|
|
|
|
|
}
|
|
|
}
|
|
|
//cod
|
|
|
- else if ("2".equals(dataType)) {
|
|
|
+ else if ("2".equals(dataType)) {
|
|
|
if ("4".equals(type)) {
|
|
|
startTime = startTime + " 00:00:00";
|
|
|
endTime = endTime + " 23:59:59";
|
|
|
queryWrapper.between("create_date",startTime, endTime);
|
|
|
queryWrapper.eq("loction_type" ,1);
|
|
|
- List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
|
+ List<ProCountVo> protData1 = protDataMapper.listCod(queryWrapper);
|
|
|
proCountDto.setInList(protData1);
|
|
|
|
|
|
- queryWrapper.eq("loction_type" ,2);
|
|
|
- List<ProtData> protData2 = protDataMapper.listPh(queryWrapper);
|
|
|
+ QueryWrapper<ProtData> queryWrapper2 = new QueryWrapper<>();
|
|
|
+ queryWrapper2.eq("farm_id", farmId);
|
|
|
+ queryWrapper2.between("create_date",startTime, endTime);
|
|
|
+ queryWrapper2.eq("loction_type" ,2);
|
|
|
+ List<ProCountVo> protData2 = protDataMapper.listCod(queryWrapper2);
|
|
|
proCountDto.setDealList(protData2);
|
|
|
|
|
|
- queryWrapper.eq("loction_type" ,3);
|
|
|
- List<ProtData> protData3 = protDataMapper.listPh(queryWrapper);
|
|
|
+ QueryWrapper<ProtData> queryWrapper3 = new QueryWrapper<>();
|
|
|
+ queryWrapper3.eq("farm_id", farmId);
|
|
|
+ queryWrapper3.between("create_date",startTime, endTime);
|
|
|
+ queryWrapper3.eq("loction_type" ,3);
|
|
|
+ List<ProCountVo> protData3 = protDataMapper.listCod(queryWrapper3);
|
|
|
+
|
|
|
proCountDto.setOutList(protData3);
|
|
|
|
|
|
|
|
|
+ // protDataList=endList;
|
|
|
}
|
|
|
//本年
|
|
|
else if ("3".equals(type)) {
|
|
|
Calendar dateTime = Calendar.getInstance();
|
|
|
-
|
|
|
+ int i = dateTime.get(Calendar.YEAR);
|
|
|
// DateTime dateTime = DateUtil.beginOfYear(new Date());
|
|
|
- queryWrapper.ge("create_date", dateTime.get(Calendar.YEAR));
|
|
|
+ queryWrapper.ge("create_date", i);
|
|
|
queryWrapper.eq("loction_type" ,1);
|
|
|
- List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
|
+ List<ProCountVo> protData1 = protDataMapper.listCod(queryWrapper);
|
|
|
proCountDto.setInList(protData1);
|
|
|
|
|
|
- queryWrapper.eq("loction_type" ,2);
|
|
|
- List<ProtData> protData2 = protDataMapper.listPh(queryWrapper);
|
|
|
+ QueryWrapper<ProtData> queryWrapper2 = new QueryWrapper<>();
|
|
|
+ queryWrapper2.eq("farm_id",farmId).ge("create_date", i);
|
|
|
+ queryWrapper2.eq("loction_type" ,2);
|
|
|
+ List<ProCountVo> protData2 = protDataMapper.listCod(queryWrapper2);
|
|
|
proCountDto.setDealList(protData2);
|
|
|
|
|
|
- queryWrapper.eq("loction_type" ,3);
|
|
|
- List<ProtData> protData3 = protDataMapper.listPh(queryWrapper);
|
|
|
+ QueryWrapper<ProtData> queryWrapper3 = new QueryWrapper<>();
|
|
|
+ queryWrapper3.eq("farm_id",farmId).ge("create_date", i);
|
|
|
+ queryWrapper3.eq("loction_type" ,3);
|
|
|
+ List<ProCountVo> protData3 = protDataMapper.listCod(queryWrapper3);
|
|
|
proCountDto.setOutList(protData3);
|
|
|
|
|
|
|
|
|
+
|
|
|
}
|
|
|
//本月
|
|
|
else if ("2".equals(type)) {
|
|
|
Date timesMonthmorning = DataUill.getTimesMonthmorning();
|
|
|
queryWrapper.ge("create_date", timesMonthmorning);
|
|
|
queryWrapper.eq("loction_type" ,1);
|
|
|
- List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
|
+ List<ProCountVo> protData1 = protDataMapper.listCod(queryWrapper);
|
|
|
proCountDto.setInList(protData1);
|
|
|
|
|
|
- queryWrapper.eq("loction_type" ,2);
|
|
|
- List<ProtData> protData2 = protDataMapper.listPh(queryWrapper);
|
|
|
+ QueryWrapper<ProtData> queryWrapper2 = new QueryWrapper<>();
|
|
|
+ queryWrapper2.eq("farm_id",farmId).ge("create_date", timesMonthmorning);
|
|
|
+ queryWrapper2.eq("loction_type" ,2);
|
|
|
+ List<ProCountVo> protData2 = protDataMapper.listCod(queryWrapper2);
|
|
|
proCountDto.setDealList(protData2);
|
|
|
|
|
|
- queryWrapper.eq("loction_type" ,3);
|
|
|
- List<ProtData> protData3 = protDataMapper.listPh(queryWrapper);
|
|
|
+ QueryWrapper<ProtData> queryWrapper3 = new QueryWrapper<>();
|
|
|
+ queryWrapper3.eq("farm_id",farmId).ge("create_date", timesMonthmorning);
|
|
|
+ queryWrapper3.eq("loction_type" ,3);
|
|
|
+ List<ProCountVo> protData3 = protDataMapper.listCod(queryWrapper3);
|
|
|
proCountDto.setOutList(protData3);
|
|
|
|
|
|
|
|
@@ -203,76 +240,98 @@ public class ProtDataServiceImpl extends ServiceImpl<ProtDataMapper, ProtData> i
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
calendar.set(Calendar.DATE, calendar.get(Calendar.DATE) - 7);
|
|
|
Date dateTime = calendar.getTime();
|
|
|
+
|
|
|
queryWrapper.ge("create_date", dateTime);
|
|
|
queryWrapper.eq("loction_type" ,1);
|
|
|
- List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
|
+ List<ProCountVo> protData1 = protDataMapper.listCod(queryWrapper);
|
|
|
proCountDto.setInList(protData1);
|
|
|
|
|
|
- queryWrapper.eq("loction_type" ,2);
|
|
|
- List<ProtData> protData2 = protDataMapper.listPh(queryWrapper);
|
|
|
+ QueryWrapper<ProtData> queryWrapper2 = new QueryWrapper<>();
|
|
|
+ queryWrapper2.eq("farm_id",farmId).ge("create_date", dateTime);
|
|
|
+ queryWrapper2.eq("loction_type" ,2);
|
|
|
+ List<ProCountVo> protData2 = protDataMapper.listCod(queryWrapper2);
|
|
|
proCountDto.setDealList(protData2);
|
|
|
|
|
|
- queryWrapper.eq("loction_type" ,3);
|
|
|
- List<ProtData> protData3 = protDataMapper.listPh(queryWrapper);
|
|
|
+ QueryWrapper<ProtData> queryWrapper3 = new QueryWrapper<>();
|
|
|
+ queryWrapper3.eq("farm_id",farmId).ge("create_date", dateTime);
|
|
|
+ queryWrapper3.eq("loction_type" ,3);
|
|
|
+ List<ProCountVo> protData3 = protDataMapper.listCod(queryWrapper3);
|
|
|
proCountDto.setOutList(protData3);
|
|
|
|
|
|
|
|
|
}
|
|
|
}
|
|
|
//NH3N
|
|
|
- else if ("3".equals(dataType)) {
|
|
|
+ else if ("3".equals(dataType)) {
|
|
|
if ("4".equals(type)) {
|
|
|
startTime = startTime + " 00:00:00";
|
|
|
endTime = endTime + " 23:59:59";
|
|
|
queryWrapper.between("create_date",startTime, endTime);
|
|
|
queryWrapper.eq("loction_type" ,1);
|
|
|
- List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
|
+ List<ProCountVo> protData1 = protDataMapper.listNh3n(queryWrapper);
|
|
|
proCountDto.setInList(protData1);
|
|
|
|
|
|
- queryWrapper.eq("loction_type" ,2);
|
|
|
- List<ProtData> protData2 = protDataMapper.listPh(queryWrapper);
|
|
|
+ QueryWrapper<ProtData> queryWrapper2 = new QueryWrapper<>();
|
|
|
+ queryWrapper2.eq("farm_id", farmId);
|
|
|
+ queryWrapper2.between("create_date",startTime, endTime);
|
|
|
+ queryWrapper2.eq("loction_type" ,2);
|
|
|
+ List<ProCountVo> protData2 = protDataMapper.listNh3n(queryWrapper2);
|
|
|
proCountDto.setDealList(protData2);
|
|
|
|
|
|
- queryWrapper.eq("loction_type" ,3);
|
|
|
- List<ProtData> protData3 = protDataMapper.listPh(queryWrapper);
|
|
|
+ QueryWrapper<ProtData> queryWrapper3 = new QueryWrapper<>();
|
|
|
+ queryWrapper3.eq("farm_id", farmId);
|
|
|
+ queryWrapper3.between("create_date",startTime, endTime);
|
|
|
+ queryWrapper3.eq("loction_type" ,3);
|
|
|
+ List<ProCountVo> protData3 = protDataMapper.listNh3n(queryWrapper3);
|
|
|
+
|
|
|
proCountDto.setOutList(protData3);
|
|
|
|
|
|
|
|
|
+ // protDataList=endList;
|
|
|
}
|
|
|
//本年
|
|
|
else if ("3".equals(type)) {
|
|
|
Calendar dateTime = Calendar.getInstance();
|
|
|
-
|
|
|
+ int i = dateTime.get(Calendar.YEAR);
|
|
|
// DateTime dateTime = DateUtil.beginOfYear(new Date());
|
|
|
- queryWrapper.ge("create_date", dateTime.get(Calendar.YEAR));
|
|
|
+ queryWrapper.ge("create_date", i);
|
|
|
queryWrapper.eq("loction_type" ,1);
|
|
|
- List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
|
+ List<ProCountVo> protData1 = protDataMapper.listNh3n(queryWrapper);
|
|
|
proCountDto.setInList(protData1);
|
|
|
|
|
|
- queryWrapper.eq("loction_type" ,2);
|
|
|
- List<ProtData> protData2 = protDataMapper.listPh(queryWrapper);
|
|
|
+ QueryWrapper<ProtData> queryWrapper2 = new QueryWrapper<>();
|
|
|
+ queryWrapper2.eq("farm_id",farmId).ge("create_date", i);
|
|
|
+ queryWrapper2.eq("loction_type" ,2);
|
|
|
+ List<ProCountVo> protData2 = protDataMapper.listNh3n(queryWrapper2);
|
|
|
proCountDto.setDealList(protData2);
|
|
|
|
|
|
- queryWrapper.eq("loction_type" ,3);
|
|
|
- List<ProtData> protData3 = protDataMapper.listPh(queryWrapper);
|
|
|
+ QueryWrapper<ProtData> queryWrapper3 = new QueryWrapper<>();
|
|
|
+ queryWrapper3.eq("farm_id",farmId).ge("create_date", i);
|
|
|
+ queryWrapper3.eq("loction_type" ,3);
|
|
|
+ List<ProCountVo> protData3 = protDataMapper.listNh3n(queryWrapper3);
|
|
|
proCountDto.setOutList(protData3);
|
|
|
|
|
|
|
|
|
+
|
|
|
}
|
|
|
//本月
|
|
|
else if ("2".equals(type)) {
|
|
|
Date timesMonthmorning = DataUill.getTimesMonthmorning();
|
|
|
queryWrapper.ge("create_date", timesMonthmorning);
|
|
|
queryWrapper.eq("loction_type" ,1);
|
|
|
- List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
|
+ List<ProCountVo> protData1 = protDataMapper.listNh3n(queryWrapper);
|
|
|
proCountDto.setInList(protData1);
|
|
|
|
|
|
- queryWrapper.eq("loction_type" ,2);
|
|
|
- List<ProtData> protData2 = protDataMapper.listPh(queryWrapper);
|
|
|
+ QueryWrapper<ProtData> queryWrapper2 = new QueryWrapper<>();
|
|
|
+ queryWrapper2.eq("farm_id",farmId).ge("create_date", timesMonthmorning);
|
|
|
+ queryWrapper2.eq("loction_type" ,2);
|
|
|
+ List<ProCountVo> protData2 = protDataMapper.listNh3n(queryWrapper2);
|
|
|
proCountDto.setDealList(protData2);
|
|
|
|
|
|
- queryWrapper.eq("loction_type" ,3);
|
|
|
- List<ProtData> protData3 = protDataMapper.listPh(queryWrapper);
|
|
|
+ QueryWrapper<ProtData> queryWrapper3 = new QueryWrapper<>();
|
|
|
+ queryWrapper3.eq("farm_id",farmId).ge("create_date", timesMonthmorning);
|
|
|
+ queryWrapper3.eq("loction_type" ,3);
|
|
|
+ List<ProCountVo> protData3 = protDataMapper.listNh3n(queryWrapper3);
|
|
|
proCountDto.setOutList(protData3);
|
|
|
|
|
|
|
|
@@ -282,17 +341,22 @@ public class ProtDataServiceImpl extends ServiceImpl<ProtDataMapper, ProtData> i
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
calendar.set(Calendar.DATE, calendar.get(Calendar.DATE) - 7);
|
|
|
Date dateTime = calendar.getTime();
|
|
|
+
|
|
|
queryWrapper.ge("create_date", dateTime);
|
|
|
queryWrapper.eq("loction_type" ,1);
|
|
|
- List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
|
+ List<ProCountVo> protData1 = protDataMapper.listNh3n(queryWrapper);
|
|
|
proCountDto.setInList(protData1);
|
|
|
|
|
|
- queryWrapper.eq("loction_type" ,2);
|
|
|
- List<ProtData> protData2 = protDataMapper.listPh(queryWrapper);
|
|
|
+ QueryWrapper<ProtData> queryWrapper2 = new QueryWrapper<>();
|
|
|
+ queryWrapper2.eq("farm_id",farmId).ge("create_date", dateTime);
|
|
|
+ queryWrapper2.eq("loction_type" ,2);
|
|
|
+ List<ProCountVo> protData2 = protDataMapper.listNh3n(queryWrapper2);
|
|
|
proCountDto.setDealList(protData2);
|
|
|
|
|
|
- queryWrapper.eq("loction_type" ,3);
|
|
|
- List<ProtData> protData3 = protDataMapper.listPh(queryWrapper);
|
|
|
+ QueryWrapper<ProtData> queryWrapper3 = new QueryWrapper<>();
|
|
|
+ queryWrapper3.eq("farm_id",farmId).ge("create_date", dateTime);
|
|
|
+ queryWrapper3.eq("loction_type" ,3);
|
|
|
+ List<ProCountVo> protData3 = protDataMapper.listNh3n(queryWrapper3);
|
|
|
proCountDto.setOutList(protData3);
|
|
|
|
|
|
|
|
@@ -305,53 +369,70 @@ public class ProtDataServiceImpl extends ServiceImpl<ProtDataMapper, ProtData> i
|
|
|
endTime = endTime + " 23:59:59";
|
|
|
queryWrapper.between("create_date",startTime, endTime);
|
|
|
queryWrapper.eq("loction_type" ,1);
|
|
|
- List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
|
+ List<ProCountVo> protData1 = protDataMapper.listTp(queryWrapper);
|
|
|
proCountDto.setInList(protData1);
|
|
|
|
|
|
- queryWrapper.eq("loction_type" ,2);
|
|
|
- List<ProtData> protData2 = protDataMapper.listPh(queryWrapper);
|
|
|
+ QueryWrapper<ProtData> queryWrapper2 = new QueryWrapper<>();
|
|
|
+ queryWrapper2.eq("farm_id", farmId);
|
|
|
+ queryWrapper2.between("create_date",startTime, endTime);
|
|
|
+ queryWrapper2.eq("loction_type" ,2);
|
|
|
+ List<ProCountVo> protData2 = protDataMapper.listTp(queryWrapper2);
|
|
|
proCountDto.setDealList(protData2);
|
|
|
|
|
|
- queryWrapper.eq("loction_type" ,3);
|
|
|
- List<ProtData> protData3 = protDataMapper.listPh(queryWrapper);
|
|
|
+ QueryWrapper<ProtData> queryWrapper3 = new QueryWrapper<>();
|
|
|
+ queryWrapper3.eq("farm_id", farmId);
|
|
|
+ queryWrapper3.between("create_date",startTime, endTime);
|
|
|
+ queryWrapper3.eq("loction_type" ,3);
|
|
|
+ List<ProCountVo> protData3 = protDataMapper.listTp(queryWrapper3);
|
|
|
+
|
|
|
proCountDto.setOutList(protData3);
|
|
|
|
|
|
|
|
|
+ // protDataList=endList;
|
|
|
}
|
|
|
//本年
|
|
|
else if ("3".equals(type)) {
|
|
|
Calendar dateTime = Calendar.getInstance();
|
|
|
-
|
|
|
+ int i = dateTime.get(Calendar.YEAR);
|
|
|
// DateTime dateTime = DateUtil.beginOfYear(new Date());
|
|
|
- queryWrapper.ge("create_date", dateTime.get(Calendar.YEAR));
|
|
|
+ queryWrapper.ge("create_date", i);
|
|
|
queryWrapper.eq("loction_type" ,1);
|
|
|
- List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
|
+ List<ProCountVo> protData1 = protDataMapper.listTp(queryWrapper);
|
|
|
proCountDto.setInList(protData1);
|
|
|
|
|
|
- queryWrapper.eq("loction_type" ,2);
|
|
|
- List<ProtData> protData2 = protDataMapper.listPh(queryWrapper);
|
|
|
+ QueryWrapper<ProtData> queryWrapper2 = new QueryWrapper<>();
|
|
|
+ queryWrapper2.eq("farm_id",farmId).ge("create_date", i);
|
|
|
+ queryWrapper2.eq("loction_type" ,2);
|
|
|
+ List<ProCountVo> protData2 = protDataMapper.listTp(queryWrapper2);
|
|
|
proCountDto.setDealList(protData2);
|
|
|
|
|
|
- queryWrapper.eq("loction_type" ,3);
|
|
|
- List<ProtData> protData3 = protDataMapper.listPh(queryWrapper);
|
|
|
+ QueryWrapper<ProtData> queryWrapper3 = new QueryWrapper<>();
|
|
|
+ queryWrapper3.eq("farm_id",farmId).ge("create_date", i);
|
|
|
+ queryWrapper3.eq("loction_type" ,3);
|
|
|
+ List<ProCountVo> protData3 = protDataMapper.listTp(queryWrapper3);
|
|
|
proCountDto.setOutList(protData3);
|
|
|
|
|
|
|
|
|
+
|
|
|
}
|
|
|
//本月
|
|
|
else if ("2".equals(type)) {
|
|
|
Date timesMonthmorning = DataUill.getTimesMonthmorning();
|
|
|
queryWrapper.ge("create_date", timesMonthmorning);
|
|
|
queryWrapper.eq("loction_type" ,1);
|
|
|
- List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
|
+ List<ProCountVo> protData1 = protDataMapper.listTp(queryWrapper);
|
|
|
proCountDto.setInList(protData1);
|
|
|
|
|
|
- queryWrapper.eq("loction_type" ,2);
|
|
|
- List<ProtData> protData2 = protDataMapper.listPh(queryWrapper);
|
|
|
+ QueryWrapper<ProtData> queryWrapper2 = new QueryWrapper<>();
|
|
|
+ queryWrapper2.eq("farm_id",farmId).ge("create_date", timesMonthmorning);
|
|
|
+ queryWrapper2.eq("loction_type" ,2);
|
|
|
+ List<ProCountVo> protData2 = protDataMapper.listTp(queryWrapper2);
|
|
|
proCountDto.setDealList(protData2);
|
|
|
|
|
|
- queryWrapper.eq("loction_type" ,3);
|
|
|
- List<ProtData> protData3 = protDataMapper.listPh(queryWrapper);
|
|
|
+ QueryWrapper<ProtData> queryWrapper3 = new QueryWrapper<>();
|
|
|
+ queryWrapper3.eq("farm_id",farmId).ge("create_date", timesMonthmorning);
|
|
|
+ queryWrapper3.eq("loction_type" ,3);
|
|
|
+ List<ProCountVo> protData3 = protDataMapper.listTp(queryWrapper3);
|
|
|
proCountDto.setOutList(protData3);
|
|
|
|
|
|
|
|
@@ -361,76 +442,98 @@ public class ProtDataServiceImpl extends ServiceImpl<ProtDataMapper, ProtData> i
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
calendar.set(Calendar.DATE, calendar.get(Calendar.DATE) - 7);
|
|
|
Date dateTime = calendar.getTime();
|
|
|
+
|
|
|
queryWrapper.ge("create_date", dateTime);
|
|
|
queryWrapper.eq("loction_type" ,1);
|
|
|
- List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
|
+ List<ProCountVo> protData1 = protDataMapper.listTp(queryWrapper);
|
|
|
proCountDto.setInList(protData1);
|
|
|
|
|
|
- queryWrapper.eq("loction_type" ,2);
|
|
|
- List<ProtData> protData2 = protDataMapper.listPh(queryWrapper);
|
|
|
+ QueryWrapper<ProtData> queryWrapper2 = new QueryWrapper<>();
|
|
|
+ queryWrapper2.eq("farm_id",farmId).ge("create_date", dateTime);
|
|
|
+ queryWrapper2.eq("loction_type" ,2);
|
|
|
+ List<ProCountVo> protData2 = protDataMapper.listTp(queryWrapper2);
|
|
|
proCountDto.setDealList(protData2);
|
|
|
|
|
|
- queryWrapper.eq("loction_type" ,3);
|
|
|
- List<ProtData> protData3 = protDataMapper.listPh(queryWrapper);
|
|
|
+ QueryWrapper<ProtData> queryWrapper3 = new QueryWrapper<>();
|
|
|
+ queryWrapper3.eq("farm_id",farmId).ge("create_date", dateTime);
|
|
|
+ queryWrapper3.eq("loction_type" ,3);
|
|
|
+ List<ProCountVo> protData3 = protDataMapper.listTp(queryWrapper3);
|
|
|
proCountDto.setOutList(protData3);
|
|
|
|
|
|
|
|
|
}
|
|
|
}
|
|
|
//TN
|
|
|
- else if ("5".equals(dataType)) {
|
|
|
+ else if ("5".equals(dataType)) {
|
|
|
if ("4".equals(type)) {
|
|
|
startTime = startTime + " 00:00:00";
|
|
|
endTime = endTime + " 23:59:59";
|
|
|
queryWrapper.between("create_date",startTime, endTime);
|
|
|
queryWrapper.eq("loction_type" ,1);
|
|
|
- List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
|
+ List<ProCountVo> protData1 = protDataMapper.listTn(queryWrapper);
|
|
|
proCountDto.setInList(protData1);
|
|
|
|
|
|
- queryWrapper.eq("loction_type" ,2);
|
|
|
- List<ProtData> protData2 = protDataMapper.listPh(queryWrapper);
|
|
|
+ QueryWrapper<ProtData> queryWrapper2 = new QueryWrapper<>();
|
|
|
+ queryWrapper2.eq("farm_id", farmId);
|
|
|
+ queryWrapper2.between("create_date",startTime, endTime);
|
|
|
+ queryWrapper2.eq("loction_type" ,2);
|
|
|
+ List<ProCountVo> protData2 = protDataMapper.listTn(queryWrapper2);
|
|
|
proCountDto.setDealList(protData2);
|
|
|
|
|
|
- queryWrapper.eq("loction_type" ,3);
|
|
|
- List<ProtData> protData3 = protDataMapper.listPh(queryWrapper);
|
|
|
+ QueryWrapper<ProtData> queryWrapper3 = new QueryWrapper<>();
|
|
|
+ queryWrapper3.eq("farm_id", farmId);
|
|
|
+ queryWrapper3.between("create_date",startTime, endTime);
|
|
|
+ queryWrapper3.eq("loction_type" ,3);
|
|
|
+ List<ProCountVo> protData3 = protDataMapper.listTn(queryWrapper3);
|
|
|
+
|
|
|
proCountDto.setOutList(protData3);
|
|
|
|
|
|
|
|
|
+ // protDataList=endList;
|
|
|
}
|
|
|
//本年
|
|
|
else if ("3".equals(type)) {
|
|
|
Calendar dateTime = Calendar.getInstance();
|
|
|
-
|
|
|
+ int i = dateTime.get(Calendar.YEAR);
|
|
|
// DateTime dateTime = DateUtil.beginOfYear(new Date());
|
|
|
- queryWrapper.ge("create_date", dateTime.get(Calendar.YEAR));
|
|
|
+ queryWrapper.ge("create_date", i);
|
|
|
queryWrapper.eq("loction_type" ,1);
|
|
|
- List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
|
+ List<ProCountVo> protData1 = protDataMapper.listTn(queryWrapper);
|
|
|
proCountDto.setInList(protData1);
|
|
|
|
|
|
- queryWrapper.eq("loction_type" ,2);
|
|
|
- List<ProtData> protData2 = protDataMapper.listPh(queryWrapper);
|
|
|
+ QueryWrapper<ProtData> queryWrapper2 = new QueryWrapper<>();
|
|
|
+ queryWrapper2.eq("farm_id",farmId).ge("create_date", i);
|
|
|
+ queryWrapper2.eq("loction_type" ,2);
|
|
|
+ List<ProCountVo> protData2 = protDataMapper.listTn(queryWrapper2);
|
|
|
proCountDto.setDealList(protData2);
|
|
|
|
|
|
- queryWrapper.eq("loction_type" ,3);
|
|
|
- List<ProtData> protData3 = protDataMapper.listPh(queryWrapper);
|
|
|
+ QueryWrapper<ProtData> queryWrapper3 = new QueryWrapper<>();
|
|
|
+ queryWrapper3.eq("farm_id",farmId).ge("create_date", i);
|
|
|
+ queryWrapper3.eq("loction_type" ,3);
|
|
|
+ List<ProCountVo> protData3 = protDataMapper.listTn(queryWrapper3);
|
|
|
proCountDto.setOutList(protData3);
|
|
|
|
|
|
|
|
|
+
|
|
|
}
|
|
|
//本月
|
|
|
else if ("2".equals(type)) {
|
|
|
Date timesMonthmorning = DataUill.getTimesMonthmorning();
|
|
|
queryWrapper.ge("create_date", timesMonthmorning);
|
|
|
queryWrapper.eq("loction_type" ,1);
|
|
|
- List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
|
+ List<ProCountVo> protData1 = protDataMapper.listTn(queryWrapper);
|
|
|
proCountDto.setInList(protData1);
|
|
|
|
|
|
- queryWrapper.eq("loction_type" ,2);
|
|
|
- List<ProtData> protData2 = protDataMapper.listPh(queryWrapper);
|
|
|
+ QueryWrapper<ProtData> queryWrapper2 = new QueryWrapper<>();
|
|
|
+ queryWrapper2.eq("farm_id",farmId).ge("create_date", timesMonthmorning);
|
|
|
+ queryWrapper2.eq("loction_type" ,2);
|
|
|
+ List<ProCountVo> protData2 = protDataMapper.listTn(queryWrapper2);
|
|
|
proCountDto.setDealList(protData2);
|
|
|
|
|
|
- queryWrapper.eq("loction_type" ,3);
|
|
|
- List<ProtData> protData3 = protDataMapper.listPh(queryWrapper);
|
|
|
+ QueryWrapper<ProtData> queryWrapper3 = new QueryWrapper<>();
|
|
|
+ queryWrapper3.eq("farm_id",farmId).ge("create_date", timesMonthmorning);
|
|
|
+ queryWrapper3.eq("loction_type" ,3);
|
|
|
+ List<ProCountVo> protData3 = protDataMapper.listTn(queryWrapper3);
|
|
|
proCountDto.setOutList(protData3);
|
|
|
|
|
|
|
|
@@ -440,17 +543,22 @@ public class ProtDataServiceImpl extends ServiceImpl<ProtDataMapper, ProtData> i
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
calendar.set(Calendar.DATE, calendar.get(Calendar.DATE) - 7);
|
|
|
Date dateTime = calendar.getTime();
|
|
|
+
|
|
|
queryWrapper.ge("create_date", dateTime);
|
|
|
queryWrapper.eq("loction_type" ,1);
|
|
|
- List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
|
+ List<ProCountVo> protData1 = protDataMapper.listTn(queryWrapper);
|
|
|
proCountDto.setInList(protData1);
|
|
|
|
|
|
- queryWrapper.eq("loction_type" ,2);
|
|
|
- List<ProtData> protData2 = protDataMapper.listPh(queryWrapper);
|
|
|
+ QueryWrapper<ProtData> queryWrapper2 = new QueryWrapper<>();
|
|
|
+ queryWrapper2.eq("farm_id",farmId).ge("create_date", dateTime);
|
|
|
+ queryWrapper2.eq("loction_type" ,2);
|
|
|
+ List<ProCountVo> protData2 = protDataMapper.listTn(queryWrapper2);
|
|
|
proCountDto.setDealList(protData2);
|
|
|
|
|
|
- queryWrapper.eq("loction_type" ,3);
|
|
|
- List<ProtData> protData3 = protDataMapper.listPh(queryWrapper);
|
|
|
+ QueryWrapper<ProtData> queryWrapper3 = new QueryWrapper<>();
|
|
|
+ queryWrapper3.eq("farm_id",farmId).ge("create_date", dateTime);
|
|
|
+ queryWrapper3.eq("loction_type" ,3);
|
|
|
+ List<ProCountVo> protData3 = protDataMapper.listTn(queryWrapper3);
|
|
|
proCountDto.setOutList(protData3);
|
|
|
|
|
|
|
|
@@ -463,53 +571,70 @@ public class ProtDataServiceImpl extends ServiceImpl<ProtDataMapper, ProtData> i
|
|
|
endTime = endTime + " 23:59:59";
|
|
|
queryWrapper.between("create_date",startTime, endTime);
|
|
|
queryWrapper.eq("loction_type" ,1);
|
|
|
- List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
|
+ List<ProCountVo> protData1 = protDataMapper.listFlow(queryWrapper);
|
|
|
proCountDto.setInList(protData1);
|
|
|
|
|
|
- queryWrapper.eq("loction_type" ,2);
|
|
|
- List<ProtData> protData2 = protDataMapper.listPh(queryWrapper);
|
|
|
+ QueryWrapper<ProtData> queryWrapper2 = new QueryWrapper<>();
|
|
|
+ queryWrapper2.eq("farm_id", farmId);
|
|
|
+ queryWrapper2.between("create_date",startTime, endTime);
|
|
|
+ queryWrapper2.eq("loction_type" ,2);
|
|
|
+ List<ProCountVo> protData2 = protDataMapper.listFlow(queryWrapper2);
|
|
|
proCountDto.setDealList(protData2);
|
|
|
|
|
|
- queryWrapper.eq("loction_type" ,3);
|
|
|
- List<ProtData> protData3 = protDataMapper.listPh(queryWrapper);
|
|
|
+ QueryWrapper<ProtData> queryWrapper3 = new QueryWrapper<>();
|
|
|
+ queryWrapper3.eq("farm_id", farmId);
|
|
|
+ queryWrapper3.between("create_date",startTime, endTime);
|
|
|
+ queryWrapper3.eq("loction_type" ,3);
|
|
|
+ List<ProCountVo> protData3 = protDataMapper.listFlow(queryWrapper3);
|
|
|
+
|
|
|
proCountDto.setOutList(protData3);
|
|
|
|
|
|
|
|
|
+ // protDataList=endList;
|
|
|
}
|
|
|
//本年
|
|
|
else if ("3".equals(type)) {
|
|
|
Calendar dateTime = Calendar.getInstance();
|
|
|
-
|
|
|
+ int i = dateTime.get(Calendar.YEAR);
|
|
|
// DateTime dateTime = DateUtil.beginOfYear(new Date());
|
|
|
- queryWrapper.ge("create_date", dateTime.get(Calendar.YEAR));
|
|
|
+ queryWrapper.ge("create_date", i);
|
|
|
queryWrapper.eq("loction_type" ,1);
|
|
|
- List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
|
+ List<ProCountVo> protData1 = protDataMapper.listFlow(queryWrapper);
|
|
|
proCountDto.setInList(protData1);
|
|
|
|
|
|
- queryWrapper.eq("loction_type" ,2);
|
|
|
- List<ProtData> protData2 = protDataMapper.listPh(queryWrapper);
|
|
|
+ QueryWrapper<ProtData> queryWrapper2 = new QueryWrapper<>();
|
|
|
+ queryWrapper2.eq("farm_id",farmId).ge("create_date", i);
|
|
|
+ queryWrapper2.eq("loction_type" ,2);
|
|
|
+ List<ProCountVo> protData2 = protDataMapper.listFlow(queryWrapper2);
|
|
|
proCountDto.setDealList(protData2);
|
|
|
|
|
|
- queryWrapper.eq("loction_type" ,3);
|
|
|
- List<ProtData> protData3 = protDataMapper.listPh(queryWrapper);
|
|
|
+ QueryWrapper<ProtData> queryWrapper3 = new QueryWrapper<>();
|
|
|
+ queryWrapper3.eq("farm_id",farmId).ge("create_date", i);
|
|
|
+ queryWrapper3.eq("loction_type" ,3);
|
|
|
+ List<ProCountVo> protData3 = protDataMapper.listFlow(queryWrapper3);
|
|
|
proCountDto.setOutList(protData3);
|
|
|
|
|
|
|
|
|
+
|
|
|
}
|
|
|
//本月
|
|
|
else if ("2".equals(type)) {
|
|
|
Date timesMonthmorning = DataUill.getTimesMonthmorning();
|
|
|
queryWrapper.ge("create_date", timesMonthmorning);
|
|
|
queryWrapper.eq("loction_type" ,1);
|
|
|
- List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
|
+ List<ProCountVo> protData1 = protDataMapper.listFlow(queryWrapper);
|
|
|
proCountDto.setInList(protData1);
|
|
|
|
|
|
- queryWrapper.eq("loction_type" ,2);
|
|
|
- List<ProtData> protData2 = protDataMapper.listPh(queryWrapper);
|
|
|
+ QueryWrapper<ProtData> queryWrapper2 = new QueryWrapper<>();
|
|
|
+ queryWrapper2.eq("farm_id",farmId).ge("create_date", timesMonthmorning);
|
|
|
+ queryWrapper2.eq("loction_type" ,2);
|
|
|
+ List<ProCountVo> protData2 = protDataMapper.listFlow(queryWrapper2);
|
|
|
proCountDto.setDealList(protData2);
|
|
|
|
|
|
- queryWrapper.eq("loction_type" ,3);
|
|
|
- List<ProtData> protData3 = protDataMapper.listPh(queryWrapper);
|
|
|
+ QueryWrapper<ProtData> queryWrapper3 = new QueryWrapper<>();
|
|
|
+ queryWrapper3.eq("farm_id",farmId).ge("create_date", timesMonthmorning);
|
|
|
+ queryWrapper3.eq("loction_type" ,3);
|
|
|
+ List<ProCountVo> protData3 = protDataMapper.listFlow(queryWrapper3);
|
|
|
proCountDto.setOutList(protData3);
|
|
|
|
|
|
|
|
@@ -519,17 +644,22 @@ public class ProtDataServiceImpl extends ServiceImpl<ProtDataMapper, ProtData> i
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
calendar.set(Calendar.DATE, calendar.get(Calendar.DATE) - 7);
|
|
|
Date dateTime = calendar.getTime();
|
|
|
+
|
|
|
queryWrapper.ge("create_date", dateTime);
|
|
|
queryWrapper.eq("loction_type" ,1);
|
|
|
- List<ProtData> protData1 = protDataMapper.listPh(queryWrapper);
|
|
|
+ List<ProCountVo> protData1 = protDataMapper.listFlow(queryWrapper);
|
|
|
proCountDto.setInList(protData1);
|
|
|
|
|
|
- queryWrapper.eq("loction_type" ,2);
|
|
|
- List<ProtData> protData2 = protDataMapper.listPh(queryWrapper);
|
|
|
+ QueryWrapper<ProtData> queryWrapper2 = new QueryWrapper<>();
|
|
|
+ queryWrapper2.eq("farm_id",farmId).ge("create_date", dateTime);
|
|
|
+ queryWrapper2.eq("loction_type" ,2);
|
|
|
+ List<ProCountVo> protData2 = protDataMapper.listFlow(queryWrapper2);
|
|
|
proCountDto.setDealList(protData2);
|
|
|
|
|
|
- queryWrapper.eq("loction_type" ,3);
|
|
|
- List<ProtData> protData3 = protDataMapper.listPh(queryWrapper);
|
|
|
+ QueryWrapper<ProtData> queryWrapper3 = new QueryWrapper<>();
|
|
|
+ queryWrapper3.eq("farm_id",farmId).ge("create_date", dateTime);
|
|
|
+ queryWrapper3.eq("loction_type" ,3);
|
|
|
+ List<ProCountVo> protData3 = protDataMapper.listFlow(queryWrapper3);
|
|
|
proCountDto.setOutList(protData3);
|
|
|
|
|
|
|