Browse Source

Merge remote-tracking branch 'origin/V0.0.2' into V0.0.2

ouyang 2 năm trước cách đây
mục cha
commit
88401078d9
13 tập tin đã thay đổi với 1404 bổ sung5 xóa
  1. 6 5
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/impl/AppPlanServiceImpl.java
  2. 95 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/controller/CoreSafecheckPlanController.java
  3. 96 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/controller/CoreSafecheckPlanToRoleController.java
  4. 232 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/domain/CoreSafecheckPlan.java
  5. 57 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/domain/CoreSafecheckPlanToRole.java
  6. 64 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/mapper/CoreSafecheckPlanMapper.java
  7. 62 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/mapper/CoreSafecheckPlanToRoleMapper.java
  8. 72 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/service/ICoreSafecheckPlanService.java
  9. 72 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/service/ICoreSafecheckPlanToRoleService.java
  10. 166 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/service/impl/CoreSafecheckPlanServiceImpl.java
  11. 121 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/service/impl/CoreSafecheckPlanToRoleServiceImpl.java
  12. 288 0
      soc-modules/soc-modules-core/src/main/resources/mapper/safetycheck/CoreSafecheckPlanMapper.xml
  13. 73 0
      soc-modules/soc-modules-core/src/main/resources/mapper/safetycheck/CoreSafecheckPlanToRoleMapper.xml

+ 6 - 5
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/impl/AppPlanServiceImpl.java

@@ -160,6 +160,7 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
             plan.setPlanStatus(d.getStatus());
             plan.setDistributePlanStatus(d.getStatus().toString());
             plan.setId(null);
+//            plan.setPlanName(plan.getPlanName()+"下发"+orgService.selectOrgById(d.getOrgId(),SecurityConstants.INNER).getName());
             plan.setPlanName(plan.getPlanName());
             plan.setParentId(dto.getId());
             baseMapper.insert(plan);
@@ -299,11 +300,11 @@ public class AppPlanServiceImpl extends ServiceImpl<AppPlanMapper, AppPlan> impl
             qw.lambda().eq(AppPlan::getPlanName, app.getPlanName())
                     .ne(AppPlan::getId, plan.getId());
 
-            Long size = baseMapper.selectCount(qw);
-
-            if (size > 0) {
-                throw new RuntimeException("计划名称重复,请确认!");
-            }
+//            Long size = baseMapper.selectCount(qw);
+//
+//            if (size > 0) {
+//                throw new RuntimeException("计划名称重复,请确认!");
+//            }
 
 
             baseMapper.updateById(plan);

+ 95 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/controller/CoreSafecheckPlanController.java

@@ -0,0 +1,95 @@
+package com.xunmei.core.safetyCheck.controller;
+
+import java.util.List;
+import java.io.IOException;
+import javax.servlet.http.HttpServletResponse;
+
+import com.xunmei.core.safetyCheck.domain.CoreSafecheckPlan;
+import com.xunmei.core.safetyCheck.service.ICoreSafecheckPlanService;
+import org.springframework.beans.factory.annotation.Autowired;
+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.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.xunmei.common.log.annotation.Log;
+import com.xunmei.common.log.enums.BusinessType;
+import com.xunmei.common.security.annotation.RequiresPermissions;
+import com.xunmei.common.core.web.controller.BaseController;
+import com.xunmei.common.core.web.domain.AjaxResult;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.xunmei.common.core.web.page.TableDataInfo;
+
+/**
+ * 常规安全检查计划Controller
+ *
+ * @author xunmei
+ * @date 2023-09-12
+ */
+@Api(tags = {"CoreSafecheckPlan"})
+@RestController
+@RequestMapping("/checkplan")
+public class CoreSafecheckPlanController extends BaseController {
+    @Autowired
+    private ICoreSafecheckPlanService coreSafecheckPlanService;
+
+    /**
+     * 查询常规安全检查计划列表
+     */
+    @ApiOperation(value = "查询CoreSafecheckPlan列表")
+    @RequiresPermissions("system:checkplan:list")
+    @PostMapping("/list")
+    public TableDataInfo<CoreSafecheckPlan> list(@RequestBody CoreSafecheckPlan coreSafecheckPlan) {
+
+        return coreSafecheckPlanService.selectPage(coreSafecheckPlan);
+    }
+
+
+    /**
+     * 获取常规安全检查计划详细信息
+     */
+    @ApiOperation(value = "获取CoreSafecheckPlan详细信息")
+    @RequiresPermissions("system:checkplan:query")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        return success(coreSafecheckPlanService.selectCoreSafecheckPlanById(id));
+    }
+
+    /**
+     * 新增常规安全检查计划
+     */
+    @ApiOperation(value = "新增CoreSafecheckPlan")
+    @RequiresPermissions("system:checkplan:add")
+    @Log(title = "常规安全检查计划", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody CoreSafecheckPlan coreSafecheckPlan) {
+        return toAjax(coreSafecheckPlanService.insertCoreSafecheckPlan(coreSafecheckPlan));
+    }
+
+    /**
+     * 修改常规安全检查计划
+     */
+    @ApiOperation(value = "修改CoreSafecheckPlan")
+    @RequiresPermissions("system:checkplan:edit")
+    @Log(title = "常规安全检查计划", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody CoreSafecheckPlan coreSafecheckPlan) {
+        return toAjax(coreSafecheckPlanService.updateCoreSafecheckPlan(coreSafecheckPlan));
+    }
+
+    /**
+     * 删除常规安全检查计划
+     */
+    @ApiOperation(value = "删除CoreSafecheckPlan")
+    @RequiresPermissions("system:checkplan:remove")
+    @Log(title = "常规安全检查计划", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        return toAjax(coreSafecheckPlanService.deleteCoreSafecheckPlanByIds(ids));
+    }
+}

+ 96 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/controller/CoreSafecheckPlanToRoleController.java

