28 changed files with 1447 additions and 43 deletions
Binary file not shown.
Binary file not shown.
@ -0,0 +1,52 @@ |
|||||||
|
package com.ruoyi.swlscx.actualSurvey.controller; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||||
|
import com.ruoyi.common.core.page.R; |
||||||
|
import com.ruoyi.swlscx.actualSurvey.domain.vo.HyObqGVo; |
||||||
|
import com.ruoyi.swlscx.actualSurvey.domain.vo.HyXsmsrsGVo; |
||||||
|
import com.ruoyi.swlscx.actualSurvey.service.HyObqGService; |
||||||
|
import com.ruoyi.swlscx.actualSurvey.service.HyXsmsrsGService; |
||||||
|
import com.ruoyi.swlscx.basic.domain.vo.HyStscAVo; |
||||||
|
import com.ruoyi.swlscx.common.PageParams; |
||||||
|
import com.ruoyi.swlscx.year.domain.vo.HyYrpFVo; |
||||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||||
|
import org.springframework.web.bind.annotation.RestController; |
||||||
|
|
||||||
|
/** |
||||||
|
* @Author al |
||||||
|
* @Date 2025/7/10 15:49 |
||||||
|
* @Description: TODO |
||||||
|
* @Version |
||||||
|
*/ |
||||||
|
@RestController |
||||||
|
@RequestMapping("/actualSurvey") |
||||||
|
public class ActualSurveyController { |
||||||
|
|
||||||
|
@Autowired |
||||||
|
private HyObqGService hyObqGService; |
||||||
|
|
||||||
|
@Autowired |
||||||
|
private HyXsmsrsGService hyXsmsrsGService; |
||||||
|
|
||||||
|
/** |
||||||
|
* 实测流量成果表 |
||||||
|
*/ |
||||||
|
@GetMapping("/getFlowResult") |
||||||
|
public R getMonthRainList(Integer pageNum, Integer pageSize, String startTime, String endTime, String stcd, String stnm) { |
||||||
|
PageParams pageParams = new PageParams(pageNum.longValue(), pageSize.longValue()); |
||||||
|
IPage<HyObqGVo> hyObqGVoIPage = hyObqGService.selectHyObqGDataByPageAndInfo(pageParams, startTime, endTime, stcd, stnm); |
||||||
|
return R.ok().put("data", hyObqGVoIPage.getRecords()).put("count", hyObqGVoIPage.getTotal()); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 实测大断面成果表 |
||||||
|
*/ |
||||||
|
@GetMapping("/getActualMeasurementList") |
||||||
|
public R getActualMeasurementList(Integer pageNum, Integer pageSize, String startTime, String endTime, String stcd, String stnm) { |
||||||
|
PageParams pageParams = new PageParams(pageNum.longValue(), pageSize.longValue()); |
||||||
|
IPage<HyXsmsrsGVo> hyXsmsrsGVoIPage = hyXsmsrsGService.selectHyXsmsrsGDataByPageAndInfo(pageParams, startTime, endTime, stcd, stnm); |
||||||
|
return R.ok().put("data", hyXsmsrsGVoIPage.getRecords()).put("count", hyXsmsrsGVoIPage.getTotal()); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,56 @@ |
|||||||
|
package com.ruoyi.swlscx.actualSurvey.controller; |
||||||
|
|
||||||
|
import com.ruoyi.common.core.page.R; |
||||||
|
import com.ruoyi.swlscx.actualSurvey.service.HyObqGService; |
||||||
|
import com.ruoyi.swlscx.actualSurvey.service.HyXsmsrsGService; |
||||||
|
import lombok.RequiredArgsConstructor; |
||||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||||
|
import org.springframework.web.bind.annotation.RequestParam; |
||||||
|
import org.springframework.web.bind.annotation.RestController; |
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse; |
||||||
|
|
||||||
|
/** |
||||||
|
* @Author al |
||||||
|
* @Date 2025/7/10 16:13 |
||||||
|
* @Description: TODO |
||||||
|
* @Version |
||||||
|
*/ |
||||||
|
|
||||||
|
@RequestMapping("/report") |
||||||
|
@RestController |
||||||
|
public class ActualSurveyExportController { |
||||||
|
|
||||||
|
@Autowired |
||||||
|
private HyObqGService hyObqGService; |
||||||
|
|
||||||
|
|
||||||
|
@Autowired |
||||||
|
private HyXsmsrsGService hyXsmsrsGService; |
||||||
|
/** |
||||||
|
* 导出实测流量成果表 |
||||||
|
*/ |
||||||
|
@RequestMapping("/flowResult") |
||||||
|
public R exportHyObqGtList(HttpServletResponse response, |
||||||
|
@RequestParam String startTime, |
||||||
|
@RequestParam String endTime, |
||||||
|
@RequestParam String stcd, |
||||||
|
@RequestParam String stnm) { |
||||||
|
return hyObqGService.exportHyObqGData(response, startTime, endTime, stcd, stnm); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/** |
||||||
|
* 导出实测大断面成果表 |
||||||
|
*/ |
||||||
|
@RequestMapping("/actualMeasurement") |
||||||
|
public R exportActualMeasurementList(HttpServletResponse response, |
||||||
|
@RequestParam String startTime, |
||||||
|
@RequestParam String endTime, |
||||||
|
@RequestParam String stcd, |
||||||
|
@RequestParam String stnm) { |
||||||
|
return hyXsmsrsGService.exportHyXsmsrsGData(response, startTime, endTime, stcd, stnm); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,48 @@ |
|||||||
|
package com.ruoyi.swlscx.actualSurvey.domain.po; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
import lombok.Data; |
||||||
|
|
||||||
|
import java.time.LocalDateTime; |
||||||
|
import java.util.Date; |
||||||
|
|
||||||
|
/** |
||||||
|
* @Author al |
||||||
|
* @Date 2025/7/10 15:44 |
||||||
|
* @Description: TODO |
||||||
|
* @Version |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
@TableName("hy_obq_g") |
||||||
|
public class HyObqG { |
||||||
|
|
||||||
|
private String id; // 唯一标识符
|
||||||
|
|
||||||
|
private String stcd; // 站码
|
||||||
|
private Integer yr; // 年份(整数类型)
|
||||||
|
private Integer mnth; // 月份(整数类型)
|
||||||
|
private Integer qobno; // 流量施测号数
|
||||||
|
|
||||||
|
private Date msqbgtm; // 测流起时间(使用LocalDateTime)
|
||||||
|
private Date msqedtm; // 测流止时间
|
||||||
|
|
||||||
|
private String xsqlc; // 测流断面位置
|
||||||
|
private String msqmt; // 测流方法
|
||||||
|
private Double bsggz; // 基本水尺水位
|
||||||
|
private Double q; // 流量
|
||||||
|
private String qrcd; // 流量注解码
|
||||||
|
private Double xstta; // 断面总面积
|
||||||
|
private Double xsa; // 断面过水面积
|
||||||
|
private String xsarcd; // 断面面积注解码
|
||||||
|
private Double xsavv; // 断面平均流速
|
||||||
|
private Double xsmxv; // 断面最大流速
|
||||||
|
private Double tpwd; // 水面宽
|
||||||
|
private Double xsavdp; // 断面平均水深
|
||||||
|
private Double xsmxdp; // 断面最大水深
|
||||||
|
private Double ibwd; // 水浸冰底宽度
|
||||||
|
private Double ibavdp; // 水浸冰底平均水深
|
||||||
|
private Double ibmxdp; // 水浸冰底最大水深
|
||||||
|
private Double rvsfsl; // 水面比降
|
||||||
|
private Double n; // 糙率
|
||||||
|
private String obnont; // 测次说明
|
||||||
|
} |
@ -0,0 +1,33 @@ |
|||||||
|
package com.ruoyi.swlscx.actualSurvey.domain.po; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType; |
||||||
|
import lombok.Data; |
||||||
|
|
||||||
|
import java.math.BigDecimal; |
||||||
|
import java.time.LocalDateTime; |
||||||
|
import java.util.Date; |
||||||
|
|
||||||
|
/** |
||||||
|
* @Author al |
||||||
|
* @Date 2025/7/11 15:39 |
||||||
|
* @Description: TODO |
||||||
|
* @Version |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
public class HyXsmsrsG { |
||||||
|
private String stcd; // 站码
|
||||||
|
|
||||||
|
private Date obdt; // 施测日期
|
||||||
|
|
||||||
|
private Integer obno; // 测次号
|
||||||
|
|
||||||
|
private String vtno; // 垂线号
|
||||||
|
|
||||||
|
private BigDecimal di; // 起点距(米)
|
||||||
|
private BigDecimal rvbbel; // 河底高程(米)
|
||||||
|
private String rvbbelrcd; // 河底高程注解码
|
||||||
|
private BigDecimal odbrz; // 测时水位(米)
|
||||||
|
private String odbrzrcd; // 测时水位注解码
|
||||||
|
private String vtaz; // 垂线方位
|
||||||
|
private Integer nof; // 默认值1
|
||||||
|
} |
@ -0,0 +1,60 @@ |
|||||||
|
package com.ruoyi.swlscx.actualSurvey.domain.vo; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
import lombok.Data; |
||||||
|
|
||||||
|
import java.io.Serializable; |
||||||
|
import java.util.Date; |
||||||
|
|
||||||
|
/** |
||||||
|
* @Author al |
||||||
|
* @Date 2025/7/10 15:44 |
||||||
|
* @Description: TODO |
||||||
|
* @Version |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
public class HyObqGVo implements Serializable { |
||||||
|
|
||||||
|
private String id; // 唯一标识符
|
||||||
|
|
||||||
|
private String stcd; // 站码
|
||||||
|
private Integer yr; // 年份(整数类型)
|
||||||
|
private Integer mnth; // 月份(整数类型)
|
||||||
|
private Integer qobno; // 流量施测号数
|
||||||
|
|
||||||
|
private Date msqbgtm; // 测流起时间(使用LocalDateTime)
|
||||||
|
private Date msqedtm; // 测流止时间
|
||||||
|
|
||||||
|
private String xsqlc; // 测流断面位置
|
||||||
|
private String msqmt; // 测流方法
|
||||||
|
private Double bsggz; // 基本水尺水位
|
||||||
|
private Double q; // 流量
|
||||||
|
private String qrcd; // 流量注解码
|
||||||
|
|
||||||
|
|
||||||
|
private Double xstta; // 断面总面积
|
||||||
|
private Double xsa; // 断面过水面积
|
||||||
|
private String xsarcd; // 断面面积注解码
|
||||||
|
private Double xsavv; // 断面平均流速
|
||||||
|
private Double xsmxv; // 断面最大流速
|
||||||
|
|
||||||
|
private Double tpwd; // 水面宽
|
||||||
|
private Double xsavdp; // 断面平均水深
|
||||||
|
private Double xsmxdp; // 断面最大水深
|
||||||
|
private Double ibwd; // 水浸冰底宽度
|
||||||
|
private Double ibavdp; // 水浸冰底平均水深
|
||||||
|
private Double ibmxdp; // 水浸冰底最大水深
|
||||||
|
private Double rvsfsl; // 水面比降
|
||||||
|
private Double n; // 糙率
|
||||||
|
private String obnont; // 测次说明
|
||||||
|
|
||||||
|
/**站名**/ |
||||||
|
private String stnm; |
||||||
|
|
||||||
|
/** |
||||||
|
* 行政区划码 |
||||||
|
*/ |
||||||
|
private String addvcd; |
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L; |
||||||
|
} |
@ -0,0 +1,44 @@ |
|||||||
|
package com.ruoyi.swlscx.actualSurvey.domain.vo; |
||||||
|
|
||||||
|
import lombok.Data; |
||||||
|
|
||||||
|
import java.io.Serializable; |
||||||
|
import java.math.BigDecimal; |
||||||
|
import java.util.Date; |
||||||
|
|
||||||
|
/** |
||||||
|
* @Author al |
||||||
|
* @Date 2025/7/11 15:39 |
||||||
|
* @Description: TODO |
||||||
|
* @Version |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
public class HyXsmsrsGVo implements Serializable { |
||||||
|
private String stcd; // 站码
|
||||||
|
|
||||||
|
private Date obdt; // 施测日期
|
||||||
|
|
||||||
|
private Integer obno; // 测次号
|
||||||
|
|
||||||
|
private String vtno; // 垂线号
|
||||||
|
|
||||||
|
private BigDecimal di; // 起点距(米)
|
||||||
|
private BigDecimal rvbbel; // 河底高程(米)
|
||||||
|
private String rvbbelrcd; // 河底高程注解码
|
||||||
|
private BigDecimal odbrz; // 测时水位(米)
|
||||||
|
private String odbrzrcd; // 测时水位注解码
|
||||||
|
private String vtaz; // 垂线方位
|
||||||
|
private Integer nof; // 默认值1
|
||||||
|
|
||||||
|
|
||||||
|
/**站名**/ |
||||||
|
private String stnm; |
||||||
|
|
||||||
|
/** |
||||||
|
* 行政区划码 |
||||||
|
*/ |
||||||
|
private String addvcd; |
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L; |
||||||
|
|
||||||
|
} |
@ -0,0 +1,25 @@ |
|||||||
|
package com.ruoyi.swlscx.actualSurvey.mapper; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||||
|
import com.ruoyi.swlscx.actualSurvey.domain.po.HyObqG; |
||||||
|
import com.ruoyi.swlscx.actualSurvey.domain.vo.HyObqGVo; |
||||||
|
import org.apache.ibatis.annotations.Mapper; |
||||||
|
import org.apache.ibatis.annotations.Param; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
import java.util.Map; |
||||||
|
|
||||||
|
/** |
||||||
|
* @Author al |
||||||
|
* @Date 2025/7/10 15:46 |
||||||
|
* @Description: TODO |
||||||
|
* @Version |
||||||
|
*/ |
||||||
|
@Mapper |
||||||
|
public interface HyObqGMapper extends BaseMapper<HyObqG> { |
||||||
|
IPage<HyObqGVo> selectHyObqGDataByPageAndInfo(@Param("page") Page<HyObqGVo> page, @Param("map") Map<String, Object> map); |
||||||
|
|
||||||
|
List<HyObqGVo> selectHyObqGData(@Param("map") Map<String, Object> map); |
||||||
|
} |
@ -0,0 +1,25 @@ |
|||||||
|
package com.ruoyi.swlscx.actualSurvey.mapper; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||||
|
import com.ruoyi.swlscx.actualSurvey.domain.po.HyXsmsrsG; |
||||||
|
import com.ruoyi.swlscx.actualSurvey.domain.vo.HyXsmsrsGVo; |
||||||
|
import org.apache.ibatis.annotations.Mapper; |
||||||
|
import org.apache.ibatis.annotations.Param; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
import java.util.Map; |
||||||
|
|
||||||
|
/** |
||||||
|
* @Author al |
||||||
|
* @Date 2025/7/11 15:40 |
||||||
|
* @Description: TODO |
||||||
|
* @Version |
||||||
|
*/ |
||||||
|
@Mapper |
||||||
|
public interface HyXsmsrsGMapper extends BaseMapper<HyXsmsrsG> { |
||||||
|
IPage<HyXsmsrsGVo> selectHyXsmsrsGDataByPageAndInfo(@Param("page") Page<HyXsmsrsGVo> page, @Param("map") Map<String, Object> map); |
||||||
|
|
||||||
|
List<HyXsmsrsGVo> selectHyXsmsrsGData(@Param("map") Map<String, Object> map); |
||||||
|
} |
@ -0,0 +1,26 @@ |
|||||||
|
package com.ruoyi.swlscx.actualSurvey.service; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||||
|
import com.baomidou.mybatisplus.extension.service.IService; |
||||||
|
import com.ruoyi.common.core.page.R; |
||||||
|
import com.ruoyi.swlscx.actualSurvey.domain.po.HyObqG; |
||||||
|
import com.ruoyi.swlscx.actualSurvey.domain.vo.HyObqGVo; |
||||||
|
import com.ruoyi.swlscx.common.PageParams; |
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse; |
||||||
|
|
||||||
|
/** |
||||||
|
* @Author al |
||||||
|
* @Date 2025/7/10 15:47 |
||||||
|
* @Description: TODO |
||||||
|
* @Version |
||||||
|
*/ |
||||||
|
public interface HyObqGService extends IService<HyObqG> { |
||||||
|
|
||||||
|
/** |
||||||
|
* 查询实测流量表 |
||||||
|
*/ |
||||||
|
IPage<HyObqGVo> selectHyObqGDataByPageAndInfo(PageParams pageParams, String startTime, String endTime, String stcd, String stnm); |
||||||
|
|
||||||
|
R exportHyObqGData(HttpServletResponse response, String startTime, String endTime, String stcd, String stnm); |
||||||
|
} |
@ -0,0 +1,22 @@ |
|||||||
|
package com.ruoyi.swlscx.actualSurvey.service; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||||
|
import com.baomidou.mybatisplus.extension.service.IService; |
||||||
|
import com.ruoyi.common.core.page.R; |
||||||
|
import com.ruoyi.swlscx.actualSurvey.domain.po.HyXsmsrsG; |
||||||
|
import com.ruoyi.swlscx.actualSurvey.domain.vo.HyXsmsrsGVo; |
||||||
|
import com.ruoyi.swlscx.common.PageParams; |
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse; |
||||||
|
|
||||||
|
/** |
||||||
|
* @Author al |
||||||
|
* @Date 2025/7/11 15:40 |
||||||
|
* @Description: TODO |
||||||
|
* @Version |
||||||
|
*/ |
||||||
|
public interface HyXsmsrsGService extends IService<HyXsmsrsG> { |
||||||
|
IPage<HyXsmsrsGVo> selectHyXsmsrsGDataByPageAndInfo(PageParams pageParams, String startTime, String endTime, String stcd, String stnm); |
||||||
|
|
||||||
|
R exportHyXsmsrsGData(HttpServletResponse response, String startTime, String endTime, String stcd, String stnm); |
||||||
|
} |
@ -0,0 +1,210 @@ |
|||||||
|
package com.ruoyi.swlscx.actualSurvey.service.impl; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||||
|
import com.ruoyi.common.config.RuoYiConfig; |
||||||
|
import com.ruoyi.common.core.page.R; |
||||||
|
import com.ruoyi.common.utils.DateUtils; |
||||||
|
import com.ruoyi.common.utils.SecurityUtils; |
||||||
|
import com.ruoyi.swlscx.actualSurvey.domain.po.HyObqG; |
||||||
|
import com.ruoyi.swlscx.actualSurvey.domain.vo.HyObqGVo; |
||||||
|
import com.ruoyi.swlscx.actualSurvey.mapper.HyObqGMapper; |
||||||
|
import com.ruoyi.swlscx.actualSurvey.service.HyObqGService; |
||||||
|
import com.ruoyi.swlscx.basic.domain.po.YcExportTask; |
||||||
|
import com.ruoyi.swlscx.basic.service.YcExportTaskService; |
||||||
|
import com.ruoyi.swlscx.common.PageParams; |
||||||
|
import com.ruoyi.swlscx.common.constants.SystemConstants; |
||||||
|
import com.ruoyi.swlscx.common.utils.CommonUtils; |
||||||
|
import com.ruoyi.swlscx.common.utils.ExcelUtils; |
||||||
|
import com.ruoyi.swlscx.common.utils.Query; |
||||||
|
import com.ruoyi.swlscx.month.domain.vo.HyMptEVo; |
||||||
|
import org.apache.commons.lang3.ObjectUtils; |
||||||
|
import org.apache.poi.ss.usermodel.CellStyle; |
||||||
|
import org.apache.poi.ss.usermodel.Row; |
||||||
|
import org.apache.poi.ss.usermodel.Sheet; |
||||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||||
|
import org.springframework.context.ApplicationContext; |
||||||
|
import org.springframework.stereotype.Service; |
||||||
|
|
||||||
|
import javax.annotation.Resource; |
||||||
|
import javax.servlet.http.HttpServletResponse; |
||||||
|
import java.io.File; |
||||||
|
import java.util.Date; |
||||||
|
import java.util.List; |
||||||
|
import java.util.Map; |
||||||
|
import java.util.concurrent.CompletableFuture; |
||||||
|
import java.util.concurrent.ThreadPoolExecutor; |
||||||
|
|
||||||
|
/** |
||||||
|
* @Author al |
||||||
|
* @Date 2025/7/10 15:47 |
||||||
|
* @Description: TODO |
||||||
|
* @Version |
||||||
|
*/ |
||||||
|
@Service |
||||||
|
public class HyObqGServiceImpl extends ServiceImpl<HyObqGMapper, HyObqG> |
||||||
|
implements HyObqGService { |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override |
||||||
|
public IPage<HyObqGVo> selectHyObqGDataByPageAndInfo(PageParams pageParams, String startTime, String endTime, String stcd, String stnm) { |
||||||
|
Map<String, Object> map = CommonUtils.getMonthDataMap(pageParams, startTime, endTime, stcd, stnm); |
||||||
|
return this.baseMapper.selectHyObqGDataByPageAndInfo(new Query<HyObqGVo>().getPage(map), map); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public R exportHyObqGData(HttpServletResponse response, String startTime, String endTime, String stcd, String stnm) { |
||||||
|
Long userId = SecurityUtils.getUserId(); |
||||||
|
String tableName = "实测流量表"; |
||||||
|
return taskAndExport(tableName,startTime, endTime, stcd, stnm, userId); |
||||||
|
} |
||||||
|
|
||||||
|
@Resource |
||||||
|
private ThreadPoolExecutor labelThreadPool; |
||||||
|
|
||||||
|
@Resource |
||||||
|
private YcExportTaskService ycExportTaskService; |
||||||
|
|
||||||
|
@Resource |
||||||
|
private ThreadPoolExecutor importThreadPool; |
||||||
|
|
||||||
|
@Autowired |
||||||
|
private ApplicationContext context; |
||||||
|
|
||||||
|
private R taskAndExport(String tableName,String startTime, String endTime, String stcd, String stnm, Long userId) { |
||||||
|
String startNewTime=""; |
||||||
|
String endNewTime=""; |
||||||
|
if (ObjectUtils.isNotEmpty(startTime) ){ |
||||||
|
startNewTime=startTime.substring(0,6); |
||||||
|
} |
||||||
|
if (ObjectUtils.isNotEmpty(endTime)){ |
||||||
|
endNewTime=endTime.substring(0,6); |
||||||
|
} |
||||||
|
String filename = tableName + startNewTime + "-" + endNewTime; |
||||||
|
// 查询是否已存在相同条件且未完成的任务
|
||||||
|
List<YcExportTask> ongoingTasks = ycExportTaskService.list( |
||||||
|
new QueryWrapper<YcExportTask>() |
||||||
|
.eq("user_id", userId) |
||||||
|
.eq("filename", filename) |
||||||
|
.eq("status", 0) // 状态为0表示任务未完成
|
||||||
|
); |
||||||
|
|
||||||
|
if (!ongoingTasks.isEmpty()) { |
||||||
|
return R.error("当前任务正在下载中,请稍后重试"); |
||||||
|
} |
||||||
|
|
||||||
|
YcExportTask ycExportTask = new YcExportTask(); |
||||||
|
String pathPeffix = RuoYiConfig.getExportPath() + |
||||||
|
File.separator + userId + File.separator+ |
||||||
|
DateUtils.parseDateToStr("yyyy-MM-dd",DateUtils.getNowDate()) + File.separator + |
||||||
|
DateUtils.parseDateToStr("HH_mm",DateUtils.getNowDate())+File.separator; |
||||||
|
ycExportTask.setFilename(filename); |
||||||
|
ycExportTask.setUserId(userId); |
||||||
|
ycExportTask.setStartTime(new Date()); |
||||||
|
ycExportTask.setStatus(0); |
||||||
|
ycExportTask.setFilepath(pathPeffix); |
||||||
|
ycExportTaskService.save(ycExportTask); |
||||||
|
CompletableFuture.runAsync(() -> { |
||||||
|
try { |
||||||
|
File dest = new File(pathPeffix); |
||||||
|
if (!dest.exists()) { |
||||||
|
dest.mkdirs(); |
||||||
|
} |
||||||
|
String fullPath = pathPeffix + filename; |
||||||
|
exportBlackData(fullPath, startTime, endTime, stcd, stnm); |
||||||
|
|
||||||
|
ycExportTask.setStatus(1); |
||||||
|
ycExportTask.setEndTime(new Date()); |
||||||
|
ycExportTaskService.updateById(ycExportTask); |
||||||
|
} catch (Exception e) { |
||||||
|
log.error(e.getMessage(), e); |
||||||
|
R.error("任务下载失败"); |
||||||
|
} |
||||||
|
}, labelThreadPool); |
||||||
|
return R.ok("任务已提交,请稍后下载"); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
private void exportBlackData(String tableName, String startTime, String endTime, String stcd, String stnm) { |
||||||
|
Map<String, Object> rainMap = CommonUtils.getMonthDataMap(new PageParams(0L, 1000000000L), startTime, endTime, stcd, stnm); |
||||||
|
ExcelUtils.excelBackExport2("flowResult.xls", tableName, (Sheet sheet, CellStyle style) -> |
||||||
|
dataModel1(rainMap, sheet, style)); |
||||||
|
} |
||||||
|
public int dataModel1(Map<String, Object> map, Sheet sheet, CellStyle style) { |
||||||
|
// 批量查询数据
|
||||||
|
List<HyObqGVo> hyObqGVos = this.baseMapper.selectHyObqGData(map); |
||||||
|
|
||||||
|
// 定义当前sheet的行号
|
||||||
|
int rowIndex = 2; // 从第二行开始写入数据
|
||||||
|
// 定义全局序号
|
||||||
|
int globalIndex = 1; // 从1开始
|
||||||
|
|
||||||
|
// 定义当前sheet的编号
|
||||||
|
int sheetIndex = 1; |
||||||
|
|
||||||
|
// 最大行数限制
|
||||||
|
int maxRowsPerSheet = 65536; // 对于 .xls 文件,最大行数为 65536
|
||||||
|
int batchSize = 1000; // 每次批量处理1000行,减少逐行写入的开销
|
||||||
|
|
||||||
|
// 复制表头到新sheet的逻辑
|
||||||
|
ExcelUtils.copyHeader(sheet, style); |
||||||
|
|
||||||
|
// 批量处理数据
|
||||||
|
for (int i = 0; i < hyObqGVos.size(); i += batchSize) { |
||||||
|
// 处理一批数据
|
||||||
|
int toIndex = Math.min(i + batchSize, hyObqGVos.size()); |
||||||
|
List<HyObqGVo> batchList = hyObqGVos.subList(i, toIndex); |
||||||
|
|
||||||
|
// 批量写入数据
|
||||||
|
for (HyObqGVo vo : batchList) { |
||||||
|
// 如果当前行数达到最大行数,创建新sheet
|
||||||
|
if (rowIndex >= maxRowsPerSheet) { |
||||||
|
sheetIndex++; |
||||||
|
sheet = sheet.getWorkbook().createSheet("实测流量表" + sheetIndex); |
||||||
|
rowIndex = 2; // 重置行号
|
||||||
|
// 复制表头到新sheet
|
||||||
|
ExcelUtils.copyHeader(sheet, style); |
||||||
|
} |
||||||
|
|
||||||
|
// 创建新行并写入数据
|
||||||
|
Row row = ExcelUtils.createRow(sheet, rowIndex); |
||||||
|
|
||||||
|
// 使用 globalIndex 作为序号
|
||||||
|
ExcelUtils.formatCell(row, 0, String.valueOf(globalIndex), style); |
||||||
|
ExcelUtils.formatCell(row, 1, vo.getStcd() != null ? vo.getStcd() : "", style); |
||||||
|
ExcelUtils.formatCell(row, 2, vo.getStnm() != null ? vo.getStnm() : "", style); |
||||||
|
ExcelUtils.formatCell(row, 3, vo.getAddvcd() != null ? vo.getAddvcd() : "", style); |
||||||
|
ExcelUtils.formatCell(row, 4, vo.getYr() != null ? vo.getYr().toString() : "", style); |
||||||
|
ExcelUtils.formatCell(row, 5, vo.getMnth() != null ? vo.getMnth().toString() : "", style); |
||||||
|
ExcelUtils.formatCell(row, 6, vo.getQobno() != null ? vo.getQobno().toString() : "", style); |
||||||
|
ExcelUtils.formatCell(row, 7, vo.getMsqbgtm() != null ? DateUtils.parseDateToStr(SystemConstants.TIME_FORMAT,vo.getMsqbgtm()) : "", style); |
||||||
|
ExcelUtils.formatCell(row, 8, vo.getMsqedtm() != null ? DateUtils.parseDateToStr(SystemConstants.TIME_FORMAT,vo.getMsqedtm()) : "", style); |
||||||
|
ExcelUtils.formatCell(row, 9, vo.getXsqlc() != null ? vo.getXsqlc() : "", style); |
||||||
|
ExcelUtils.formatCell(row, 10, vo.getMsqmt() != null ? vo.getMsqmt() : "", style); |
||||||
|
ExcelUtils.formatCell(row, 11, vo.getBsggz() != null ? vo.getBsggz().toString() : "", style); |
||||||
|
ExcelUtils.formatCell(row, 12, vo.getQ() != null ? vo.getQ().toString() : "", style); |
||||||
|
ExcelUtils.formatCell(row, 13, vo.getQrcd() != null ? vo.getQrcd() : "", style); |
||||||
|
ExcelUtils.formatCell(row, 14, vo.getXstta() != null ? vo.getXstta().toString() : "", style); |
||||||
|
ExcelUtils.formatCell(row, 15, vo.getXsa() != null ? vo.getXsa().toString() : "", style); |
||||||
|
ExcelUtils.formatCell(row, 16, vo.getXsarcd() != null ? vo.getXsarcd() : "", style); |
||||||
|
ExcelUtils.formatCell(row, 17, vo.getXsavv() != null ? vo.getXsavv().toString() : "", style); |
||||||
|
ExcelUtils.formatCell(row, 18, vo.getXsmxv() != null ? vo.getXsmxv().toString() : "", style); |
||||||
|
ExcelUtils.formatCell(row, 19, vo.getTpwd() != null ? vo.getTpwd().toString() : "", style); |
||||||
|
ExcelUtils.formatCell(row, 20, vo.getXsavdp() != null ? vo.getXsavdp().toString() : "", style); |
||||||
|
ExcelUtils.formatCell(row, 21, vo.getXsmxdp() != null ? vo.getXsmxdp().toString() : "", style); |
||||||
|
ExcelUtils.formatCell(row, 22, vo.getIbwd() != null ? vo.getIbwd().toString() : "", style); |
||||||
|
ExcelUtils.formatCell(row, 23, vo.getIbavdp() != null ? vo.getIbavdp().toString() : "", style); |
||||||
|
ExcelUtils.formatCell(row, 24, vo.getIbmxdp() != null ? vo.getIbmxdp().toString() : "", style); |
||||||
|
ExcelUtils.formatCell(row, 25, vo.getRvsfsl() != null ? vo.getRvsfsl().toString() : "", style); |
||||||
|
ExcelUtils.formatCell(row, 26, vo.getN() != null ? vo.getN().toString() : "", style); |
||||||
|
ExcelUtils.formatCell(row, 27, vo.getObnont() != null ? vo.getObnont() : "", style); |
||||||
|
// 增加行号和全局序号
|
||||||
|
rowIndex++; |
||||||
|
globalIndex++; |
||||||
|
} |
||||||
|
} |
||||||
|
return 0; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,187 @@ |
|||||||
|
package com.ruoyi.swlscx.actualSurvey.service.impl; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||||
|
import com.ruoyi.common.config.RuoYiConfig; |
||||||
|
import com.ruoyi.common.core.page.R; |
||||||
|
import com.ruoyi.common.utils.DateUtils; |
||||||
|
import com.ruoyi.common.utils.SecurityUtils; |
||||||
|
import com.ruoyi.swlscx.actualSurvey.domain.po.HyXsmsrsG; |
||||||
|
import com.ruoyi.swlscx.actualSurvey.domain.vo.HyObqGVo; |
||||||
|
import com.ruoyi.swlscx.actualSurvey.domain.vo.HyXsmsrsGVo; |
||||||
|
import com.ruoyi.swlscx.actualSurvey.mapper.HyXsmsrsGMapper; |
||||||
|
import com.ruoyi.swlscx.actualSurvey.service.HyXsmsrsGService; |
||||||
|
import com.ruoyi.swlscx.basic.domain.po.YcExportTask; |
||||||
|
import com.ruoyi.swlscx.basic.service.YcExportTaskService; |
||||||
|
import com.ruoyi.swlscx.common.PageParams; |
||||||
|
import com.ruoyi.swlscx.common.constants.SystemConstants; |
||||||
|
import com.ruoyi.swlscx.common.utils.CommonUtils; |
||||||
|
import com.ruoyi.swlscx.common.utils.ExcelUtils; |
||||||
|
import com.ruoyi.swlscx.common.utils.Query; |
||||||
|
import org.apache.commons.lang3.ObjectUtils; |
||||||
|
import org.apache.poi.ss.usermodel.CellStyle; |
||||||
|
import org.apache.poi.ss.usermodel.Row; |
||||||
|
import org.apache.poi.ss.usermodel.Sheet; |
||||||
|
import org.springframework.stereotype.Service; |
||||||
|
|
||||||
|
import javax.annotation.Resource; |
||||||
|
import javax.servlet.http.HttpServletResponse; |
||||||
|
import java.io.File; |
||||||
|
import java.util.Date; |
||||||
|
import java.util.List; |
||||||
|
import java.util.Map; |
||||||
|
import java.util.concurrent.CompletableFuture; |
||||||
|
import java.util.concurrent.ThreadPoolExecutor; |
||||||
|
|
||||||
|
/** |
||||||
|
* @Author al |
||||||
|
* @Date 2025/7/11 15:41 |
||||||
|
* @Description: TODO |
||||||
|
* @Version |
||||||
|
*/ |
||||||
|
@Service |
||||||
|
public class HyXsmsrsGServiceImpl extends ServiceImpl<HyXsmsrsGMapper, HyXsmsrsG> |
||||||
|
implements HyXsmsrsGService { |
||||||
|
|
||||||
|
@Resource |
||||||
|
private ThreadPoolExecutor labelThreadPool; |
||||||
|
|
||||||
|
@Resource |
||||||
|
private YcExportTaskService ycExportTaskService; |
||||||
|
|
||||||
|
@Override |
||||||
|
public IPage<HyXsmsrsGVo> selectHyXsmsrsGDataByPageAndInfo(PageParams pageParams, String startTime, String endTime, String stcd, String stnm) { |
||||||
|
Map<String, Object> map = CommonUtils.getYearAndDayDataMap(pageParams, startTime, endTime, stcd, stnm); |
||||||
|
return this.baseMapper.selectHyXsmsrsGDataByPageAndInfo(new Query<HyXsmsrsGVo>().getPage(map), map); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public R exportHyXsmsrsGData(HttpServletResponse response, String startTime, String endTime, String stcd, String stnm) { |
||||||
|
Long userId = SecurityUtils.getUserId(); |
||||||
|
String tableName = "实测大断面成果表"; |
||||||
|
return taskAndExport(tableName,startTime, endTime, stcd, stnm, userId); |
||||||
|
} |
||||||
|
|
||||||
|
private R taskAndExport(String tableName,String startTime, String endTime, String stcd, String stnm, Long userId) { |
||||||
|
String startNewTime=""; |
||||||
|
String endNewTime=""; |
||||||
|
if (ObjectUtils.isNotEmpty(startTime) ){ |
||||||
|
startNewTime=startTime.substring(0,6); |
||||||
|
} |
||||||
|
if (ObjectUtils.isNotEmpty(endTime)){ |
||||||
|
endNewTime=endTime.substring(0,6); |
||||||
|
} |
||||||
|
String filename = tableName + startNewTime + "-" + endNewTime; |
||||||
|
// 查询是否已存在相同条件且未完成的任务
|
||||||
|
List<YcExportTask> ongoingTasks = ycExportTaskService.list( |
||||||
|
new QueryWrapper<YcExportTask>() |
||||||
|
.eq("user_id", userId) |
||||||
|
.eq("filename", filename) |
||||||
|
.eq("status", 0) // 状态为0表示任务未完成
|
||||||
|
); |
||||||
|
|
||||||
|
if (!ongoingTasks.isEmpty()) { |
||||||
|
return R.error("当前任务正在下载中,请稍后重试"); |
||||||
|
} |
||||||
|
|
||||||
|
YcExportTask ycExportTask = new YcExportTask(); |
||||||
|
String pathPeffix = RuoYiConfig.getExportPath() + |
||||||
|
File.separator + userId + File.separator+ |
||||||
|
DateUtils.parseDateToStr("yyyy-MM-dd",DateUtils.getNowDate()) + File.separator + |
||||||
|
DateUtils.parseDateToStr("HH_mm",DateUtils.getNowDate())+File.separator; |
||||||
|
ycExportTask.setFilename(filename); |
||||||
|
ycExportTask.setUserId(userId); |
||||||
|
ycExportTask.setStartTime(new Date()); |
||||||
|
ycExportTask.setStatus(0); |
||||||
|
ycExportTask.setFilepath(pathPeffix); |
||||||
|
ycExportTaskService.save(ycExportTask); |
||||||
|
CompletableFuture.runAsync(() -> { |
||||||
|
try { |
||||||
|
File dest = new File(pathPeffix); |
||||||
|
if (!dest.exists()) { |
||||||
|
dest.mkdirs(); |
||||||
|
} |
||||||
|
String fullPath = pathPeffix + filename; |
||||||
|
exportBlackData(fullPath, startTime, endTime, stcd, stnm); |
||||||
|
|
||||||
|
ycExportTask.setStatus(1); |
||||||
|
ycExportTask.setEndTime(new Date()); |
||||||
|
ycExportTaskService.updateById(ycExportTask); |
||||||
|
} catch (Exception e) { |
||||||
|
log.error(e.getMessage(), e); |
||||||
|
R.error("任务下载失败"); |
||||||
|
} |
||||||
|
}, labelThreadPool); |
||||||
|
return R.ok("任务已提交,请稍后下载"); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
private void exportBlackData(String tableName, String startTime, String endTime, String stcd, String stnm) { |
||||||
|
Map<String, Object> rainMap = CommonUtils.getYearAndDayDataMap(new PageParams(0L, 1000000000L), startTime, endTime, stcd, stnm); |
||||||
|
ExcelUtils.excelBackExport2("hyXsmsrsG.xls", tableName, (Sheet sheet, CellStyle style) -> |
||||||
|
dataModel1(rainMap, sheet, style)); |
||||||
|
} |
||||||
|
|
||||||
|
public int dataModel1(Map<String, Object> map, Sheet sheet, CellStyle style) { |
||||||
|
// 批量查询数据
|
||||||
|
List<HyXsmsrsGVo> hyXsmsrsGVos = this.baseMapper.selectHyXsmsrsGData(map); |
||||||
|
|
||||||
|
// 定义当前sheet的行号
|
||||||
|
int rowIndex = 2; // 从第二行开始写入数据
|
||||||
|
// 定义全局序号
|
||||||
|
int globalIndex = 1; // 从1开始
|
||||||
|
|
||||||
|
// 定义当前sheet的编号
|
||||||
|
int sheetIndex = 1; |
||||||
|
|
||||||
|
// 最大行数限制
|
||||||
|
int maxRowsPerSheet = 65536; // 对于 .xls 文件,最大行数为 65536
|
||||||
|
int batchSize = 1000; // 每次批量处理1000行,减少逐行写入的开销
|
||||||
|
|
||||||
|
// 复制表头到新sheet的逻辑
|
||||||
|
ExcelUtils.copyHeader(sheet, style); |
||||||
|
|
||||||
|
// 批量处理数据
|
||||||
|
for (int i = 0; i < hyXsmsrsGVos.size(); i += batchSize) { |
||||||
|
// 处理一批数据
|
||||||
|
int toIndex = Math.min(i + batchSize, hyXsmsrsGVos.size()); |
||||||
|
List<HyXsmsrsGVo> batchList = hyXsmsrsGVos.subList(i, toIndex); |
||||||
|
|
||||||
|
// 批量写入数据
|
||||||
|
for (HyXsmsrsGVo vo : batchList) { |
||||||
|
// 如果当前行数达到最大行数,创建新sheet
|
||||||
|
if (rowIndex >= maxRowsPerSheet) { |
||||||
|
sheetIndex++; |
||||||
|
sheet = sheet.getWorkbook().createSheet("实测大断面成果表" + sheetIndex); |
||||||
|
rowIndex = 2; // 重置行号
|
||||||
|
// 复制表头到新sheet
|
||||||
|
ExcelUtils.copyHeader(sheet, style); |
||||||
|
} |
||||||
|
|
||||||
|
// 创建新行并写入数据
|
||||||
|
Row row = ExcelUtils.createRow(sheet, rowIndex); |
||||||
|
|
||||||
|
// 使用 globalIndex 作为序号
|
||||||
|
ExcelUtils.formatCell(row, 0, String.valueOf(globalIndex), style); |
||||||
|
ExcelUtils.formatCell(row, 1, vo.getStcd() != null ? vo.getStcd() : "", style); |
||||||
|
ExcelUtils.formatCell(row, 2, vo.getStnm() != null ? vo.getStnm() : "", style); |
||||||
|
ExcelUtils.formatCell(row, 3, vo.getAddvcd() != null ? vo.getAddvcd() : "", style); |
||||||
|
ExcelUtils.formatCell(row, 4, vo.getObdt() != null ? DateUtils.parseDateToStr(SystemConstants.TIME_FORMAT,vo.getObdt()) : "", style); |
||||||
|
ExcelUtils.formatCell(row, 5, vo.getObno() != null ? vo.getObno().toString() : "", style); |
||||||
|
ExcelUtils.formatCell(row, 6, vo.getVtno() != null ? vo.getVtno() : "", style); |
||||||
|
ExcelUtils.formatCell(row, 7, vo.getDi() != null ? vo.getDi().toString() : "", style); |
||||||
|
ExcelUtils.formatCell(row, 8, vo.getRvbbel() != null ? vo.getRvbbel().toString() : "", style); |
||||||
|
ExcelUtils.formatCell(row, 9, vo.getRvbbelrcd() != null ? vo.getRvbbelrcd() : "", style); |
||||||
|
ExcelUtils.formatCell(row, 10, vo.getOdbrz() != null ? vo.getOdbrz().toString() : "", style); |
||||||
|
ExcelUtils.formatCell(row, 11, vo.getOdbrzrcd() != null ? vo.getOdbrzrcd() : "", style); |
||||||
|
ExcelUtils.formatCell(row, 12, vo.getVtaz() != null ? vo.getVtaz() : "", style); |
||||||
|
ExcelUtils.formatCell(row, 13, vo.getNof() != null ? vo.getNof() .toString(): "", style); |
||||||
|
// 增加行号和全局序号
|
||||||
|
rowIndex++; |
||||||
|
globalIndex++; |
||||||
|
} |
||||||
|
} |
||||||
|
return 0; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,35 @@ |
|||||||
|
package com.ruoyi.swlscx.synchronousData.dto; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||||
|
import lombok.Data; |
||||||
|
import org.springframework.data.annotation.Id; |
||||||
|
|
||||||
|
/** |
||||||
|
* @Author al |
||||||
|
* @Date 2025/7/8 15:35 |
||||||
|
* @Description: TODO |
||||||
|
* @Version |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
public class YcResStatInfo { |
||||||
|
|
||||||
|
private Long id; |
||||||
|
|
||||||
|
private String stcd; |
||||||
|
|
||||||
|
private String stnm; |
||||||
|
|
||||||
|
private String sType; |
||||||
|
|
||||||
|
private String resType; |
||||||
|
|
||||||
|
private Long resTableId; |
||||||
|
|
||||||
|
private String resTable; |
||||||
|
|
||||||
|
private String statYear; |
||||||
|
|
||||||
|
private String oldYear; |
||||||
|
|
||||||
|
} |
@ -0,0 +1,33 @@ |
|||||||
|
package com.ruoyi.swlscx.synchronousData.mapper; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||||
|
import com.ruoyi.swlscx.basic.domain.vo.HyStscAVo; |
||||||
|
import com.ruoyi.swlscx.synchronousData.dto.YcResStatInfo; |
||||||
|
import org.apache.ibatis.annotations.Mapper; |
||||||
|
import org.apache.ibatis.annotations.Param; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
import java.util.Map; |
||||||
|
|
||||||
|
/** |
||||||
|
* @Author al |
||||||
|
* @Date 2025/7/8 15:18 |
||||||
|
* @Description: TODO |
||||||
|
* @Version |
||||||
|
*/ |
||||||
|
@Mapper |
||||||
|
public interface YcResTableInfoMapper { |
||||||
|
|
||||||
|
List<YcResStatInfo> getResTableByDay(@Param("tableName") String tableName); |
||||||
|
|
||||||
|
void saveBatch(List<YcResStatInfo> ycResStatInfoList); |
||||||
|
|
||||||
|
IPage<YcResStatInfo> getPageList(@Param("page") Page<HyStscAVo> page, @Param("param")Map<String,Object> map); |
||||||
|
|
||||||
|
List<YcResStatInfo> getResTableRainXPList(@Param("tableName") String tableName); |
||||||
|
|
||||||
|
List<YcResStatInfo> getResTableRainrexBList(@Param("tableName") String tableName); |
||||||
|
|
||||||
|
List<YcResStatInfo> getResTableTMList(@Param("tableName") String tableName); |
||||||
|
} |
@ -0,0 +1,15 @@ |
|||||||
|
package com.ruoyi.swlscx.synchronousData.service; |
||||||
|
|
||||||
|
import com.ruoyi.common.core.page.R; |
||||||
|
|
||||||
|
/** |
||||||
|
* @Author al |
||||||
|
* @Date 2025/7/8 15:18 |
||||||
|
* @Description: TODO |
||||||
|
* @Version |
||||||
|
*/ |
||||||
|
public interface YcResTableInfoService { |
||||||
|
R getYcResTableInfo(); |
||||||
|
|
||||||
|
R getStatInfo(String stcds, String startTime, String endTime,Integer pageNum,Integer pageSize); |
||||||
|
} |
@ -0,0 +1,224 @@ |
|||||||
|
package com.ruoyi.swlscx.synchronousData.service.impl; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||||
|
import com.ruoyi.common.core.page.R; |
||||||
|
import com.ruoyi.common.core.text.Convert; |
||||||
|
import com.ruoyi.swlscx.basic.domain.vo.HyStscAVo; |
||||||
|
import com.ruoyi.swlscx.common.utils.Query; |
||||||
|
import com.ruoyi.swlscx.synchronousData.dto.YcResStatInfo; |
||||||
|
import com.ruoyi.swlscx.synchronousData.enums.SWTableEnum; |
||||||
|
import com.ruoyi.swlscx.synchronousData.mapper.YcResTableInfoMapper; |
||||||
|
import com.ruoyi.swlscx.synchronousData.service.YcResTableInfoService; |
||||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||||
|
import org.springframework.stereotype.Service; |
||||||
|
import org.springframework.transaction.annotation.Transactional; |
||||||
|
|
||||||
|
import java.util.*; |
||||||
|
import java.util.stream.Collectors; |
||||||
|
|
||||||
|
/** |
||||||
|
* @Author al |
||||||
|
* @Date 2025/7/8 15:18 |
||||||
|
* @Description: TODO |
||||||
|
* @Version |
||||||
|
*/ |
||||||
|
@Service |
||||||
|
public class YcResTableInfoServiceImpl implements YcResTableInfoService { |
||||||
|
|
||||||
|
@Autowired |
||||||
|
private YcResTableInfoMapper ycResTableInfoMapper; |
||||||
|
|
||||||
|
@Override |
||||||
|
@Transactional(rollbackFor = Exception.class) |
||||||
|
public R getYcResTableInfo() { |
||||||
|
//逐日降水
|
||||||
|
List<YcResStatInfo> ycResStatInfoList = ycResTableInfoMapper.getResTableRainXPList(SWTableEnum.MONTH_RAIN.value()); |
||||||
|
ycResStatInfoList.forEach(i -> { |
||||||
|
i.setSType("P"); |
||||||
|
i.setResType("雨量资料"); |
||||||
|
i.setResTableId(1L); |
||||||
|
String statYear = i.getStatYear(); |
||||||
|
i.setStatYear(formatYears(statYear)); |
||||||
|
i.setOldYear(statYear); |
||||||
|
i.setResTable("逐日降水数据表"); |
||||||
|
} |
||||||
|
); |
||||||
|
ycResTableInfoMapper.saveBatch(ycResStatInfoList); |
||||||
|
|
||||||
|
//最大小时降水表(1)
|
||||||
|
List<YcResStatInfo> ycResStatInfoMMXPList = ycResTableInfoMapper.getResTableRainXPList(SWTableEnum.DP_MMXP.value()); |
||||||
|
ycResStatInfoMMXPList.forEach(i -> { |
||||||
|
i.setSType("P"); |
||||||
|
i.setResType("雨量资料"); |
||||||
|
i.setResTableId(2L); |
||||||
|
String statYear = i.getStatYear(); |
||||||
|
i.setStatYear(formatYears(statYear)); |
||||||
|
i.setOldYear(statYear); |
||||||
|
i.setResTable("各时段最大降水表(1)"); |
||||||
|
} |
||||||
|
); |
||||||
|
ycResTableInfoMapper.saveBatch(ycResStatInfoMMXPList); |
||||||
|
|
||||||
|
|
||||||
|
//最大小时降水表(2)
|
||||||
|
List<YcResStatInfo> ycResStatInfoHMXPList = ycResTableInfoMapper.getResTableRainXPList(SWTableEnum.DP_HMXP.value()); |
||||||
|
ycResStatInfoHMXPList.forEach(i -> { |
||||||
|
i.setSType("P"); |
||||||
|
i.setResType("雨量资料"); |
||||||
|
i.setResTableId(3L); |
||||||
|
String statYear = i.getStatYear(); |
||||||
|
i.setStatYear(formatYears(statYear)); |
||||||
|
i.setOldYear(statYear); |
||||||
|
i.setResTable("各时段最大降水表(2)"); |
||||||
|
} |
||||||
|
); |
||||||
|
ycResTableInfoMapper.saveBatch(ycResStatInfoHMXPList); |
||||||
|
|
||||||
|
//降水量摘录表
|
||||||
|
List<YcResStatInfo> ycResStatInfoPrexBList = ycResTableInfoMapper.getResTableRainrexBList(SWTableEnum.DP_HOUR.value()); |
||||||
|
ycResStatInfoPrexBList.forEach(i -> { |
||||||
|
i.setSType("P"); |
||||||
|
i.setResType("雨量资料"); |
||||||
|
i.setResTableId(4L); |
||||||
|
String statYear = i.getStatYear(); |
||||||
|
i.setStatYear(formatYears(statYear)); |
||||||
|
i.setOldYear(statYear); |
||||||
|
i.setResTable("降水量摘录表"); |
||||||
|
} |
||||||
|
); |
||||||
|
ycResTableInfoMapper.saveBatch(ycResStatInfoPrexBList); |
||||||
|
|
||||||
|
|
||||||
|
//逐日平均水位表
|
||||||
|
List<YcResStatInfo> ycResStatInfoZDayList = ycResTableInfoMapper.getResTableRainXPList(SWTableEnum.MONTH_RIVER.value()); |
||||||
|
ycResStatInfoZDayList.forEach(i -> { |
||||||
|
i.setSType("Z"); |
||||||
|
i.setResType("水位资料"); |
||||||
|
i.setResTableId(5L); |
||||||
|
String statYear = i.getStatYear(); |
||||||
|
i.setStatYear(formatYears(statYear)); |
||||||
|
i.setOldYear(statYear); |
||||||
|
i.setResTable("逐日平均水位表"); |
||||||
|
} |
||||||
|
); |
||||||
|
|
||||||
|
ycResTableInfoMapper.saveBatch(ycResStatInfoZDayList); |
||||||
|
|
||||||
|
// 水闸洪水水文要素摘录表
|
||||||
|
List<YcResStatInfo> ycResStatInfoSZList2 = ycResTableInfoMapper.getResTableTMList(SWTableEnum.DP_WSFHEX.value()); |
||||||
|
ycResStatInfoSZList2.forEach(i -> { |
||||||
|
i.setSType("Z"); |
||||||
|
i.setResType("水位资料"); |
||||||
|
i.setResTableId(6L); |
||||||
|
String statYear = i.getStatYear(); |
||||||
|
i.setStatYear(formatYears(statYear)); |
||||||
|
i.setOldYear(statYear); |
||||||
|
i.setResTable("水闸洪水水文要素摘录表"); |
||||||
|
} |
||||||
|
); |
||||||
|
ycResTableInfoMapper.saveBatch(ycResStatInfoSZList2); |
||||||
|
|
||||||
|
|
||||||
|
// 逐潮高低潮位表
|
||||||
|
List<YcResStatInfo> ycResStatInfoZCList2 = ycResTableInfoMapper.getResTableTMList(SWTableEnum.DP_HLTDZ.value()); |
||||||
|
ycResStatInfoZCList2.forEach(i -> { |
||||||
|
i.setSType("Z"); |
||||||
|
i.setResType("水位资料"); |
||||||
|
i.setResTableId(7L); |
||||||
|
String statYear = i.getStatYear(); |
||||||
|
i.setStatYear(formatYears(statYear)); |
||||||
|
i.setOldYear(statYear); |
||||||
|
i.setResTable("逐潮高低潮位表"); |
||||||
|
} |
||||||
|
); |
||||||
|
ycResTableInfoMapper.saveBatch(ycResStatInfoZCList2); |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 潮位月年统计表
|
||||||
|
List<YcResStatInfo> ycResStatInfoCWList2 = ycResTableInfoMapper.getResTableRainXPList(SWTableEnum.MONTH_MTTDZ.value()); |
||||||
|
ycResStatInfoCWList2.forEach(i -> { |
||||||
|
i.setSType("Z"); |
||||||
|
i.setResType("水位资料"); |
||||||
|
i.setResTableId(8L); |
||||||
|
String statYear = i.getStatYear(); |
||||||
|
i.setStatYear(formatYears(statYear)); |
||||||
|
i.setOldYear(statYear); |
||||||
|
i.setResTable("潮位月年统计表"); |
||||||
|
} |
||||||
|
); |
||||||
|
ycResTableInfoMapper.saveBatch(ycResStatInfoCWList2); |
||||||
|
|
||||||
|
|
||||||
|
return R.ok().put("data", ycResStatInfoSZList2); |
||||||
|
} |
||||||
|
|
||||||
|
public static String formatYears(String yearStr) { |
||||||
|
if (yearStr == null || yearStr.isEmpty()) { |
||||||
|
return ""; |
||||||
|
} |
||||||
|
|
||||||
|
// 拆分年份并转换为整数集合
|
||||||
|
String[] yearArray = yearStr.split(","); |
||||||
|
List<Integer> years = new ArrayList<>(); |
||||||
|
for (String year : yearArray) { |
||||||
|
try { |
||||||
|
years.add(Integer.parseInt(year.trim())); |
||||||
|
} catch (NumberFormatException ignored) { |
||||||
|
} |
||||||
|
} |
||||||
|
if (years.isEmpty()) return ""; |
||||||
|
|
||||||
|
// 排序年份
|
||||||
|
Collections.sort(years); |
||||||
|
|
||||||
|
// 合并连续年份
|
||||||
|
List<String> parts = new ArrayList<>(); |
||||||
|
int start = years.get(0); |
||||||
|
int prev = start; |
||||||
|
|
||||||
|
for (int i = 1; i < years.size(); i++) { |
||||||
|
int current = years.get(i); |
||||||
|
if (current == prev + 1) { // 连续年份
|
||||||
|
prev = current; |
||||||
|
} else { // 非连续年份
|
||||||
|
addYearPart(parts, start, prev); |
||||||
|
start = current; |
||||||
|
prev = current; |
||||||
|
} |
||||||
|
} |
||||||
|
addYearPart(parts, start, prev); // 处理最后一组
|
||||||
|
|
||||||
|
return String.join(",", parts); |
||||||
|
} |
||||||
|
|
||||||
|
private static void addYearPart(List<String> parts, int start, int end) { |
||||||
|
if (start == end) { |
||||||
|
parts.add(String.valueOf(start)); |
||||||
|
} else { |
||||||
|
parts.add(start + "-" + end); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public R getStatInfo(String stcds, String startTime, String endTime, Integer pageNum, Integer pageSize) { |
||||||
|
Map<String, Object> map = new HashMap<>(); |
||||||
|
map.put("page", Convert.toStr(pageNum)); |
||||||
|
map.put("limit", Convert.toStr(pageSize)); |
||||||
|
List<String> filteredList = Collections.emptyList(); |
||||||
|
if (stcds != null) { |
||||||
|
if (stcds.contains("all")) { |
||||||
|
stcds = ""; |
||||||
|
} |
||||||
|
filteredList = Arrays.stream(stcds.split(",")) |
||||||
|
.filter(s -> s != null && !s.trim().isEmpty()) |
||||||
|
.map(String::trim) |
||||||
|
.collect(Collectors.toList()); |
||||||
|
} |
||||||
|
System.out.println("stcds: "+stcds); |
||||||
|
map.put("stcds", filteredList.isEmpty() ? null : filteredList); |
||||||
|
IPage<YcResStatInfo> ycResStatInfoIPage = ycResTableInfoMapper.getPageList(new Query<HyStscAVo>().getPage(map), map); |
||||||
|
|
||||||
|
return R.ok().put("data", ycResStatInfoIPage.getRecords()).put("count", ycResStatInfoIPage.getTotal()); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,70 @@ |
|||||||
|
<?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.ruoyi.swlscx.actualSurvey.mapper.HyObqGMapper"> |
||||||
|
<select id="selectHyObqGDataByPageAndInfo" resultType="com.ruoyi.swlscx.actualSurvey.domain.vo.HyObqGVo"> |
||||||
|
select hsa.stcd,hme.yr,hme.mnth,hme.qobno,hme.msqbgtm,hme.msqedtm,hme.xsqlc,hme.msqmt,hme.bsggz,hme.q,hme.qrcd,hme.xstta, hme.xsa,hme.xsarcd |
||||||
|
, hme.xsavv,hme.xsmxv , hme.tpwd , hme.xsavdp , hme.xsmxdp , hme.ibwd , hme.ibavdp,hme.ibmxdp,hme.rvsfsl,hme.n |
||||||
|
, hme.obnont,hsa.stnm,hsa.addvcd from hy_obq_g hme |
||||||
|
left join hy_stsc_a hsa on hme.stcd = hsa.stcd |
||||||
|
<where> |
||||||
|
<trim prefixOverrides="and"> |
||||||
|
<if test="map.stcd != null and map.stcd.size >0"> |
||||||
|
and hme.stcd in <foreach collection="map.stcd" item="stcd" separator="," open="(" close=")"> |
||||||
|
#{stcd} |
||||||
|
</foreach> |
||||||
|
</if> |
||||||
|
<if test="map.stnm != null and map.stnm != ''"> |
||||||
|
and hsa.stnm like concat('%',#{map.stnm},'%') |
||||||
|
</if> |
||||||
|
<if test="map.startYear != null and map.startYear != ''"> |
||||||
|
and hme.yr >= #{map.startYear} |
||||||
|
</if> |
||||||
|
<if test="map.endYear != null and map.endYear != ''"> |
||||||
|
and hme.yr <= #{map.endYear} |
||||||
|
</if> |
||||||
|
<if test="map.startTime != null and map.startTime != ''"> |
||||||
|
and CONCAT(hme.yr, LPAD(hme.MNTH, 2, '0')) >= #{map.startTime} |
||||||
|
</if> |
||||||
|
<if test="map.endTime != null and map.endTime != ''"> |
||||||
|
and CONCAT(hme.yr, LPAD(hme.MNTH, 2, '0')) <= #{map.endTime} |
||||||
|
</if> |
||||||
|
</trim> |
||||||
|
</where> |
||||||
|
order by hme.yr , hme.MNTH ,hme.msqbgtm |
||||||
|
</select> |
||||||
|
|
||||||
|
<select id="selectHyObqGData" resultType="com.ruoyi.swlscx.actualSurvey.domain.vo.HyObqGVo"> |
||||||
|
select hsa.stcd,hme.yr,hme.mnth,hme.qobno,hme.msqbgtm,hme.msqedtm,hme.xsqlc,hme.msqmt,hme.bsggz,hme.q,hme.qrcd,hme.xstta, hme.xsa,hme.xsarcd |
||||||
|
, hme.xsavv,hme.xsmxv , hme.tpwd , hme.xsavdp , hme.xsmxdp , hme.ibwd , hme.ibavdp,hme.ibmxdp,hme.rvsfsl,hme.n |
||||||
|
, hme.obnont,hsa.stnm,hsa.addvcd from hy_obq_g hme |
||||||
|
left join hy_stsc_a hsa on hme.stcd = hsa.stcd |
||||||
|
<where> |
||||||
|
<trim prefixOverrides="and"> |
||||||
|
<if test="map.stcd != null and map.stcd.size >0"> |
||||||
|
and hme.stcd in <foreach collection="map.stcd" item="stcd" separator="," open="(" close=")"> |
||||||
|
#{stcd} |
||||||
|
</foreach> |
||||||
|
</if> |
||||||
|
<if test="map.stnm != null and map.stnm != ''"> |
||||||
|
and hsa.stnm like concat('%',#{map.stnm},'%') |
||||||
|
</if> |
||||||
|
<if test="map.startYear != null and map.startYear != ''"> |
||||||
|
and hme.yr >= #{map.startYear} |
||||||
|
</if> |
||||||
|
<if test="map.endYear != null and map.endYear != ''"> |
||||||
|
and hme.yr <= #{map.endYear} |
||||||
|
</if> |
||||||
|
<if test="map.startTime != null and map.startTime != ''"> |
||||||
|
and CONCAT(hme.yr, LPAD(hme.MNTH, 2, '0')) >= #{map.startTime} |
||||||
|
</if> |
||||||
|
<if test="map.endTime != null and map.endTime != ''"> |
||||||
|
and CONCAT(hme.yr, LPAD(hme.MNTH, 2, '0')) <= #{map.endTime} |
||||||
|
</if> |
||||||
|
</trim> |
||||||
|
</where> |
||||||
|
order by hme.yr , hme.MNTH ,hme.msqbgtm |
||||||
|
</select> |
||||||
|
|
||||||
|
</mapper> |
@ -0,0 +1,54 @@ |
|||||||
|
<?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.ruoyi.swlscx.actualSurvey.mapper.HyXsmsrsGMapper"> |
||||||
|
|
||||||
|
<select id="selectHyXsmsrsGDataByPageAndInfo" resultType="com.ruoyi.swlscx.actualSurvey.domain.vo.HyXsmsrsGVo"> |
||||||
|
select hsa.stcd,hme.obdt,hme.obno,hme.vtno,hme.di,hme.rvbbel,hme.rvbbelrcd,hme.odbrz,hme.odbrzrcd,hme.vtaz,hme.nof |
||||||
|
,hsa.stnm,hsa.addvcd from hy_xsmsrs_g hme |
||||||
|
left join hy_stsc_a hsa on hme.stcd = hsa.stcd |
||||||
|
<where> |
||||||
|
<trim prefixOverrides="and"> |
||||||
|
<if test="map.stcd != null and map.stcd.size >0"> |
||||||
|
and hme.stcd in |
||||||
|
<foreach collection="map.stcd" item="stcd" separator="," open="(" close=")"> |
||||||
|
#{stcd} |
||||||
|
</foreach> |
||||||
|
</if> |
||||||
|
<if test="map.startTime != null and map.startTime != ''"> |
||||||
|
and hme.OBDT >= #{map.startTime} |
||||||
|
</if> |
||||||
|
<if test="map.endTime != null and map.endTime != ''"> |
||||||
|
and hme.OBDT <= #{map.endTime} |
||||||
|
</if> |
||||||
|
</trim> |
||||||
|
</where> |
||||||
|
order by hme.stcd,hme.OBDT,hme.obno |
||||||
|
|
||||||
|
</select> |
||||||
|
|
||||||
|
|
||||||
|
<select id="selectHyXsmsrsGData" resultType="com.ruoyi.swlscx.actualSurvey.domain.vo.HyXsmsrsGVo"> |
||||||
|
select hsa.stcd,hme.obdt,hme.obno,hme.vtno,hme.di,hme.rvbbel,hme.rvbbelrcd,hme.odbrz,hme.odbrzrcd,hme.vtaz,hme.nof |
||||||
|
,hsa.stnm,hsa.addvcd from hy_xsmsrs_g hme |
||||||
|
left join hy_stsc_a hsa on hme.stcd = hsa.stcd |
||||||
|
<where> |
||||||
|
<trim prefixOverrides="and"> |
||||||
|
<if test="map.stcd != null and map.stcd.size >0"> |
||||||
|
and hme.stcd in |
||||||
|
<foreach collection="map.stcd" item="stcd" separator="," open="(" close=")"> |
||||||
|
#{stcd} |
||||||
|
</foreach> |
||||||
|
</if> |
||||||
|
<if test="map.startTime != null and map.startTime != ''"> |
||||||
|
and hme.OBDT >= #{map.startTime} |
||||||
|
</if> |
||||||
|
<if test="map.endTime != null and map.endTime != ''"> |
||||||
|
and hme.OBDT <= #{map.endTime} |
||||||
|
</if> |
||||||
|
</trim> |
||||||
|
</where> |
||||||
|
order by hme.stcd,hme.OBDT,hme.obno |
||||||
|
</select> |
||||||
|
|
||||||
|
</mapper> |
@ -0,0 +1,84 @@ |
|||||||
|
<?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.ruoyi.swlscx.synchronousData.mapper.YcResTableInfoMapper"> |
||||||
|
|
||||||
|
|
||||||
|
<select id="getResTableByDay" resultType="com.ruoyi.swlscx.synchronousData.dto.YcResStatInfo"> |
||||||
|
SELECT stcd, |
||||||
|
group_concat(tm) as statYear |
||||||
|
FROM (SELECT a.stcd, |
||||||
|
LEFT(a.dt, 4) tm |
||||||
|
FROM ${tableName} a |
||||||
|
JOIN hy_stsc_a b ON a.stcd = b.stcd |
||||||
|
GROUP BY stcd, |
||||||
|
LEFT(dt, 4)) a |
||||||
|
GROUP BY stcd |
||||||
|
</select> |
||||||
|
|
||||||
|
<insert id="saveBatch" parameterType="java.util.List"> |
||||||
|
INSERT INTO yc_res_stat_info |
||||||
|
(stcd, s_type, res_table_id, res_type, res_table,stat_year,old_year) |
||||||
|
VALUES |
||||||
|
<foreach collection="list" item="item" separator=","> |
||||||
|
(#{item.stcd}, #{item.sType}, #{item.resTableId}, #{item.resType}, #{item.resTable}, |
||||||
|
#{item.statYear}, #{item.oldYear}) |
||||||
|
</foreach> |
||||||
|
ON DUPLICATE KEY UPDATE |
||||||
|
res_type = VALUES(res_type), |
||||||
|
res_table = VALUES(res_table), |
||||||
|
stat_year = VALUES(stat_year), |
||||||
|
old_year = VALUES(old_year) |
||||||
|
</insert> |
||||||
|
|
||||||
|
<select id="getPageList" resultType="com.ruoyi.swlscx.synchronousData.dto.YcResStatInfo"> |
||||||
|
SELECT a.stcd, |
||||||
|
b.stnm, |
||||||
|
a.s_type, |
||||||
|
a.res_table_id, |
||||||
|
a.res_type, |
||||||
|
a.res_table, |
||||||
|
a.stat_year |
||||||
|
FROM yc_res_stat_info a |
||||||
|
left join hy_stsc_a b on a.stcd = b.stcd |
||||||
|
<where> |
||||||
|
<trim prefixOverrides="and"> |
||||||
|
<if test="param.stcds != null and param.stcds.size >0"> |
||||||
|
a.stcd in <foreach collection="param.stcds" item="stcd" separator="," open="(" close=")"> |
||||||
|
#{stcd} |
||||||
|
</foreach> |
||||||
|
</if> |
||||||
|
</trim> |
||||||
|
</where> |
||||||
|
order by a.stcd |
||||||
|
</select> |
||||||
|
|
||||||
|
|
||||||
|
<select id="getResTableRainXPList" resultType="com.ruoyi.swlscx.synchronousData.dto.YcResStatInfo"> |
||||||
|
SELECT stcd, |
||||||
|
group_concat(yr) as statYear |
||||||
|
FROM (SELECT a.stcd, |
||||||
|
yr |
||||||
|
FROM ${tableName} a |
||||||
|
JOIN hy_stsc_a b ON a.stcd = b.stcd |
||||||
|
GROUP BY stcd, |
||||||
|
yr) a |
||||||
|
GROUP BY stcd |
||||||
|
</select> |
||||||
|
|
||||||
|
|
||||||
|
<select id="getResTableRainrexBList" resultType="com.ruoyi.swlscx.synchronousData.dto.YcResStatInfo" > |
||||||
|
SELECT stcd, GROUP_CONCAT(DISTINCT LEFT(bgtm, 4)) AS statYear |
||||||
|
FROM ${tableName} a |
||||||
|
WHERE EXISTS (SELECT 1 FROM hy_stsc_a b WHERE a.stcd = b.stcd) |
||||||
|
GROUP BY stcd |
||||||
|
</select> |
||||||
|
|
||||||
|
<select id="getResTableTMList" resultType="com.ruoyi.swlscx.synchronousData.dto.YcResStatInfo"> |
||||||
|
SELECT stcd, GROUP_CONCAT(DISTINCT LEFT(tm, 4)) AS statYear |
||||||
|
FROM ${tableName} a |
||||||
|
WHERE EXISTS (SELECT 1 FROM hy_stsc_a b WHERE a.stcd = b.stcd) |
||||||
|
GROUP BY stcd |
||||||
|
</select> |
||||||
|
</mapper> |
Loading…
Reference in new issue