fix: 优化过鱼倒数统计
This commit is contained in:
parent
4ba5a2c05d
commit
eb4cb28b39
@ -9,9 +9,11 @@ public interface FishStatisticsMapper {
|
|||||||
|
|
||||||
List<FishStatisticsVO> queryStatistics(@Param("basinCode") String basinCode,
|
List<FishStatisticsVO> queryStatistics(@Param("basinCode") String basinCode,
|
||||||
@Param("stationCode") String stationCode,
|
@Param("stationCode") String stationCode,
|
||||||
|
@Param("reportMonth") String reportMonth,
|
||||||
@Param("startRow") int startRow,
|
@Param("startRow") int startRow,
|
||||||
@Param("endRow") int endRow);
|
@Param("endRow") int endRow);
|
||||||
|
|
||||||
int countStatistics(@Param("basinCode") String basinCode,
|
int countStatistics(@Param("basinCode") String basinCode,
|
||||||
@Param("stationCode") String stationCode);
|
@Param("stationCode") String stationCode,
|
||||||
}
|
@Param("reportMonth") String reportMonth);
|
||||||
|
}
|
||||||
|
|||||||
@ -12,6 +12,8 @@ import jakarta.annotation.Resource;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -29,6 +31,10 @@ public class FishStatisticsServiceImpl implements IFishStatisticsService {
|
|||||||
|
|
||||||
String basinNamesStr = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "basinCode");
|
String basinNamesStr = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "basinCode");
|
||||||
String stationNamesStr = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "stationCode");
|
String stationNamesStr = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "stationCode");
|
||||||
|
String reportMonth = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "reportMonth");
|
||||||
|
if (StrUtil.isBlank(reportMonth)) {
|
||||||
|
reportMonth = LocalDate.now().minusMonths(1).format(DateTimeFormatter.ofPattern("yyyy-MM"));
|
||||||
|
}
|
||||||
|
|
||||||
// List<String> basinNames = parseFilterList(basinNamesStr);
|
// List<String> basinNames = parseFilterList(basinNamesStr);
|
||||||
// List<String> stationNames = parseFilterList(stationNamesStr);
|
// List<String> stationNames = parseFilterList(stationNamesStr);
|
||||||
@ -47,9 +53,9 @@ public class FishStatisticsServiceImpl implements IFishStatisticsService {
|
|||||||
int endRow = startRow + pageSize;
|
int endRow = startRow + pageSize;
|
||||||
|
|
||||||
List<FishStatisticsVO> records = fishStatisticsMapper.queryStatistics(
|
List<FishStatisticsVO> records = fishStatisticsMapper.queryStatistics(
|
||||||
basinNamesStr, stationNamesStr, startRow, endRow);
|
basinNamesStr, stationNamesStr, reportMonth, startRow, endRow);
|
||||||
|
|
||||||
int total = fishStatisticsMapper.countStatistics(basinNamesStr, basinNamesStr);
|
int total = fishStatisticsMapper.countStatistics(basinNamesStr, stationNamesStr, reportMonth);
|
||||||
|
|
||||||
Page<FishStatisticsVO> page = new Page<>();
|
Page<FishStatisticsVO> page = new Page<>();
|
||||||
page.setRecords(records);
|
page.setRecords(records);
|
||||||
@ -66,4 +72,4 @@ public class FishStatisticsServiceImpl implements IFishStatisticsService {
|
|||||||
}
|
}
|
||||||
return Arrays.asList(filterValue.split(","));
|
return Arrays.asList(filterValue.split(","));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -167,6 +167,9 @@
|
|||||||
FROM FISH_DRAFT_DATA
|
FROM FISH_DRAFT_DATA
|
||||||
WHERE DELETED_FLAG = 0
|
WHERE DELETED_FLAG = 0
|
||||||
AND STATUS IN ('PENDING','APPROVED')
|
AND STATUS IN ('PENDING','APPROVED')
|
||||||
|
<if test="reportMonth != null and reportMonth != ''">
|
||||||
|
AND TO_CHAR(STRDT, 'YYYY-MM') = #{reportMonth}
|
||||||
|
</if>
|
||||||
GROUP BY CREATED_BY, TO_CHAR(STRDT, 'YYYY-MM')
|
GROUP BY CREATED_BY, TO_CHAR(STRDT, 'YYYY-MM')
|
||||||
),
|
),
|
||||||
|
|
||||||
@ -186,7 +189,7 @@
|
|||||||
sa.MIN_STATION_CODE,
|
sa.MIN_STATION_CODE,
|
||||||
ba.BASIN_NAMES,
|
ba.BASIN_NAMES,
|
||||||
sa.STATION_NAMES,
|
sa.STATION_NAMES,
|
||||||
fm.REPORT_MONTH,
|
NVL(fm.REPORT_MONTH, #{reportMonth}) AS REPORT_MONTH,
|
||||||
fm.MIN_STRDT,
|
fm.MIN_STRDT,
|
||||||
fm.MAX_ENDDT,
|
fm.MAX_ENDDT,
|
||||||
fm.TOTAL_FCNT,
|
fm.TOTAL_FCNT,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user