@@ -0,0 +1,96 @@
+package com.xunmei.core.safetyCheck.controller;
+
+import java.util.List;
+import java.io.IOException;
+import javax.servlet.http.HttpServletResponse;
+
+import com.xunmei.core.safetyCheck.domain.CoreSafecheckPlanToRole;
+import com.xunmei.core.safetyCheck.service.ICoreSafecheckPlanToRoleService;
+import org.springframework.beans.factory.annotation.Autowired;
+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.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.xunmei.common.log.annotation.Log;
+import com.xunmei.common.log.enums.BusinessType;
+import com.xunmei.common.security.annotation.RequiresPermissions;
+import com.xunmei.common.core.web.controller.BaseController;
+import com.xunmei.common.core.web.domain.AjaxResult;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.xunmei.common.core.web.page.TableDataInfo;
+
+/**
+ * 常规安全检查计划执行角色关联Controller
+ *
+ * @author xunmei
+ * @date 2023-09-12
+ */
+@Api(tags = {"CoreSafecheckPlanToRole" })
+@RestController
+@RequestMapping("/role")
+public class CoreSafecheckPlanToRoleController extends BaseController {
+    @Autowired
+    private ICoreSafecheckPlanToRoleService coreSafecheckPlanToRoleService;
+
+/**
+ * 查询常规安全检查计划执行角色关联列表
+ */
+@ApiOperation(value = "查询CoreSafecheckPlanToRole列表")
+@RequiresPermissions("system:role:list")
+@GetMapping("/list")
+    public TableDataInfo<CoreSafecheckPlanToRole> list(CoreSafecheckPlanToRole coreSafecheckPlanToRole) {
+
+        return coreSafecheckPlanToRoleService.selectPage( coreSafecheckPlanToRole);
+    }
+
+
+
+    /**
+     * 获取常规安全检查计划执行角色关联详细信息
+     */
+    @ApiOperation(value = "获取CoreSafecheckPlanToRole详细信息")
+    @RequiresPermissions("system:role:query")
+    @GetMapping(value = "/{planId}")
+    public AjaxResult getInfo(@PathVariable("planId") Long planId) {
+        return success(coreSafecheckPlanToRoleService.selectCoreSafecheckPlanToRoleByPlanId(planId));
+    }
+
+    /**
+     * 新增常规安全检查计划执行角色关联
+     */
+    @ApiOperation(value = "新增CoreSafecheckPlanToRole")
+    @RequiresPermissions("system:role:add")
+    @Log(title = "常规安全检查计划执行角色关联" , businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody CoreSafecheckPlanToRole coreSafecheckPlanToRole) {
+        return toAjax(coreSafecheckPlanToRoleService.insertCoreSafecheckPlanToRole(coreSafecheckPlanToRole));
+    }
+
+    /**
+     * 修改常规安全检查计划执行角色关联
+     */
+    @ApiOperation(value = "修改CoreSafecheckPlanToRole")
+    @RequiresPermissions("system:role:edit")
+    @Log(title = "常规安全检查计划执行角色关联" , businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody CoreSafecheckPlanToRole coreSafecheckPlanToRole) {
+        return toAjax(coreSafecheckPlanToRoleService.updateCoreSafecheckPlanToRole(coreSafecheckPlanToRole));
+    }
+
+    /**
+     * 删除常规安全检查计划执行角色关联
+     */
+    @ApiOperation(value = "删除CoreSafecheckPlanToRole")
+    @RequiresPermissions("system:role:remove")
+    @Log(title = "常规安全检查计划执行角色关联" , businessType = BusinessType.DELETE)
+    @DeleteMapping("/{planIds}")
+    public AjaxResult remove(@PathVariable Long[] planIds) {
+        return toAjax(coreSafecheckPlanToRoleService.deleteCoreSafecheckPlanToRoleByPlanIds(planIds));
+    }
+}

+ 232 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/domain/CoreSafecheckPlan.java

@@ -0,0 +1,232 @@
+package com.xunmei.core.safetyCheck.domain;
+
+import java.util.Date;
+import java.util.List;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import com.xunmei.system.api.domain.SysRole;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import com.xunmei.common.core.web.domain.BaseEntity;
+
+/**
+ * 常规安全检查计划对象 core_safecheck_plan
+ *
+ * @author xunmei
+ * @date 2023-09-12
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("core_safecheck_plan")
+@ApiModel(value = "CoreSafecheckPlan对象", description = "常规安全检查计划")
+public class CoreSafecheckPlan extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(value = "id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long id;
+
+    /**
+     * 计划名称
+     */
+    @ApiModelProperty(value = "计划名称")
+    private String planName;
+    @TableField(exist = false)
+    private String checkRole;
+    /**
+     * 检查角色
+     */
+    @TableField(exist = false)
+    private List<SysRole> roleList;
+    @TableField(exist = false)
+    private List<Long> roleIds;
+    /**
+     * roleList
+     * 计划周期:每日,每周,每月,每季度,每半年,每年 ,无周期
+     */
+    @ApiModelProperty(value = "计划周期:每日,每周,每月,每季度,每半年,每年 ,无周期")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long planCycle;
+    /**
+     * 计划创建机构名称
+     */
+    @TableField(exist = false)
+    private String planCreateOrgName;
+    /**
+     * 计划创建机构id
+     */
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long planCreateOrgId;
+    /**
+     * 检查类型
+     */
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long checkType;
+    /**
+     * 计划所属机构名称
+     */
+    @TableField(exist = false)
+    private String planOfOrgName;
+    /**
+     * 计划所属机构id
+     */
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long planOfOrgId;
+    /**
+     * 检查机构类型
+     */
+    @ApiModelProperty(value = "检查机构类型")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long execOrgType;
+    @ApiModelProperty(value = "检查机构")
+    private String execOrg;
+
+    /**
+     * 受检机构类型
+     */
+    @ApiModelProperty(value = "受检机构类型")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long checkOrgType;
+    @ApiModelProperty(value = "受检机构")
+    private String checkOrg;
+
+    /**
+     * 计划状态:0:启用,1禁用
+     */
+    @ApiModelProperty(value = "计划状态:0:启用,1禁用")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long planStatus;
+
+    /**
+     * 开始日期
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @ApiModelProperty(value = "开始日期")
+    private Date startDate;
+
+    /**
+     * 结束日期
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @ApiModelProperty(value = "结束日期")
+    private Date endDate;
+
+    /**
+     * 立即生成任务
+     */
+    @ApiModelProperty(value = "立即生成任务")
+    private String buildTaskNow;
+
+    /**
+     * 备注
+     */
+    @ApiModelProperty(value = "备注")
+    private String description;
+
+    /**
+     * 是否删除
+     */
+    @ApiModelProperty(value = "是否删除")
+    private String isDeleted;
+
+    /**
+     * 修改人名称
+     */
+    @ApiModelProperty(value = "修改人名称")
+    private String modifiedName;
+    /**
+     * 修改时间
+     */
+    private Date modifiedTime;
+    @TableField(exist = false)
+    private List<String> checkRoleNames;
+    @TableField(exist = false)
+    private List<Long> checkRoleIds;
+    /**
+     * 修改人id
+     */
+    @ApiModelProperty(value = "修改人id")
+    private Long modifiedBy;
+    @TableField(exist = false)
+    private List<CoreSafecheckPlan> children;
+    /**
+     * 数据来源 0:检查计划 ,1:登记检查结果
+     */
+    @ApiModelProperty(value = "数据来源 0:检查计划 ,1:登记检查结果")
+    private Long sourceType;
+    /**
+     * 检查次数
+     */
+    private Long count;
+
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+
+
+                .append("id", getId())
+
+
+                .append("planName", getPlanName())
+
+
+                .append("planCycle", getPlanCycle())
+
+
+                .append("execOrgType", getExecOrgType())
+
+
+                .append("checkOrgType", getCheckOrgType())
+
+
+                .append("planStatus", getPlanStatus())
+
+
+                .append("startDate", getStartDate())
+
+
+                .append("endDate", getEndDate())
+
+
+                .append("buildTaskNow", getBuildTaskNow())
+
+
+                .append("description", getDescription())
+
+
+                .append("isDeleted", getIsDeleted())
+
+
+                .append("createTime", getCreateTime())
+
+
+                .append("modifiedName", getModifiedName())
+
+
+                .append("updateTime", getUpdateTime())
+
+
+                .append("modifiedBy", getModifiedBy())
+
+
+                .append("sourceType", getSourceType())
+                .toString();
+    }
+}

