fix: 分页查询过鱼数据(关联电站和设施)优化

This commit is contained in:
tangwei 2026-06-05 17:02:34 +08:00
parent 94a587774f
commit df2c74c5e0
4 changed files with 41 additions and 8 deletions

View File

@ -202,6 +202,11 @@ public class FishDraftDataVO implements Serializable {
*/
private String rvcd;
/**
* 流域名称全路径
*/
private String rvnm;
/**
* 电站经度电站表
*/

View File

@ -23,6 +23,7 @@ public interface FishDraftDataMapper extends BaseMapper<FishDraftData> {
@Param("stcd") String stcd,
@Param("rstcd") String rstcd,
@Param("baseId") String baseId,
@Param("rvcd") String rvcd,
@Param("direction") String direction,
@Param("status") String status,
@Param("ftp") String ftp,
@ -38,6 +39,7 @@ public interface FishDraftDataMapper extends BaseMapper<FishDraftData> {
List<FishDraftDataVO> selectJoinList(@Param("stcd") String stcd,
@Param("rstcd") String rstcd,
@Param("baseId") String baseId,
@Param("rvcd") String rvcd,
@Param("direction") String direction,
@Param("status") String status,
@Param("ftp") String ftp,

View File

@ -89,6 +89,7 @@ public class FishDraftDataServiceImpl extends ServiceImpl<FishDraftDataMapper, F
String approvalId = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "approvalId");
String rstcd = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "rstcd");
String hbrvcd = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "hbrvcd");
String rvcd = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "rvcd");
String baseId = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "baseId");
String ftp = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "ftp");
String direction = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "direction");
@ -106,7 +107,7 @@ public class FishDraftDataServiceImpl extends ServiceImpl<FishDraftDataMapper, F
startTime=STRDT.split(",")[0];
endTime=STRDT.split(",")[1];
}
Page<FishDraftDataVO> resultPage = fishDraftDataMapper.selectJoinPage(page, stcd, rstcd, baseId, direction, status, ftp, startTime, endTime,userId,hbrvcd,approvalId);
Page<FishDraftDataVO> resultPage = fishDraftDataMapper.selectJoinPage(page, stcd, rstcd, baseId, rvcd, direction, status, ftp, startTime, endTime,userId,hbrvcd,approvalId);
fillUserNames(resultPage.getRecords());
return resultPage;
}
@ -117,13 +118,14 @@ public class FishDraftDataServiceImpl extends ServiceImpl<FishDraftDataMapper, F
String stcd = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "stcd");
String rstcd = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "rstcd");
String baseId = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "baseId");
String rvcd = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "rvcd");
String direction = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "direction");
String status = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "status");
String ftp = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "ftp");
String startTime = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "startTime");
String endTime = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "endTime");
List<FishDraftDataVO> list = fishDraftDataMapper.selectJoinList(stcd, rstcd, baseId, direction, status, ftp, startTime, endTime);
List<FishDraftDataVO> list = fishDraftDataMapper.selectJoinList(stcd, rstcd, baseId, rvcd, direction, status, ftp, startTime, endTime);
fillUserNames(list);
return list;
}

View File

@ -76,6 +76,7 @@
<result column="HBRVCD" property="hbrvcd"/>
<result column="HBRVNM" property="hbrvnm"/>
<result column="RVCD" property="rvcd"/>
<result column="RVNM" property="rvnm"/>
<result column="LGTD" property="lgtd"/>
<result column="LTTD" property="lttd"/>
<result column="ROW_INDEX" property="rowIndex"/>
@ -85,7 +86,7 @@
D.ID,
D.STCD,
E.HBRVCD,
G.HBRVNM,
NULL AS HBRVNM,
D.TM,
D.FTP,
FB.NAME FTPNAME,
@ -120,13 +121,27 @@
E.ENNM,
E.BASE_ID,
H.BASENAME,
E.RVCD,
E.REACHCD AS RVCD,
R.RVNM,
E.LGTD,
E.LTTD,
E.ORDER_INDEX,
D.ROW_INDEX
</sql>
<sql id="rvcdDisplayJoin">
LEFT JOIN (
SELECT
d.RVCD,
LTRIM(SYS_CONNECT_BY_PATH(d.RVNM, '-'), '-') AS RVNM
FROM SD_RVCD_DIC d
WHERE NVL(d.ENABLED, 1) = 1
AND NVL(d.IS_DELETED, 0) = 0
START WITH d.PRVCD IS NULL OR d.PRVCD = '' OR d.PRVCD = '0'
CONNECT BY PRIOR d.RVCD = d.PRVCD
) R ON R.RVCD = E.REACHCD
</sql>
<select id="selectJoinPage" resultMap="JoinResultMap">
SELECT
<include refid="joinColumns"/>
@ -135,7 +150,7 @@
LEFT JOIN SD_FISHDICTORY_B FB ON FB.ID = D.FTP
LEFT JOIN SD_ENGINFO_B_H E ON F.RSTCD = E.STCD
LEFT JOIN SD_HYDROBASE H ON E.BASE_ID = H.BASEID
LEFT JOIN SD_HBRV_DIC G ON G.HBRVCD = E.HBRVCD
<include refid="rvcdDisplayJoin"/>
WHERE D.DELETED_FLAG = 0
<if test="stcd != null and stcd != ''">
AND D.STCD = #{stcd}
@ -152,6 +167,9 @@
<if test="baseId != null and baseId != ''">
AND E.BASE_ID = #{baseId}
</if>
<if test="rvcd != null and rvcd != ''">
AND E.REACHCD = #{rvcd}
</if>
<if test="hbrvcd != null and hbrvcd != ''">
AND E.HBRVCD = #{hbrvcd}
</if>
@ -178,7 +196,10 @@
<include refid="joinColumns"/>
FROM FISH_DRAFT_DATA D
LEFT JOIN SD_FPSS_B_H F ON D.STCD = F.STCD
LEFT JOIN SD_FISHDICTORY_B FB ON FB.ID = D.FTP
LEFT JOIN SD_ENGINFO_B_H E ON F.RSTCD = E.STCD
LEFT JOIN SD_HYDROBASE H ON E.BASE_ID = H.BASEID
<include refid="rvcdDisplayJoin"/>
WHERE D.DELETED_FLAG = 0
<if test="stcd != null and stcd != ''">
AND D.STCD = #{stcd}
@ -192,6 +213,9 @@
<if test="baseId != null and baseId != ''">
AND E.BASE_ID = #{baseId}
</if>
<if test="rvcd != null and rvcd != ''">
AND E.REACHCD = #{rvcd}
</if>
<if test="direction != null and direction != ''">
AND D.DIRECTION = #{direction}
</if>