diff --git a/springboot-ademo/src/main/java/com/tiesheng/demo/config/TestJobConfig.java b/springboot-ademo/src/main/java/com/tiesheng/demo/config/TestJobConfig.java new file mode 100644 index 0000000..f6b84f0 --- /dev/null +++ b/springboot-ademo/src/main/java/com/tiesheng/demo/config/TestJobConfig.java @@ -0,0 +1,30 @@ +package com.tiesheng.demo.config; + + +import cn.hutool.core.collection.CollUtil; +import com.tiesheng.core.service.JobService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import javax.annotation.PostConstruct; + +/** + * @author hao + */ +@Component +public class TestJobConfig { + + @Autowired + JobService jobService; + + @PostConstruct + public void init() { + + jobService.refreshPoint("230328001", "demo", "辅导员统计", "辅导员责任班级,学生展示"); + + // 辅导员职位 + jobService.refresh("class_fdy", "辅导员", "辅导员", 1, CollUtil.newArrayList("230328001")); + + } + +} diff --git a/springboot-util/src/main/java/com/tiesheng/util/pojos/IdName.java b/springboot-util/src/main/java/com/tiesheng/util/pojos/IdName.java new file mode 100644 index 0000000..8abcf28 --- /dev/null +++ b/springboot-util/src/main/java/com/tiesheng/util/pojos/IdName.java @@ -0,0 +1,36 @@ +package com.tiesheng.util.pojos; + +public class IdName { + + private String id; + private String name; + private String extra; + + /////////////////////////////////////////////////////////////////////////// + // setter\getter + /////////////////////////////////////////////////////////////////////////// + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getExtra() { + return extra; + } + + public void setExtra(String extra) { + this.extra = extra; + } +} diff --git a/springboot-web/src/main/java/com/tiesheng/core/controller/JobController.java b/springboot-web/src/main/java/com/tiesheng/core/controller/JobController.java new file mode 100644 index 0000000..ff7ee7f --- /dev/null +++ b/springboot-web/src/main/java/com/tiesheng/core/controller/JobController.java @@ -0,0 +1,135 @@ +package com.tiesheng.core.controller; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.tiesheng.core.pojos.dao.CoreJob; +import com.tiesheng.core.pojos.dao.CoreJobPoint; +import com.tiesheng.core.pojos.dto.IdDTO; +import com.tiesheng.core.pojos.dto.PageDTO; +import com.tiesheng.core.pojos.dto.job.JobUpdateDTO; +import com.tiesheng.core.pojos.dto.job.JobUpdateRxDTO; +import com.tiesheng.core.pojos.dto.job.JobUserAssignDTO; +import com.tiesheng.core.pojos.dto.job.JobUserOwner; +import com.tiesheng.core.service.JobService; +import com.tiesheng.login.config.token.TsTokenConfig; +import com.tiesheng.util.exception.ApiException; +import com.tiesheng.util.pojos.ApiResp; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.validation.Valid; +import java.util.List; + +/** + * @author hao + */ +@RestController +@RequestMapping("/job") +public class JobController { + + @Autowired + JobService jobService; + + + /** + * 获取职位列表 + * + * @return + */ + @GetMapping("/list") + public ApiResp> list(PageDTO dto) { + QueryWrapper queryWrapper = new QueryWrapper().eq("is_deleted", 0); + dto.likeColumns(queryWrapper, "name"); + List jobList = jobService.list(queryWrapper); + return ApiResp.respOK(jobList); + } + + + /** + * 添加、编辑职位 + * + * @return + */ + @PostMapping("/update") + public ApiResp update(@Valid @RequestBody JobUpdateDTO dto) { + CoreJob job = BeanUtil.copyProperties(dto, CoreJob.class); + if (!StrUtil.isEmpty(job.getId())) { + CoreJob byId = jobService.getById(job.getId()); + if (byId != null && byId.getIsSystem() == 1) { + throw new ApiException("系统配置,无法编辑"); + } + } + jobService.saveOrUpdate(job); + return ApiResp.respOK(""); + } + + + /** + * 获取职位功能点 + * + * @return + */ + @GetMapping("/point/list") + public ApiResp> pointList() { + List pointList = jobService.getJobPointMapper().selectList(new QueryWrapper() + .eq("is_deleted", 0) + ); + return ApiResp.respOK(pointList); + } + + + /** + * 获取关系 + * + * @param dto + * @return + */ + @GetMapping("/point/rx") + public ApiResp> pointRx(@Valid IdDTO dto) { + List list = jobService.getJobPointMapper().getJobRx(dto.getId()); + return ApiResp.respOK(list); + } + + + /** + * 更新职位关系 + * + * @return + */ + @PostMapping("/point/rx") + public ApiResp updateJobRx(@Valid @RequestBody JobUpdateRxDTO dto) { + jobService.updateJobRx(dto.getJobId(), StrUtil.split(dto.getPoints(), ",")); + return ApiResp.respOK(""); + } + + + /** + * 用户职位分配 + * + * @return + */ + @PostMapping("/user/assign") + public ApiResp userAssign(@Valid @RequestBody JobUserAssignDTO dto) { + jobService.userAssign(dto.getUserId(), dto.getJobId()); + return ApiResp.respOK(""); + } + + + /** + * 获取用户自己的 + * + * @return + */ + @GetMapping("/user/owner") + public ApiResp> userOwner() { + List coreJobUsers = jobService.getJobUserMapper().list(TsTokenConfig.get().getId()); + coreJobUsers.forEach(it -> { + List list = jobService.getJobPointMapper().getJobRx(it.getJobId()); + it.setPoints(list); + }); + return ApiResp.respOK(coreJobUsers); + } + + +} diff --git a/springboot-web/src/main/java/com/tiesheng/core/mapper/CoreJobMapper.java b/springboot-web/src/main/java/com/tiesheng/core/mapper/CoreJobMapper.java new file mode 100644 index 0000000..49cba78 --- /dev/null +++ b/springboot-web/src/main/java/com/tiesheng/core/mapper/CoreJobMapper.java @@ -0,0 +1,7 @@ +package com.tiesheng.core.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.tiesheng.core.pojos.dao.CoreJob; + +public interface CoreJobMapper extends BaseMapper { +} \ No newline at end of file diff --git a/springboot-web/src/main/java/com/tiesheng/core/mapper/CoreJobPointMapper.java b/springboot-web/src/main/java/com/tiesheng/core/mapper/CoreJobPointMapper.java new file mode 100644 index 0000000..4ec7dd1 --- /dev/null +++ b/springboot-web/src/main/java/com/tiesheng/core/mapper/CoreJobPointMapper.java @@ -0,0 +1,37 @@ +package com.tiesheng.core.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.tiesheng.core.pojos.dao.CoreJobPoint; +import com.tiesheng.util.pojos.IdName; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +public interface CoreJobPointMapper extends BaseMapper { + + + /** + * 清除职位的关联关系 + * + * @param jobId + */ + void clearJobRx(@Param("jobId") String jobId); + + + /** + * 更新关联关系 + * + * @param pointList + */ + void updateJobRx(@Param("list") List pointList); + + + /** + * 获取关联的point + * + * @param jobId + * @return + */ + List getJobRx(@Param("jobId") String jobId); + +} diff --git a/springboot-web/src/main/java/com/tiesheng/core/mapper/CoreJobUserMapper.java b/springboot-web/src/main/java/com/tiesheng/core/mapper/CoreJobUserMapper.java new file mode 100644 index 0000000..ba59ee1 --- /dev/null +++ b/springboot-web/src/main/java/com/tiesheng/core/mapper/CoreJobUserMapper.java @@ -0,0 +1,21 @@ +package com.tiesheng.core.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.tiesheng.core.pojos.dao.CoreJobUser; +import com.tiesheng.core.pojos.dto.job.JobUserOwner; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +public interface CoreJobUserMapper extends BaseMapper { + + + /** + * 获取指定用户的职位和功能点 + * + * @param userId + * @return + */ + List list(@Param("userId") String userId); + +} diff --git a/springboot-web/src/main/java/com/tiesheng/core/pojos/dao/CoreJob.java b/springboot-web/src/main/java/com/tiesheng/core/pojos/dao/CoreJob.java new file mode 100644 index 0000000..31d5230 --- /dev/null +++ b/springboot-web/src/main/java/com/tiesheng/core/pojos/dao/CoreJob.java @@ -0,0 +1,86 @@ +package com.tiesheng.core.pojos.dao; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.tiesheng.core.pojos.DaoBase; +import java.util.Date; + +/** + * 职位 + */ +@TableName(value = "core_job") +public class CoreJob extends DaoBase { + /** + * 名称 + */ + @TableField(value = "`name`") + private String name; + + /** + * 其他说明 + */ + @TableField(value = "remark") + private String remark; + + /** + * 是否系统 + */ + @TableField(value = "is_system") + private Integer isSystem; + + /** + * 获取名称 + * + * @return name - 名称 + */ + public String getName() { + return name; + } + + /** + * 设置名称 + * + * @param name 名称 + */ + public void setName(String name) { + this.name = name; + } + + /** + * 获取其他说明 + * + * @return remark - 其他说明 + */ + public String getRemark() { + return remark; + } + + /** + * 设置其他说明 + * + * @param remark 其他说明 + */ + public void setRemark(String remark) { + this.remark = remark; + } + + /** + * 获取是否系统 + * + * @return is_system - 是否系统 + */ + public Integer getIsSystem() { + return isSystem; + } + + /** + * 设置是否系统 + * + * @param isSystem 是否系统 + */ + public void setIsSystem(Integer isSystem) { + this.isSystem = isSystem; + } +} \ No newline at end of file diff --git a/springboot-web/src/main/java/com/tiesheng/core/pojos/dao/CoreJobPoint.java b/springboot-web/src/main/java/com/tiesheng/core/pojos/dao/CoreJobPoint.java new file mode 100644 index 0000000..ddf1fad --- /dev/null +++ b/springboot-web/src/main/java/com/tiesheng/core/pojos/dao/CoreJobPoint.java @@ -0,0 +1,86 @@ +package com.tiesheng.core.pojos.dao; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.tiesheng.core.pojos.DaoBase; +import java.util.Date; + +/** + * 职位-功能点 + */ +@TableName(value = "core_job_point") +public class CoreJobPoint extends DaoBase { + /** + * 业务 + */ + @TableField(value = "service") + private String service; + + /** + * 名称 + */ + @TableField(value = "`name`") + private String name; + + /** + * 其他说明 + */ + @TableField(value = "remark") + private String remark; + + /** + * 获取业务 + * + * @return service - 业务 + */ + public String getService() { + return service; + } + + /** + * 设置业务 + * + * @param service 业务 + */ + public void setService(String service) { + this.service = service; + } + + /** + * 获取名称 + * + * @return name - 名称 + */ + public String getName() { + return name; + } + + /** + * 设置名称 + * + * @param name 名称 + */ + public void setName(String name) { + this.name = name; + } + + /** + * 获取其他说明 + * + * @return remark - 其他说明 + */ + public String getRemark() { + return remark; + } + + /** + * 设置其他说明 + * + * @param remark 其他说明 + */ + public void setRemark(String remark) { + this.remark = remark; + } +} \ No newline at end of file diff --git a/springboot-web/src/main/java/com/tiesheng/core/pojos/dao/CoreJobUser.java b/springboot-web/src/main/java/com/tiesheng/core/pojos/dao/CoreJobUser.java new file mode 100644 index 0000000..390b250 --- /dev/null +++ b/springboot-web/src/main/java/com/tiesheng/core/pojos/dao/CoreJobUser.java @@ -0,0 +1,62 @@ +package com.tiesheng.core.pojos.dao; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.tiesheng.core.pojos.DaoBase; +import java.util.Date; + +/** + * 职位-用户 + */ +@TableName(value = "core_job_user") +public class CoreJobUser extends DaoBase { + /** + * 用户id + */ + @TableField(value = "user_id") + private String userId; + + /** + * 用户 + */ + @TableField(value = "job_id") + private String jobId; + + /** + * 获取用户id + * + * @return user_id - 用户id + */ + public String getUserId() { + return userId; + } + + /** + * 设置用户id + * + * @param userId 用户id + */ + public void setUserId(String userId) { + this.userId = userId; + } + + /** + * 获取用户 + * + * @return job_id - 用户 + */ + public String getJobId() { + return jobId; + } + + /** + * 设置用户 + * + * @param jobId 用户 + */ + public void setJobId(String jobId) { + this.jobId = jobId; + } +} \ No newline at end of file diff --git a/springboot-web/src/main/java/com/tiesheng/core/pojos/dto/IdDTO.java b/springboot-web/src/main/java/com/tiesheng/core/pojos/dto/IdDTO.java new file mode 100644 index 0000000..eb7151e --- /dev/null +++ b/springboot-web/src/main/java/com/tiesheng/core/pojos/dto/IdDTO.java @@ -0,0 +1,23 @@ +package com.tiesheng.core.pojos.dto; + +import javax.validation.constraints.NotEmpty; + +public class IdDTO { + + @NotEmpty(message = "需要ID") + private String id; + + /////////////////////////////////////////////////////////////////////////// + // setter\getter + /////////////////////////////////////////////////////////////////////////// + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + +} diff --git a/springboot-web/src/main/java/com/tiesheng/core/pojos/dto/job/JobUpdateDTO.java b/springboot-web/src/main/java/com/tiesheng/core/pojos/dto/job/JobUpdateDTO.java new file mode 100644 index 0000000..86658f8 --- /dev/null +++ b/springboot-web/src/main/java/com/tiesheng/core/pojos/dto/job/JobUpdateDTO.java @@ -0,0 +1,40 @@ +package com.tiesheng.core.pojos.dto.job; + +import javax.validation.constraints.NotEmpty; + +public class JobUpdateDTO { + + private String id; + + @NotEmpty(message = "请输入职位名称") + private String name; + private String remark; + + /////////////////////////////////////////////////////////////////////////// + // setter\getter + /////////////////////////////////////////////////////////////////////////// + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } +} diff --git a/springboot-web/src/main/java/com/tiesheng/core/pojos/dto/job/JobUpdateRxDTO.java b/springboot-web/src/main/java/com/tiesheng/core/pojos/dto/job/JobUpdateRxDTO.java new file mode 100644 index 0000000..87e6d43 --- /dev/null +++ b/springboot-web/src/main/java/com/tiesheng/core/pojos/dto/job/JobUpdateRxDTO.java @@ -0,0 +1,30 @@ +package com.tiesheng.core.pojos.dto.job; + +import javax.validation.constraints.NotEmpty; + +public class JobUpdateRxDTO { + + @NotEmpty(message = "请选择职位") + private String jobId; + private String points; + + /////////////////////////////////////////////////////////////////////////// + // setter\getter + /////////////////////////////////////////////////////////////////////////// + + public String getJobId() { + return jobId; + } + + public void setJobId(String jobId) { + this.jobId = jobId; + } + + public String getPoints() { + return points; + } + + public void setPoints(String points) { + this.points = points; + } +} diff --git a/springboot-web/src/main/java/com/tiesheng/core/pojos/dto/job/JobUserAssignDTO.java b/springboot-web/src/main/java/com/tiesheng/core/pojos/dto/job/JobUserAssignDTO.java new file mode 100644 index 0000000..8070e0e --- /dev/null +++ b/springboot-web/src/main/java/com/tiesheng/core/pojos/dto/job/JobUserAssignDTO.java @@ -0,0 +1,31 @@ +package com.tiesheng.core.pojos.dto.job; + +import javax.validation.constraints.NotEmpty; + +public class JobUserAssignDTO { + + @NotEmpty(message = "请选择用户") + private String userId; + @NotEmpty(message = "请选择职位") + private String jobId; + + /////////////////////////////////////////////////////////////////////////// + // setter\getter + /////////////////////////////////////////////////////////////////////////// + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public String getJobId() { + return jobId; + } + + public void setJobId(String jobId) { + this.jobId = jobId; + } +} diff --git a/springboot-web/src/main/java/com/tiesheng/core/pojos/dto/job/JobUserOwner.java b/springboot-web/src/main/java/com/tiesheng/core/pojos/dto/job/JobUserOwner.java new file mode 100644 index 0000000..9b72a72 --- /dev/null +++ b/springboot-web/src/main/java/com/tiesheng/core/pojos/dto/job/JobUserOwner.java @@ -0,0 +1,40 @@ +package com.tiesheng.core.pojos.dto.job; + +import com.tiesheng.util.pojos.IdName; + +import java.util.List; + +public class JobUserOwner { + + private String jobId; + private String jobName; + private List points; + + /////////////////////////////////////////////////////////////////////////// + // setter\getter + /////////////////////////////////////////////////////////////////////////// + + public String getJobId() { + return jobId; + } + + public void setJobId(String jobId) { + this.jobId = jobId; + } + + public String getJobName() { + return jobName; + } + + public void setJobName(String jobName) { + this.jobName = jobName; + } + + public List getPoints() { + return points; + } + + public void setPoints(List points) { + this.points = points; + } +} diff --git a/springboot-web/src/main/java/com/tiesheng/core/service/JobService.java b/springboot-web/src/main/java/com/tiesheng/core/service/JobService.java new file mode 100644 index 0000000..2e4633c --- /dev/null +++ b/springboot-web/src/main/java/com/tiesheng/core/service/JobService.java @@ -0,0 +1,131 @@ +package com.tiesheng.core.service; + +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.tiesheng.core.mapper.CoreJobMapper; +import com.tiesheng.core.mapper.CoreJobPointMapper; +import com.tiesheng.core.mapper.CoreJobUserMapper; +import com.tiesheng.core.pojos.dao.CoreJob; +import com.tiesheng.core.pojos.dao.CoreJobPoint; +import com.tiesheng.core.pojos.dao.CoreJobUser; +import com.tiesheng.util.pojos.IdName; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author hao + */ +@Service +public class JobService extends TsServiceBase { + + @Autowired + CoreJobPointMapper coreJobPointMapper; + @Autowired + CoreJobUserMapper coreJobUserMapper; + + public CoreJobPointMapper getJobPointMapper() { + return coreJobPointMapper; + } + + public CoreJobUserMapper getJobUserMapper() { + return coreJobUserMapper; + } + + /** + * 刷新职位 + * + * @param name + * @param remark + * @param isSystem + */ + public void refresh(String id, String name, String remark, Integer isSystem, List points) { + CoreJob coreJob = new CoreJob(); + coreJob.setId(id); + coreJob.setName(name); + coreJob.setRemark(remark); + coreJob.setIsSystem(isSystem); + saveOrUpdate(coreJob); + + // 增加关联关系 + updateJobRx(coreJob.getId(), points); + } + + + /** + * 刷新功能点 + * + * @param id + * @param service + * @param name + * @param remark + */ + public void refreshPoint(String id, String service, String name, String remark) { + CoreJobPoint jobPoint = new CoreJobPoint(); + jobPoint.setId(id); + jobPoint.setService(service); + jobPoint.setName(name); + jobPoint.setRemark(remark); + try { + coreJobPointMapper.insert(jobPoint); + } catch (Exception e) { + coreJobPointMapper.updateById(jobPoint); + } + } + + + /** + * 更新关联关系 + * + * @param jobId + * @param points + */ + public void updateJobRx(String jobId, List points) { + List nameList = new ArrayList<>(); + for (String s : points) { + IdName id = new IdName(); + id.setId(IdUtil.getSnowflakeNextIdStr()); + id.setName(jobId); + id.setExtra(s); + nameList.add(id); + } + if (StrUtil.isEmpty(jobId)) { + return; + } + coreJobPointMapper.clearJobRx(jobId); + if (CollUtil.isNotEmpty(nameList)) { + coreJobPointMapper.updateJobRx(nameList); + } + } + + + /** + * 分配职位 + * + * @param userId + * @param jobId + */ + public void userAssign(String userId, String jobId) { + CoreJobUser jobUser = coreJobUserMapper.selectOne(new QueryWrapper() + .eq("is_deleted", 0) + .eq("user_id", userId) + .eq("job_id", jobId) + ); + if (jobUser == null) { + jobUser = new CoreJobUser(); + } + jobUser.setUserId(userId); + jobUser.setJobId(jobId); + if (StrUtil.isEmpty(jobUser.getId())) { + coreJobUserMapper.insert(jobUser); + } else { + coreJobUserMapper.updateById(jobUser); + } + } + + +} diff --git a/springboot-web/src/main/resources/db/migration/core_job.sql b/springboot-web/src/main/resources/db/migration/core_job.sql new file mode 100644 index 0000000..0683af0 --- /dev/null +++ b/springboot-web/src/main/resources/db/migration/core_job.sql @@ -0,0 +1,66 @@ +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for core_job +-- ---------------------------- +CREATE TABLE `core_job` +( + `id` varchar(50) NOT NULL, + `create_time` datetime NOT NULL, + `update_time` datetime NOT NULL, + `is_deleted` int(6) NOT NULL DEFAULT '0', + `name` varchar(255) DEFAULT NULL COMMENT '名称', + `remark` varchar(500) DEFAULT NULL COMMENT '其他说明', + `is_system` int(6) NOT NULL DEFAULT '0' COMMENT '是否系统', + PRIMARY KEY (`id`) +) ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4 COMMENT ='职位'; + +-- ---------------------------- +-- Table structure for core_job_point +-- ---------------------------- +CREATE TABLE `core_job_point` +( + `id` varchar(50) NOT NULL, + `create_time` datetime NOT NULL, + `update_time` datetime NOT NULL, + `is_deleted` int(6) NOT NULL DEFAULT '0', + `service` varchar(20) DEFAULT NULL COMMENT '业务', + `name` varchar(255) DEFAULT NULL COMMENT '名称', + `remark` varchar(500) DEFAULT NULL COMMENT '其他说明', + PRIMARY KEY (`id`) +) ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4 COMMENT ='职位-功能点'; + +-- ---------------------------- +-- Table structure for core_job_rx +-- ---------------------------- +CREATE TABLE `core_job_rx` +( + `id` varchar(50) NOT NULL, + `create_time` datetime NOT NULL, + `update_time` datetime NOT NULL, + `is_deleted` int(6) NOT NULL DEFAULT '0', + `job_id` varchar(50) DEFAULT NULL COMMENT '职位id', + `point_id` varchar(50) DEFAULT NULL COMMENT ' 功能点id', + PRIMARY KEY (`id`) +) ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4 COMMENT ='职位-功能关系'; + +-- ---------------------------- +-- Table structure for core_job_user +-- ---------------------------- +CREATE TABLE `core_job_user` +( + `id` varchar(50) NOT NULL, + `create_time` datetime NOT NULL, + `update_time` datetime NOT NULL, + `is_deleted` int(6) NOT NULL DEFAULT '0', + `user_id` varchar(50) NOT NULL COMMENT '用户id', + `job_id` varchar(50) NOT NULL COMMENT '用户', + PRIMARY KEY (`id`) +) ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4 COMMENT ='职位-用户'; + +SET FOREIGN_KEY_CHECKS = 1; diff --git a/springboot-web/src/main/resources/mapper/CoreJobMapper.xml b/springboot-web/src/main/resources/mapper/CoreJobMapper.xml new file mode 100644 index 0000000..e3e0352 --- /dev/null +++ b/springboot-web/src/main/resources/mapper/CoreJobMapper.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + id, create_time, update_time, is_deleted, `name`, remark, is_system + + \ No newline at end of file diff --git a/springboot-web/src/main/resources/mapper/CoreJobPointMapper.xml b/springboot-web/src/main/resources/mapper/CoreJobPointMapper.xml new file mode 100644 index 0000000..6c6d12d --- /dev/null +++ b/springboot-web/src/main/resources/mapper/CoreJobPointMapper.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + id, create_time, update_time, is_deleted, service, `name`, remark + + + + delete from core_job_rx where job_id=#{jobId} + + + + insert into core_job_rx( + id, create_time, update_time, is_deleted, job_id, point_id + ) VALUES + + (#{as.id}, + now(), + now(), + 0, + #{as.name}, + #{as.extra} + ) + + + + + + + diff --git a/springboot-web/src/main/resources/mapper/CoreJobUserMapper.xml b/springboot-web/src/main/resources/mapper/CoreJobUserMapper.xml new file mode 100644 index 0000000..089d63d --- /dev/null +++ b/springboot-web/src/main/resources/mapper/CoreJobUserMapper.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + id, create_time, update_time, is_deleted, user_id, job_id + + + +