fix: 分页查询过鱼数据(关联电站和设施)优化
This commit is contained in:
parent
94a587774f
commit
df2c74c5e0
@ -202,6 +202,11 @@ public class FishDraftDataVO implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private String rvcd;
|
private String rvcd;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流域名称(全路径)
|
||||||
|
*/
|
||||||
|
private String rvnm;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 电站经度(电站表)
|
* 电站经度(电站表)
|
||||||
*/
|
*/
|
||||||
@ -241,4 +246,4 @@ public class FishDraftDataVO implements Serializable {
|
|||||||
* 基地流域编码
|
* 基地流域编码
|
||||||
*/
|
*/
|
||||||
private String hbrvnm;
|
private String hbrvnm;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,6 +23,7 @@ public interface FishDraftDataMapper extends BaseMapper<FishDraftData> {
|
|||||||
@Param("stcd") String stcd,
|
@Param("stcd") String stcd,
|
||||||
@Param("rstcd") String rstcd,
|
@Param("rstcd") String rstcd,
|
||||||
@Param("baseId") String baseId,
|
@Param("baseId") String baseId,
|
||||||
|
@Param("rvcd") String rvcd,
|
||||||
@Param("direction") String direction,
|
@Param("direction") String direction,
|
||||||
@Param("status") String status,
|
@Param("status") String status,
|
||||||
@Param("ftp") String ftp,
|
@Param("ftp") String ftp,
|
||||||
@ -38,6 +39,7 @@ public interface FishDraftDataMapper extends BaseMapper<FishDraftData> {
|
|||||||
List<FishDraftDataVO> selectJoinList(@Param("stcd") String stcd,
|
List<FishDraftDataVO> selectJoinList(@Param("stcd") String stcd,
|
||||||
@Param("rstcd") String rstcd,
|
@Param("rstcd") String rstcd,
|
||||||
@Param("baseId") String baseId,
|
@Param("baseId") String baseId,
|
||||||
|
@Param("rvcd") String rvcd,
|
||||||
@Param("direction") String direction,
|
@Param("direction") String direction,
|
||||||
@Param("status") String status,
|
@Param("status") String status,
|
||||||
@Param("ftp") String ftp,
|
@Param("ftp") String ftp,
|
||||||
@ -79,4 +81,4 @@ public interface FishDraftDataMapper extends BaseMapper<FishDraftData> {
|
|||||||
*/
|
*/
|
||||||
@Select("SELECT COUNT(*) FROM FISH_DRAFT_DATA WHERE APPROVAL_ID = #{approvalId}")
|
@Select("SELECT COUNT(*) FROM FISH_DRAFT_DATA WHERE APPROVAL_ID = #{approvalId}")
|
||||||
int countByApprovalId(@Param("approvalId") Long approvalId);
|
int countByApprovalId(@Param("approvalId") Long approvalId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -89,6 +89,7 @@ public class FishDraftDataServiceImpl extends ServiceImpl<FishDraftDataMapper, F
|
|||||||
String approvalId = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "approvalId");
|
String approvalId = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "approvalId");
|
||||||
String rstcd = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "rstcd");
|
String rstcd = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "rstcd");
|
||||||
String hbrvcd = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "hbrvcd");
|
String hbrvcd = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "hbrvcd");
|
||||||
|
String rvcd = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "rvcd");
|
||||||
String baseId = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "baseId");
|
String baseId = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "baseId");
|
||||||
String ftp = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "ftp");
|
String ftp = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "ftp");
|
||||||
String direction = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "direction");
|
String direction = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "direction");
|
||||||
@ -106,7 +107,7 @@ public class FishDraftDataServiceImpl extends ServiceImpl<FishDraftDataMapper, F
|
|||||||
startTime=STRDT.split(",")[0];
|
startTime=STRDT.split(",")[0];
|
||||||
endTime=STRDT.split(",")[1];
|
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());
|
fillUserNames(resultPage.getRecords());
|
||||||
return resultPage;
|
return resultPage;
|
||||||
}
|
}
|
||||||
@ -117,13 +118,14 @@ public class FishDraftDataServiceImpl extends ServiceImpl<FishDraftDataMapper, F
|
|||||||
String stcd = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "stcd");
|
String stcd = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "stcd");
|
||||||
String rstcd = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "rstcd");
|
String rstcd = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "rstcd");
|
||||||
String baseId = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "baseId");
|
String baseId = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "baseId");
|
||||||
|
String rvcd = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "rvcd");
|
||||||
String direction = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "direction");
|
String direction = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "direction");
|
||||||
String status = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "status");
|
String status = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "status");
|
||||||
String ftp = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "ftp");
|
String ftp = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "ftp");
|
||||||
String startTime = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "startTime");
|
String startTime = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "startTime");
|
||||||
String endTime = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "endTime");
|
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);
|
fillUserNames(list);
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
@ -665,4 +667,4 @@ public class FishDraftDataServiceImpl extends ServiceImpl<FishDraftDataMapper, F
|
|||||||
log.info("批量保存草稿完成, 共{}条, 耗时{}ms", fishDraftDataList.size(), System.currentTimeMillis() - start);
|
log.info("批量保存草稿完成, 共{}条, 耗时{}ms", fishDraftDataList.size(), System.currentTimeMillis() - start);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -76,6 +76,7 @@
|
|||||||
<result column="HBRVCD" property="hbrvcd"/>
|
<result column="HBRVCD" property="hbrvcd"/>
|
||||||
<result column="HBRVNM" property="hbrvnm"/>
|
<result column="HBRVNM" property="hbrvnm"/>
|
||||||
<result column="RVCD" property="rvcd"/>
|
<result column="RVCD" property="rvcd"/>
|
||||||
|
<result column="RVNM" property="rvnm"/>
|
||||||
<result column="LGTD" property="lgtd"/>
|
<result column="LGTD" property="lgtd"/>
|
||||||
<result column="LTTD" property="lttd"/>
|
<result column="LTTD" property="lttd"/>
|
||||||
<result column="ROW_INDEX" property="rowIndex"/>
|
<result column="ROW_INDEX" property="rowIndex"/>
|
||||||
@ -85,7 +86,7 @@
|
|||||||
D.ID,
|
D.ID,
|
||||||
D.STCD,
|
D.STCD,
|
||||||
E.HBRVCD,
|
E.HBRVCD,
|
||||||
G.HBRVNM,
|
NULL AS HBRVNM,
|
||||||
D.TM,
|
D.TM,
|
||||||
D.FTP,
|
D.FTP,
|
||||||
FB.NAME FTPNAME,
|
FB.NAME FTPNAME,
|
||||||
@ -120,13 +121,27 @@
|
|||||||
E.ENNM,
|
E.ENNM,
|
||||||
E.BASE_ID,
|
E.BASE_ID,
|
||||||
H.BASENAME,
|
H.BASENAME,
|
||||||
E.RVCD,
|
E.REACHCD AS RVCD,
|
||||||
|
R.RVNM,
|
||||||
E.LGTD,
|
E.LGTD,
|
||||||
E.LTTD,
|
E.LTTD,
|
||||||
E.ORDER_INDEX,
|
E.ORDER_INDEX,
|
||||||
D.ROW_INDEX
|
D.ROW_INDEX
|
||||||
</sql>
|
</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 id="selectJoinPage" resultMap="JoinResultMap">
|
||||||
SELECT
|
SELECT
|
||||||
<include refid="joinColumns"/>
|
<include refid="joinColumns"/>
|
||||||
@ -135,7 +150,7 @@
|
|||||||
LEFT JOIN SD_FISHDICTORY_B FB ON FB.ID = D.FTP
|
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_ENGINFO_B_H E ON F.RSTCD = E.STCD
|
||||||
LEFT JOIN SD_HYDROBASE H ON E.BASE_ID = H.BASEID
|
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
|
WHERE D.DELETED_FLAG = 0
|
||||||
<if test="stcd != null and stcd != ''">
|
<if test="stcd != null and stcd != ''">
|
||||||
AND D.STCD = #{stcd}
|
AND D.STCD = #{stcd}
|
||||||
@ -152,6 +167,9 @@
|
|||||||
<if test="baseId != null and baseId != ''">
|
<if test="baseId != null and baseId != ''">
|
||||||
AND E.BASE_ID = #{baseId}
|
AND E.BASE_ID = #{baseId}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="rvcd != null and rvcd != ''">
|
||||||
|
AND E.REACHCD = #{rvcd}
|
||||||
|
</if>
|
||||||
<if test="hbrvcd != null and hbrvcd != ''">
|
<if test="hbrvcd != null and hbrvcd != ''">
|
||||||
AND E.HBRVCD = #{hbrvcd}
|
AND E.HBRVCD = #{hbrvcd}
|
||||||
</if>
|
</if>
|
||||||
@ -178,7 +196,10 @@
|
|||||||
<include refid="joinColumns"/>
|
<include refid="joinColumns"/>
|
||||||
FROM FISH_DRAFT_DATA D
|
FROM FISH_DRAFT_DATA D
|
||||||
LEFT JOIN SD_FPSS_B_H F ON D.STCD = F.STCD
|
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_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
|
WHERE D.DELETED_FLAG = 0
|
||||||
<if test="stcd != null and stcd != ''">
|
<if test="stcd != null and stcd != ''">
|
||||||
AND D.STCD = #{stcd}
|
AND D.STCD = #{stcd}
|
||||||
@ -192,6 +213,9 @@
|
|||||||
<if test="baseId != null and baseId != ''">
|
<if test="baseId != null and baseId != ''">
|
||||||
AND E.BASE_ID = #{baseId}
|
AND E.BASE_ID = #{baseId}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="rvcd != null and rvcd != ''">
|
||||||
|
AND E.REACHCD = #{rvcd}
|
||||||
|
</if>
|
||||||
<if test="direction != null and direction != ''">
|
<if test="direction != null and direction != ''">
|
||||||
AND D.DIRECTION = #{direction}
|
AND D.DIRECTION = #{direction}
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user