fix: 过鱼填报逻辑优化

This commit is contained in:
tangwei 2026-06-05 13:54:32 +08:00
parent d20269b156
commit 4522383206
3 changed files with 16 additions and 4 deletions

View File

@ -44,7 +44,10 @@ public interface SdEngInfoBHMapper extends BaseMapper<SdEngInfoBH> {
* 根据基地流域编码列表批量查询电站 * 根据基地流域编码列表批量查询电站
*/ */
List<SdEngInfoBH> selectByRvcdList(@Param("rvcdList") List<String> rvcdList); List<SdEngInfoBH> selectByRvcdList(@Param("rvcdList") List<String> rvcdList);
/**
* 根据基地流域编码列表批量查询电站
*/
List<SdEngInfoBH> selectByReachcdList(@Param("rvcdList") List<String> rvcdList);
List<StationBasinInfo> selectStationBasinInfo(); List<StationBasinInfo> selectStationBasinInfo();
} }

View File

@ -215,7 +215,7 @@ public class FishImportServiceImpl implements IFishImportService {
if (!allowedRvcdSet.isEmpty() || !directStcdSet.isEmpty()) { if (!allowedRvcdSet.isEmpty() || !directStcdSet.isEmpty()) {
if (!allowedRvcdSet.isEmpty()) { if (!allowedRvcdSet.isEmpty()) {
List<SdEngInfoBH> stationsFromHbrv = engInfoBHMapper.selectByRvcdList(new ArrayList<>(allowedRvcdSet)); List<SdEngInfoBH> stationsFromHbrv = engInfoBHMapper.selectByReachcdList(new ArrayList<>(allowedRvcdSet));
for (SdEngInfoBH station : stationsFromHbrv) { for (SdEngInfoBH station : stationsFromHbrv) {
if (station.getStcd() != null) { if (station.getStcd() != null) {
directStcdSet.add(station.getStcd()); directStcdSet.add(station.getStcd());
@ -230,7 +230,7 @@ public class FishImportServiceImpl implements IFishImportService {
directStcdSet.add(station.getStcd()); directStcdSet.add(station.getStcd());
} }
if (station.getRvcd() != null) { if (station.getRvcd() != null) {
allowedRvcdSet.add(station.getRvcd()); allowedRvcdSet.add(station.getReachcd());
} }
} }
} }
@ -1146,7 +1146,7 @@ public class FishImportServiceImpl implements IFishImportService {
return findFirst(engInfoBHMapper.selectList(new LambdaQueryWrapper<SdEngInfoBH>() return findFirst(engInfoBHMapper.selectList(new LambdaQueryWrapper<SdEngInfoBH>()
.select(SdEngInfoBH::getStcd) .select(SdEngInfoBH::getStcd)
.eq(SdEngInfoBH::getStcd, normalizedStationCode) .eq(SdEngInfoBH::getStcd, normalizedStationCode)
.eq(SdEngInfoBH::getRvcd, normalizedRvcd))) != null; .eq(SdEngInfoBH::getReachcd, normalizedRvcd))) != null;
} }
@Override @Override

View File

@ -331,5 +331,14 @@
ORDER BY HBRVCD, ORDER_INDEX ASC ORDER BY HBRVCD, ORDER_INDEX ASC
</select> </select>
<select id="selectByReachcdList" resultMap="BaseResultMap">
SELECT * FROM SD_ENGINFO_B_H
WHERE REACHCD IN
<foreach collection="rvcdList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
ORDER BY RVCD, ORDER_INDEX ASC
</select>
</mapper> </mapper>