Merge branch 'refs/heads/main_完善统计分析功能'
This commit is contained in:
@@ -0,0 +1,129 @@
|
|||||||
|
package com.ruoyi.cms.controller;
|
||||||
|
|
||||||
|
import com.ruoyi.cms.domain.ModelWarningIndicator;
|
||||||
|
import com.ruoyi.cms.domain.vo.TreeVo;
|
||||||
|
import com.ruoyi.cms.service.ModelWarningIndicatorService;
|
||||||
|
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.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 就业失业预警指标
|
||||||
|
*
|
||||||
|
* @author 马宝龙
|
||||||
|
* @date 2026/7/1
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/model/warningIndicator")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class ModelWarningIndicatorController extends BaseController {
|
||||||
|
|
||||||
|
private final ModelWarningIndicatorService modelWarningIndicatorService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建指标
|
||||||
|
*
|
||||||
|
* @param modelWarningIndicator 指标
|
||||||
|
* @return 创建结果
|
||||||
|
*/
|
||||||
|
@PostMapping("/create")
|
||||||
|
public AjaxResult createIndicator(@Valid @RequestBody ModelWarningIndicator modelWarningIndicator) {
|
||||||
|
modelWarningIndicatorService.create(modelWarningIndicator);
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新指标
|
||||||
|
*
|
||||||
|
* @param modelWarningIndicator 指标
|
||||||
|
* @return 更新结果
|
||||||
|
*/
|
||||||
|
@PutMapping("/update")
|
||||||
|
public AjaxResult updateIndicator(@Valid @RequestBody ModelWarningIndicator modelWarningIndicator) {
|
||||||
|
modelWarningIndicatorService.update(modelWarningIndicator);
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除指标
|
||||||
|
*
|
||||||
|
* @param id 指标id
|
||||||
|
* @return 删除结果
|
||||||
|
*/
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
public AjaxResult deleteIndicator(@RequestParam Long id) {
|
||||||
|
modelWarningIndicatorService.delete(id);
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询指标详情
|
||||||
|
*
|
||||||
|
* @param id ID
|
||||||
|
* @return 指标
|
||||||
|
*/
|
||||||
|
@GetMapping("/detail")
|
||||||
|
public AjaxResult detail(@RequestParam Long id) {
|
||||||
|
ModelWarningIndicator indicator = modelWarningIndicatorService.detail(id);
|
||||||
|
return AjaxResult.success(indicator);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询分页列表
|
||||||
|
*
|
||||||
|
* @param modelWarningIndicator 指标
|
||||||
|
* @return 分页列表
|
||||||
|
*/
|
||||||
|
@PostMapping("/page")
|
||||||
|
@ResponseBody
|
||||||
|
public TableDataInfo page(@RequestBody ModelWarningIndicator modelWarningIndicator) {
|
||||||
|
startPage();
|
||||||
|
List<ModelWarningIndicator> list = modelWarningIndicatorService.list(modelWarningIndicator);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 树结构
|
||||||
|
*
|
||||||
|
* @return 树结构
|
||||||
|
*/
|
||||||
|
@GetMapping("/tree")
|
||||||
|
public AjaxResult tree() {
|
||||||
|
|
||||||
|
List<TreeVo> treeList = new ArrayList<>();
|
||||||
|
treeList.add(TreeVo.builder()
|
||||||
|
.id(1L)
|
||||||
|
.code("1")
|
||||||
|
.desc("就业指标")
|
||||||
|
.children(modelWarningIndicatorService.tree(1))
|
||||||
|
.build());
|
||||||
|
treeList.add(TreeVo.builder()
|
||||||
|
.id(2L)
|
||||||
|
.code("2")
|
||||||
|
.desc("失业指标")
|
||||||
|
.children(modelWarningIndicatorService.tree(2))
|
||||||
|
.build());
|
||||||
|
treeList.add(TreeVo.builder()
|
||||||
|
.id(3L)
|
||||||
|
.code("3")
|
||||||
|
.desc("经济指标")
|
||||||
|
.children(modelWarningIndicatorService.tree(3))
|
||||||
|
.build());
|
||||||
|
|
||||||
|
return AjaxResult.success(treeList);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,96 @@
|
|||||||
|
package com.ruoyi.cms.controller;
|
||||||
|
|
||||||
|
import com.ruoyi.cms.domain.ModelWarningIndicatorData;
|
||||||
|
import com.ruoyi.cms.service.ModelWarningIndicatorDataService;
|
||||||
|
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/1
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/model/warningIndicatorData")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class ModelWarningIndicatorDataController extends BaseController {
|
||||||
|
|
||||||
|
private final ModelWarningIndicatorDataService modelWarningIndicatorDataService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建指标数据
|
||||||
|
*
|
||||||
|
* @param modelWarningIndicatorData 指标数据
|
||||||
|
* @return 创建结果
|
||||||
|
*/
|
||||||
|
@PostMapping("/create")
|
||||||
|
public AjaxResult createIndicatorData(@Valid @RequestBody ModelWarningIndicatorData modelWarningIndicatorData) {
|
||||||
|
modelWarningIndicatorDataService.create(modelWarningIndicatorData);
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新指标数据
|
||||||
|
*
|
||||||
|
* @param modelWarningIndicatorData 指标数据
|
||||||
|
* @return 更新结果
|
||||||
|
*/
|
||||||
|
@PutMapping("/update")
|
||||||
|
public AjaxResult updateIndicatorData(@Valid @RequestBody ModelWarningIndicatorData modelWarningIndicatorData) {
|
||||||
|
modelWarningIndicatorDataService.update(modelWarningIndicatorData);
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除指标数据
|
||||||
|
*
|
||||||
|
* @param id 指标数据id
|
||||||
|
* @return 删除结果
|
||||||
|
*/
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
public AjaxResult deleteIndicatorData(@RequestParam Long id) {
|
||||||
|
modelWarningIndicatorDataService.delete(id);
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询指标数据详情
|
||||||
|
*
|
||||||
|
* @param id ID
|
||||||
|
* @return 指标数据
|
||||||
|
*/
|
||||||
|
@GetMapping("/detail")
|
||||||
|
public AjaxResult detail(@RequestParam Long id) {
|
||||||
|
ModelWarningIndicatorData indicatorData = modelWarningIndicatorDataService.detail(id);
|
||||||
|
return AjaxResult.success(indicatorData);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询分页列表
|
||||||
|
*
|
||||||
|
* @param modelWarningIndicatorData 指标数据
|
||||||
|
* @return 分页列表
|
||||||
|
*/
|
||||||
|
@PostMapping("/page")
|
||||||
|
@ResponseBody
|
||||||
|
public TableDataInfo page(@RequestBody ModelWarningIndicatorData modelWarningIndicatorData) {
|
||||||
|
startPage();
|
||||||
|
List<ModelWarningIndicatorData> list = modelWarningIndicatorDataService.list(modelWarningIndicatorData);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 就业失业预警指标
|
||||||
|
*
|
||||||
|
* @author 马宝龙
|
||||||
|
* @date 2026/7/1
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class ModelWarningIndicator implements Serializable {
|
||||||
|
private static final long serialVersionUID = -3444223057995852026L;
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 指标名称
|
||||||
|
*/
|
||||||
|
@Excel(name = "指标名称")
|
||||||
|
private String indicatorName;
|
||||||
|
/**
|
||||||
|
* 指标编码
|
||||||
|
*/
|
||||||
|
@Excel(name = "指标编码")
|
||||||
|
private String indicatorCode;
|
||||||
|
/**
|
||||||
|
* 指标类型(1-就业指标 2-失业指标 3-经济指标)
|
||||||
|
*/
|
||||||
|
@Excel(name = "指标类型")
|
||||||
|
private Integer indicatorType;
|
||||||
|
/**
|
||||||
|
* 排序
|
||||||
|
*/
|
||||||
|
@Excel(name = "排序")
|
||||||
|
private Integer sortOrder;
|
||||||
|
}
|
||||||
@@ -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/1
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class ModelWarningIndicatorData implements Serializable {
|
||||||
|
private static final long serialVersionUID = -4917368203958852026L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ID
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 指标编码
|
||||||
|
*/
|
||||||
|
@Excel(name = "指标编码")
|
||||||
|
private String indicatorCode;
|
||||||
|
/**
|
||||||
|
* 指标值
|
||||||
|
*/
|
||||||
|
@Excel(name = "指标值")
|
||||||
|
private BigDecimal dataValue;
|
||||||
|
/**
|
||||||
|
* 年份
|
||||||
|
*/
|
||||||
|
@Excel(name = "年份")
|
||||||
|
private Integer year;
|
||||||
|
/**
|
||||||
|
* 月份
|
||||||
|
*/
|
||||||
|
@Excel(name = "月份")
|
||||||
|
private Integer month;
|
||||||
|
/**
|
||||||
|
* 区域编码
|
||||||
|
*/
|
||||||
|
@Excel(name = "区域编码")
|
||||||
|
private String regionCode;
|
||||||
|
/**
|
||||||
|
* 区域名称
|
||||||
|
*/
|
||||||
|
@Excel(name = "区域名称")
|
||||||
|
private String regionName;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
@Excel(name = "备注")
|
||||||
|
private String remark;
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package com.ruoyi.cms.domain.vo;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 树状结构
|
||||||
|
*
|
||||||
|
* @author 马宝龙
|
||||||
|
* @date 2026/7/1
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class TreeVo implements Serializable {
|
||||||
|
private static final long serialVersionUID = 830000385760580785L;
|
||||||
|
/**
|
||||||
|
* ID
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 编码
|
||||||
|
*/
|
||||||
|
private String code;
|
||||||
|
/**
|
||||||
|
* 描述
|
||||||
|
*/
|
||||||
|
private String desc;
|
||||||
|
/**
|
||||||
|
* 子节点
|
||||||
|
*/
|
||||||
|
private List<TreeVo> children;
|
||||||
|
}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
package com.ruoyi.cms.mapper;
|
||||||
|
|
||||||
|
import com.ruoyi.cms.domain.ModelWarningIndicatorData;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 就业失业预警指标数据
|
||||||
|
*
|
||||||
|
* @author 马宝龙
|
||||||
|
* @date 2026/7/1
|
||||||
|
*/
|
||||||
|
public interface ModelWarningIndicatorDataMapper {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增指标数据
|
||||||
|
*
|
||||||
|
* @param modelWarningIndicatorData 指标数据
|
||||||
|
*/
|
||||||
|
void insert(ModelWarningIndicatorData modelWarningIndicatorData);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改指标数据
|
||||||
|
*
|
||||||
|
* @param modelWarningIndicatorData 指标数据
|
||||||
|
*/
|
||||||
|
void update(ModelWarningIndicatorData modelWarningIndicatorData);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过ID删除指标数据
|
||||||
|
*
|
||||||
|
* @param id ID
|
||||||
|
*/
|
||||||
|
void deleteById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过ID查询指标数据
|
||||||
|
*
|
||||||
|
* @param id ID
|
||||||
|
* @return 指标数据
|
||||||
|
*/
|
||||||
|
ModelWarningIndicatorData selectById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询唯一
|
||||||
|
*
|
||||||
|
* @param modelWarningIndicatorData 指标数据
|
||||||
|
* @return 指标数据
|
||||||
|
*/
|
||||||
|
ModelWarningIndicatorData findUnique(ModelWarningIndicatorData modelWarningIndicatorData);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询列表
|
||||||
|
*
|
||||||
|
* @param modelWarningIndicatorData 指标数据
|
||||||
|
* @return 列表
|
||||||
|
*/
|
||||||
|
List<ModelWarningIndicatorData> list(ModelWarningIndicatorData modelWarningIndicatorData);
|
||||||
|
}
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
package com.ruoyi.cms.mapper;
|
||||||
|
|
||||||
|
import com.ruoyi.cms.domain.ModelWarningIndicator;
|
||||||
|
import com.ruoyi.cms.domain.vo.TreeVo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 就业失业预警指标
|
||||||
|
*
|
||||||
|
* @author 马宝龙
|
||||||
|
* @date 2026/7/1
|
||||||
|
*/
|
||||||
|
public interface ModelWarningIndicatorMapper {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增指标
|
||||||
|
*
|
||||||
|
* @param modelWarningIndicator 指标
|
||||||
|
*/
|
||||||
|
void insert(ModelWarningIndicator modelWarningIndicator);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改指标
|
||||||
|
*
|
||||||
|
* @param modelWarningIndicator 指标
|
||||||
|
*/
|
||||||
|
void update(ModelWarningIndicator modelWarningIndicator);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过ID删除指标
|
||||||
|
*
|
||||||
|
* @param id ID
|
||||||
|
*/
|
||||||
|
void deleteById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过ID查询指标
|
||||||
|
*
|
||||||
|
* @param id ID
|
||||||
|
* @return 指标
|
||||||
|
*/
|
||||||
|
ModelWarningIndicator selectById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询唯一
|
||||||
|
*
|
||||||
|
* @param modelWarningIndicator 指标
|
||||||
|
* @return 指标
|
||||||
|
*/
|
||||||
|
ModelWarningIndicator findUnique(ModelWarningIndicator modelWarningIndicator);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询列表
|
||||||
|
*
|
||||||
|
* @param modelWarningIndicator 指标
|
||||||
|
* @return 列表
|
||||||
|
*/
|
||||||
|
List<ModelWarningIndicator> list(ModelWarningIndicator modelWarningIndicator);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 树结构
|
||||||
|
*
|
||||||
|
* @param indicatorType 指标类型
|
||||||
|
* @return 树结构
|
||||||
|
*/
|
||||||
|
List<TreeVo> tree(Integer indicatorType);
|
||||||
|
}
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
package com.ruoyi.cms.service;
|
||||||
|
|
||||||
|
import com.ruoyi.cms.domain.ModelWarningIndicatorData;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 就业失业预警指标数据
|
||||||
|
*
|
||||||
|
* @author 马宝龙
|
||||||
|
* @date 2026/7/1
|
||||||
|
*/
|
||||||
|
public interface ModelWarningIndicatorDataService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建指标数据
|
||||||
|
*
|
||||||
|
* @param modelWarningIndicatorData 指标数据
|
||||||
|
*/
|
||||||
|
void create(ModelWarningIndicatorData modelWarningIndicatorData);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新指标数据
|
||||||
|
*
|
||||||
|
* @param modelWarningIndicatorData 指标数据
|
||||||
|
*/
|
||||||
|
void update(ModelWarningIndicatorData modelWarningIndicatorData);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除指标数据
|
||||||
|
*
|
||||||
|
* @param id 指标数据id
|
||||||
|
*/
|
||||||
|
void delete(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询指标数据详情
|
||||||
|
*
|
||||||
|
* @param id ID
|
||||||
|
* @return 指标数据
|
||||||
|
*/
|
||||||
|
ModelWarningIndicatorData detail(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询列表
|
||||||
|
*
|
||||||
|
* @param modelWarningIndicatorData 指标数据
|
||||||
|
* @return 列表
|
||||||
|
*/
|
||||||
|
List<ModelWarningIndicatorData> list(ModelWarningIndicatorData modelWarningIndicatorData);
|
||||||
|
}
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
package com.ruoyi.cms.service;
|
||||||
|
|
||||||
|
import com.ruoyi.cms.domain.ModelWarningIndicator;
|
||||||
|
import com.ruoyi.cms.domain.vo.TreeVo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 就业失业预警指标
|
||||||
|
*
|
||||||
|
* @author 马宝龙
|
||||||
|
* @date 2026/7/1
|
||||||
|
*/
|
||||||
|
public interface ModelWarningIndicatorService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建指标
|
||||||
|
*
|
||||||
|
* @param modelWarningIndicator 指标
|
||||||
|
*/
|
||||||
|
void create(ModelWarningIndicator modelWarningIndicator);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新指标
|
||||||
|
*
|
||||||
|
* @param modelWarningIndicator 指标
|
||||||
|
*/
|
||||||
|
void update(ModelWarningIndicator modelWarningIndicator);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除指标
|
||||||
|
*
|
||||||
|
* @param id 指标id
|
||||||
|
*/
|
||||||
|
void delete(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询指标详情
|
||||||
|
*
|
||||||
|
* @param id ID
|
||||||
|
* @return 指标
|
||||||
|
*/
|
||||||
|
ModelWarningIndicator detail(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询列表
|
||||||
|
*
|
||||||
|
* @param modelWarningIndicator 指标
|
||||||
|
* @return 列表
|
||||||
|
*/
|
||||||
|
List<ModelWarningIndicator> list(ModelWarningIndicator modelWarningIndicator);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 树结构
|
||||||
|
*
|
||||||
|
* @param indicatorType 指标类型
|
||||||
|
* @return 树结构
|
||||||
|
*/
|
||||||
|
List<TreeVo> tree(Integer indicatorType);
|
||||||
|
}
|
||||||
@@ -0,0 +1,129 @@
|
|||||||
|
package com.ruoyi.cms.service.impl;
|
||||||
|
|
||||||
|
import com.ruoyi.cms.domain.ModelWarningIndicatorData;
|
||||||
|
import com.ruoyi.cms.mapper.ModelWarningIndicatorDataMapper;
|
||||||
|
import com.ruoyi.cms.service.ModelWarningIndicatorDataService;
|
||||||
|
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.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 就业失业预警指标数据
|
||||||
|
*
|
||||||
|
* @author 马宝龙
|
||||||
|
* @date 2026/7/1
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class ModelWarningIndicatorDataServiceImpl implements ModelWarningIndicatorDataService {
|
||||||
|
|
||||||
|
private final ModelWarningIndicatorDataMapper modelWarningIndicatorDataMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void create(ModelWarningIndicatorData modelWarningIndicatorData) {
|
||||||
|
|
||||||
|
check(modelWarningIndicatorData);
|
||||||
|
|
||||||
|
// 查询唯一
|
||||||
|
Optional<ModelWarningIndicatorData> optional = findUnique(modelWarningIndicatorData);
|
||||||
|
if (optional.isPresent()) {
|
||||||
|
// 更新
|
||||||
|
ModelWarningIndicatorData exists = optional.get();
|
||||||
|
modelWarningIndicatorData.setId(exists.getId());
|
||||||
|
modelWarningIndicatorDataMapper.update(modelWarningIndicatorData);
|
||||||
|
} else {
|
||||||
|
// 新增
|
||||||
|
modelWarningIndicatorDataMapper.insert(modelWarningIndicatorData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查
|
||||||
|
*
|
||||||
|
* @param modelWarningIndicatorData 指标数据
|
||||||
|
*/
|
||||||
|
void check(ModelWarningIndicatorData modelWarningIndicatorData) {
|
||||||
|
if (StringUtils.isBlank(modelWarningIndicatorData.getIndicatorCode())) {
|
||||||
|
throw new ServiceException("指标编码不能为空");
|
||||||
|
}
|
||||||
|
if (Objects.isNull(modelWarningIndicatorData.getDataValue())) {
|
||||||
|
throw new ServiceException("指标值不能为空");
|
||||||
|
}
|
||||||
|
if (Objects.isNull(modelWarningIndicatorData.getYear())) {
|
||||||
|
throw new ServiceException("年份不能为空");
|
||||||
|
}
|
||||||
|
if (Objects.isNull(modelWarningIndicatorData.getMonth()) || modelWarningIndicatorData.getMonth() < 1
|
||||||
|
|| modelWarningIndicatorData.getMonth() > 12) {
|
||||||
|
throw new ServiceException("月份必须在1-12之间");
|
||||||
|
}
|
||||||
|
if (StringUtils.isBlank(modelWarningIndicatorData.getRegionCode())) {
|
||||||
|
throw new ServiceException("区域编码不能为空");
|
||||||
|
}
|
||||||
|
if (StringUtils.isBlank(modelWarningIndicatorData.getRegionName())) {
|
||||||
|
throw new ServiceException("区域名称不能为空");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void update(ModelWarningIndicatorData modelWarningIndicatorData) {
|
||||||
|
|
||||||
|
check(modelWarningIndicatorData);
|
||||||
|
|
||||||
|
if (Objects.isNull(modelWarningIndicatorData.getId())) {
|
||||||
|
throw new ServiceException("id不能为空");
|
||||||
|
}
|
||||||
|
Optional<ModelWarningIndicatorData> unique = findUnique(modelWarningIndicatorData);
|
||||||
|
if (!unique.isPresent()) {
|
||||||
|
modelWarningIndicatorDataMapper.update(modelWarningIndicatorData);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ModelWarningIndicatorData exists = unique.get();
|
||||||
|
if (!exists.getId().equals(modelWarningIndicatorData.getId())) {
|
||||||
|
throw new ServiceException("指标数据已存在");
|
||||||
|
}
|
||||||
|
modelWarningIndicatorDataMapper.update(modelWarningIndicatorData);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void delete(Long id) {
|
||||||
|
if (Objects.isNull(id)) {
|
||||||
|
throw new ServiceException("id不能为空");
|
||||||
|
}
|
||||||
|
modelWarningIndicatorDataMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ModelWarningIndicatorData detail(Long id) {
|
||||||
|
|
||||||
|
if (Objects.isNull(id)) {
|
||||||
|
throw new ServiceException("id不能为空");
|
||||||
|
}
|
||||||
|
|
||||||
|
return modelWarningIndicatorDataMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询唯一
|
||||||
|
*
|
||||||
|
* @param modelWarningIndicatorData 指标数据
|
||||||
|
* @return 指标数据
|
||||||
|
*/
|
||||||
|
private Optional<ModelWarningIndicatorData> findUnique(ModelWarningIndicatorData modelWarningIndicatorData) {
|
||||||
|
ModelWarningIndicatorData unique = modelWarningIndicatorDataMapper.findUnique(modelWarningIndicatorData);
|
||||||
|
return Optional.ofNullable(unique);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ModelWarningIndicatorData> list(ModelWarningIndicatorData modelWarningIndicatorData) {
|
||||||
|
return modelWarningIndicatorDataMapper.list(modelWarningIndicatorData);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,139 @@
|
|||||||
|
package com.ruoyi.cms.service.impl;
|
||||||
|
|
||||||
|
import com.ruoyi.cms.domain.ModelWarningIndicator;
|
||||||
|
import com.ruoyi.cms.domain.vo.TreeVo;
|
||||||
|
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.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/1
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class ModelWarningIndicatorServiceImpl implements ModelWarningIndicatorService {
|
||||||
|
|
||||||
|
private final ModelWarningIndicatorMapper modelWarningIndicatorMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void create(ModelWarningIndicator modelWarningIndicator) {
|
||||||
|
|
||||||
|
check(modelWarningIndicator);
|
||||||
|
|
||||||
|
// 查询唯一
|
||||||
|
Optional<ModelWarningIndicator> optional = findUnique(modelWarningIndicator);
|
||||||
|
if (optional.isPresent()) {
|
||||||
|
// 更新
|
||||||
|
ModelWarningIndicator exists = optional.get();
|
||||||
|
modelWarningIndicator.setId(exists.getId());
|
||||||
|
modelWarningIndicatorMapper.update(modelWarningIndicator);
|
||||||
|
} else {
|
||||||
|
// 新增
|
||||||
|
modelWarningIndicatorMapper.insert(modelWarningIndicator);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查
|
||||||
|
*
|
||||||
|
* @param modelWarningIndicator 指标
|
||||||
|
*/
|
||||||
|
void check(ModelWarningIndicator modelWarningIndicator) {
|
||||||
|
if (StringUtils.isBlank(modelWarningIndicator.getIndicatorName())) {
|
||||||
|
throw new ServiceException("指标名称不能为空");
|
||||||
|
}
|
||||||
|
if (StringUtils.isBlank(modelWarningIndicator.getIndicatorCode())) {
|
||||||
|
throw new ServiceException("指标编码不能为空");
|
||||||
|
}
|
||||||
|
Set<Integer> typeList = new HashSet<>();
|
||||||
|
typeList.add(1);
|
||||||
|
typeList.add(2);
|
||||||
|
typeList.add(3);
|
||||||
|
if (!typeList.contains(modelWarningIndicator.getIndicatorType())) {
|
||||||
|
throw new ServiceException("指标类型错误");
|
||||||
|
}
|
||||||
|
if (Objects.isNull(modelWarningIndicator.getSortOrder())) {
|
||||||
|
throw new ServiceException("排序不能为空");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void update(ModelWarningIndicator modelWarningIndicator) {
|
||||||
|
|
||||||
|
check(modelWarningIndicator);
|
||||||
|
|
||||||
|
if (Objects.isNull(modelWarningIndicator.getId())) {
|
||||||
|
throw new ServiceException("id不能为空");
|
||||||
|
}
|
||||||
|
Optional<ModelWarningIndicator> unique = findUnique(modelWarningIndicator);
|
||||||
|
if (!unique.isPresent()) {
|
||||||
|
modelWarningIndicatorMapper.update(modelWarningIndicator);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ModelWarningIndicator exists = unique.get();
|
||||||
|
if (!exists.getId().equals(modelWarningIndicator.getId())) {
|
||||||
|
throw new ServiceException("指标已存在");
|
||||||
|
}
|
||||||
|
modelWarningIndicatorMapper.update(modelWarningIndicator);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void delete(Long id) {
|
||||||
|
if (Objects.isNull(id)) {
|
||||||
|
throw new ServiceException("id不能为空");
|
||||||
|
}
|
||||||
|
// todo 判断 指标是否存在数据
|
||||||
|
|
||||||
|
modelWarningIndicatorMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ModelWarningIndicator detail(Long id) {
|
||||||
|
|
||||||
|
if (Objects.isNull(id)) {
|
||||||
|
throw new ServiceException("id不能为空");
|
||||||
|
}
|
||||||
|
|
||||||
|
return modelWarningIndicatorMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询唯一
|
||||||
|
*
|
||||||
|
* @param modelWarningIndicator 指标
|
||||||
|
* @return 指标
|
||||||
|
*/
|
||||||
|
private Optional<ModelWarningIndicator> findUnique(ModelWarningIndicator modelWarningIndicator) {
|
||||||
|
ModelWarningIndicator unique = modelWarningIndicatorMapper.findUnique(modelWarningIndicator);
|
||||||
|
return Optional.ofNullable(unique);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ModelWarningIndicator> list(ModelWarningIndicator modelWarningIndicator) {
|
||||||
|
return modelWarningIndicatorMapper.list(modelWarningIndicator);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<TreeVo> tree(Integer indicatorType) {
|
||||||
|
if (Objects.isNull(indicatorType)) {
|
||||||
|
throw new ServiceException("指标类型不能为空");
|
||||||
|
}
|
||||||
|
return modelWarningIndicatorMapper.tree(indicatorType);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
<?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.ModelWarningIndicatorDataMapper">
|
||||||
|
|
||||||
|
<insert id="insert" parameterType="com.ruoyi.cms.domain.ModelWarningIndicatorData">
|
||||||
|
INSERT INTO model_warning_indicator_data (indicator_code, data_value, year, month, region_code, region_name, remark)
|
||||||
|
VALUES (#{indicatorCode}, #{dataValue}, #{year}, #{month}, #{regionCode}, #{regionName}, #{remark})
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
|
||||||
|
<insert id="update" parameterType="com.ruoyi.cms.domain.ModelWarningIndicatorData">
|
||||||
|
UPDATE
|
||||||
|
model_warning_indicator_data
|
||||||
|
SET indicator_code = #{indicatorCode},
|
||||||
|
data_value = #{dataValue},
|
||||||
|
year = #{year},
|
||||||
|
month = #{month},
|
||||||
|
region_code = #{regionCode},
|
||||||
|
region_name = #{regionName},
|
||||||
|
remark = #{remark}
|
||||||
|
WHERE id = #{id}
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<insert id="deleteById" parameterType="java.lang.Long">
|
||||||
|
DELETE
|
||||||
|
FROM model_warning_indicator_data
|
||||||
|
WHERE id = #{id}
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<select id="selectById" parameterType="com.ruoyi.cms.domain.ModelWarningIndicatorData"
|
||||||
|
resultType="com.ruoyi.cms.domain.ModelWarningIndicatorData">
|
||||||
|
SELECT *
|
||||||
|
FROM model_warning_indicator_data
|
||||||
|
WHERE id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="findUnique" parameterType="com.ruoyi.cms.domain.ModelWarningIndicatorData"
|
||||||
|
resultType="com.ruoyi.cms.domain.ModelWarningIndicatorData">
|
||||||
|
SELECT *
|
||||||
|
FROM model_warning_indicator_data
|
||||||
|
WHERE indicator_code = #{indicatorCode}
|
||||||
|
AND year = #{year}
|
||||||
|
AND month = #{month}
|
||||||
|
AND region_code = #{regionCode}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="list" parameterType="com.ruoyi.cms.domain.ModelWarningIndicatorData"
|
||||||
|
resultType="com.ruoyi.cms.domain.ModelWarningIndicatorData">
|
||||||
|
SELECT *
|
||||||
|
FROM model_warning_indicator_data
|
||||||
|
<where>
|
||||||
|
<if test="id != null ">
|
||||||
|
AND id = #{id}
|
||||||
|
</if>
|
||||||
|
<if test="indicatorCode != null and indicatorCode != ''">
|
||||||
|
AND indicator_code = #{indicatorCode}
|
||||||
|
</if>
|
||||||
|
<if test="year != null">
|
||||||
|
AND year = #{year}
|
||||||
|
</if>
|
||||||
|
<if test="month != null">
|
||||||
|
AND month = #{month}
|
||||||
|
</if>
|
||||||
|
<if test="regionCode != null and regionCode != ''">
|
||||||
|
AND region_code = #{regionCode}
|
||||||
|
</if>
|
||||||
|
<if test="regionName != null and regionName != ''">
|
||||||
|
AND region_name LIKE '%'||#{regionName}||'%'
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
ORDER BY year DESC, month DESC, indicator_code
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
<?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.ModelWarningIndicatorMapper">
|
||||||
|
|
||||||
|
<insert id="insert" parameterType="com.ruoyi.cms.domain.ModelWarningIndicator">
|
||||||
|
INSERT INTO model_warning_indicator (indicator_name, indicator_code, indicator_type, sort_order)
|
||||||
|
VALUES (#{indicatorName}, #{indicatorCode}, #{indicatorType}, #{sortOrder})
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
|
||||||
|
<insert id="update" parameterType="com.ruoyi.cms.domain.ModelWarningIndicator">
|
||||||
|
UPDATE
|
||||||
|
model_warning_indicator
|
||||||
|
SET indicator_name = #{indicatorName},
|
||||||
|
indicator_code = #{indicatorCode},
|
||||||
|
indicator_type = #{indicatorType},
|
||||||
|
sort_order = #{sortOrder}
|
||||||
|
WHERE id = #{id}
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<insert id="deleteById" parameterType="java.lang.Long">
|
||||||
|
DELETE
|
||||||
|
FROM model_warning_indicator
|
||||||
|
WHERE id = #{id}
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<select id="selectById" parameterType="com.ruoyi.cms.domain.ModelWarningIndicator"
|
||||||
|
resultType="com.ruoyi.cms.domain.ModelWarningIndicator">
|
||||||
|
SELECT *
|
||||||
|
FROM model_warning_indicator
|
||||||
|
WHERE id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="findUnique" parameterType="com.ruoyi.cms.domain.ModelWarningIndicator"
|
||||||
|
resultType="com.ruoyi.cms.domain.ModelWarningIndicator">
|
||||||
|
SELECT *
|
||||||
|
FROM model_warning_indicator
|
||||||
|
WHERE indicator_code = #{indicatorCode}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="list" parameterType="com.ruoyi.cms.domain.ModelWarningIndicator"
|
||||||
|
resultType="com.ruoyi.cms.domain.ModelWarningIndicator">
|
||||||
|
SELECT *
|
||||||
|
FROM model_warning_indicator
|
||||||
|
<where>
|
||||||
|
<if test="id != null ">
|
||||||
|
AND id = #{id}
|
||||||
|
</if>
|
||||||
|
<if test="indicatorName != null and indicatorName != ''">
|
||||||
|
AND indicator_name LIKE '%'||#{indicatorName} || '%'
|
||||||
|
</if>
|
||||||
|
<if test="indicatorCode != null and indicatorCode != ''">
|
||||||
|
AND indicator_code = #{indicatorCode}
|
||||||
|
</if>
|
||||||
|
<if test="indicatorType != null and indicatorType != ''">
|
||||||
|
AND indicator_type = #{indicatorType}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
ORDER BY sort_order
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="tree" parameterType="java.lang.Integer"
|
||||||
|
resultType="com.ruoyi.cms.domain.vo.TreeVo">
|
||||||
|
SELECT id,
|
||||||
|
indicator_name as "desc",
|
||||||
|
indicator_code as code
|
||||||
|
FROM model_warning_indicator
|
||||||
|
WHERE indicator_type = #{indicatorType}
|
||||||
|
ORDER BY sort_order
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -111,6 +111,8 @@ public class SecurityConfig {
|
|||||||
requests.antMatchers("/sso/pc/code/login").permitAll()
|
requests.antMatchers("/sso/pc/code/login").permitAll()
|
||||||
// 大数据分析先放行
|
// 大数据分析先放行
|
||||||
.antMatchers("/analysis/**").permitAll()
|
.antMatchers("/analysis/**").permitAll()
|
||||||
|
// 模型先放行
|
||||||
|
.antMatchers("/model/**").permitAll()
|
||||||
// 静态资源,可匿名访问
|
// 静态资源,可匿名访问
|
||||||
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js",
|
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js",
|
||||||
"/profile/**").permitAll()
|
"/profile/**").permitAll()
|
||||||
|
|||||||
@@ -695,3 +695,80 @@ ON COLUMN shz_data_dashboard.theme_job_seeker.user_type IS '用户类型';
|
|||||||
|
|
||||||
COMMENT
|
COMMENT
|
||||||
ON TABLE shz_data_dashboard.theme_job_seeker IS '求职者主题库';
|
ON TABLE shz_data_dashboard.theme_job_seeker IS '求职者主题库';
|
||||||
|
|
||||||
|
-- 就业失业预警指标
|
||||||
|
CREATE TABLE shz_data_dashboard.model_warning_indicator
|
||||||
|
(
|
||||||
|
id serial PRIMARY KEY,
|
||||||
|
indicator_name character varying(400) NOT NULL COLLATE pg_catalog."default",
|
||||||
|
indicator_code character varying(200) NOT NULL COLLATE pg_catalog."default",
|
||||||
|
indicator_type smallint NOT NULL,
|
||||||
|
sort_order integer NOT NULL
|
||||||
|
)
|
||||||
|
;
|
||||||
|
|
||||||
|
ALTER TABLE shz_data_dashboard.model_warning_indicator
|
||||||
|
OWNER TO sysdba;
|
||||||
|
|
||||||
|
COMMENT
|
||||||
|
ON COLUMN shz_data_dashboard.model_warning_indicator.id IS '主键';
|
||||||
|
|
||||||
|
COMMENT
|
||||||
|
ON COLUMN shz_data_dashboard.model_warning_indicator.indicator_name IS '指标名称';
|
||||||
|
|
||||||
|
COMMENT
|
||||||
|
ON COLUMN shz_data_dashboard.model_warning_indicator.indicator_code IS '指标编码';
|
||||||
|
|
||||||
|
COMMENT
|
||||||
|
ON COLUMN shz_data_dashboard.model_warning_indicator.indicator_type IS '指标类型(1-就业指标 2-失业指标 3-经济指标)';
|
||||||
|
|
||||||
|
COMMENT
|
||||||
|
ON COLUMN shz_data_dashboard.model_warning_indicator.sort_order IS '排序';
|
||||||
|
|
||||||
|
COMMENT
|
||||||
|
ON TABLE shz_data_dashboard.model_warning_indicator IS '就业失业预警指标';
|
||||||
|
|
||||||
|
|
||||||
|
-- 就业失业预警指标数据
|
||||||
|
CREATE TABLE shz_data_dashboard.model_warning_indicator_data
|
||||||
|
(
|
||||||
|
id serial PRIMARY KEY,
|
||||||
|
indicator_code character varying(200) NOT NULL COLLATE pg_catalog."default",
|
||||||
|
data_value double precision NOT NULL,
|
||||||
|
year integer NOT NULL,
|
||||||
|
month integer NOT NULL,
|
||||||
|
region_code character varying(200) NOT NULL COLLATE pg_catalog."default",
|
||||||
|
region_name character varying(400) NOT NULL COLLATE pg_catalog."default",
|
||||||
|
remark character varying(500) COLLATE pg_catalog."default"
|
||||||
|
)
|
||||||
|
;
|
||||||
|
|
||||||
|
ALTER TABLE shz_data_dashboard.model_warning_indicator_data
|
||||||
|
OWNER TO sysdba;
|
||||||
|
|
||||||
|
COMMENT
|
||||||
|
ON COLUMN shz_data_dashboard.model_warning_indicator_data.id IS '主键';
|
||||||
|
|
||||||
|
COMMENT
|
||||||
|
ON COLUMN shz_data_dashboard.model_warning_indicator_data.indicator_code IS '指标编码';
|
||||||
|
|
||||||
|
COMMENT
|
||||||
|
ON COLUMN shz_data_dashboard.model_warning_indicator_data.data_value IS '指标值';
|
||||||
|
|
||||||
|
COMMENT
|
||||||
|
ON COLUMN shz_data_dashboard.model_warning_indicator_data.year IS '年份';
|
||||||
|
|
||||||
|
COMMENT
|
||||||
|
ON COLUMN shz_data_dashboard.model_warning_indicator_data.month IS '月份';
|
||||||
|
|
||||||
|
COMMENT
|
||||||
|
ON COLUMN shz_data_dashboard.model_warning_indicator_data.region_code IS '区域编码';
|
||||||
|
|
||||||
|
COMMENT
|
||||||
|
ON COLUMN shz_data_dashboard.model_warning_indicator_data.region_name IS '区域名称';
|
||||||
|
|
||||||
|
COMMENT
|
||||||
|
ON COLUMN shz_data_dashboard.model_warning_indicator_data.remark IS '备注';
|
||||||
|
|
||||||
|
COMMENT
|
||||||
|
ON TABLE shz_data_dashboard.model_warning_indicator_data IS '就业失业预警指标数据';
|
||||||
Reference in New Issue
Block a user