+ 57 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/domain/CoreSafecheckPlanToRole.java

@@ -0,0 +1,57 @@
+package com.xunmei.core.safetyCheck.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import com.xunmei.common.core.web.domain.BaseEntity;
+
+/**
+ * 常规安全检查计划执行角色关联对象 core_safecheck_plan_to_role
+ *
+ * @author xunmei
+ * @date 2023-09-12
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("core_safecheck_plan_to_role")
+@ApiModel(value = "CoreSafecheckPlanToRole对象", description = "常规安全检查计划执行角色关联")
+public class CoreSafecheckPlanToRole extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 计划id
+     */
+    @ApiModelProperty(value = "计划id")
+    private Long planId;
+
+    /**
+     * 角色id
+     */
+    @ApiModelProperty(value = "角色id")
+    private Long roleId;
+
+    public CoreSafecheckPlanToRole(Long planId, Long roleId) {
+        this.planId = planId;
+        this.roleId = roleId;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+
+
+                .append("planId", getPlanId())
+
+
+                .append("roleId", getRoleId())
+                .toString();
+    }
+}

+ 64 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/mapper/CoreSafecheckPlanMapper.java

@@ -0,0 +1,64 @@
+package com.xunmei.core.safetyCheck.mapper;
+
+import java.util.List;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.xunmei.core.safetyCheck.domain.CoreSafecheckPlan;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * 常规安全检查计划Mapper接口
+ *
+ * @author xunmei
+ * @date 2023-09-12
+ */
+public interface CoreSafecheckPlanMapper extends BaseMapper<CoreSafecheckPlan> {
+    /**
+     * 查询常规安全检查计划
+     *
+     * @param id 常规安全检查计划主键
+     * @return 常规安全检查计划
+     */
+    CoreSafecheckPlan selectCoreSafecheckPlanById(Long id);
+
+    /**
+     * 查询常规安全检查计划列表
+     *
+     * @param coreSafecheckPlan 常规安全检查计划
+     * @return 常规安全检查计划集合
+     */
+    List<CoreSafecheckPlan> selectCoreSafecheckPlanList(CoreSafecheckPlan coreSafecheckPlan);
+    Page<CoreSafecheckPlan> selectCoreSafecheckPlanPage( Page<CoreSafecheckPlan> page,@Param("check") CoreSafecheckPlan coreSafecheckPlan);
+    /**
+     * 新增常规安全检查计划
+     *
+     * @param coreSafecheckPlan 常规安全检查计划
+     * @return 结果
+     */
+    int insertCoreSafecheckPlan(CoreSafecheckPlan coreSafecheckPlan);
+
+    /**
+     * 修改常规安全检查计划
+     *
+     * @param coreSafecheckPlan 常规安全检查计划
+     * @return 结果
+     */
+    int updateCoreSafecheckPlan(CoreSafecheckPlan coreSafecheckPlan);
+
+    /**
+     * 删除常规安全检查计划
+     *
+     * @param id 常规安全检查计划主键
+     * @return 结果
+     */
+    int deleteCoreSafecheckPlanById(Long id);
+
+    /**
+     * 批量删除常规安全检查计划
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    int deleteCoreSafecheckPlanByIds(Long[] ids);
+}

+ 62 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/mapper/CoreSafecheckPlanToRoleMapper.java

@@ -0,0 +1,62 @@
+package com.xunmei.core.safetyCheck.mapper;
+
+import java.util.List;
+
+import com.xunmei.core.safetyCheck.domain.CoreSafecheckPlanToRole;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 常规安全检查计划执行角色关联Mapper接口
+ *
+ * @author xunmei
+ * @date 2023-09-12
+ */
+public interface CoreSafecheckPlanToRoleMapper extends BaseMapper<CoreSafecheckPlanToRole> {
+    /**
+     * 查询常规安全检查计划执行角色关联
+     *
+     * @param planId 常规安全检查计划执行角色关联主键
+     * @return 常规安全检查计划执行角色关联
+     */
+    CoreSafecheckPlanToRole selectCoreSafecheckPlanToRoleByPlanId(Long planId);
+
+    /**
+     * 查询常规安全检查计划执行角色关联列表
+     *
+     * @param coreSafecheckPlanToRole 常规安全检查计划执行角色关联
+     * @return 常规安全检查计划执行角色关联集合
+     */
+    List<CoreSafecheckPlanToRole> selectCoreSafecheckPlanToRoleList(CoreSafecheckPlanToRole coreSafecheckPlanToRole);
+
+    /**
+     * 新增常规安全检查计划执行角色关联
+     *
+     * @param coreSafecheckPlanToRole 常规安全检查计划执行角色关联
+     * @return 结果
+     */
+    int insertCoreSafecheckPlanToRole(CoreSafecheckPlanToRole coreSafecheckPlanToRole);
+
+    /**
+     * 修改常规安全检查计划执行角色关联
+     *
+     * @param coreSafecheckPlanToRole 常规安全检查计划执行角色关联
+     * @return 结果
+     */
+    int updateCoreSafecheckPlanToRole(CoreSafecheckPlanToRole coreSafecheckPlanToRole);
+
+    /**
+     * 删除常规安全检查计划执行角色关联
+     *
+     * @param planId 常规安全检查计划执行角色关联主键
+     * @return 结果
+     */
+    int deleteCoreSafecheckPlanToRoleByPlanId(Long planId);
+
+    /**
+     * 批量删除常规安全检查计划执行角色关联
+     *
+     * @param planIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    int deleteCoreSafecheckPlanToRoleByPlanIds(Long[] planIds);
+}

+ 72 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/service/ICoreSafecheckPlanService.java

@@ -0,0 +1,72 @@
+package com.xunmei.core.safetyCheck.service;
+
+import java.util.List;
+
+import com.xunmei.core.safetyCheck.domain.CoreSafecheckPlan;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.xunmei.common.core.web.page.TableDataInfo;
+
+/**
+ * 常规安全检查计划Service接口
+ *
+ * @author xunmei
+ * @date 2023-09-12
+ */
+public interface ICoreSafecheckPlanService extends IService<CoreSafecheckPlan> {
+    /**
+     * 查询常规安全检查计划
+     *
+     * @param id 常规安全检查计划主键
+     * @return 常规安全检查计划
+     */
+    CoreSafecheckPlan selectCoreSafecheckPlanById(Long id);
+
+    /**
+     * 查询常规安全检查计划列表
+     *
+     * @param coreSafecheckPlan 常规安全检查计划
+     * @return 常规安全检查计划集合
+     */
+    List<CoreSafecheckPlan> selectCoreSafecheckPlanList(CoreSafecheckPlan coreSafecheckPlan);
+
+    /**
+     * 新增常规安全检查计划
+     *
+     * @param coreSafecheckPlan 常规安全检查计划
+     * @return 结果
+     */
+    int insertCoreSafecheckPlan(CoreSafecheckPlan coreSafecheckPlan);
+
+    /**
+     * 修改常规安全检查计划
+     *
+     * @param coreSafecheckPlan 常规安全检查计划
+     * @return 结果
+     */
+    int updateCoreSafecheckPlan(CoreSafecheckPlan coreSafecheckPlan);
+
+    /**
+     * 批量删除常规安全检查计划
+     *
+     * @param ids 需要删除的常规安全检查计划主键集合
+     * @return 结果
+     */
+    int deleteCoreSafecheckPlanByIds(Long[] ids);
+
+    /**
+     * 删除常规安全检查计划信息
+     *
+     * @param id 常规安全检查计划主键
+     * @return 结果
+     */
+    int deleteCoreSafecheckPlanById(Long id);
+
+    /**
+     * 查询常规安全检查计划分页数据
+     *
+     * @param coreSafecheckPlan 查询条件对象
+     * @return Page
+     */
+    TableDataInfo<CoreSafecheckPlan> selectPage(CoreSafecheckPlan coreSafecheckPlan);
+}

+ 72 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/service/ICoreSafecheckPlanToRoleService.java

@@ -0,0 +1,72 @@
+package com.xunmei.core.safetyCheck.service;
+
+import java.util.List;
+
+import com.xunmei.core.safetyCheck.domain.CoreSafecheckPlanToRole;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.xunmei.common.core.web.page.TableDataInfo;
+
+/**
+ * 常规安全检查计划执行角色关联Service接口
+ *
+ * @author xunmei
+ * @date 2023-09-12
+ */
+public interface ICoreSafecheckPlanToRoleService extends IService<CoreSafecheckPlanToRole> {
+    /**
+     * 查询常规安全检查计划执行角色关联
+     *
+     * @param planId 常规安全检查计划执行角色关联主键
+     * @return 常规安全检查计划执行角色关联
+     */
+     CoreSafecheckPlanToRole selectCoreSafecheckPlanToRoleByPlanId(Long planId);
+
+    /**
+     * 查询常规安全检查计划执行角色关联列表
+     *
+     * @param coreSafecheckPlanToRole 常规安全检查计划执行角色关联
+     * @return 常规安全检查计划执行角色关联集合
+     */
+    List<CoreSafecheckPlanToRole> selectCoreSafecheckPlanToRoleList(CoreSafecheckPlanToRole coreSafecheckPlanToRole);
+
+    /**
+     * 新增常规安全检查计划执行角色关联
+     *
+     * @param coreSafecheckPlanToRole 常规安全检查计划执行角色关联
+     * @return 结果
+     */
+    int insertCoreSafecheckPlanToRole(CoreSafecheckPlanToRole coreSafecheckPlanToRole);
+
+    /**
+     * 修改常规安全检查计划执行角色关联
+     *
+     * @param coreSafecheckPlanToRole 常规安全检查计划执行角色关联
+     * @return 结果
+     */
+    int updateCoreSafecheckPlanToRole(CoreSafecheckPlanToRole coreSafecheckPlanToRole);
+
+    /**
+     * 批量删除常规安全检查计划执行角色关联
+     *
+     * @param planIds 需要删除的常规安全检查计划执行角色关联主键集合
+     * @return 结果
+     */
+    int deleteCoreSafecheckPlanToRoleByPlanIds(Long[] planIds);
+
+    /**
+     * 删除常规安全检查计划执行角色关联信息
+     *
+     * @param planId 常规安全检查计划执行角色关联主键
+     * @return 结果
+     */
+    int deleteCoreSafecheckPlanToRoleByPlanId(Long planId);
+
+    /**
+     * 查询常规安全检查计划执行角色关联分页数据
+     *
+     * @param coreSafecheckPlanToRole 查询条件对象
+     * @return Page
+     */
+    TableDataInfo<CoreSafecheckPlanToRole> selectPage(CoreSafecheckPlanToRole coreSafecheckPlanToRole);
+}

+ 166 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/service/impl/CoreSafecheckPlanServiceImpl.java

@@ -0,0 +1,166 @@
+package com.xunmei.core.safetyCheck.service.impl;
+
+import java.util.List;
+
+import com.xunmei.common.core.utils.DateUtils;
+import com.xunmei.core.safetyCheck.domain.CoreSafecheckPlan;
+import com.xunmei.core.safetyCheck.domain.CoreSafecheckPlanToRole;
+import com.xunmei.core.safetyCheck.mapper.CoreSafecheckPlanMapper;
+import com.xunmei.core.safetyCheck.mapper.CoreSafecheckPlanToRoleMapper;
+import com.xunmei.core.safetyCheck.service.ICoreSafecheckPlanService;
+import com.xunmei.system.api.RemoteOrgService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.Arrays;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.xunmei.common.core.web.page.TableDataInfo;
+
+/**
+ * 常规安全检查计划Service业务层处理
+ *
+ * @author xunmei
+ * @date 2023-09-12
+ */
+@Service
+public class CoreSafecheckPlanServiceImpl extends ServiceImpl<CoreSafecheckPlanMapper, CoreSafecheckPlan> implements ICoreSafecheckPlanService {
+    @Autowired
+    private CoreSafecheckPlanMapper coreSafecheckPlanMapper;
+    @Autowired
+    private RemoteOrgService orgService;
+    @Autowired
+    private CoreSafecheckPlanToRoleMapper coreSafecheckPlanToRoleMapper;
+
+    @Override
+    public TableDataInfo<CoreSafecheckPlan> selectPage(CoreSafecheckPlan coreSafecheckPlan) {
+        //未删除
+        coreSafecheckPlan.setIsDeleted("0");
+        Page<CoreSafecheckPlan> page;
+        //分页
+        if (coreSafecheckPlan.getPageNum() != null && coreSafecheckPlan.getPageSize() != null) {
+            page = new Page<>(coreSafecheckPlan.getPageNum(), coreSafecheckPlan.getPageSize());
+        } else {
+            page = new Page<>();
+        }
+        //查询条件
+        QueryWrapper<CoreSafecheckPlan> query = new QueryWrapper<>(coreSafecheckPlan);
+        //下穿
+//        if (coreSafecheckPlan.getCheckSub()){
+//            List<Long> ids = orgService.selectCheckSubOrgIdList(coreSafecheckPlan.getOrgId());
+//            //清空前端传递的org_id
+//            coreSafecheckPlan.setOrgId(null);
+//            //添加in条件
+//            query.in("org_id",ids);
+//        }
+        //时间范围查询
+        if (coreSafecheckPlan.getParams().get("beginTime") != null && coreSafecheckPlan.getParams().get("endTime") != null) {
+            query.between("create_time", coreSafecheckPlan.getParams().get("beginTime"), coreSafecheckPlan.getParams().get("endTime"));
+        }
+        //获取数据
+        page = coreSafecheckPlanMapper.selectCoreSafecheckPlanPage(page, coreSafecheckPlan);
+        //抓换为TableDataInfo适配前端
+        return TableDataInfo.build(page);
+
+
+    }
+
+
+    /**
+     * 查询常规安全检查计划
+     *
+     * @param id 常规安全检查计划主键
+     * @return 常规安全检查计划
+     */
+    @Override
+    public CoreSafecheckPlan selectCoreSafecheckPlanById(Long id) {
+        return coreSafecheckPlanMapper.selectCoreSafecheckPlanById(id);
+    }
+
+    /**
+     * 查询常规安全检查计划列表
+     *
+     * @param coreSafecheckPlan 常规安全检查计划
+     * @return 常规安全检查计划
+     */
+    @Override
+    public List<CoreSafecheckPlan> selectCoreSafecheckPlanList(CoreSafecheckPlan coreSafecheckPlan) {
+        return coreSafecheckPlanMapper.selectList(new QueryWrapper<>(coreSafecheckPlan));
+    }
+
+    /**
+     * 新增常规安全检查计划
+     *
+     * @param coreSafecheckPlan 常规安全检查计划
+     * @return 结果
+     */
+    @Override
+    public int insertCoreSafecheckPlan(CoreSafecheckPlan coreSafecheckPlan) {
+        //先处理检查计划
+        coreSafecheckPlan.setCreateTime(DateUtils.getNowDate());
+        coreSafecheckPlan.setPlanOfOrgId(coreSafecheckPlan.getPlanCreateOrgId());
+        coreSafecheckPlanMapper.insert(coreSafecheckPlan);
+
+        //再处理角色关系
+        if (coreSafecheckPlan.getRoleIds() != null) {
+            if (coreSafecheckPlan.getId() != null) {
+                coreSafecheckPlanToRoleMapper.deleteCoreSafecheckPlanToRoleByPlanId(coreSafecheckPlan.getId());
+            }
+            for (Long id :
+                    coreSafecheckPlan.getRoleIds()) {
+                coreSafecheckPlanToRoleMapper.insert(new CoreSafecheckPlanToRole(coreSafecheckPlan.getId(), id));
+
+            }
+        }
+        return 1;
+    }
+
+    /**
+     * 修改常规安全检查计划
+     *
+     * @param coreSafecheckPlan 常规安全检查计划
+     * @return 结果
+     */
+    @Override
+    public int updateCoreSafecheckPlan(CoreSafecheckPlan coreSafecheckPlan) {
+        //先处理检查计划
+        coreSafecheckPlan.setUpdateTime(DateUtils.getNowDate());
+        coreSafecheckPlanMapper.updateById(coreSafecheckPlan);
+        //再处理角色关系
+        if (coreSafecheckPlan.getRoleIds() != null) {
+            if (coreSafecheckPlan.getId() != null) {
+                coreSafecheckPlanToRoleMapper.deleteCoreSafecheckPlanToRoleByPlanId(coreSafecheckPlan.getId());
+            }
+            for (Long id :
+                    coreSafecheckPlan.getRoleIds()) {
+                coreSafecheckPlanToRoleMapper.insert(new CoreSafecheckPlanToRole(coreSafecheckPlan.getId(), id));
+
+            }
+        }
+        return 1;
+    }
+
+    /**
+     * 批量删除常规安全检查计划
+     *
+     * @param ids 需要删除的常规安全检查计划主键
+     * @return 结果
+     */
+    @Override
+    public int deleteCoreSafecheckPlanByIds(Long[] ids) {
+        return coreSafecheckPlanMapper.deleteBatchIds(Arrays.asList((ids)));
+    }
+
+    /**
+     * 删除常规安全检查计划信息
+     *
+     * @param id 常规安全检查计划主键
+     * @return 结果
+     */
+    @Override
+    public int deleteCoreSafecheckPlanById(Long id) {
+        return coreSafecheckPlanMapper.deleteById(id);
+    }
+}

+ 121 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/service/impl/CoreSafecheckPlanToRoleServiceImpl.java

@@ -0,0 +1,121 @@
+package com.xunmei.core.safetyCheck.service.impl;
+
+import java.util.List;
+
+import com.xunmei.core.safetyCheck.domain.CoreSafecheckPlanToRole;
+import com.xunmei.core.safetyCheck.mapper.CoreSafecheckPlanToRoleMapper;
+import com.xunmei.core.safetyCheck.service.ICoreSafecheckPlanToRoleService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import java.util.Arrays;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.xunmei.common.core.web.page.TableDataInfo;
+
+/**
+ * 常规安全检查计划执行角色关联Service业务层处理
+ *
+ * @author xunmei
+ * @date 2023-09-12
+ */
+@Service
+public class CoreSafecheckPlanToRoleServiceImpl extends ServiceImpl<CoreSafecheckPlanToRoleMapper, CoreSafecheckPlanToRole> implements ICoreSafecheckPlanToRoleService {
+    @Autowired
+    private CoreSafecheckPlanToRoleMapper coreSafecheckPlanToRoleMapper;
+
+
+    @Override
+    public TableDataInfo<CoreSafecheckPlanToRole> selectPage(CoreSafecheckPlanToRole coreSafecheckPlanToRole) {
+        //未删除
+//        coreSafecheckPlanToRole.setDeleted(0L);
+        Page<CoreSafecheckPlanToRole> page;
+        //分页
+        if (coreSafecheckPlanToRole.getPageNum()!=null&&coreSafecheckPlanToRole.getPageSize()!=null)
+        {
+            page = new Page<>(coreSafecheckPlanToRole.getPageNum(), coreSafecheckPlanToRole.getPageSize());
+        }else{
+            page = new Page<>();
+        }
+
+//        //时间范围查询
+//        if (coreSafecheckPlanToRole.getParams().get("beginTime")!=null&&coreSafecheckPlanToRole.getParams().get("endTime")!=null){
+//            query.between("create_time", coreSafecheckPlanToRole.getParams().get("beginTime"), coreSafecheckPlanToRole.getParams().get("endTime"));
+//        }
+        //获取数据
+//        page = coreSafecheckPlanToRoleMapper.selectPage(page, query);
+        //抓换为TableDataInfo适配前端
+        return TableDataInfo.build(page);
+
+
+
+
+    }
+
+
+    /**
+     * 查询常规安全检查计划执行角色关联
+     *
+     * @param planId 常规安全检查计划执行角色关联主键
+     * @return 常规安全检查计划执行角色关联
+     */
+    @Override
+    public CoreSafecheckPlanToRole selectCoreSafecheckPlanToRoleByPlanId(Long planId) {
+        return coreSafecheckPlanToRoleMapper.selectById(planId);
+    }
+
+    /**
+     * 查询常规安全检查计划执行角色关联列表
+     *
+     * @param coreSafecheckPlanToRole 常规安全检查计划执行角色关联
+     * @return 常规安全检查计划执行角色关联
+     */
+    @Override
+    public List<CoreSafecheckPlanToRole> selectCoreSafecheckPlanToRoleList(CoreSafecheckPlanToRole coreSafecheckPlanToRole) {
+        return coreSafecheckPlanToRoleMapper.selectList(new QueryWrapper<>(coreSafecheckPlanToRole));
+    }
+
+    /**
+     * 新增常规安全检查计划执行角色关联
+     *
+     * @param coreSafecheckPlanToRole 常规安全检查计划执行角色关联
+     * @return 结果
+     */
+    @Override
+    public int insertCoreSafecheckPlanToRole(CoreSafecheckPlanToRole coreSafecheckPlanToRole) {
+            return coreSafecheckPlanToRoleMapper.insert(coreSafecheckPlanToRole);
+    }
+
+    /**
+     * 修改常规安全检查计划执行角色关联
+     *
+     * @param coreSafecheckPlanToRole 常规安全检查计划执行角色关联
+     * @return 结果
+     */
+    @Override
+    public int updateCoreSafecheckPlanToRole(CoreSafecheckPlanToRole coreSafecheckPlanToRole) {
+        return coreSafecheckPlanToRoleMapper.updateById(coreSafecheckPlanToRole);
+    }
+
+    /**
+     * 批量删除常规安全检查计划执行角色关联
+     *
+     * @param planIds 需要删除的常规安全检查计划执行角色关联主键
+     * @return 结果
+     */
+    @Override
+    public int deleteCoreSafecheckPlanToRoleByPlanIds(Long[] planIds) {
+        return coreSafecheckPlanToRoleMapper.deleteBatchIds(Arrays.asList((planIds)));
+    }
+
+    /**
+     * 删除常规安全检查计划执行角色关联信息
+     *
+     * @param planId 常规安全检查计划执行角色关联主键
+     * @return 结果
+     */
+    @Override
+    public int deleteCoreSafecheckPlanToRoleByPlanId(Long planId) {
+        return coreSafecheckPlanToRoleMapper.deleteById(planId);
+    }
+}

+ 288 - 0
soc-modules/soc-modules-core/src/main/resources/mapper/safetycheck/CoreSafecheckPlanMapper.xml

@@ -0,0 +1,288 @@
+<?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.xunmei.core.safetyCheck.mapper.CoreSafecheckPlanMapper">
+
+    <resultMap type="com.xunmei.core.safetyCheck.domain.CoreSafecheckPlan" id="CoreSafecheckPlanResult">
+        <result property="id" column="id"/>
+        <result property="planName" column="plan_name"/>
+        <result property="planCycle" column="plan_cycle"/>
+        <result property="execOrgType" column="exec_org_type"/>
+        <result property="checkOrgType" column="check_org_type"/>
+        <result property="planStatus" column="plan_status"/>
+        <result property="startDate" column="start_date"/>
+        <result property="endDate" column="end_date"/>
+        <result property="buildTaskNow" column="build_task_now"/>
+        <result property="description" column="description"/>
+        <result property="isDeleted" column="is_deleted"/>
+        <result property="createTime" column="create_time"/>
+        <result property="modifiedName" column="modified_name"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="modifiedBy" column="modified_by"/>
+        <result property="sourceType" column="source_type"/>
+
+        <result property="planCreateOrgId" column="plan_create_org_id"/>
+        <result property="planOfOrgId" column="plan_of_org_id"/>
+        <result property="checkType" column="check_type"/>
+        <result property="count" column="count"/>
+        <result property="modifiedTime" column="modified_time"/>
+        <result property="createBy" column="create_by"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="planCreateOrgName" column="plan_create_org_name"/>
+        <result property="planOfOrgName" column="plan_of_org_name"/>
+        <result property="execOrg" column="exec_org"/>
+        <result property="checkOrg" column="check_org"/>
+        <collection property="roleList" ofType="com.xunmei.system.api.domain.SysRole">
+            <result column="role_name" property="roleName"/>
+            <result column="role_id" property="id"/>
+        </collection>
+
+    </resultMap>
+
+    <sql id="selectCoreSafecheckPlanVo">
+        SELECT c.*,
+               o1.NAME AS plan_create_org_name,
+               o2.NAME AS plan_of_org_name,
+               r.role_name,
+               r.id    as role_id
+
+        FROM core_safecheck_plan c
+                 LEFT JOIN sys_org o1 ON c.plan_create_org_id = o1.id
+                 LEFT JOIN sys_org o2 ON c.plan_of_org_id = o2.id
+                 LEFT JOIN core_safecheck_plan_to_role pr ON c.id = pr.plan_id
+                 LEFT JOIN sys_role r ON r.id = pr.role_id
+    </sql>
+
+    <select id="selectCoreSafecheckPlanList" parameterType="com.xunmei.core.safetyCheck.domain.CoreSafecheckPlan"
+            resultMap="CoreSafecheckPlanResult">
+        <include refid="selectCoreSafecheckPlanVo"/>
+        <where>
+            <if test="planName != null  and planName != ''">
+                and plan_name like concat('%', #{planName}, '%')
+            </if>
+            <if test="planCycle != null ">
+                and plan_cycle = #{planCycle}
+            </if>
+            <if test="execOrgType != null ">
+                and exec_org_type = #{execOrgType}
+            </if>
+            <if test="checkOrgType != null ">
+                and check_org_type = #{checkOrgType}
+            </if>
+            <if test="planStatus != null ">
+                and plan_status = #{planStatus}
+            </if>
+            <if test="startDate != null ">
+                and start_date = #{startDate}
+            </if>
+            <if test="endDate != null ">
+                and end_date = #{endDate}
+            </if>
+            <if test="buildTaskNow != null  and buildTaskNow != ''">
+                and build_task_now = #{buildTaskNow}
+            </if>
+            <if test="description != null  and description != ''">
+                and description = #{description}
+            </if>
+            <if test="isDeleted != null  and isDeleted != ''">
+                and is_deleted = #{isDeleted}
+            </if>
+            <if test="modifiedName != null  and modifiedName != ''">
+                and modified_name like concat('%', #{modifiedName}, '%')
+            </if>
+            <if test="modifiedBy != null ">
+                and modified_by = #{modifiedBy}
+            </if>
+            <if test="sourceType != null ">
+                and source_type = #{sourceType}
+            </if>
+        </where>
+    </select>
+
+    <select id="selectCoreSafecheckPlanById" parameterType="Long"
+            resultMap="CoreSafecheckPlanResult">
+        SELECT c.*,
+               o1.NAME AS plan_create_org_name,
+               o2.NAME AS plan_of_org_name,
+               r.role_name
+                ,
+               r.id    as role_id
+        FROM core_safecheck_plan c
+                 LEFT JOIN sys_org o1 ON c.plan_create_org_id = o1.id
+                 LEFT JOIN sys_org o2 ON c.plan_of_org_id = o2.id
+                 LEFT JOIN core_safecheck_plan_to_role pr ON c.id = pr.plan_id
+                 LEFT JOIN sys_role r ON r.id = pr.role_id
+        where c.id = #{id}
+    </select>
+    <select id="selectCoreSafecheckPlanPage" resultMap="CoreSafecheckPlanResult">
+        SELECT
+        c.*,
+        o1.NAME AS plan_create_org_name,
+        o2.NAME AS plan_of_org_name,
+        r.role_name
+        ,
+        r.id as role_id
+        FROM
+        core_safecheck_plan c
+        LEFT JOIN sys_org o1 ON c.plan_create_org_id = o1.id
+        LEFT JOIN sys_org o2 ON c.plan_of_org_id = o2.id
+        LEFT JOIN core_safecheck_plan_to_role pr ON c.id = pr.plan_id
+        LEFT JOIN sys_role r ON r.id = pr.role_id
+        where 1=1
+        <if test="check.planName != null  and check.planName != ''">
+            and c.plan_name like concat('%', #{check.planName}, '%')
+        </if>
+        <if test="check.planCycle != null ">
+            and c.plan_cycle = #{check.planCycle}
+        </if>
+        <if test="check.execOrgType != null ">
+            and c.exec_org_type = #{check.execOrgType}
+        </if>
+        <if test="check.checkOrgType != null ">
+            and c.check_org_type = #{check.checkOrgType}
+        </if>
+        <if test="check.planStatus != null ">
+            and c.plan_status = #{check.planStatus}
+        </if>
+
+        <if test="check.checkRole != null ">
+            and r.id = #{check.checkRole}
+        </if>
+
+    </select>
+
+    <insert id="insertCoreSafecheckPlan" parameterType="com.xunmei.core.safetyCheck.domain.CoreSafecheckPlan"
+            useGeneratedKeys="true" keyProperty="id">
+        insert into core_safecheck_plan
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="planName != null">plan_name,
+            </if>
+            <if test="planCycle != null">plan_cycle,
+            </if>
+            <if test="execOrgType != null">exec_org_type,
+            </if>
+            <if test="checkOrgType != null">check_org_type,
+            </if>
+            <if test="planStatus != null">plan_status,
+            </if>
+            <if test="startDate != null">start_date,
+            </if>
+            <if test="endDate != null">end_date,
+            </if>
+            <if test="buildTaskNow != null">build_task_now,
+            </if>
+            <if test="description != null">description,
+            </if>
+            <if test="isDeleted != null">is_deleted,
+            </if>
+            <if test="createTime != null">create_time,
+            </if>
+            <if test="modifiedName != null">modified_name,
+            </if>
+            <if test="updateTime != null">update_time,
+            </if>
+            <if test="modifiedBy != null">modified_by,
+            </if>
+            <if test="sourceType != null">source_type,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="planName != null">#{planName},
+            </if>
+            <if test="planCycle != null">#{planCycle},
+            </if>
+            <if test="execOrgType != null">#{execOrgType},
+            </if>
+            <if test="checkOrgType != null">#{checkOrgType},
+            </if>
+            <if test="planStatus != null">#{planStatus},
+            </if>
+            <if test="startDate != null">#{startDate},
+            </if>
+            <if test="endDate != null">#{endDate},
+            </if>
+            <if test="buildTaskNow != null">#{buildTaskNow},
+            </if>
+            <if test="description != null">#{description},
+            </if>
+            <if test="isDeleted != null">#{isDeleted},
+            </if>
+            <if test="createTime != null">#{createTime},
+            </if>
+            <if test="modifiedName != null">#{modifiedName},
+            </if>
+            <if test="updateTime != null">#{updateTime},
+            </if>
+            <if test="modifiedBy != null">#{modifiedBy},
+            </if>
+            <if test="sourceType != null">#{sourceType},
+            </if>
+        </trim>
+    </insert>
+
+    <update id="updateCoreSafecheckPlan" parameterType="com.xunmei.core.safetyCheck.domain.CoreSafecheckPlan">
+        update core_safecheck_plan
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="planName != null">plan_name =
+                #{planName},
+            </if>
+            <if test="planCycle != null">plan_cycle =
+                #{planCycle},
+            </if>
+            <if test="execOrgType != null">exec_org_type =
+                #{execOrgType},
+            </if>
+            <if test="checkOrgType != null">check_org_type =
+                #{checkOrgType},
+            </if>
+            <if test="planStatus != null">plan_status =
+                #{planStatus},
+            </if>
+            <if test="startDate != null">start_date =
+                #{startDate},
+            </if>
+            <if test="endDate != null">end_date =
+                #{endDate},
+            </if>
+            <if test="buildTaskNow != null">build_task_now =
+                #{buildTaskNow},
+            </if>
+            <if test="description != null">description =
+                #{description},
+            </if>
+            <if test="isDeleted != null">is_deleted =
+                #{isDeleted},
+            </if>
+            <if test="createTime != null">create_time =
+                #{createTime},
+            </if>
+            <if test="modifiedName != null">modified_name =
+                #{modifiedName},
+            </if>
+            <if test="updateTime != null">update_time =
+                #{updateTime},
+            </if>
+            <if test="modifiedBy != null">modified_by =
+                #{modifiedBy},
+            </if>
+            <if test="sourceType != null">source_type =
+                #{sourceType},
+            </if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteCoreSafecheckPlanById" parameterType="Long">
+        delete
+        from core_safecheck_plan
+        where id = #{id}
+    </delete>
+
+    <delete id="deleteCoreSafecheckPlanByIds" parameterType="String">
+        delete from core_safecheck_plan where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 73 - 0
soc-modules/soc-modules-core/src/main/resources/mapper/safetycheck/CoreSafecheckPlanToRoleMapper.xml

@@ -0,0 +1,73 @@
+<?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.xunmei.core.safetyCheck.mapper.CoreSafecheckPlanToRoleMapper">
+
+    <resultMap type="com.xunmei.core.safetyCheck.domain.CoreSafecheckPlanToRole" id="CoreSafecheckPlanToRoleResult">
+                <result property="planId" column="plan_id"/>
+                <result property="roleId" column="role_id"/>
+    </resultMap>
+
+    <sql id="selectCoreSafecheckPlanToRoleVo">
+        select plan_id, role_id
+        from core_safecheck_plan_to_role
+    </sql>
+
+    <select id="selectCoreSafecheckPlanToRoleList" parameterType="com.xunmei.core.safetyCheck.domain.CoreSafecheckPlanToRole"
+            resultMap="CoreSafecheckPlanToRoleResult">
+        <include refid="selectCoreSafecheckPlanToRoleVo"/>
+        <where>
+                        <if test="planId != null ">
+                            and plan_id = #{planId}
+                        </if>
+                        <if test="roleId != null ">
+                            and role_id = #{roleId}
+                        </if>
+        </where>
+    </select>
+
+    <select id="selectCoreSafecheckPlanToRoleByPlanId" parameterType="Long"
+            resultMap="CoreSafecheckPlanToRoleResult">
+            <include refid="selectCoreSafecheckPlanToRoleVo"/>
+            where plan_id = #{planId}
+    </select>
+
+    <insert id="insertCoreSafecheckPlanToRole" parameterType="com.xunmei.core.safetyCheck.domain.CoreSafecheckPlanToRole">
+        insert into core_safecheck_plan_to_role
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+                    <if test="planId != null">plan_id,
+                    </if>
+                    <if test="roleId != null">role_id,
+                    </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+                    <if test="planId != null">#{planId},
+                    </if>
+                    <if test="roleId != null">#{roleId},
+                    </if>
+        </trim>
+    </insert>
+
+    <update id="updateCoreSafecheckPlanToRole" parameterType="com.xunmei.core.safetyCheck.domain.CoreSafecheckPlanToRole">
+        update core_safecheck_plan_to_role
+        <trim prefix="SET" suffixOverrides=",">
+                    <if test="roleId != null">role_id =
+                        #{roleId},
+                    </if>
+        </trim>
+        where plan_id = #{planId}
+    </update>
+
+    <delete id="deleteCoreSafecheckPlanToRoleByPlanId" parameterType="Long">
+        delete
+        from core_safecheck_plan_to_role where plan_id = #{planId}
+    </delete>
+
+    <delete id="deleteCoreSafecheckPlanToRoleByPlanIds" parameterType="String">
+        delete from core_safecheck_plan_to_role where plan_id in
+        <foreach item="planId" collection="array" open="(" separator="," close=")">
+            #{planId}
+        </foreach>
+    </delete>
+</mapper>