添加功能
This commit is contained in:
@@ -0,0 +1,96 @@
|
||||
package com.ruoyi.cms.controller;
|
||||
|
||||
import com.ruoyi.cms.domain.ModelUnemploymentWarningDiffusion;
|
||||
import com.ruoyi.cms.service.ModelUnemploymentWarningDiffusionService;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 失业预警扩散指数管理
|
||||
*
|
||||
* @author 马宝龙
|
||||
* @date 2026/7/2
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/model/unemploymentWarningDiffusion")
|
||||
@RequiredArgsConstructor
|
||||
public class ModelUnemploymentWarningDiffusionController extends BaseController {
|
||||
|
||||
private final ModelUnemploymentWarningDiffusionService modelUnemploymentWarningDiffusionService;
|
||||
|
||||
/**
|
||||
* 创建
|
||||
*
|
||||
* @param modelUnemploymentWarningDiffusion 失业预警扩散指数
|
||||
* @return 创建结果
|
||||
*/
|
||||
@PostMapping("/create")
|
||||
public AjaxResult create(@Valid @RequestBody ModelUnemploymentWarningDiffusion modelUnemploymentWarningDiffusion) {
|
||||
modelUnemploymentWarningDiffusionService.create(modelUnemploymentWarningDiffusion);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param modelUnemploymentWarningDiffusion 失业预警扩散指数
|
||||
* @return 更新结果
|
||||
*/
|
||||
@PutMapping("/update")
|
||||
public AjaxResult update(@Valid @RequestBody ModelUnemploymentWarningDiffusion modelUnemploymentWarningDiffusion) {
|
||||
modelUnemploymentWarningDiffusionService.update(modelUnemploymentWarningDiffusion);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param id ID
|
||||
* @return 删除结果
|
||||
*/
|
||||
@DeleteMapping("/delete")
|
||||
public AjaxResult delete(@RequestParam Long id) {
|
||||
modelUnemploymentWarningDiffusionService.delete(id);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*
|
||||
* @param id ID
|
||||
* @return 失业预警扩散指数
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
public AjaxResult detail(@RequestParam Long id) {
|
||||
ModelUnemploymentWarningDiffusion diffusion = modelUnemploymentWarningDiffusionService.detail(id);
|
||||
return AjaxResult.success(diffusion);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分页列表
|
||||
*
|
||||
* @param modelUnemploymentWarningDiffusion 失业预警扩散指数
|
||||
* @return 分页列表
|
||||
*/
|
||||
@PostMapping("/page")
|
||||
@ResponseBody
|
||||
public TableDataInfo page(@RequestBody ModelUnemploymentWarningDiffusion modelUnemploymentWarningDiffusion) {
|
||||
startPage();
|
||||
List<ModelUnemploymentWarningDiffusion> list = modelUnemploymentWarningDiffusionService.list(modelUnemploymentWarningDiffusion);
|
||||
return getDataTable(list);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.ruoyi.cms.domain;
|
||||
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 失业预警扩散指数管理
|
||||
*
|
||||
* @author 马宝龙
|
||||
* @date 2026/7/2
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ModelUnemploymentWarningDiffusion implements Serializable {
|
||||
private static final long serialVersionUID = -3444223057995852029L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 指标编码
|
||||
*/
|
||||
@Excel(name = "指标编码")
|
||||
private String indicatorCode;
|
||||
|
||||
/**
|
||||
* 指标名称
|
||||
*/
|
||||
private String indicatorName;
|
||||
|
||||
/**
|
||||
* 指标权重
|
||||
*/
|
||||
@Excel(name = "指标权重")
|
||||
private BigDecimal indicatorWeight;
|
||||
|
||||
/**
|
||||
* 指标类型
|
||||
*/
|
||||
@Excel(name = "指标类型")
|
||||
private Integer indicatorType;
|
||||
|
||||
/**
|
||||
* 提前期数
|
||||
*/
|
||||
@Excel(name = "提前期数")
|
||||
private Integer leadPeriod;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@Excel(name = "排序")
|
||||
private Integer sortOrder;
|
||||
}
|
||||
@@ -44,10 +44,10 @@ public interface ModelEmploymentMonitorCompositeMapper {
|
||||
/**
|
||||
* 查询唯一
|
||||
*
|
||||
* @param modelEmploymentMonitorComposite 就业监测综合指数
|
||||
* @param indicatorCode 指标编码
|
||||
* @return 就业监测综合指数
|
||||
*/
|
||||
ModelEmploymentMonitorComposite findUnique(ModelEmploymentMonitorComposite modelEmploymentMonitorComposite);
|
||||
ModelEmploymentMonitorComposite findUnique(String indicatorCode);
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
|
||||
@@ -44,10 +44,10 @@ public interface ModelUnemploymentRateMonitorMapper {
|
||||
/**
|
||||
* 查询唯一
|
||||
*
|
||||
* @param modelUnemploymentRateMonitor 失业率监测
|
||||
* @param indicatorCode 指标编码
|
||||
* @return 失业率监测
|
||||
*/
|
||||
ModelUnemploymentRateMonitor findUnique(ModelUnemploymentRateMonitor modelUnemploymentRateMonitor);
|
||||
ModelUnemploymentRateMonitor findUnique(String indicatorCode);
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.ruoyi.cms.mapper;
|
||||
|
||||
import com.ruoyi.cms.domain.ModelUnemploymentWarningDiffusion;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 失业预警扩散指数管理
|
||||
*
|
||||
* @author 马宝龙
|
||||
* @date 2026/7/2
|
||||
*/
|
||||
public interface ModelUnemploymentWarningDiffusionMapper {
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param modelUnemploymentWarningDiffusion 失业预警扩散指数
|
||||
*/
|
||||
void insert(ModelUnemploymentWarningDiffusion modelUnemploymentWarningDiffusion);
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*
|
||||
* @param modelUnemploymentWarningDiffusion 失业预警扩散指数
|
||||
*/
|
||||
void update(ModelUnemploymentWarningDiffusion modelUnemploymentWarningDiffusion);
|
||||
|
||||
/**
|
||||
* 通过ID删除
|
||||
*
|
||||
* @param id ID
|
||||
*/
|
||||
void deleteById(Long id);
|
||||
|
||||
/**
|
||||
* 通过ID查询
|
||||
*
|
||||
* @param id ID
|
||||
* @return 失业预警扩散指数
|
||||
*/
|
||||
ModelUnemploymentWarningDiffusion selectById(Long id);
|
||||
|
||||
/**
|
||||
* 查询唯一
|
||||
*
|
||||
* @param indicatorCode 指标编码
|
||||
* @return 失业预警扩散指数
|
||||
*/
|
||||
ModelUnemploymentWarningDiffusion findUnique(String indicatorCode);
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*
|
||||
* @param modelUnemploymentWarningDiffusion 失业预警扩散指数
|
||||
* @return 列表
|
||||
*/
|
||||
List<ModelUnemploymentWarningDiffusion> list(ModelUnemploymentWarningDiffusion modelUnemploymentWarningDiffusion);
|
||||
}
|
||||
@@ -49,6 +49,14 @@ public interface ModelWarningIndicatorDataMapper {
|
||||
*/
|
||||
ModelWarningIndicatorData findUnique(ModelWarningIndicatorData modelWarningIndicatorData);
|
||||
|
||||
/**
|
||||
* 通过指标编码查询
|
||||
*
|
||||
* @param indicatorCode 指标编码
|
||||
* @return 指标数据列表
|
||||
*/
|
||||
List<ModelWarningIndicatorData> selectByIndicatorCode(String indicatorCode);
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.ruoyi.cms.service;
|
||||
|
||||
import com.ruoyi.cms.domain.ModelUnemploymentWarningDiffusion;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 失业预警扩散指数管理
|
||||
*
|
||||
* @author 马宝龙
|
||||
* @date 2026/7/2
|
||||
*/
|
||||
public interface ModelUnemploymentWarningDiffusionService {
|
||||
|
||||
/**
|
||||
* 创建
|
||||
*
|
||||
* @param modelUnemploymentWarningDiffusion 失业预警扩散指数
|
||||
*/
|
||||
void create(ModelUnemploymentWarningDiffusion modelUnemploymentWarningDiffusion);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param modelUnemploymentWarningDiffusion 失业预警扩散指数
|
||||
*/
|
||||
void update(ModelUnemploymentWarningDiffusion modelUnemploymentWarningDiffusion);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param id ID
|
||||
*/
|
||||
void delete(Long id);
|
||||
|
||||
/**
|
||||
* 查询详情
|
||||
*
|
||||
* @param id ID
|
||||
* @return 失业预警扩散指数
|
||||
*/
|
||||
ModelUnemploymentWarningDiffusion detail(Long id);
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*
|
||||
* @param modelUnemploymentWarningDiffusion 失业预警扩散指数
|
||||
* @return 列表
|
||||
*/
|
||||
List<ModelUnemploymentWarningDiffusion> list(ModelUnemploymentWarningDiffusion modelUnemploymentWarningDiffusion);
|
||||
}
|
||||
@@ -130,7 +130,7 @@ public class ModelEmploymentMonitorCompositeServiceImpl implements ModelEmployme
|
||||
*/
|
||||
private Optional<ModelEmploymentMonitorComposite> findUnique(ModelEmploymentMonitorComposite modelEmploymentMonitorComposite) {
|
||||
ModelEmploymentMonitorComposite unique =
|
||||
modelEmploymentMonitorCompositeMapper.findUnique(modelEmploymentMonitorComposite);
|
||||
modelEmploymentMonitorCompositeMapper.findUnique(modelEmploymentMonitorComposite.getIndicatorCode());
|
||||
return Optional.ofNullable(unique);
|
||||
}
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@ public class ModelUnemploymentRateMonitorServiceImpl implements ModelUnemploymen
|
||||
*/
|
||||
private Optional<ModelUnemploymentRateMonitor> findUnique(ModelUnemploymentRateMonitor modelUnemploymentRateMonitor) {
|
||||
ModelUnemploymentRateMonitor unique =
|
||||
modelUnemploymentRateMonitorMapper.findUnique(modelUnemploymentRateMonitor);
|
||||
modelUnemploymentRateMonitorMapper.findUnique(modelUnemploymentRateMonitor.getIndicatorCode());
|
||||
return Optional.ofNullable(unique);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,144 @@
|
||||
package com.ruoyi.cms.service.impl;
|
||||
|
||||
import com.ruoyi.cms.domain.ModelUnemploymentWarningDiffusion;
|
||||
import com.ruoyi.cms.domain.ModelWarningIndicator;
|
||||
import com.ruoyi.cms.mapper.ModelUnemploymentWarningDiffusionMapper;
|
||||
import com.ruoyi.cms.mapper.ModelWarningIndicatorMapper;
|
||||
import com.ruoyi.cms.service.ModelUnemploymentWarningDiffusionService;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 失业预警扩散指数管理
|
||||
*
|
||||
* @author 马宝龙
|
||||
* @date 2026/7/2
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
public class ModelUnemploymentWarningDiffusionServiceImpl implements ModelUnemploymentWarningDiffusionService {
|
||||
|
||||
|
||||
private final ModelUnemploymentWarningDiffusionMapper modelUnemploymentWarningDiffusionMapper;
|
||||
private final ModelWarningIndicatorMapper modelWarningIndicatorMapper;
|
||||
|
||||
@Override
|
||||
public void create(ModelUnemploymentWarningDiffusion modelUnemploymentWarningDiffusion) {
|
||||
|
||||
check(modelUnemploymentWarningDiffusion);
|
||||
|
||||
// 查询唯一
|
||||
Optional<ModelUnemploymentWarningDiffusion> optional = findUnique(modelUnemploymentWarningDiffusion);
|
||||
if (optional.isPresent()) {
|
||||
// 更新
|
||||
ModelUnemploymentWarningDiffusion exists = optional.get();
|
||||
modelUnemploymentWarningDiffusion.setId(exists.getId());
|
||||
modelUnemploymentWarningDiffusionMapper.update(modelUnemploymentWarningDiffusion);
|
||||
} else {
|
||||
// 新增
|
||||
modelUnemploymentWarningDiffusionMapper.insert(modelUnemploymentWarningDiffusion);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查
|
||||
*
|
||||
* @param modelUnemploymentWarningDiffusion 失业预警扩散指数
|
||||
*/
|
||||
void check(ModelUnemploymentWarningDiffusion modelUnemploymentWarningDiffusion) {
|
||||
if (StringUtils.isBlank(modelUnemploymentWarningDiffusion.getIndicatorCode())) {
|
||||
throw new ServiceException("指标编码不能为空");
|
||||
}
|
||||
if (Objects.isNull(modelUnemploymentWarningDiffusion.getIndicatorWeight())) {
|
||||
throw new ServiceException("指标权重不能为空");
|
||||
}
|
||||
Set<Integer> indicatorTypes = new HashSet<>();
|
||||
indicatorTypes.add(1);
|
||||
indicatorTypes.add(2);
|
||||
if (Objects.isNull(modelUnemploymentWarningDiffusion.getIndicatorType())
|
||||
|| !indicatorTypes.contains(modelUnemploymentWarningDiffusion.getIndicatorType())) {
|
||||
throw new ServiceException("指标类型错误");
|
||||
}
|
||||
if (Objects.isNull(modelUnemploymentWarningDiffusion.getLeadPeriod())) {
|
||||
throw new ServiceException("提前期数不能为空");
|
||||
}
|
||||
if (Objects.isNull(modelUnemploymentWarningDiffusion.getSortOrder())) {
|
||||
throw new ServiceException("排序不能为空");
|
||||
}
|
||||
|
||||
// 校验指标是否存在
|
||||
ModelWarningIndicator unique =
|
||||
modelWarningIndicatorMapper.findUnique(modelUnemploymentWarningDiffusion.getIndicatorCode());
|
||||
if (Objects.isNull(unique)) {
|
||||
throw new ServiceException("指标[" + modelUnemploymentWarningDiffusion.getIndicatorCode() + "]不存在");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(ModelUnemploymentWarningDiffusion modelUnemploymentWarningDiffusion) {
|
||||
|
||||
check(modelUnemploymentWarningDiffusion);
|
||||
|
||||
if (Objects.isNull(modelUnemploymentWarningDiffusion.getId())) {
|
||||
throw new ServiceException("id不能为空");
|
||||
}
|
||||
Optional<ModelUnemploymentWarningDiffusion> unique = findUnique(modelUnemploymentWarningDiffusion);
|
||||
if (!unique.isPresent()) {
|
||||
modelUnemploymentWarningDiffusionMapper.update(modelUnemploymentWarningDiffusion);
|
||||
return;
|
||||
}
|
||||
ModelUnemploymentWarningDiffusion exists = unique.get();
|
||||
if (!exists.getId().equals(modelUnemploymentWarningDiffusion.getId())) {
|
||||
throw new ServiceException("指标已存在");
|
||||
}
|
||||
modelUnemploymentWarningDiffusionMapper.update(modelUnemploymentWarningDiffusion);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(Long id) {
|
||||
if (Objects.isNull(id)) {
|
||||
throw new ServiceException("id不能为空");
|
||||
}
|
||||
modelUnemploymentWarningDiffusionMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModelUnemploymentWarningDiffusion detail(Long id) {
|
||||
|
||||
if (Objects.isNull(id)) {
|
||||
throw new ServiceException("id不能为空");
|
||||
}
|
||||
|
||||
return modelUnemploymentWarningDiffusionMapper.selectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询唯一
|
||||
*
|
||||
* @param modelUnemploymentWarningDiffusion 失业预警扩散指数
|
||||
* @return 失业预警扩散指数
|
||||
*/
|
||||
private Optional<ModelUnemploymentWarningDiffusion> findUnique(ModelUnemploymentWarningDiffusion modelUnemploymentWarningDiffusion) {
|
||||
ModelUnemploymentWarningDiffusion unique =
|
||||
modelUnemploymentWarningDiffusionMapper.findUnique(modelUnemploymentWarningDiffusion.getIndicatorCode());
|
||||
return Optional.ofNullable(unique);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ModelUnemploymentWarningDiffusion> list(ModelUnemploymentWarningDiffusion modelUnemploymentWarningDiffusion) {
|
||||
return modelUnemploymentWarningDiffusionMapper.list(modelUnemploymentWarningDiffusion);
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,22 @@
|
||||
package com.ruoyi.cms.service.impl;
|
||||
|
||||
import com.ruoyi.cms.domain.ModelEmploymentMonitorComposite;
|
||||
import com.ruoyi.cms.domain.ModelUnemploymentRateMonitor;
|
||||
import com.ruoyi.cms.domain.ModelUnemploymentWarningDiffusion;
|
||||
import com.ruoyi.cms.domain.ModelWarningIndicator;
|
||||
import com.ruoyi.cms.domain.ModelWarningIndicatorData;
|
||||
import com.ruoyi.cms.domain.vo.TreeVo;
|
||||
import com.ruoyi.cms.mapper.ModelEmploymentMonitorCompositeMapper;
|
||||
import com.ruoyi.cms.mapper.ModelUnemploymentRateMonitorMapper;
|
||||
import com.ruoyi.cms.mapper.ModelUnemploymentWarningDiffusionMapper;
|
||||
import com.ruoyi.cms.mapper.ModelWarningIndicatorDataMapper;
|
||||
import com.ruoyi.cms.mapper.ModelWarningIndicatorMapper;
|
||||
import com.ruoyi.cms.service.ModelWarningIndicatorService;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
@@ -30,6 +39,10 @@ import java.util.Set;
|
||||
public class ModelWarningIndicatorServiceImpl implements ModelWarningIndicatorService {
|
||||
|
||||
private final ModelWarningIndicatorMapper modelWarningIndicatorMapper;
|
||||
private final ModelWarningIndicatorDataMapper modelWarningIndicatorDataMapper;
|
||||
private final ModelUnemploymentRateMonitorMapper modelUnemploymentRateMonitorMapper;
|
||||
private final ModelEmploymentMonitorCompositeMapper modelEmploymentMonitorCompositeMapper;
|
||||
private final ModelUnemploymentWarningDiffusionMapper modelUnemploymentWarningDiffusionMapper;
|
||||
|
||||
@Override
|
||||
public void create(ModelWarningIndicator modelWarningIndicator) {
|
||||
@@ -98,7 +111,32 @@ public class ModelWarningIndicatorServiceImpl implements ModelWarningIndicatorSe
|
||||
if (Objects.isNull(id)) {
|
||||
throw new ServiceException("id不能为空");
|
||||
}
|
||||
// todo 判断 指标是否存在数据
|
||||
ModelWarningIndicator detail = detail(id);
|
||||
// 就业失业预警指标数据是否有数据
|
||||
List<ModelWarningIndicatorData> uniqueData =
|
||||
modelWarningIndicatorDataMapper.selectByIndicatorCode(detail.getIndicatorCode());
|
||||
if (CollectionUtils.isNotEmpty(uniqueData)) {
|
||||
throw new ServiceException("就业失业预警指标数据有数据,请先删除就业失业预警指标数据");
|
||||
}
|
||||
// 失业率监测管理是否有数据
|
||||
ModelUnemploymentRateMonitor uniqueMonitor =
|
||||
modelUnemploymentRateMonitorMapper.findUnique(detail.getIndicatorCode());
|
||||
if (Objects.nonNull(uniqueMonitor)) {
|
||||
throw new ServiceException("失业率监测管理有数据,请先删除失业率监测管理数据");
|
||||
}
|
||||
// 就业监测综合管理是否有数据
|
||||
ModelEmploymentMonitorComposite uniqueComposite =
|
||||
modelEmploymentMonitorCompositeMapper.findUnique(detail.getIndicatorCode());
|
||||
if (Objects.nonNull(uniqueComposite)) {
|
||||
throw new ServiceException("就业监测综合管理有数据,请先删除就业监测综合管理数据");
|
||||
}
|
||||
// 失业预警扩散管理是否有数据
|
||||
ModelUnemploymentWarningDiffusion uniqueDiffusion =
|
||||
modelUnemploymentWarningDiffusionMapper.findUnique(detail.getIndicatorCode());
|
||||
if (Objects.nonNull(uniqueDiffusion)) {
|
||||
throw new ServiceException("失业预警扩散管理有数据,请先删除失业预警扩散管理数据");
|
||||
}
|
||||
|
||||
|
||||
modelWarningIndicatorMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
WHERE a.id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="findUnique" parameterType="com.ruoyi.cms.domain.ModelEmploymentMonitorComposite"
|
||||
<select id="findUnique" parameterType="java.lang.String"
|
||||
resultType="com.ruoyi.cms.domain.ModelEmploymentMonitorComposite">
|
||||
|
||||
SELECT *
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
WHERE a.id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="findUnique" parameterType="com.ruoyi.cms.domain.ModelUnemploymentRateMonitor"
|
||||
<select id="findUnique" parameterType="java.lang.String"
|
||||
resultType="com.ruoyi.cms.domain.ModelUnemploymentRateMonitor">
|
||||
|
||||
SELECT *
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
<?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.cms.mapper.ModelUnemploymentWarningDiffusionMapper">
|
||||
|
||||
<insert id="insert" parameterType="com.ruoyi.cms.domain.ModelUnemploymentWarningDiffusion">
|
||||
INSERT INTO model_unemployment_warning_diffusion (indicator_code, indicator_weight, indicator_type, lead_period, sort_order)
|
||||
VALUES (#{indicatorCode}, #{indicatorWeight}, #{indicatorType}, #{leadPeriod}, #{sortOrder})
|
||||
</insert>
|
||||
|
||||
<insert id="update" parameterType="com.ruoyi.cms.domain.ModelUnemploymentWarningDiffusion">
|
||||
UPDATE model_unemployment_warning_diffusion
|
||||
SET indicator_code = #{indicatorCode},
|
||||
indicator_weight = #{indicatorWeight},
|
||||
indicator_type = #{indicatorType},
|
||||
lead_period = #{leadPeriod},
|
||||
sort_order = #{sortOrder}
|
||||
WHERE id = #{id}
|
||||
</insert>
|
||||
|
||||
<insert id="deleteById" parameterType="java.lang.Long">
|
||||
DELETE
|
||||
FROM model_unemployment_warning_diffusion
|
||||
WHERE id = #{id}
|
||||
</insert>
|
||||
|
||||
<select id="selectById" parameterType="com.ruoyi.cms.domain.ModelUnemploymentWarningDiffusion"
|
||||
resultType="com.ruoyi.cms.domain.ModelUnemploymentWarningDiffusion">
|
||||
|
||||
SELECT a.id,
|
||||
a.indicator_code,
|
||||
a.indicator_weight,
|
||||
a.indicator_type,
|
||||
a.lead_period,
|
||||
a.sort_order,
|
||||
b.indicator_name
|
||||
FROM model_unemployment_warning_diffusion a
|
||||
LEFT JOIN model_warning_indicator b ON a.indicator_code = b.indicator_code
|
||||
WHERE a.id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="findUnique" parameterType="java.lang.String"
|
||||
resultType="com.ruoyi.cms.domain.ModelUnemploymentWarningDiffusion">
|
||||
|
||||
SELECT *
|
||||
FROM model_unemployment_warning_diffusion
|
||||
WHERE indicator_code = #{indicatorCode}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="list" parameterType="com.ruoyi.cms.domain.ModelUnemploymentWarningDiffusion"
|
||||
resultType="com.ruoyi.cms.domain.ModelUnemploymentWarningDiffusion">
|
||||
SELECT a.id,
|
||||
a.indicator_code,
|
||||
a.indicator_weight,
|
||||
a.indicator_type,
|
||||
a.lead_period,
|
||||
a.sort_order,
|
||||
b.indicator_name
|
||||
FROM model_unemployment_warning_diffusion a
|
||||
LEFT JOIN model_warning_indicator b ON a.indicator_code = b.indicator_code
|
||||
<where>
|
||||
<if test="id != null ">
|
||||
AND a.id = #{id}
|
||||
</if>
|
||||
<if test="indicatorCode != null and indicatorCode != ''">
|
||||
AND a.indicator_code = #{indicatorCode}
|
||||
</if>
|
||||
<if test="indicatorType != null">
|
||||
AND a.indicator_type = #{indicatorType}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY a.sort_order
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -44,6 +44,19 @@
|
||||
AND region_code = #{regionCode}
|
||||
</select>
|
||||
|
||||
<select id="selectByIndicatorCode" parameterType="java.lang.String"
|
||||
resultType="com.ruoyi.cms.domain.ModelWarningIndicatorData">
|
||||
SELECT *
|
||||
FROM model_warning_indicator_data
|
||||
<where>
|
||||
<if test="indicatorCode != null and indicatorCode != ''">
|
||||
AND indicator_code = #{indicatorCode}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY year DESC, month DESC, indicator_code
|
||||
</select>
|
||||
|
||||
|
||||
<select id="list" parameterType="com.ruoyi.cms.domain.ModelWarningIndicatorData"
|
||||
resultType="com.ruoyi.cms.domain.ModelWarningIndicatorData">
|
||||
SELECT *
|
||||
|
||||
@@ -800,7 +800,7 @@ ON TABLE shz_data_dashboard.model_unemployment_rate_monitor IS '失业率监
|
||||
-- 就业监测综合指数管理
|
||||
CREATE TABLE shz_data_dashboard.model_employment_monitor_composite
|
||||
(
|
||||
id serial PRIMARY KEY,
|
||||
id serial PRIMARY KEY,
|
||||
indicator_code character varying(200) NOT NULL COLLATE pg_catalog."default",
|
||||
indicator_weight double precision NOT NULL,
|
||||
indicator_type integer NOT NULL,
|
||||
@@ -827,4 +827,41 @@ COMMENT
|
||||
ON COLUMN shz_data_dashboard.model_employment_monitor_composite.sort_order IS '排序';
|
||||
|
||||
COMMENT
|
||||
ON TABLE shz_data_dashboard.model_employment_monitor_composite IS '就业监测综合指数管理';
|
||||
ON TABLE shz_data_dashboard.model_employment_monitor_composite IS '就业监测综合指数管理';
|
||||
|
||||
|
||||
--失业预警扩散指数管理
|
||||
CREATE TABLE shz_data_dashboard.model_unemployment_warning_diffusion
|
||||
(
|
||||
id serial PRIMARY KEY,
|
||||
indicator_code character varying(200) NOT NULL COLLATE pg_catalog."default",
|
||||
indicator_weight double precision NOT NULL,
|
||||
indicator_type integer NOT NULL,
|
||||
lead_period integer NOT NULL,
|
||||
sort_order integer NOT NULL
|
||||
)
|
||||
;
|
||||
|
||||
ALTER TABLE shz_data_dashboard.model_unemployment_warning_diffusion
|
||||
OWNER TO sysdba;
|
||||
|
||||
COMMENT
|
||||
ON COLUMN shz_data_dashboard.model_unemployment_warning_diffusion.id IS '主键';
|
||||
|
||||
COMMENT
|
||||
ON COLUMN shz_data_dashboard.model_unemployment_warning_diffusion.indicator_code IS '指标编码';
|
||||
|
||||
COMMENT
|
||||
ON COLUMN shz_data_dashboard.model_unemployment_warning_diffusion.indicator_weight IS '指标权重';
|
||||
|
||||
COMMENT
|
||||
ON COLUMN shz_data_dashboard.model_unemployment_warning_diffusion.indicator_type IS '指标类型';
|
||||
|
||||
COMMENT
|
||||
ON COLUMN shz_data_dashboard.model_unemployment_warning_diffusion.lead_period IS '提前期数';
|
||||
|
||||
COMMENT
|
||||
ON COLUMN shz_data_dashboard.model_unemployment_warning_diffusion.sort_order IS '排序';
|
||||
|
||||
COMMENT
|
||||
ON TABLE shz_data_dashboard.model_unemployment_warning_diffusion IS '失业预警扩散指数管理';
|
||||
Reference in New Issue
Block a user