fix: 优化过鱼设施草稿表数据
This commit is contained in:
parent
daea0c3139
commit
89f2b34d56
@ -1,18 +1,17 @@
|
||||
package com.yfd.platform.data.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.yfd.platform.common.DataSourceLoadOptionsBase;
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.config.ResponseResult;
|
||||
import com.yfd.platform.data.domain.FishDraftData;
|
||||
import com.yfd.platform.data.domain.FishImportRequest;
|
||||
import com.yfd.platform.data.domain.FishImportResult;
|
||||
import com.yfd.platform.data.domain.ImportTask;
|
||||
import com.yfd.platform.data.domain.vo.FishDraftDataVO;
|
||||
import com.yfd.platform.data.service.IFishDraftDataService;
|
||||
import com.yfd.platform.data.service.IFishImportService;
|
||||
import com.yfd.platform.data.service.IImportTaskService;
|
||||
import com.yfd.platform.utils.KendoUtil;
|
||||
import com.yfd.platform.utils.QgcQueryWrapperUtil;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
@ -44,17 +43,16 @@ public class FishDraftDataController {
|
||||
private IImportTaskService importTaskService;
|
||||
|
||||
@PostMapping("/page")
|
||||
@Operation(summary = "分页查询过鱼数据")
|
||||
@Operation(summary = "分页查询过鱼数据(关联电站和设施)")
|
||||
public ResponseResult queryPageList(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
Page page = KendoUtil.getPage(dataSourceRequest);
|
||||
Page<FishDraftData> result = fishDraftDataService.queryPageList(page, dataSourceRequest);
|
||||
Page<FishDraftDataVO> result = fishDraftDataService.queryPageList( dataSourceRequest);
|
||||
return ResponseResult.successData(result);
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "查询过鱼数据列表")
|
||||
public ResponseResult list() {
|
||||
List<FishDraftData> list = fishDraftDataService.list();
|
||||
@PostMapping("/list")
|
||||
@Operation(summary = "查询过鱼数据列表(关联电站和设施,不分页)")
|
||||
public ResponseResult list(@RequestBody DataSourceRequest dataSourceRequest) {
|
||||
List<FishDraftDataVO> list = fishDraftDataService.queryJoinList(dataSourceRequest);
|
||||
return ResponseResult.successData(list);
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,202 @@
|
||||
package com.yfd.platform.data.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 过鱼数据关联查询VO
|
||||
* </p>
|
||||
*/
|
||||
@Data
|
||||
public class FishDraftDataVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 过鱼设施编码
|
||||
*/
|
||||
private String stcd;
|
||||
|
||||
/**
|
||||
* 填报时间
|
||||
*/
|
||||
private Date tm;
|
||||
|
||||
/**
|
||||
* 鱼类
|
||||
*/
|
||||
private String ftp;
|
||||
|
||||
/**
|
||||
* 鱼类全长
|
||||
*/
|
||||
private String fsz;
|
||||
|
||||
/**
|
||||
* 过鱼数量
|
||||
*/
|
||||
private Integer fcnt;
|
||||
|
||||
/**
|
||||
* 平均体重
|
||||
*/
|
||||
private String fwet;
|
||||
|
||||
/**
|
||||
* 开始日期
|
||||
*/
|
||||
private Date strdt;
|
||||
|
||||
/**
|
||||
* 结束日期
|
||||
*/
|
||||
private Date enddt;
|
||||
|
||||
/**
|
||||
* 游向(上行/下行/上行折返/下行折返)
|
||||
*/
|
||||
private String direction;
|
||||
|
||||
/**
|
||||
* 年份
|
||||
*/
|
||||
private Integer yr;
|
||||
|
||||
/**
|
||||
* 主要月份
|
||||
*/
|
||||
private Integer mouth;
|
||||
|
||||
/**
|
||||
* 过鱼视频文件路径
|
||||
*/
|
||||
private String vdpth;
|
||||
|
||||
/**
|
||||
* 图片文件路径
|
||||
*/
|
||||
private String picpth;
|
||||
|
||||
/**
|
||||
* 是否鱼苗(0否 1是)
|
||||
*/
|
||||
private Integer isfs;
|
||||
|
||||
/**
|
||||
* 数据来源(MANUAL手工 / IMPORT导入 / AUTO自动)
|
||||
*/
|
||||
private String sourceType;
|
||||
|
||||
/**
|
||||
* 审批批次ID
|
||||
*/
|
||||
private Long approvalId;
|
||||
|
||||
/**
|
||||
* 状态(DRAFT未提交 / SUBMITTED已提交 / APPROVED已通过 / REJECTED已驳回)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 锁定标识(1锁定不可编辑 0可编辑)
|
||||
*/
|
||||
private Integer lockFlag;
|
||||
|
||||
/**
|
||||
* 提交审批时间
|
||||
*/
|
||||
private Date submitTime;
|
||||
|
||||
/**
|
||||
* 审批完成时间
|
||||
*/
|
||||
private Date approveTime;
|
||||
|
||||
/**
|
||||
* 删除标记(0未删除 1已删除)
|
||||
*/
|
||||
private Integer deletedFlag;
|
||||
|
||||
/**
|
||||
* 删除人
|
||||
*/
|
||||
private String deletedBy;
|
||||
|
||||
/**
|
||||
* 删除时间
|
||||
*/
|
||||
private Date deletedAt;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createdAt;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createdBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updatedAt;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
private String updatedBy;
|
||||
|
||||
/**
|
||||
* 设施名称(过鱼设施表)
|
||||
*/
|
||||
private String stnm;
|
||||
|
||||
/**
|
||||
* 过鱼设施类型(过鱼设施表)
|
||||
*/
|
||||
private String sttp;
|
||||
|
||||
/**
|
||||
* 所属电站编码(过鱼设施表)
|
||||
*/
|
||||
private String rstcd;
|
||||
|
||||
/**
|
||||
* 电站名称(电站表)
|
||||
*/
|
||||
private String ennm;
|
||||
|
||||
/**
|
||||
* 所属基地编码(电站表)
|
||||
*/
|
||||
private String baseId;
|
||||
|
||||
/**
|
||||
* 流域编码(电站表)
|
||||
*/
|
||||
private String rvcd;
|
||||
|
||||
/**
|
||||
* 电站经度(电站表)
|
||||
*/
|
||||
private Double lgtd;
|
||||
|
||||
/**
|
||||
* 电站纬度(电站表)
|
||||
*/
|
||||
private Double lttd;
|
||||
|
||||
/**
|
||||
* 排序字段
|
||||
*/
|
||||
private Integer orderIndex;
|
||||
}
|
||||
@ -1,7 +1,9 @@
|
||||
package com.yfd.platform.data.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.yfd.platform.data.domain.FishDraftData;
|
||||
import com.yfd.platform.data.domain.vo.FishDraftDataVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
@ -14,6 +16,26 @@ import java.util.List;
|
||||
*/
|
||||
public interface FishDraftDataMapper extends BaseMapper<FishDraftData> {
|
||||
|
||||
/**
|
||||
* 关联查询过鱼数据(分页)
|
||||
*/
|
||||
Page<FishDraftDataVO> selectJoinPage(Page<FishDraftDataVO> page,
|
||||
@Param("stcd") String stcd,
|
||||
@Param("rstcd") String rstcd,
|
||||
@Param("baseId") String baseId,
|
||||
@Param("direction") String direction,
|
||||
@Param("status") String status,
|
||||
@Param("ftp") String ftp);
|
||||
|
||||
/**
|
||||
* 关联查询过鱼数据(不分页)
|
||||
*/
|
||||
List<FishDraftDataVO> selectJoinList(@Param("stcd") String stcd,
|
||||
@Param("rstcd") String rstcd,
|
||||
@Param("baseId") String baseId,
|
||||
@Param("direction") String direction,
|
||||
@Param("status") String status);
|
||||
|
||||
/**
|
||||
* 根据审批批次ID查询草稿数据
|
||||
*/
|
||||
|
||||
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.data.domain.FishDraftData;
|
||||
import com.yfd.platform.data.domain.vo.FishDraftDataVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -15,9 +16,14 @@ import java.util.List;
|
||||
public interface IFishDraftDataService extends IService<FishDraftData> {
|
||||
|
||||
/**
|
||||
* 分页查询草稿数据
|
||||
* 分页查询草稿数据(关联电站和设施表)
|
||||
*/
|
||||
Page<FishDraftData> queryPageList(Page<FishDraftData> page, DataSourceRequest dataSourceRequest);
|
||||
Page<FishDraftDataVO> queryPageList(DataSourceRequest dataSourceRequest);
|
||||
|
||||
/**
|
||||
* 查询草稿数据列表(关联电站和设施表,不分页)
|
||||
*/
|
||||
List<FishDraftDataVO> queryJoinList(DataSourceRequest dataSourceRequest);
|
||||
|
||||
/**
|
||||
* 根据审批批次ID查询
|
||||
|
||||
@ -5,10 +5,12 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.yfd.platform.common.DataSourceLoadOptionsBase;
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.data.domain.FishDraftData;
|
||||
import com.yfd.platform.data.domain.vo.FishDraftDataVO;
|
||||
import com.yfd.platform.data.mapper.FishDraftDataMapper;
|
||||
import com.yfd.platform.data.service.IApprovalChangeLogService;
|
||||
import com.yfd.platform.data.service.IApprovalMainService;
|
||||
import com.yfd.platform.data.service.IFishDraftDataService;
|
||||
import com.yfd.platform.utils.KendoUtil;
|
||||
import com.yfd.platform.utils.QgcQueryWrapperUtil;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -36,7 +38,23 @@ public class FishDraftDataServiceImpl extends ServiceImpl<FishDraftDataMapper, F
|
||||
private IApprovalChangeLogService approvalChangeLogService;
|
||||
|
||||
@Override
|
||||
public Page<FishDraftData> queryPageList(Page<FishDraftData> page, DataSourceRequest dataSourceRequest) {
|
||||
public Page<FishDraftDataVO> queryPageList(DataSourceRequest dataSourceRequest) {
|
||||
Page<FishDraftDataVO> page = KendoUtil.getPage(dataSourceRequest);
|
||||
DataSourceLoadOptionsBase loadOptions = dataSourceRequest.toDevRequest();
|
||||
String stcd = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "stcd");
|
||||
String rstcd = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "rstcd");
|
||||
String baseId = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "baseId");
|
||||
String ftp = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "ftp");
|
||||
String direction = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "direction");
|
||||
String status = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "status");
|
||||
|
||||
Page<FishDraftDataVO> resultPage = fishDraftDataMapper.selectJoinPage(
|
||||
page, stcd, rstcd, baseId, direction, status,ftp);
|
||||
return resultPage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FishDraftDataVO> queryJoinList(DataSourceRequest dataSourceRequest) {
|
||||
DataSourceLoadOptionsBase loadOptions = dataSourceRequest.toDevRequest();
|
||||
String stcd = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "stcd");
|
||||
String rstcd = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "rstcd");
|
||||
@ -44,8 +62,7 @@ public class FishDraftDataServiceImpl extends ServiceImpl<FishDraftDataMapper, F
|
||||
String direction = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "direction");
|
||||
String status = QgcQueryWrapperUtil.getFilterFieldValue(loadOptions, "status");
|
||||
|
||||
StringBuilder sql = new StringBuilder();
|
||||
return null;
|
||||
return fishDraftDataMapper.selectJoinList(stcd, rstcd, baseId, direction, status);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
193
backend/src/main/resources/mapper/data/FishDraftDataMapper.xml
Normal file
193
backend/src/main/resources/mapper/data/FishDraftDataMapper.xml
Normal file
@ -0,0 +1,193 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yfd.platform.data.mapper.FishDraftDataMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.yfd.platform.data.domain.FishDraftData">
|
||||
<id column="ID" property="id"/>
|
||||
<result column="STCD" property="stcd"/>
|
||||
<result column="TM" property="tm"/>
|
||||
<result column="FTP" property="ftp"/>
|
||||
<result column="FSZ" property="fsz"/>
|
||||
<result column="FCNT" property="fcnt"/>
|
||||
<result column="FWET" property="fwet"/>
|
||||
<result column="STRDT" property="strdt"/>
|
||||
<result column="ENDDT" property="enddt"/>
|
||||
<result column="DIRECTION" property="direction"/>
|
||||
<result column="YR" property="yr"/>
|
||||
<result column="MOUTH" property="mouth"/>
|
||||
<result column="VDPTH" property="vdpth"/>
|
||||
<result column="PICPTH" property="picpth"/>
|
||||
<result column="ISFS" property="isfs"/>
|
||||
<result column="SOURCE_TYPE" property="sourceType"/>
|
||||
<result column="APPROVAL_ID" property="approvalId"/>
|
||||
<result column="STATUS" property="status"/>
|
||||
<result column="LOCK_FLAG" property="lockFlag"/>
|
||||
<result column="SUBMIT_TIME" property="submitTime"/>
|
||||
<result column="APPROVE_TIME" property="approveTime"/>
|
||||
<result column="DELETED_FLAG" property="deletedFlag"/>
|
||||
<result column="DELETED_BY" property="deletedBy"/>
|
||||
<result column="DELETED_AT" property="deletedAt"/>
|
||||
<result column="CREATED_AT" property="createdAt"/>
|
||||
<result column="CREATED_BY" property="createdBy"/>
|
||||
<result column="UPDATED_AT" property="updatedAt"/>
|
||||
<result column="UPDATED_BY" property="updatedBy"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="JoinResultMap" type="com.yfd.platform.data.domain.vo.FishDraftDataVO">
|
||||
<id column="ID" property="id"/>
|
||||
<result column="STCD" property="stcd"/>
|
||||
<result column="TM" property="tm"/>
|
||||
<result column="FTP" property="ftp"/>
|
||||
<result column="FSZ" property="fsz"/>
|
||||
<result column="FCNT" property="fcnt"/>
|
||||
<result column="FWET" property="fwet"/>
|
||||
<result column="STRDT" property="strdt"/>
|
||||
<result column="ENDDT" property="enddt"/>
|
||||
<result column="DIRECTION" property="direction"/>
|
||||
<result column="YR" property="yr"/>
|
||||
<result column="MOUTH" property="mouth"/>
|
||||
<result column="VDPTH" property="vdpth"/>
|
||||
<result column="PICPTH" property="picpth"/>
|
||||
<result column="ISFS" property="isfs"/>
|
||||
<result column="SOURCE_TYPE" property="sourceType"/>
|
||||
<result column="APPROVAL_ID" property="approvalId"/>
|
||||
<result column="STATUS" property="status"/>
|
||||
<result column="LOCK_FLAG" property="lockFlag"/>
|
||||
<result column="SUBMIT_TIME" property="submitTime"/>
|
||||
<result column="APPROVE_TIME" property="approveTime"/>
|
||||
<result column="DELETED_FLAG" property="deletedFlag"/>
|
||||
<result column="DELETED_BY" property="deletedBy"/>
|
||||
<result column="DELETED_AT" property="deletedAt"/>
|
||||
<result column="CREATED_AT" property="createdAt"/>
|
||||
<result column="CREATED_BY" property="createdBy"/>
|
||||
<result column="UPDATED_AT" property="updatedAt"/>
|
||||
<result column="UPDATED_BY" property="updatedBy"/>
|
||||
<result column="STNM" property="stnm"/>
|
||||
<result column="STTP" property="sttp"/>
|
||||
<result column="RSTCD" property="rstcd"/>
|
||||
<result column="ENNM" property="ennm"/>
|
||||
<result column="BASE_ID" property="baseId"/>
|
||||
<result column="RVCD" property="rvcd"/>
|
||||
<result column="LGTD" property="lgtd"/>
|
||||
<result column="LTTD" property="lttd"/>
|
||||
<result column="ORDER_INDEX" property="orderIndex"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="joinColumns">
|
||||
D.ID,
|
||||
D.STCD,
|
||||
D.TM,
|
||||
D.FTP,
|
||||
D.FSZ,
|
||||
D.FCNT,
|
||||
D.FWET,
|
||||
D.STRDT,
|
||||
D.ENDDT,
|
||||
D.DIRECTION,
|
||||
D.YR,
|
||||
D.MOUTH,
|
||||
D.VDPTH,
|
||||
D.PICPTH,
|
||||
D.ISFS,
|
||||
D.SOURCE_TYPE,
|
||||
D.APPROVAL_ID,
|
||||
D.STATUS,
|
||||
D.LOCK_FLAG,
|
||||
D.SUBMIT_TIME,
|
||||
D.APPROVE_TIME,
|
||||
D.DELETED_FLAG,
|
||||
D.DELETED_BY,
|
||||
D.DELETED_AT,
|
||||
D.CREATED_AT,
|
||||
D.CREATED_BY,
|
||||
D.UPDATED_AT,
|
||||
D.UPDATED_BY,
|
||||
F.STNM,
|
||||
F.STTP,
|
||||
F.RSTCD,
|
||||
E.ENNM,
|
||||
E.BASE_ID,
|
||||
E.RVCD,
|
||||
E.LGTD,
|
||||
E.LTTD,
|
||||
E.ORDER_INDEX
|
||||
</sql>
|
||||
|
||||
<select id="selectJoinPage" resultMap="JoinResultMap">
|
||||
SELECT
|
||||
<include refid="joinColumns"/>
|
||||
FROM FISH_DRAFT_DATA D
|
||||
LEFT JOIN SD_FPSS_B_H F ON D.STCD = F.STCD
|
||||
LEFT JOIN SD_ENGINFO_B_H E ON F.RSTCD = E.STCD
|
||||
WHERE D.DELETED_FLAG = 0
|
||||
<if test="stcd != null and stcd != ''">
|
||||
AND D.STCD = #{stcd}
|
||||
</if>
|
||||
<if test="stcd != null and stcd != ''">
|
||||
AND D.FTP = #{ftp}
|
||||
</if>
|
||||
<if test="rstcd != null and rstcd != ''">
|
||||
AND F.RSTCD = #{rstcd}
|
||||
</if>
|
||||
<if test="baseId != null and baseId != ''">
|
||||
AND E.BASE_ID = #{baseId}
|
||||
</if>
|
||||
<if test="direction != null and direction != ''">
|
||||
AND D.DIRECTION = #{direction}
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND D.STATUS = #{status}
|
||||
</if>
|
||||
ORDER BY D.CREATED_AT DESC
|
||||
</select>
|
||||
|
||||
<select id="selectJoinList" resultMap="JoinResultMap">
|
||||
SELECT
|
||||
<include refid="joinColumns"/>
|
||||
FROM FISH_DRAFT_DATA D
|
||||
LEFT JOIN SD_FPSS_B_H F ON D.STCD = F.STCD
|
||||
LEFT JOIN SD_ENGINFO_B_H E ON F.RSTCD = E.STCD
|
||||
WHERE D.DELETED_FLAG = 0
|
||||
<if test="stcd != null and stcd != ''">
|
||||
AND D.STCD = #{stcd}
|
||||
</if>
|
||||
<if test="rstcd != null and rstcd != ''">
|
||||
AND F.RSTCD = #{rstcd}
|
||||
</if>
|
||||
<if test="baseId != null and baseId != ''">
|
||||
AND E.BASE_ID = #{baseId}
|
||||
</if>
|
||||
<if test="direction != null and direction != ''">
|
||||
AND D.DIRECTION = #{direction}
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND D.STATUS = #{status}
|
||||
</if>
|
||||
ORDER BY D.CREATED_AT DESC
|
||||
</select>
|
||||
|
||||
<select id="selectJoinCount" resultType="long">
|
||||
SELECT COUNT(*)
|
||||
FROM FISH_DRAFT_DATA D
|
||||
LEFT JOIN SD_FPSS_B_H F ON D.STCD = F.STCD
|
||||
LEFT JOIN SD_ENGINFO_B_H E ON F.RSTCD = E.STCD
|
||||
WHERE D.DELETED_FLAG = 0
|
||||
<if test="stcd != null and stcd != ''">
|
||||
AND D.STCD = #{stcd}
|
||||
</if>
|
||||
<if test="rstcd != null and rstcd != ''">
|
||||
AND F.RSTCD = #{rstcd}
|
||||
</if>
|
||||
<if test="baseId != null and baseId != ''">
|
||||
AND E.BASE_ID = #{baseId}
|
||||
</if>
|
||||
<if test="direction != null and direction != ''">
|
||||
AND D.DIRECTION = #{direction}
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND D.STATUS = #{status}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue
Block a user