fix: 优化过鱼设施倒数统计优化
This commit is contained in:
parent
23e1e80cb4
commit
ab4f40ed56
@ -112,8 +112,9 @@ public class FishDraftDataController {
|
|||||||
|
|
||||||
@PostMapping("/statistics")
|
@PostMapping("/statistics")
|
||||||
@Operation(summary = "过鱼到数统计(按用户月度汇总,支持流域/电站多选过滤)")
|
@Operation(summary = "过鱼到数统计(按用户月度汇总,支持流域/电站多选过滤)")
|
||||||
public ResponseResult statistics(@RequestBody DataSourceRequest dataSourceRequest) {
|
public ResponseResult statistics(@RequestBody DataSourceRequest dataSourceRequest,
|
||||||
Page<FishStatisticsVO> result = fishStatisticsService.queryPage(dataSourceRequest);
|
@RequestHeader(value = "Tenant_id", required = false) String tenantId) {
|
||||||
|
Page<FishStatisticsVO> result = fishStatisticsService.queryPage(dataSourceRequest, tenantId);
|
||||||
return ResponseResult.successData(result);
|
return ResponseResult.successData(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -10,10 +10,12 @@ 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("reportMonth") String reportMonth,
|
||||||
|
@Param("tenantId") String tenantId,
|
||||||
@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);
|
@Param("reportMonth") String reportMonth,
|
||||||
|
@Param("tenantId") String tenantId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,5 +6,5 @@ import com.yfd.platform.qgc_data.domain.vo.FishStatisticsVO;
|
|||||||
|
|
||||||
public interface IFishStatisticsService {
|
public interface IFishStatisticsService {
|
||||||
|
|
||||||
Page<FishStatisticsVO> queryPage(DataSourceRequest dataSourceRequest);
|
Page<FishStatisticsVO> queryPage(DataSourceRequest dataSourceRequest, String tenantId);
|
||||||
}
|
}
|
||||||
@ -26,7 +26,7 @@ public class FishStatisticsServiceImpl implements IFishStatisticsService {
|
|||||||
private FishStatisticsMapper fishStatisticsMapper;
|
private FishStatisticsMapper fishStatisticsMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<FishStatisticsVO> queryPage(DataSourceRequest dataSourceRequest) {
|
public Page<FishStatisticsVO> queryPage(DataSourceRequest dataSourceRequest, String tenantId) {
|
||||||
DataSourceLoadOptionsBase loadOptions = dataSourceRequest.toDevRequest();
|
DataSourceLoadOptionsBase loadOptions = dataSourceRequest.toDevRequest();
|
||||||
|
|
||||||
String basinNamesStr = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "basinCode");
|
String basinNamesStr = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "basinCode");
|
||||||
@ -53,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, reportMonth, startRow, endRow);
|
basinNamesStr, stationNamesStr, reportMonth, tenantId, startRow, endRow);
|
||||||
|
|
||||||
int total = fishStatisticsMapper.countStatistics(basinNamesStr, stationNamesStr, reportMonth);
|
int total = fishStatisticsMapper.countStatistics(basinNamesStr, stationNamesStr, reportMonth, tenantId);
|
||||||
|
|
||||||
Page<FishStatisticsVO> page = new Page<>();
|
Page<FishStatisticsVO> page = new Page<>();
|
||||||
page.setRecords(records);
|
page.setRecords(records);
|
||||||
|
|||||||
@ -115,6 +115,9 @@
|
|||||||
<if test="stationCode != null and stationCode != ''">
|
<if test="stationCode != null and stationCode != ''">
|
||||||
AND STATION_CODE = #{stationCode}
|
AND STATION_CODE = #{stationCode}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="tenantId != null and tenantId != ''">
|
||||||
|
AND USER_ID IN (SELECT USER_ID FROM SYS_USER_TENANT WHERE TENANT_ID = #{tenantId})
|
||||||
|
</if>
|
||||||
</where>
|
</where>
|
||||||
),
|
),
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user