Sfoglia il codice sorgente

web-企业岗位编辑添加【工种】信息

liao-sea 11 mesi fa
parent
commit
4e84f80bb5

+ 38 - 0
src/main/java/com/hz/employmentsite/controller/jobUserManager/WorkCategoryController.java

@@ -0,0 +1,38 @@
+package com.hz.employmentsite.controller.jobUserManager;
+
+import com.hz.employmentsite.filter.exception.BaseResponse;
+import com.hz.employmentsite.filter.exception.RespGenerstor;
+import com.hz.employmentsite.model.SysDictionaryItem;
+import com.hz.employmentsite.services.service.jobUserManager.WorkCategoryService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+@RestController
+@RequestMapping(value = "/api/workCategory")
+public class WorkCategoryController {
+
+    @Autowired
+    private WorkCategoryService workCategoryService;
+
+
+    @ResponseBody
+    @GetMapping("/getFirstWorkCategoryList")
+    public BaseResponse<List<SysDictionaryItem>> getList() {
+        return RespGenerstor.success(workCategoryService.getList());
+    }
+
+    @ResponseBody
+    @GetMapping("/getListByParentWorkCategoryID")
+    public BaseResponse<List<SysDictionaryItem>> getListByParentProfessionID(@RequestParam("parentWorkCategoryID") String parentWorkCategoryID) {
+        return RespGenerstor.success(workCategoryService.getListByParentWorkCategoryID(parentWorkCategoryID));
+    }
+
+    @ResponseBody
+    @GetMapping("/getParentWorkCategoryID")
+    public BaseResponse<String> getParentProfessionID(@RequestParam("workCategoryID") String workCategoryID) {
+        return RespGenerstor.success(workCategoryService.getParentWorkCategoryID(workCategoryID));
+    }
+
+}

+ 30 - 0
src/main/java/com/hz/employmentsite/mapper/PcWorkcategoryMapper.java

@@ -0,0 +1,30 @@
+package com.hz.employmentsite.mapper;
+
+import com.hz.employmentsite.model.PcWorkcategory;
+import com.hz.employmentsite.model.PcWorkcategoryExample;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface PcWorkcategoryMapper {
+    long countByExample(PcWorkcategoryExample example);
+
+    int deleteByExample(PcWorkcategoryExample example);
+
+    int deleteByPrimaryKey(String workCategoryID);
+
+    int insert(PcWorkcategory row);
+
+    int insertSelective(PcWorkcategory row);
+
+    List<PcWorkcategory> selectByExample(PcWorkcategoryExample example);
+
+    PcWorkcategory selectByPrimaryKey(String workCategoryID);
+
+    int updateByExampleSelective(@Param("row") PcWorkcategory row, @Param("example") PcWorkcategoryExample example);
+
+    int updateByExample(@Param("row") PcWorkcategory row, @Param("example") PcWorkcategoryExample example);
+
+    int updateByPrimaryKeySelective(PcWorkcategory row);
+
+    int updateByPrimaryKey(PcWorkcategory row);
+}

+ 53 - 0
src/main/java/com/hz/employmentsite/model/PcWorkcategory.java

