diff --git a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/constant/enums/ModelTemplateTypeEnum.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/constant/enums/ModelTemplateTypeEnum.java index 254d24f..4d2c5ad 100644 --- a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/constant/enums/ModelTemplateTypeEnum.java +++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/constant/enums/ModelTemplateTypeEnum.java @@ -22,6 +22,8 @@ public enum ModelTemplateTypeEnum { MODEL_SUPPLY_MONITOR_LABOR_JOIN_RATE("劳动力动态监测系统-劳动力供给劳动参与率"), MODEL_SUPPLY_MONITOR_INDUSTRY_POPULATION("劳动力动态监测系统-劳动力供给分行业劳动力人口"), + + MODEL_SUPPLY_MONITOR_OCCUPATION_POPULATION("劳动力动态监测系统-劳动力供给分职业劳动力人口"), ; private final String desc; } diff --git a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/controller/ModelSupplyMonitorOccupationPopulationController.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/controller/ModelSupplyMonitorOccupationPopulationController.java new file mode 100644 index 0000000..2e855ea --- /dev/null +++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/controller/ModelSupplyMonitorOccupationPopulationController.java @@ -0,0 +1,104 @@ +package com.ruoyi.cms.controller; + +import com.ruoyi.cms.domain.ModelSupplyMonitorOccupationPopulation; +import com.ruoyi.cms.service.ModelSupplyMonitorOccupationPopulationService; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +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.RestController; + +import javax.validation.Valid; +import java.util.List; + +/** + * 劳动力供给分职业劳动力人口 + * + * @author 马宝龙 + * @date 2026/7/3 + */ +@RestController +@RequestMapping("/model/supplyMonitorOccupationPopulation") +@RequiredArgsConstructor +public class ModelSupplyMonitorOccupationPopulationController extends BaseController { + + private final ModelSupplyMonitorOccupationPopulationService modelSupplyMonitorOccupationPopulationService; + + /** + * 创建 + * + * @param modelSupplyMonitorOccupationPopulation 劳动力供给分职业劳动力人口 + * @return 创建结果 + */ + @PostMapping("/create") + public AjaxResult create(@Valid @RequestBody ModelSupplyMonitorOccupationPopulation modelSupplyMonitorOccupationPopulation) { + modelSupplyMonitorOccupationPopulationService.create(modelSupplyMonitorOccupationPopulation); + return AjaxResult.success(); + } + + /** + * 更新 + * + * @param modelSupplyMonitorOccupationPopulation 劳动力供给分职业劳动力人口 + * @return 更新结果 + */ + @PutMapping("/update") + public AjaxResult update(@Valid @RequestBody ModelSupplyMonitorOccupationPopulation modelSupplyMonitorOccupationPopulation) { + modelSupplyMonitorOccupationPopulationService.update(modelSupplyMonitorOccupationPopulation); + return AjaxResult.success(); + } + + /** + * 删除 + * + * @param id ID + * @return 删除结果 + */ + @DeleteMapping("/delete") + public AjaxResult delete(@RequestParam Long id) { + modelSupplyMonitorOccupationPopulationService.delete(id); + return AjaxResult.success(); + } + + /** + * 清空 + * + * @return 清空结果 + */ + @DeleteMapping("/clear") + public AjaxResult clear() { + modelSupplyMonitorOccupationPopulationService.clear(); + return AjaxResult.success(); + } + + /** + * 查询详情 + * + * @param id ID + * @return 劳动力供给分职业劳动力人口 + */ + @GetMapping("/detail") + public AjaxResult detail(@RequestParam Long id) { + ModelSupplyMonitorOccupationPopulation data = modelSupplyMonitorOccupationPopulationService.detail(id); + return AjaxResult.success(data); + } + + /** + * 查询列表 + * + * @param modelSupplyMonitorOccupationPopulation 劳动力供给分职业劳动力人口 + * @return 列表 + */ + @PostMapping("/list") + public AjaxResult list(@RequestBody ModelSupplyMonitorOccupationPopulation modelSupplyMonitorOccupationPopulation) { + List list = + modelSupplyMonitorOccupationPopulationService.list(modelSupplyMonitorOccupationPopulation); + return AjaxResult.success(list); + } +} \ No newline at end of file diff --git a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/domain/ModelSupplyMonitorOccupationPopulation.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/domain/ModelSupplyMonitorOccupationPopulation.java new file mode 100644 index 0000000..615f511 --- /dev/null +++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/domain/ModelSupplyMonitorOccupationPopulation.java @@ -0,0 +1,53 @@ +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/3 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class ModelSupplyMonitorOccupationPopulation implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private Long id; + /** + * 年份 + */ + @Excel(name = "年份") + private Integer year; + /** + * 职业编号 + */ + @Excel(name = "职业编号") + private String occupationCode; + /** + * 职业名称 + */ + @Excel(name = "职业名称") + private String occupationName; + /** + * 男性人数 + */ + @Excel(name = "男性人数") + private Integer maleCount; + /** + * 女性人数 + */ + @Excel(name = "女性人数") + private Integer femaleCount; +} \ No newline at end of file diff --git a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/mapper/ModelSupplyMonitorOccupationPopulationMapper.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/mapper/ModelSupplyMonitorOccupationPopulationMapper.java new file mode 100644 index 0000000..726e2c3 --- /dev/null +++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/mapper/ModelSupplyMonitorOccupationPopulationMapper.java @@ -0,0 +1,64 @@ +package com.ruoyi.cms.mapper; + +import com.ruoyi.cms.domain.ModelSupplyMonitorOccupationPopulation; + +import java.util.List; + +/** + * 劳动力供给分职业劳动力人口 + * + * @author 马宝龙 + * @date 2026/7/3 + */ +public interface ModelSupplyMonitorOccupationPopulationMapper { + + /** + * 新增 + * + * @param modelSupplyMonitorOccupationPopulation 劳动力供给分职业劳动力人口 + */ + void insert(ModelSupplyMonitorOccupationPopulation modelSupplyMonitorOccupationPopulation); + + /** + * 修改 + * + * @param modelSupplyMonitorOccupationPopulation 劳动力供给分职业劳动力人口 + */ + void update(ModelSupplyMonitorOccupationPopulation modelSupplyMonitorOccupationPopulation); + + /** + * 通过ID删除 + * + * @param id ID + */ + void deleteById(Long id); + + /** + * 清空 + */ + void clear(); + + /** + * 通过ID查询 + * + * @param id ID + * @return 劳动力供给分职业劳动力人口 + */ + ModelSupplyMonitorOccupationPopulation selectById(Long id); + + /** + * 查询唯一(按年份+职业编号) + * + * @param modelSupplyMonitorOccupationPopulation 劳动力供给分职业劳动力人口 + * @return 劳动力供给分职业劳动力人口 + */ + ModelSupplyMonitorOccupationPopulation findUnique(ModelSupplyMonitorOccupationPopulation modelSupplyMonitorOccupationPopulation); + + /** + * 查询列表 + * + * @param modelSupplyMonitorOccupationPopulation 劳动力供给分职业劳动力人口 + * @return 列表 + */ + List list(ModelSupplyMonitorOccupationPopulation modelSupplyMonitorOccupationPopulation); +} \ No newline at end of file diff --git a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/ModelSupplyMonitorOccupationPopulationService.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/ModelSupplyMonitorOccupationPopulationService.java new file mode 100644 index 0000000..aca4b0f --- /dev/null +++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/ModelSupplyMonitorOccupationPopulationService.java @@ -0,0 +1,75 @@ +package com.ruoyi.cms.service; + +import com.ruoyi.cms.domain.ModelSupplyMonitorOccupationPopulation; +import com.ruoyi.cms.domain.dto.ModelExportParamDto; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + * 劳动力供给分职业劳动力人口 + * + * @author 马宝龙 + * @date 2026/7/3 + */ +public interface ModelSupplyMonitorOccupationPopulationService { + + /** + * 创建 + * + * @param modelSupplyMonitorOccupationPopulation 劳动力供给分职业劳动力人口 + */ + void create(ModelSupplyMonitorOccupationPopulation modelSupplyMonitorOccupationPopulation); + + /** + * 更新 + * + * @param modelSupplyMonitorOccupationPopulation 劳动力供给分职业劳动力人口 + */ + void update(ModelSupplyMonitorOccupationPopulation modelSupplyMonitorOccupationPopulation); + + /** + * 删除 + * + * @param id ID + */ + void delete(Long id); + + /** + * 清空 + */ + void clear(); + + /** + * 查询详情 + * + * @param id ID + * @return 劳动力供给分职业劳动力人口 + */ + ModelSupplyMonitorOccupationPopulation detail(Long id); + + /** + * 查询列表 + * + * @param modelSupplyMonitorOccupationPopulation 劳动力供给分职业劳动力人口 + * @return 列表 + */ + List list(ModelSupplyMonitorOccupationPopulation modelSupplyMonitorOccupationPopulation); + + /** + * 导入数据 + * + * @param file 文件 + * @return 导入结果 + */ + String importExcel(MultipartFile file); + + /** + * 导出数据 + * + * @param response 响应体 + * @param dto 导出参数 + */ + void exportExcel(HttpServletResponse response, ModelExportParamDto dto); +} \ No newline at end of file diff --git a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/ModelCommonServiceImpl.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/ModelCommonServiceImpl.java index e9208f1..b7b8529 100644 --- a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/ModelCommonServiceImpl.java +++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/ModelCommonServiceImpl.java @@ -5,6 +5,7 @@ import com.ruoyi.cms.domain.dto.ModelExportParamDto; import com.ruoyi.cms.service.ModelCommonService; import com.ruoyi.cms.service.ModelSupplyMonitorIndustryPopulationService; import com.ruoyi.cms.service.ModelSupplyMonitorLaborJoinRateService; +import com.ruoyi.cms.service.ModelSupplyMonitorOccupationPopulationService; import com.ruoyi.cms.service.ModelSupplyMonitorPopulationService; import com.ruoyi.cms.service.ModelSupplyMonitorTotalFertilityRateService; import com.ruoyi.cms.service.ModelWarningIndicatorDataService; @@ -42,6 +43,7 @@ public class ModelCommonServiceImpl implements ModelCommonService { private final ModelSupplyMonitorTotalFertilityRateService modelSupplyMonitorTotalFertilityRateService; private final ModelSupplyMonitorLaborJoinRateService modelSupplyMonitorLaborJoinRateService; private final ModelSupplyMonitorIndustryPopulationService modelSupplyMonitorIndustryPopulationService; + private final ModelSupplyMonitorOccupationPopulationService modelSupplyMonitorOccupationPopulationService; @Override public void template(HttpServletResponse response, @@ -95,6 +97,8 @@ public class ModelCommonServiceImpl implements ModelCommonService { return modelSupplyMonitorLaborJoinRateService.importExcel(file); case MODEL_SUPPLY_MONITOR_INDUSTRY_POPULATION: return modelSupplyMonitorIndustryPopulationService.importExcel(file); + case MODEL_SUPPLY_MONITOR_OCCUPATION_POPULATION: + return modelSupplyMonitorOccupationPopulationService.importExcel(file); default: throw new ServiceException("模板类型错误"); } @@ -122,6 +126,9 @@ public class ModelCommonServiceImpl implements ModelCommonService { case MODEL_SUPPLY_MONITOR_INDUSTRY_POPULATION: modelSupplyMonitorIndustryPopulationService.exportExcel(response, dto); break; + case MODEL_SUPPLY_MONITOR_OCCUPATION_POPULATION: + modelSupplyMonitorOccupationPopulationService.exportExcel(response, dto); + break; default: throw new ServiceException("模板类型错误"); } diff --git a/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/ModelSupplyMonitorOccupationPopulationServiceImpl.java b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/ModelSupplyMonitorOccupationPopulationServiceImpl.java new file mode 100644 index 0000000..671f383 --- /dev/null +++ b/ruoyi-bussiness/src/main/java/com/ruoyi/cms/service/impl/ModelSupplyMonitorOccupationPopulationServiceImpl.java @@ -0,0 +1,204 @@ +package com.ruoyi.cms.service.impl; + +import com.ruoyi.cms.constant.enums.ModelTemplateTypeEnum; +import com.ruoyi.cms.domain.ModelSupplyMonitorOccupationPopulation; +import com.ruoyi.cms.domain.dto.ModelExportParamDto; +import com.ruoyi.cms.mapper.ModelSupplyMonitorOccupationPopulationMapper; +import com.ruoyi.cms.service.ModelSupplyMonitorOccupationPopulationService; +import com.ruoyi.common.exception.ServiceException; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.bean.BeanValidators; +import com.ruoyi.common.utils.poi.ExcelUtil; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import javax.validation.Validator; +import java.util.List; +import java.util.Objects; +import java.util.Optional; + +/** + * 劳动力供给分职业劳动力人口 + * + * @author 马宝龙 + * @date 2026/7/3 + */ +@Slf4j +@Service +@Validated +@RequiredArgsConstructor +public class ModelSupplyMonitorOccupationPopulationServiceImpl implements ModelSupplyMonitorOccupationPopulationService { + + private final ModelSupplyMonitorOccupationPopulationMapper modelSupplyMonitorOccupationPopulationMapper; + private final Validator validator; + + @Override + public void create(ModelSupplyMonitorOccupationPopulation modelSupplyMonitorOccupationPopulation) { + + check(modelSupplyMonitorOccupationPopulation); + + // 查询唯一(按年份+职业编号) + Optional optional = findUnique(modelSupplyMonitorOccupationPopulation); + if (optional.isPresent()) { + // 更新 + ModelSupplyMonitorOccupationPopulation exists = optional.get(); + modelSupplyMonitorOccupationPopulation.setId(exists.getId()); + modelSupplyMonitorOccupationPopulationMapper.update(modelSupplyMonitorOccupationPopulation); + } else { + // 新增 + modelSupplyMonitorOccupationPopulationMapper.insert(modelSupplyMonitorOccupationPopulation); + } + } + + /** + * 检查 + * + * @param modelSupplyMonitorOccupationPopulation 劳动力供给分职业劳动力人口 + */ + void check(ModelSupplyMonitorOccupationPopulation modelSupplyMonitorOccupationPopulation) { + if (Objects.isNull(modelSupplyMonitorOccupationPopulation.getYear())) { + throw new ServiceException("年份不能为空"); + } + if (StringUtils.isBlank(modelSupplyMonitorOccupationPopulation.getOccupationCode())) { + throw new ServiceException("职业编号不能为空"); + } + if (StringUtils.isBlank(modelSupplyMonitorOccupationPopulation.getOccupationName())) { + throw new ServiceException("职业名称不能为空"); + } + if (Objects.isNull(modelSupplyMonitorOccupationPopulation.getMaleCount())) { + throw new ServiceException("男性人数不能为空"); + } + if (Objects.isNull(modelSupplyMonitorOccupationPopulation.getFemaleCount())) { + throw new ServiceException("女性人数不能为空"); + } + } + + @Override + public void update(ModelSupplyMonitorOccupationPopulation modelSupplyMonitorOccupationPopulation) { + + check(modelSupplyMonitorOccupationPopulation); + + if (Objects.isNull(modelSupplyMonitorOccupationPopulation.getId())) { + throw new ServiceException("id不能为空"); + } + Optional unique = findUnique(modelSupplyMonitorOccupationPopulation); + if (!unique.isPresent()) { + modelSupplyMonitorOccupationPopulationMapper.update(modelSupplyMonitorOccupationPopulation); + return; + } + ModelSupplyMonitorOccupationPopulation exists = unique.get(); + if (!exists.getId().equals(modelSupplyMonitorOccupationPopulation.getId())) { + throw new ServiceException("数据已存在"); + } + modelSupplyMonitorOccupationPopulationMapper.update(modelSupplyMonitorOccupationPopulation); + } + + @Override + public void delete(Long id) { + if (Objects.isNull(id)) { + throw new ServiceException("id不能为空"); + } + modelSupplyMonitorOccupationPopulationMapper.deleteById(id); + } + + @Override + public void clear() { + modelSupplyMonitorOccupationPopulationMapper.clear(); + } + + @Override + public ModelSupplyMonitorOccupationPopulation detail(Long id) { + if (Objects.isNull(id)) { + throw new ServiceException("id不能为空"); + } + return modelSupplyMonitorOccupationPopulationMapper.selectById(id); + } + + /** + * 查询唯一 + * + * @param modelSupplyMonitorOccupationPopulation 劳动力供给分职业劳动力人口 + * @return 劳动力供给分职业劳动力人口 + */ + private Optional findUnique(ModelSupplyMonitorOccupationPopulation modelSupplyMonitorOccupationPopulation) { + ModelSupplyMonitorOccupationPopulation unique = + modelSupplyMonitorOccupationPopulationMapper.findUnique(modelSupplyMonitorOccupationPopulation); + return Optional.ofNullable(unique); + } + + @Override + public List list(ModelSupplyMonitorOccupationPopulation modelSupplyMonitorOccupationPopulation) { + return modelSupplyMonitorOccupationPopulationMapper.list(modelSupplyMonitorOccupationPopulation); + } + + @Override + public String importExcel(MultipartFile file) { + try { + ExcelUtil util = new ExcelUtil<>(ModelSupplyMonitorOccupationPopulation.class); + List list = util.importExcel(file.getInputStream()); + + ModelSupplyMonitorOccupationPopulation exists; + int successNum = 0; + int failureNum = 0; + StringBuilder successMsg = new StringBuilder(); + StringBuilder failureMsg = new StringBuilder(); + for (ModelSupplyMonitorOccupationPopulation item : list) { + try { + check(item); + exists = modelSupplyMonitorOccupationPopulationMapper.findUnique(item); + if (exists == null) { + BeanValidators.validateWithException(validator, item); + modelSupplyMonitorOccupationPopulationMapper.insert(item); + successNum++; + String msg = + "
" + successNum + "、" + "年份:" + item.getYear() + "职业:" + item.getOccupationName() + "数据导入成功。"; + successMsg.append(msg); + } else { + item.setId(exists.getId()); + BeanValidators.validateWithException(validator, item); + modelSupplyMonitorOccupationPopulationMapper.update(item); + successNum++; + String msg = + "
" + successNum + "、" + "年份:" + item.getYear() + "职业:" + item.getOccupationName() + "数据更新成功。"; + successMsg.append(msg); + } + } catch (Exception e) { + failureNum++; + String msg = "
" + failureNum + "、" + "年份:" + item.getYear() + "职业:" + item.getOccupationName() + "数据导入失败:"; + failureMsg.append(msg).append(e.getMessage()); + log.error(msg, e); + } + } + if (failureNum > 0) { + failureMsg.insert(0, "导入失败!共 " + failureNum + " 条数据出现问题,错误如下:"); + throw new ServiceException(failureMsg.toString()); + } else { + successMsg.insert(0, "数据已全部导入成功!共 " + successNum + " 条:"); + } + return successMsg.toString(); + } catch (Exception e) { + log.error("数据导入失败", e); + throw new ServiceException("数据导入失败"); + } + } + + @Override + public void exportExcel(HttpServletResponse response, ModelExportParamDto dto) { + try { + + List list = list(ModelSupplyMonitorOccupationPopulation.builder() + .year(dto.getYear()) + .build()); + ExcelUtil util = new ExcelUtil<>(ModelSupplyMonitorOccupationPopulation.class); + util.exportExcel(response, list, ModelTemplateTypeEnum.MODEL_SUPPLY_MONITOR_OCCUPATION_POPULATION.getDesc()); + + } catch (Exception e) { + log.error("数据导出失败", e); + throw new ServiceException("数据导出失败"); + } + } +} \ No newline at end of file diff --git a/ruoyi-bussiness/src/main/resources/mapper/ModelSupplyMonitorOccupationPopulationMapper.xml b/ruoyi-bussiness/src/main/resources/mapper/ModelSupplyMonitorOccupationPopulationMapper.xml new file mode 100644 index 0000000..49ef34d --- /dev/null +++ b/ruoyi-bussiness/src/main/resources/mapper/ModelSupplyMonitorOccupationPopulationMapper.xml @@ -0,0 +1,82 @@ + + + + + + INSERT INTO model_supply_monitor_occupation_population (year, occupation_code, occupation_name, male_count, female_count) + VALUES (#{year}, #{occupationCode}, #{occupationName}, #{maleCount}, #{femaleCount}) + + + + UPDATE model_supply_monitor_occupation_population + SET year = #{year}, + occupation_code = #{occupationCode}, + occupation_name = #{occupationName}, + male_count = #{maleCount}, + female_count = #{femaleCount} + WHERE id = #{id} + + + + DELETE + FROM model_supply_monitor_occupation_population + WHERE id = #{id} + + + + DELETE FROM model_supply_monitor_occupation_population + WHERE id IS NOT NULL; + + + + + + + + + \ No newline at end of file diff --git a/ruoyi-bussiness/src/main/resources/template/劳动力动态监测系统-劳动力供给分职业劳动力人口.xlsx b/ruoyi-bussiness/src/main/resources/template/劳动力动态监测系统-劳动力供给分职业劳动力人口.xlsx new file mode 100644 index 0000000..18fcc5a Binary files /dev/null and b/ruoyi-bussiness/src/main/resources/template/劳动力动态监测系统-劳动力供给分职业劳动力人口.xlsx differ diff --git a/sql/datadashboard/table.sql b/sql/datadashboard/table.sql index 100034d..45e2958 100644 --- a/sql/datadashboard/table.sql +++ b/sql/datadashboard/table.sql @@ -907,9 +907,9 @@ ON TABLE shz_data_dashboard.model_supply_monitor_population IS '劳动力供 --劳动力供给总和生育率 CREATE TABLE shz_data_dashboard.model_supply_monitor_total_fertility_rate ( - id serial PRIMARY KEY, - year integer NOT NULL, - total_fertility_rate numeric(10, 2) NOT NULL + id serial PRIMARY KEY, + year integer NOT NULL, + total_fertility_rate numeric(10, 2) NOT NULL ) ; @@ -932,9 +932,9 @@ ON TABLE shz_data_dashboard.model_supply_monitor_total_fertility_rate IS '劳 --劳动力供给劳动参与率 CREATE TABLE shz_data_dashboard.model_supply_monitor_labor_join_rate ( - id serial PRIMARY KEY, - year integer NOT NULL, - age integer NOT NULL, + id serial PRIMARY KEY, + year integer NOT NULL, + age integer NOT NULL, male_labor_join_rate numeric(10, 2) NOT NULL, female_labor_join_rate numeric(10, 2) NOT NULL ) @@ -965,12 +965,12 @@ ON TABLE shz_data_dashboard.model_supply_monitor_labor_join_rate IS '劳动力 --劳动力供给分行业劳动力人口 CREATE TABLE shz_data_dashboard.model_supply_monitor_industry_population ( - id serial PRIMARY KEY, - year integer NOT NULL, - industry_code character varying(200) NOT NULL COLLATE pg_catalog."default", - industry_name character varying(200) NOT NULL COLLATE pg_catalog."default", - male_count integer NOT NULL, - female_count integer NOT NULL + id serial PRIMARY KEY, + year integer NOT NULL, + industry_code character varying(200) NOT NULL COLLATE pg_catalog."default", + industry_name character varying(200) NOT NULL COLLATE pg_catalog."default", + male_count integer NOT NULL, + female_count integer NOT NULL ) ; @@ -996,4 +996,41 @@ COMMENT ON COLUMN shz_data_dashboard.model_supply_monitor_industry_population.female_count IS '女性人数'; COMMENT -ON TABLE shz_data_dashboard.model_supply_monitor_industry_population IS '劳动力供给分行业劳动力人口'; \ No newline at end of file +ON TABLE shz_data_dashboard.model_supply_monitor_industry_population IS '劳动力供给分行业劳动力人口'; + + +--劳动力供给分职业劳动力人口 +CREATE TABLE shz_data_dashboard.model_supply_monitor_occupation_population +( + id serial PRIMARY KEY, + year integer NOT NULL, + occupation_code character varying(200) NOT NULL COLLATE pg_catalog."default", + occupation_name character varying(200) NOT NULL COLLATE pg_catalog."default", + male_count integer NOT NULL, + female_count integer NOT NULL +) +; + +ALTER TABLE shz_data_dashboard.model_supply_monitor_occupation_population + OWNER TO sysdba; + +COMMENT +ON COLUMN shz_data_dashboard.model_supply_monitor_occupation_population.id IS '主键'; + +COMMENT +ON COLUMN shz_data_dashboard.model_supply_monitor_occupation_population.year IS '年份'; + +COMMENT +ON COLUMN shz_data_dashboard.model_supply_monitor_occupation_population.occupation_code IS '职业编号'; + +COMMENT +ON COLUMN shz_data_dashboard.model_supply_monitor_occupation_population.occupation_name IS '职业名称'; + +COMMENT +ON COLUMN shz_data_dashboard.model_supply_monitor_occupation_population.male_count IS '男性人数'; + +COMMENT +ON COLUMN shz_data_dashboard.model_supply_monitor_occupation_population.female_count IS '女性人数'; + +COMMENT +ON TABLE shz_data_dashboard.model_supply_monitor_occupation_population IS '劳动力供给分职业劳动力人口'; \ No newline at end of file