@@ -0,0 +1,53 @@
+package com.hz.employmentsite.model;
+
+public class PcWorkcategory {
+    private String workCategoryID;
+
+    private String parentWorkCategoryID;
+
+    private String workCategoryName;
+
+    private Integer orderNo;
+
+    private Integer status;
+
+    public String getWorkCategoryID() {
+        return workCategoryID;
+    }
+
+    public void setWorkCategoryID(String workCategoryID) {
+        this.workCategoryID = workCategoryID == null ? null : workCategoryID.trim();
+    }
+
+    public String getParentWorkCategoryID() {
+        return parentWorkCategoryID;
+    }
+
+    public void setParentWorkCategoryID(String parentWorkCategoryID) {
+        this.parentWorkCategoryID = parentWorkCategoryID == null ? null : parentWorkCategoryID.trim();
+    }
+
+    public String getWorkCategoryName() {
+        return workCategoryName;
+    }
+
+    public void setWorkCategoryName(String workCategoryName) {
+        this.workCategoryName = workCategoryName == null ? null : workCategoryName.trim();
+    }
+
+    public Integer getOrderNo() {
+        return orderNo;
+    }
+
+    public void setOrderNo(Integer orderNo) {
+        this.orderNo = orderNo;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+}

+ 529 - 0
src/main/java/com/hz/employmentsite/model/PcWorkcategoryExample.java

@@ -0,0 +1,529 @@
+package com.hz.employmentsite.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class PcWorkcategoryExample {
+    protected String orderByClause;
+
+    protected boolean distinct;
+
+    protected List<Criteria> oredCriteria;
+
+    public PcWorkcategoryExample() {
+        oredCriteria = new ArrayList<>();
+    }
+
+    public void setOrderByClause(String orderByClause) {
+        this.orderByClause = orderByClause;
+    }
+
+    public String getOrderByClause() {
+        return orderByClause;
+    }
+
+    public void setDistinct(boolean distinct) {
+        this.distinct = distinct;
+    }
+
+    public boolean isDistinct() {
+        return distinct;
+    }
+
+    public List<Criteria> getOredCriteria() {
+        return oredCriteria;
+    }
+
+    public void or(Criteria criteria) {
+        oredCriteria.add(criteria);
+    }
+
+    public Criteria or() {
+        Criteria criteria = createCriteriaInternal();
+        oredCriteria.add(criteria);
+        return criteria;
+    }
+
+    public Criteria createCriteria() {
+        Criteria criteria = createCriteriaInternal();
+        if (oredCriteria.size() == 0) {
+            oredCriteria.add(criteria);
+        }
+        return criteria;
+    }
+
+    protected Criteria createCriteriaInternal() {
+        Criteria criteria = new Criteria();
+        return criteria;
+    }
+
+    public void clear() {
+        oredCriteria.clear();
+        orderByClause = null;
+        distinct = false;
+    }
+
+    protected abstract static class GeneratedCriteria {
+        protected List<Criterion> criteria;
+
+        protected GeneratedCriteria() {
+            super();
+            criteria = new ArrayList<>();
+        }
+
+        public boolean isValid() {
+            return criteria.size() > 0;
+        }
+
+        public List<Criterion> getAllCriteria() {
+            return criteria;
+        }
+
+        public List<Criterion> getCriteria() {
+            return criteria;
+        }
+
+        protected void addCriterion(String condition) {
+            if (condition == null) {
+                throw new RuntimeException("Value for condition cannot be null");
+            }
+            criteria.add(new Criterion(condition));
+        }
+
+        protected void addCriterion(String condition, Object value, String property) {
+            if (value == null) {
+                throw new RuntimeException("Value for " + property + " cannot be null");
+            }
+            criteria.add(new Criterion(condition, value));
+        }
+
+        protected void addCriterion(String condition, Object value1, Object value2, String property) {
+            if (value1 == null || value2 == null) {
+                throw new RuntimeException("Between values for " + property + " cannot be null");
+            }
+            criteria.add(new Criterion(condition, value1, value2));
+        }
+
+        public Criteria andWorkCategoryIDIsNull() {
+            addCriterion("WorkCategoryID is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andWorkCategoryIDIsNotNull() {
+            addCriterion("WorkCategoryID is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andWorkCategoryIDEqualTo(String value) {
+            addCriterion("WorkCategoryID =", value, "workCategoryID");
+            return (Criteria) this;
+        }
+
+        public Criteria andWorkCategoryIDNotEqualTo(String value) {
+            addCriterion("WorkCategoryID <>", value, "workCategoryID");
+            return (Criteria) this;
+        }
+
+        public Criteria andWorkCategoryIDGreaterThan(String value) {
+            addCriterion("WorkCategoryID >", value, "workCategoryID");
+            return (Criteria) this;
+        }
+
+        public Criteria andWorkCategoryIDGreaterThanOrEqualTo(String value) {
+            addCriterion("WorkCategoryID >=", value, "workCategoryID");
+            return (Criteria) this;
+        }
+
+        public Criteria andWorkCategoryIDLessThan(String value) {
+            addCriterion("WorkCategoryID <", value, "workCategoryID");
+            return (Criteria) this;
+        }
+
+        public Criteria andWorkCategoryIDLessThanOrEqualTo(String value) {
+            addCriterion("WorkCategoryID <=", value, "workCategoryID");
+            return (Criteria) this;
+        }
+
+        public Criteria andWorkCategoryIDLike(String value) {
+            addCriterion("WorkCategoryID like", value, "workCategoryID");
+            return (Criteria) this;
+        }
+
+        public Criteria andWorkCategoryIDNotLike(String value) {
+            addCriterion("WorkCategoryID not like", value, "workCategoryID");
+            return (Criteria) this;
+        }
+
+        public Criteria andWorkCategoryIDIn(List<String> values) {
+            addCriterion("WorkCategoryID in", values, "workCategoryID");
+            return (Criteria) this;
+        }
+
+        public Criteria andWorkCategoryIDNotIn(List<String> values) {
+            addCriterion("WorkCategoryID not in", values, "workCategoryID");
+            return (Criteria) this;
+        }
+
+        public Criteria andWorkCategoryIDBetween(String value1, String value2) {
+            addCriterion("WorkCategoryID between", value1, value2, "workCategoryID");
+            return (Criteria) this;
+        }
+
+        public Criteria andWorkCategoryIDNotBetween(String value1, String value2) {
+            addCriterion("WorkCategoryID not between", value1, value2, "workCategoryID");
+            return (Criteria) this;
+        }
+
+        public Criteria andParentWorkCategoryIDIsNull() {
+            addCriterion("ParentWorkCategoryID is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andParentWorkCategoryIDIsNotNull() {
+            addCriterion("ParentWorkCategoryID is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andParentWorkCategoryIDEqualTo(String value) {
+            addCriterion("ParentWorkCategoryID =", value, "parentWorkCategoryID");
+            return (Criteria) this;
+        }
+
+        public Criteria andParentWorkCategoryIDNotEqualTo(String value) {
+            addCriterion("ParentWorkCategoryID <>", value, "parentWorkCategoryID");
+            return (Criteria) this;
+        }
+
+        public Criteria andParentWorkCategoryIDGreaterThan(String value) {
+            addCriterion("ParentWorkCategoryID >", value, "parentWorkCategoryID");
+            return (Criteria) this;
+        }
+
+        public Criteria andParentWorkCategoryIDGreaterThanOrEqualTo(String value) {
+            addCriterion("ParentWorkCategoryID >=", value, "parentWorkCategoryID");
+            return (Criteria) this;
+        }
+
+        public Criteria andParentWorkCategoryIDLessThan(String value) {
+            addCriterion("ParentWorkCategoryID <", value, "parentWorkCategoryID");
+            return (Criteria) this;
+        }
+
+        public Criteria andParentWorkCategoryIDLessThanOrEqualTo(String value) {
+            addCriterion("ParentWorkCategoryID <=", value, "parentWorkCategoryID");
+            return (Criteria) this;
+        }
+
+        public Criteria andParentWorkCategoryIDLike(String value) {
+            addCriterion("ParentWorkCategoryID like", value, "parentWorkCategoryID");
+            return (Criteria) this;
+        }
+
+        public Criteria andParentWorkCategoryIDNotLike(String value) {
+            addCriterion("ParentWorkCategoryID not like", value, "parentWorkCategoryID");
+            return (Criteria) this;
+        }
+
+        public Criteria andParentWorkCategoryIDIn(List<String> values) {
+            addCriterion("ParentWorkCategoryID in", values, "parentWorkCategoryID");
+            return (Criteria) this;
+        }
+
+        public Criteria andParentWorkCategoryIDNotIn(List<String> values) {
+            addCriterion("ParentWorkCategoryID not in", values, "parentWorkCategoryID");
+            return (Criteria) this;
+        }
+
+        public Criteria andParentWorkCategoryIDBetween(String value1, String value2) {
+            addCriterion("ParentWorkCategoryID between", value1, value2, "parentWorkCategoryID");
+            return (Criteria) this;
+        }
+
+        public Criteria andParentWorkCategoryIDNotBetween(String value1, String value2) {
+            addCriterion("ParentWorkCategoryID not between", value1, value2, "parentWorkCategoryID");
+            return (Criteria) this;
+        }
+
+        public Criteria andWorkCategoryNameIsNull() {
+            addCriterion("WorkCategoryName is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andWorkCategoryNameIsNotNull() {
+            addCriterion("WorkCategoryName is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andWorkCategoryNameEqualTo(String value) {
+            addCriterion("WorkCategoryName =", value, "workCategoryName");
+            return (Criteria) this;
+        }
+
+        public Criteria andWorkCategoryNameNotEqualTo(String value) {
+            addCriterion("WorkCategoryName <>", value, "workCategoryName");
+            return (Criteria) this;
+        }
+
+        public Criteria andWorkCategoryNameGreaterThan(String value) {
+            addCriterion("WorkCategoryName >", value, "workCategoryName");
+            return (Criteria) this;
+        }
+
+        public Criteria andWorkCategoryNameGreaterThanOrEqualTo(String value) {
+            addCriterion("WorkCategoryName >=", value, "workCategoryName");
+            return (Criteria) this;
+        }
+
+        public Criteria andWorkCategoryNameLessThan(String value) {
+            addCriterion("WorkCategoryName <", value, "workCategoryName");
+            return (Criteria) this;
+        }
+
+        public Criteria andWorkCategoryNameLessThanOrEqualTo(String value) {
+            addCriterion("WorkCategoryName <=", value, "workCategoryName");
+            return (Criteria) this;
+        }
+
+        public Criteria andWorkCategoryNameLike(String value) {
+            addCriterion("WorkCategoryName like", value, "workCategoryName");
+            return (Criteria) this;
+        }
+
+        public Criteria andWorkCategoryNameNotLike(String value) {
+            addCriterion("WorkCategoryName not like", value, "workCategoryName");
+            return (Criteria) this;
+        }
+
+        public Criteria andWorkCategoryNameIn(List<String> values) {
+            addCriterion("WorkCategoryName in", values, "workCategoryName");
+            return (Criteria) this;
+        }
+
+        public Criteria andWorkCategoryNameNotIn(List<String> values) {
+            addCriterion("WorkCategoryName not in", values, "workCategoryName");
+            return (Criteria) this;
+        }
+
+        public Criteria andWorkCategoryNameBetween(String value1, String value2) {
+            addCriterion("WorkCategoryName between", value1, value2, "workCategoryName");
+            return (Criteria) this;
+        }
+
+        public Criteria andWorkCategoryNameNotBetween(String value1, String value2) {
+            addCriterion("WorkCategoryName not between", value1, value2, "workCategoryName");
+            return (Criteria) this;
+        }
+
+        public Criteria andOrderNoIsNull() {
+            addCriterion("OrderNo is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andOrderNoIsNotNull() {
+            addCriterion("OrderNo is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andOrderNoEqualTo(Integer value) {
+            addCriterion("OrderNo =", value, "orderNo");
+            return (Criteria) this;
+        }
+
+        public Criteria andOrderNoNotEqualTo(Integer value) {
+            addCriterion("OrderNo <>", value, "orderNo");
+            return (Criteria) this;
+        }
+
+        public Criteria andOrderNoGreaterThan(Integer value) {
+            addCriterion("OrderNo >", value, "orderNo");
+            return (Criteria) this;
+        }
+
+        public Criteria andOrderNoGreaterThanOrEqualTo(Integer value) {
+            addCriterion("OrderNo >=", value, "orderNo");
+            return (Criteria) this;
+        }
+
+        public Criteria andOrderNoLessThan(Integer value) {
+            addCriterion("OrderNo <", value, "orderNo");
+            return (Criteria) this;
+        }
+
+        public Criteria andOrderNoLessThanOrEqualTo(Integer value) {
+            addCriterion("OrderNo <=", value, "orderNo");
+            return (Criteria) this;
+        }
+
+        public Criteria andOrderNoIn(List<Integer> values) {
+            addCriterion("OrderNo in", values, "orderNo");
+            return (Criteria) this;
+        }
+
+        public Criteria andOrderNoNotIn(List<Integer> values) {
+            addCriterion("OrderNo not in", values, "orderNo");
+            return (Criteria) this;
+        }
+
+        public Criteria andOrderNoBetween(Integer value1, Integer value2) {
+            addCriterion("OrderNo between", value1, value2, "orderNo");
+            return (Criteria) this;
+        }
+
+        public Criteria andOrderNoNotBetween(Integer value1, Integer value2) {
+            addCriterion("OrderNo not between", value1, value2, "orderNo");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusIsNull() {
+            addCriterion("Status is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusIsNotNull() {
+            addCriterion("Status is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusEqualTo(Integer value) {
+            addCriterion("Status =", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusNotEqualTo(Integer value) {
+            addCriterion("Status <>", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusGreaterThan(Integer value) {
+            addCriterion("Status >", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusGreaterThanOrEqualTo(Integer value) {
+            addCriterion("Status >=", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusLessThan(Integer value) {
+            addCriterion("Status <", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusLessThanOrEqualTo(Integer value) {
+            addCriterion("Status <=", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusIn(List<Integer> values) {
+            addCriterion("Status in", values, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusNotIn(List<Integer> values) {
+            addCriterion("Status not in", values, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusBetween(Integer value1, Integer value2) {
+            addCriterion("Status between", value1, value2, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusNotBetween(Integer value1, Integer value2) {
+            addCriterion("Status not between", value1, value2, "status");
+            return (Criteria) this;
+        }
+    }
+
+    public static class Criteria extends GeneratedCriteria {
+        protected Criteria() {
+            super();
+        }
+    }
+
+    public static class Criterion {
+        private String condition;
+
+        private Object value;
+
+        private Object secondValue;
+
+        private boolean noValue;
+
+        private boolean singleValue;
+
+        private boolean betweenValue;
+
+        private boolean listValue;
+
+        private String typeHandler;
+
+        public String getCondition() {
+            return condition;
+        }
+
+        public Object getValue() {
+            return value;
+        }
+
+        public Object getSecondValue() {
+            return secondValue;
+        }
+
+        public boolean isNoValue() {
+            return noValue;
+        }
+
+        public boolean isSingleValue() {
+            return singleValue;
+        }
+
+        public boolean isBetweenValue() {
+            return betweenValue;
+        }
+
+        public boolean isListValue() {
+            return listValue;
+        }
+
+        public String getTypeHandler() {
+            return typeHandler;
+        }
+
+        protected Criterion(String condition) {
+            super();
+            this.condition = condition;
+            this.typeHandler = null;
+            this.noValue = true;
+        }
+
+        protected Criterion(String condition, Object value, String typeHandler) {
+            super();
+            this.condition = condition;
+            this.value = value;
+            this.typeHandler = typeHandler;
+            if (value instanceof List<?>) {
+                this.listValue = true;
+            } else {
+                this.singleValue = true;
+            }
+        }
+
+        protected Criterion(String condition, Object value) {
+            this(condition, value, null);
+        }
+
+        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
+            super();
+            this.condition = condition;
+            this.value = value;
+            this.secondValue = secondValue;
+            this.typeHandler = typeHandler;
+            this.betweenValue = true;
+        }
+
+        protected Criterion(String condition, Object value, Object secondValue) {
+            this(condition, value, secondValue, null);
+        }
+    }
+}

+ 60 - 0
src/main/java/com/hz/employmentsite/services/impl/jobUserManager/WorkCategoryServiceImpl.java

@@ -0,0 +1,60 @@
+package com.hz.employmentsite.services.impl.jobUserManager;
+
+import com.hz.employmentsite.mapper.PcWorkcategoryMapper;
+import com.hz.employmentsite.model.*;
+import com.hz.employmentsite.services.service.jobUserManager.WorkCategoryService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@Service("WorkCategoryService")
+public class WorkCategoryServiceImpl implements WorkCategoryService {
+
+
+    @Autowired
+    private PcWorkcategoryMapper pcWorkcategoryMapper;
+
+
+    @Override
+    public List<SysDictionaryItem> getList() {
+
+        List<SysDictionaryItem> list =  new ArrayList<>();
+        PcWorkcategoryExample workCategoryExp = new PcWorkcategoryExample();
+        workCategoryExp.or().andParentWorkCategoryIDEqualTo("");
+        var dataList = pcWorkcategoryMapper.selectByExample(workCategoryExp);
+        for(PcWorkcategory curWorkCategory : dataList){
+            SysDictionaryItem item = new SysDictionaryItem();
+            item.setCode(curWorkCategory.getWorkCategoryID());
+            item.setName(curWorkCategory.getWorkCategoryName());
+            list.add(item);
+        }
+        return list;
+    }
+
+
+    @Override
+    public List<SysDictionaryItem> getListByParentWorkCategoryID(String parentworkCategoryID) {
+        List<SysDictionaryItem> list =  new ArrayList<>();
+        PcWorkcategoryExample workCategoryExp = new PcWorkcategoryExample();
+        workCategoryExp.or().andParentWorkCategoryIDEqualTo(parentworkCategoryID);
+        var dataList = pcWorkcategoryMapper.selectByExample(workCategoryExp);
+        for(PcWorkcategory curWorkCategory : dataList){
+            SysDictionaryItem item = new SysDictionaryItem();
+            item.setCode(curWorkCategory.getWorkCategoryID());
+            item.setName(curWorkCategory.getWorkCategoryName());
+            list.add(item);
+        }
+        return list;
+    }
+
+    @Override
+    public String getParentWorkCategoryID(String workCategoryID){
+        PcWorkcategoryExample workCategoryExp = new PcWorkcategoryExample();
+        workCategoryExp.or().andWorkCategoryIDEqualTo(workCategoryID);
+        var curWorkCategory= pcWorkcategoryMapper.selectByExample(workCategoryExp).get(0);
+        return  curWorkCategory.getWorkCategoryID();
+    };
+
+}

+ 13 - 0
src/main/java/com/hz/employmentsite/services/service/jobUserManager/WorkCategoryService.java

@@ -0,0 +1,13 @@
+package com.hz.employmentsite.services.service.jobUserManager;
+import com.hz.employmentsite.model.SysDictionaryItem;
+
+import java.util.List;
+
+public interface WorkCategoryService {
+
+    List<SysDictionaryItem> getList();
+
+    List<SysDictionaryItem> getListByParentWorkCategoryID(String workCategoryID);
+
+    String getParentWorkCategoryID(String workCategoryID);
+}

+ 2 - 0
src/main/java/com/hz/employmentsite/vo/companyService/PostVo.java

@@ -32,6 +32,8 @@ public class PostVo {
 
     public String workName;
 
+    public String workCategoryName;
+
     public Integer recruitCount;
 
     public Integer isRead;

+ 1 - 0
src/main/resources/generatorConfig.xml

@@ -87,6 +87,7 @@
         <table schema="" tableName="pc_jobhunt"><property name="useActualColumnNames" value="true"/></table>
         <table schema="" tableName="pc_jobuser"><property name="useActualColumnNames" value="true"/></table>
         <table schema="" tableName="pc_post"><property name="useActualColumnNames" value="true"/></table>
+        <table schema="" tableName="pc_workcategory"><property name="useActualColumnNames" value="true"/></table>
         <table schema="" tableName="pc_recommend"><property name="useActualColumnNames" value="true"/></table>
         <table schema="" tableName="pc_recruit"><property name="useActualColumnNames" value="true"/></table>
         <table schema="" tableName="pc_site"><property name="useActualColumnNames" value="true"/></table>

+ 213 - 0
src/main/resources/mapping/PcWorkcategoryMapper.xml

@@ -0,0 +1,213 @@
+<?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.hz.employmentsite.mapper.PcWorkcategoryMapper">
+  <resultMap id="BaseResultMap" type="com.hz.employmentsite.model.PcWorkcategory">
+    <id column="WorkCategoryID" jdbcType="VARCHAR" property="workCategoryID" />
+    <result column="ParentWorkCategoryID" jdbcType="VARCHAR" property="parentWorkCategoryID" />
+    <result column="WorkCategoryName" jdbcType="VARCHAR" property="workCategoryName" />
+    <result column="OrderNo" jdbcType="INTEGER" property="orderNo" />
+    <result column="Status" jdbcType="INTEGER" property="status" />
+  </resultMap>
+  <sql id="Example_Where_Clause">
+    <where>
+      <foreach collection="oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Update_By_Example_Where_Clause">
+    <where>
+      <foreach collection="example.oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Base_Column_List">
+    WorkCategoryID, ParentWorkCategoryID, WorkCategoryName, OrderNo, Status
+  </sql>
+  <select id="selectByExample" parameterType="com.hz.employmentsite.model.PcWorkcategoryExample" resultMap="BaseResultMap">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from pc_workcategory
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+  </select>
+  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
+    select 
+    <include refid="Base_Column_List" />
+    from pc_workcategory
+    where WorkCategoryID = #{workCategoryID,jdbcType=VARCHAR}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
+    delete from pc_workcategory
+    where WorkCategoryID = #{workCategoryID,jdbcType=VARCHAR}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.hz.employmentsite.model.PcWorkcategoryExample">
+    delete from pc_workcategory
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.hz.employmentsite.model.PcWorkcategory">
+    insert into pc_workcategory (WorkCategoryID, ParentWorkCategoryID, 
+      WorkCategoryName, OrderNo, Status
+      )
+    values (#{workCategoryID,jdbcType=VARCHAR}, #{parentWorkCategoryID,jdbcType=VARCHAR}, 
+      #{workCategoryName,jdbcType=VARCHAR}, #{orderNo,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}
+      )
+  </insert>
+  <insert id="insertSelective" parameterType="com.hz.employmentsite.model.PcWorkcategory">
+    insert into pc_workcategory
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="workCategoryID != null">
+        WorkCategoryID,
+      </if>
+      <if test="parentWorkCategoryID != null">
+        ParentWorkCategoryID,
+      </if>
+      <if test="workCategoryName != null">
+        WorkCategoryName,
+      </if>
+      <if test="orderNo != null">
+        OrderNo,
+      </if>
+      <if test="status != null">
+        Status,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="workCategoryID != null">
+        #{workCategoryID,jdbcType=VARCHAR},
+      </if>
+      <if test="parentWorkCategoryID != null">
+        #{parentWorkCategoryID,jdbcType=VARCHAR},
+      </if>
+      <if test="workCategoryName != null">
+        #{workCategoryName,jdbcType=VARCHAR},
+      </if>
+      <if test="orderNo != null">
+        #{orderNo,jdbcType=INTEGER},
+      </if>
+      <if test="status != null">
+        #{status,jdbcType=INTEGER},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.hz.employmentsite.model.PcWorkcategoryExample" resultType="java.lang.Long">
+    select count(*) from pc_workcategory
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    update pc_workcategory
+    <set>
+      <if test="row.workCategoryID != null">
+        WorkCategoryID = #{row.workCategoryID,jdbcType=VARCHAR},
+      </if>
+      <if test="row.parentWorkCategoryID != null">
+        ParentWorkCategoryID = #{row.parentWorkCategoryID,jdbcType=VARCHAR},
+      </if>
+      <if test="row.workCategoryName != null">
+        WorkCategoryName = #{row.workCategoryName,jdbcType=VARCHAR},
+      </if>
+      <if test="row.orderNo != null">
+        OrderNo = #{row.orderNo,jdbcType=INTEGER},
+      </if>
+      <if test="row.status != null">
+        Status = #{row.status,jdbcType=INTEGER},
+      </if>
+    </set>
+    <if test="example != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    update pc_workcategory
+    set WorkCategoryID = #{row.workCategoryID,jdbcType=VARCHAR},
+      ParentWorkCategoryID = #{row.parentWorkCategoryID,jdbcType=VARCHAR},
+      WorkCategoryName = #{row.workCategoryName,jdbcType=VARCHAR},
+      OrderNo = #{row.orderNo,jdbcType=INTEGER},
+      Status = #{row.status,jdbcType=INTEGER}
+    <if test="example != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.hz.employmentsite.model.PcWorkcategory">
+    update pc_workcategory
+    <set>
+      <if test="parentWorkCategoryID != null">
+        ParentWorkCategoryID = #{parentWorkCategoryID,jdbcType=VARCHAR},
+      </if>
+      <if test="workCategoryName != null">
+        WorkCategoryName = #{workCategoryName,jdbcType=VARCHAR},
+      </if>
+      <if test="orderNo != null">
+        OrderNo = #{orderNo,jdbcType=INTEGER},
+      </if>
+      <if test="status != null">
+        Status = #{status,jdbcType=INTEGER},
+      </if>
+    </set>
+    where WorkCategoryID = #{workCategoryID,jdbcType=VARCHAR}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.hz.employmentsite.model.PcWorkcategory">
+    update pc_workcategory
+    set ParentWorkCategoryID = #{parentWorkCategoryID,jdbcType=VARCHAR},
+      WorkCategoryName = #{workCategoryName,jdbcType=VARCHAR},
+      OrderNo = #{orderNo,jdbcType=INTEGER},
+      Status = #{status,jdbcType=INTEGER}
+    where WorkCategoryID = #{workCategoryID,jdbcType=VARCHAR}
+  </update>
+</mapper>

+ 2 - 1
src/main/resources/mapping/cquery/PostCQuery.xml

@@ -11,7 +11,7 @@
         workNatureName,item2.`Name` as workYearName
         , IFNULL(count(rmgt.RecommendMgtID),0) as recommendNum
         , company.SiteID, site.SiteName, inSites.InstitutionID, company.RegionCode
-        , pro.ProfessionName, pro.ProfessionID, pro.parentProfessionID, modifyUser.Name as modifyUserName
+        , pro.ProfessionName,category.workCategoryName, pro.ProfessionID, pro.parentProfessionID, modifyUser.Name as modifyUserName
         from pc_post post
         left join pc_company company on post.CompanyID = company.CompanyID
         left join sys_dictionary_item item on item.value=post.CultureRank and item.DictionaryCode='CultureLevel'
@@ -19,6 +19,7 @@
         left join sys_dictionary_item work_nature on work_nature.value=post.WorkNatureID and
         work_nature.DictionaryCode='WorkNature'
         left join pc_profession pro on post.ProfessionID = pro.ProfessionID
+        left join pc_workcategory category on post.WorkCode = category.workCategoryID
         left join pc_recommend_mgt rmgt on post.PostID = rmgt.PostID
         left join pc_site site on company.SiteID = site.SiteID
         left join pc_site_institution inSites on site.SiteID = inSites.SiteID

+ 95 - 11
vue/src/views/companyService/post/edit.vue

@@ -2,7 +2,7 @@
   <div class="card-edit">
     <a-form :model="dataModel" autocomplete="off" @finish="onFinish">
       <h1>岗位基础信息</h1>
-      <a-row justify="start" :gutter="24" >
+      <a-row justify="start">
         <a-col flex="800px">
           <a-form-item label="企业名称" :label-col="{ span: 3}"
                        name="companyID" :rules="[{ required: true, message: '请选择关联企业!' }]" >
@@ -15,10 +15,7 @@
             </a-select>
           </a-form-item>
         </a-col>
-      </a-row>
-
-      <a-row justify="start">
-        <a-col flex="520px">
+        <a-col flex="530px">
           <a-form-item label="岗位名称" :label-col="{ span: 5 }"
                        name="professionName" :rules="[{ required: true, message: '请选择岗位名称!' }]">
             <a-cascader :load-data="loadLevelProfessionList" v-model:value="dataModel.professionName"
@@ -26,6 +23,17 @@
             </a-cascader>
           </a-form-item>
         </a-col>
+      </a-row>
+
+      <a-row justify="start">
+        <a-col flex="520px">
+          <a-form-item label="工种名称" :label-col="{ span: 5 }"
+                       name="workCategoryName" :rules="[{ required: true, message: '请选择行业工种!' }]">
+            <a-cascader :load-data="loadLevelWorkCategoryList" v-model:value="dataModel.workCategoryName"
+                        :options="firstWorkCategoryList" change-on-select @change="workCategoryChange">
+            </a-cascader>
+          </a-form-item>
+        </a-col>
         <a-col flex="340px">
           <a-form-item label="招聘人数" :label-col="{ span: 8}"
                        name="recruitCount" :rules="[{ required: true, message: '请输入招聘人数!' }]" >
@@ -284,8 +292,23 @@ export default defineComponent(
       const postStatusList = [{name: '启用', value: 1}, {name: '停用', value: 0}];
       const trialStatusList = [{name: '是', value: true}, {name: '否', value: false}];
       const firstProfessionList = ref<CascaderProps['options']>([]);
+      const firstWorkCategoryList = ref<CascaderProps['options']>([]);
       const refSelectModel = ref();
 
+      const getFirstWorkCategoryList = () => {
+        get("workCategory/getFirstWorkCategoryList", null).then(data=>{
+          firstWorkCategoryList.value = (data as any[]).map((x) => {
+            return {
+              label: x.name,
+              value: x.code,
+              isLeaf: false,
+              tag: 'firstLevel'
+            }
+          });
+        });
+        console.log(firstWorkCategoryList.value);
+      }
+
       const getFirstProfessionList = () => {
         get("profession/getFirstProfessionList", null).then(data=>{
           firstProfessionList.value = (data as any[]).map((x) => {
@@ -298,6 +321,41 @@ export default defineComponent(
           });
         });
       }
+
+      const loadLevelWorkCategoryList = (selectedOptions) => {
+        let targetOption = selectedOptions[selectedOptions.length - 1];
+        if (targetOption) {
+          if (targetOption.tag == 'firstLevel') {
+            get("workCategory/getListByParentWorkCategoryID",{parentWorkCategoryID:targetOption.value}).then(data => {
+              targetOption.loading = false;
+              targetOption.children = (data as any[]).map((x) => {
+                return {
+                  label: x.name,
+                  value: x.code,
+                  isLeaf: false,
+                  tag: 'secondLevel'
+                };
+              });
+            });
+            postCompany.dataModel.hasWorkCategory = false;
+          } else if (targetOption.tag == "secondLevel") {
+            get("workCategory/getListByParentWorkCategoryID",{parentWorkCategoryID:targetOption.value}).then(data => {
+              targetOption.loading = false;
+              targetOption.children = (data as any[]).map((x) => {
+                return {
+                  label: x.name,
+                  value: x.code,
+                  isLeaf: true,
+                  tag: 'thirdLevel'
+                };
+              });
+            });
+            postCompany.dataModel.hasWorkCategory = false;
+          }
+
+        }
+      };
+
       const loadLevelProfessionList = (selectedOptions) => {
         let targetOption = selectedOptions[selectedOptions.length - 1];
         if (targetOption) {
@@ -332,6 +390,15 @@ export default defineComponent(
         }
       };
 
+      watch(() => postCompany.dataModel.workCategoryName, (selectedValues) => {
+        console.log("dd",selectedValues);
+        if (selectedValues && selectedValues.length == 3) {
+          postCompany.dataModel.workCode = selectedValues[2];
+          postCompany.dataModel.hasWorkCategory = true;
+        }
+        //console.log("dsd",postCompany.dataModel);
+      });
+
       watch(() => postCompany.dataModel.professionName, (selectedValues) => {
         //console.log("dd",selectedValues);
         if (selectedValues && selectedValues.length == 3) {
@@ -385,11 +452,15 @@ export default defineComponent(
       const onFinish = () => {
         if(!postCompany.dataModel.hasProfession){
           message.error("请选择完整的岗位信息!")
-        }else{
-          if (!inputDataValidate()) {
-            return;
-          }
+        }
+        if(!postCompany.dataModel.hasWorkCategory){
+          message.error("请选择完整的行业工种!");
+          return;
+        }
+        console.log("当前岗位信息",postCompany.dataModel);
+        if (inputDataValidate()) {
           postCompany.dataModel.professionName = null;
+          postCompany.dataModel.workCategoryName = null;
           savePost(postCompany.dataModel).then((result) => {
             if (result) {
               tabsViewStore.closeCurrentTab(fullpath);
@@ -398,9 +469,9 @@ export default defineComponent(
           }).finally(() => {
             // 重新填充,防止请求失败
             postCompany.dataModel.professionName = postCompany.dataModel.postName;
+            postCompany.dataModel.workCategoryName = postCompany.dataModel.workName;
           });
         }
-
       }
 
       const onSelectModel = ()=>{
@@ -413,14 +484,24 @@ export default defineComponent(
 
       const loadData = (id: any) => {
         isEdit.value = id != null;
+        getFirstWorkCategoryList();
         getFirstProfessionList();
         getPostByID(id).then(result => {
+          console.log("初始化岗位信息",result);
           postCompany.dataModel = result;
           postCompany.dataModel.hasProfession = true;
+          postCompany.dataModel.hasWorkCategory = true;
         })
-        console.log("初始化岗位信息",postCompany.dataModel);
       };
 
+
+      // 行业工种选择变更事件
+      function workCategoryChange(value: any, selectedOptions: any) {
+        if (value.length >= 3) {
+          postCompany.dataModel.workName = selectedOptions[2].label;
+        }
+      }
+
       // 岗位名称选择变更事件
       function professionChange(value: any, selectedOptions: any) {
         if (value.length >= 3) {
@@ -443,11 +524,13 @@ export default defineComponent(
         loadData,
         onClose,
         onFinish,
+        loadLevelWorkCategoryList,
         loadLevelProfessionList,
         onSelectModel,
         selectLabelChecks,
         refSelectModel,
         firstProfessionList,
+        firstWorkCategoryList,
         companyList,
         postStatusList,
         trialStatusList,
@@ -456,6 +539,7 @@ export default defineComponent(
         postCompany,
         isEdit,
         jobHuntList,
+        workCategoryChange,
         professionChange,
         companyChange
       }