Browse Source

预案演练代码提交

jingyuanchao 2 years ago
parent
commit
dbd6edc258

+ 85 - 86
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/drill/domain/CoreDrillPlan.java

@@ -1,12 +1,13 @@
 package com.xunmei.common.core.domain.drill.domain;
 
+import java.time.LocalDateTime;
 import java.util.Date;
+
+import com.baomidou.mybatisplus.annotation.*;
 import com.fasterxml.jackson.annotation.JsonFormat;
 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;
@@ -24,177 +25,175 @@ import com.xunmei.common.core.web.domain.BaseEntity;
 @EqualsAndHashCode(callSuper = false)
 @Accessors(chain = true)
 @TableName("core_drill_plan")
-@ApiModel(value = "CoreDrillPlan对象" , description = "预案演练计划")
-public class CoreDrillPlan extends BaseEntity
-        {
-private static final long serialVersionUID=1L;
+@ApiModel(value = "CoreDrillPlan对象", description = "预案演练计划")
+public class CoreDrillPlan extends BaseEntity {
+    private static final long serialVersionUID = 1L;
 
-    /** 主键 */
+    @TableId(value = "id", type = IdType.INPUT)
     private Long id;
 
-    /** 计划名称 */
-            @ApiModelProperty(value = "计划名称")
+    @TableField(value = "plan_name")
+    @ApiModelProperty(value = "计划名称")
     private String planName;
 
-    /** 计划周期:0:无周期,4:每季度,4:每半年,6:每年 */
-            @ApiModelProperty(value = "计划周期:0:无周期,4:每季度,4:每半年,6:每年")
-    private Long planCycle;
+    @TableField(value = "plan_cycle")
+    @ApiModelProperty(value = "计划周期:0:无周期,4:每季度,4:每半年,6:每年")
+    private Integer planCycle;
 
-    /** 演练次数 */
-            @ApiModelProperty(value = "演练次数")
-    private Long execTimes;
+    @TableField(value = "exec_times")
+    @ApiModelProperty(value = "演练次数")
+    private Integer execTimes;
 
-    /** 计划状态:0:启用,1禁用 */
-            @ApiModelProperty(value = "计划状态:0:启用,1禁用")
-    private Long planStatus;
+    @TableField(value = "plan_status")
+    @ApiModelProperty(value = "计划状态:0:启用,1禁用")
+    private Integer planStatus;
 
-    /** 执行机构类型 */
-            @ApiModelProperty(value = "执行机构类型")
-    private Long execOrgType;
+   @TableField(value = "exec_org_type")
+    @ApiModelProperty(value = "执行机构类型")
+    private Integer execOrgType;
 
-    /** 开始日期 */
-            @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-            @ApiModelProperty(value = "开始日期")
+    @TableField(value = "plan_start_date")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @ApiModelProperty(value = "开始日期")
     private Date planStartDate;
 
-    /** 结束日期 */
-            @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-            @ApiModelProperty(value = "结束日期")
+    @TableField(value = "plan_end_date")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @ApiModelProperty(value = "结束日期")
     private Date planEndDate;
 
-    /** 立即生成任务 */
-            @ApiModelProperty(value = "立即生成任务")
+    @TableField(value = "build_task_now")
+    @ApiModelProperty(value = "立即生成任务")
     private Integer buildTaskNow;
 
-    /** 计划创建机构id */
-            @ApiModelProperty(value = "计划创建机构id")
+    @TableField(value = "create_org_id")
+    @ApiModelProperty(value = "计划创建机构id")
     private Long createOrgId;
 
-    /** 计划创建机构名称 */
-            @ApiModelProperty(value = "计划创建机构名称")
+    @TableField(value = "create_org_name")
+    @ApiModelProperty(value = "计划创建机构名称")
     private String createOrgName;
 
-    /** 计划创建机构path */
-            @ApiModelProperty(value = "计划创建机构path")
+    @TableField(value = "create_org_path")
+    @ApiModelProperty(value = "计划创建机构path")
     private String createOrgPath;
 
-    /** 计划所属机构 */
-            @ApiModelProperty(value = "计划所属机构")
+    @TableField(value = "belong_org_id")
+    @ApiModelProperty(value = "计划所属机构")
     private Long belongOrgId;
 
-    /** 计划所属机构名称 */
-            @ApiModelProperty(value = "计划所属机构名称")
+    @TableField(value = "belong_org_name")
+    @ApiModelProperty(value = "计划所属机构名称")
     private String belongOrgName;
 
-    /** 计划所属机构path */
-            @ApiModelProperty(value = "计划所属机构path")
+    @TableField(value = "belong_org_path")
+    @ApiModelProperty(value = "计划所属机构path")
     private String belongOrgPath;
 
-    /** 是否是标准计划,0:否,1:是 */
-            @ApiModelProperty(value = "是否是标准计划,0:否,1:是")
+   @TableField(value = "standard")
+    @ApiModelProperty(value = "是否是标准计划,0:否,1:是")
     private Integer standard;
 
-    /** 是否已下发,0:否,1:是 */
-            @ApiModelProperty(value = "是否已下发,0:否,1:是")
+    @TableField(value = "issue")
+    @ApiModelProperty(value = "是否已下发,0:否,1:是")
     private Integer issue;
 
-    /** 是否是被下发的计划,0:否,1:是 */
-            @ApiModelProperty(value = "是否是被下发的计划,0:否,1:是")
+    @TableField(value = "be_issue")
+    @ApiModelProperty(value = "是否是被下发的计划,0:否,1:是")
     private Integer beIssue;
 
-    /** 下发计划id */
-            @ApiModelProperty(value = "下发计划id")
+    @TableField(value = "parent_id")
+    @ApiModelProperty(value = "下发计划id")
     private Long parentId;
 
-    /** 文件 */
-            @ApiModelProperty(value = "文件")
+    @TableField(value = "file_list")
+    @ApiModelProperty(value = "文件")
     private String fileList;
 
-    /** 是否删除,0:未删除,1:已删除 */
-            @ApiModelProperty(value = "是否删除,0:未删除,1:已删除")
+    @TableField(value = "deleted")
+    @TableLogic(value = "0", delval = "1")
+    @ApiModelProperty(value = "是否删除,0:未删除,1:已删除")
     private Integer deleted;
 
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
-@Override
-public String toString(){
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-
 
-                .append("id" ,getId())
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
 
 
-                .append("planName" ,getPlanName())
+                .append("id", getId())
 
 
-                .append("planCycle" ,getPlanCycle())
+                .append("planName", getPlanName())
 
 
-                .append("execTimes" ,getExecTimes())
+                .append("planCycle", getPlanCycle())
 
 
-                .append("planStatus" ,getPlanStatus())
+                .append("execTimes", getExecTimes())
 
 
-                .append("execOrgType" ,getExecOrgType())
+                .append("planStatus", getPlanStatus())
 
 
-                .append("planStartDate" ,getPlanStartDate())
+                .append("execOrgType", getExecOrgType())
 
 
-                .append("planEndDate" ,getPlanEndDate())
+                .append("planStartDate", getPlanStartDate())
 
 
-                .append("buildTaskNow" ,getBuildTaskNow())
+                .append("planEndDate", getPlanEndDate())
 
 
+                .append("buildTaskNow", getBuildTaskNow())
 
 
-                .append("createOrgId" ,getCreateOrgId())
+                .append("createOrgId", getCreateOrgId())
 
 
-                .append("createOrgName" ,getCreateOrgName())
+                .append("createOrgName", getCreateOrgName())
 
 
-                .append("createOrgPath" ,getCreateOrgPath())
+                .append("createOrgPath", getCreateOrgPath())
 
 
-                .append("belongOrgId" ,getBelongOrgId())
+                .append("belongOrgId", getBelongOrgId())
 
 
-                .append("belongOrgName" ,getBelongOrgName())
+                .append("belongOrgName", getBelongOrgName())
 
 
-                .append("belongOrgPath" ,getBelongOrgPath())
+                .append("belongOrgPath", getBelongOrgPath())
 
 
-                .append("standard" ,getStandard())
+                .append("standard", getStandard())
 
 
-                .append("issue" ,getIssue())
+                .append("issue", getIssue())
 
 
-                .append("beIssue" ,getBeIssue())
+                .append("beIssue", getBeIssue())
 
 
-                .append("parentId" ,getParentId())
+                .append("parentId", getParentId())
 
 
-                .append("fileList" ,getFileList())
+                .append("fileList", getFileList())
 
 
-                .append("deleted" ,getDeleted())
+                .append("deleted", getDeleted())
 
 
-                .append("createBy" ,getCreateBy())
+                .append("createBy", getCreateBy())
 
 
-                .append("createTime" ,getCreateTime())
+                .append("createTime", getCreateTime())
 
 
-                .append("updateBy" ,getUpdateBy())
+                .append("updateBy", getUpdateBy())
 
 
-                .append("updateTime" ,getUpdateTime())
-        .toString();
-        }
-        }
+                .append("updateTime", getUpdateTime())
+                .toString();
+    }
+}

+ 1 - 1
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/drill/domain/CoreDrillPlanToExecOrg.java

@@ -24,7 +24,7 @@ import com.xunmei.common.core.web.domain.BaseEntity;
 @Accessors(chain = true)
 @TableName("core_drill_plan_to_exec_org")
 @ApiModel(value = "CoreDrillPlanToExecOrg对象", description = "演练计划与执行机构关系")
-public class CoreDrillPlanToExecOrg extends BaseEntity {
+public class CoreDrillPlanToExecOrg {
     private static final long serialVersionUID = 1L;
 
     @TableField(value = "plan_id")

+ 1 - 1
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/drill/domain/CoreDrillPlanToRole.java

@@ -24,7 +24,7 @@ import com.xunmei.common.core.web.domain.BaseEntity;
 @Accessors(chain = true)
 @TableName("core_drill_plan_to_role")
 @ApiModel(value = "CoreDrillPlanToRole对象", description = "演练计划执行角色关联")
-public class CoreDrillPlanToRole extends BaseEntity {
+public class CoreDrillPlanToRole {
     private static final long serialVersionUID = 1L;
 
 

+ 1 - 12
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/drill/vo/CoreDrillTaskDetailVo.java

@@ -67,18 +67,7 @@ public class CoreDrillTaskDetailVo {
 
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     @ApiModelProperty(value = "培训开始时间")
-    private LocalDateTime trainingStartDateTime;
-
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
-    @ApiModelProperty(value = "培训截止时间")
-    private LocalDateTime trainingEndDateTime;
-
-    @ApiModelProperty(value = "内容")
-    private String content;
-
-
-    @ApiModelProperty(value = "总结")
-    private String note;
+    private LocalDateTime drillTime;
 
     @ApiModelProperty(value = "图片")
     private String imageList;

+ 20 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/drill/controller/CoreDrillPlanController.java

@@ -1,5 +1,6 @@
 package com.xunmei.core.drill.controller;
 
+import com.xunmei.common.core.domain.IdName;
 import com.xunmei.common.core.domain.drill.dto.CoreDrillPlanInsertDto;
 import com.xunmei.common.core.domain.drill.dto.CoreDrillPlanPageDto;
 import com.xunmei.common.core.domain.drill.dto.CoreDrillPlanUpdateDto;
@@ -25,6 +26,8 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import com.xunmei.common.core.web.page.TableDataInfo;
 
+import java.util.List;
+
 /**
  * 预案演练计划Controller
  *
@@ -102,4 +105,21 @@ public class CoreDrillPlanController extends BaseController {
     public AjaxResult listPlanRole(Long orgId) {
         return success(coreDrillPlanService.listPlanRole(orgId));
     }
+
+    @ApiOperation(value = "计划下发")
+    @RequiresPermissions("core:drillPlan:publish")
+    @GetMapping("/publish/{planId}")
+    public AjaxResult publishPlan(@PathVariable("planId") Long planId) {
+        coreDrillPlanService.publishPlan(planId);
+        return AjaxResult.success();
+    }
+
+
+    @ApiOperation(value = "计划下拉框")
+    @RequiresPermissions("core:drillPlan:list")
+    @GetMapping("/planList/{orgId}")
+    public AjaxResult planList(@PathVariable("orgId") Long orgId) {
+        List<IdName<String, String>> planList = coreDrillPlanService.planList(orgId);
+        return AjaxResult.success(planList);
+    }
 }

+ 3 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/drill/service/impl/CoreDrillPlanServiceImpl.java

@@ -88,7 +88,7 @@ public class CoreDrillPlanServiceImpl extends ServiceImpl<CoreDrillPlanMapper, C
             dealData(record, page.getRecords(), request.getOrgId(), request);
         }
         //抓换为TableDataInfo适配前端
-        return TableDataInfo.build();
+        return TableDataInfo.build(page);
     }
 
 
@@ -445,6 +445,7 @@ public class CoreDrillPlanServiceImpl extends ServiceImpl<CoreDrillPlanMapper, C
      * @return 结果
      */
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public int deleteCoreDrillPlanById(Long id) {
         return coreDrillPlanMapper.deleteById(id);
     }
@@ -459,6 +460,7 @@ public class CoreDrillPlanServiceImpl extends ServiceImpl<CoreDrillPlanMapper, C
     }
 
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public void publishPlan(Long planId) {
         final CoreDrillPlan plan = coreDrillPlanMapper.selectById(planId);
         if (plan == null) {

+ 4 - 4
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/drill/service/impl/CoreDrillTaskServiceImpl.java

@@ -162,7 +162,7 @@ public class CoreDrillTaskServiceImpl extends ServiceImpl<CoreDrillTaskMapper, C
     @Override
     public CoreDrillTaskDetailVo selectCoreDrillTaskById(Long id) {
         CoreDrillTaskDetailVo detailVo = coreDrillTaskMapper.selectDrillTaskDetail(id);
-        List<CoreDrillTaskToUser> userList = taskToUserMapper.selectByMap(MapUtil.of("edu_training_task_id", id));
+        List<CoreDrillTaskToUser> userList = taskToUserMapper.selectByMap(MapUtil.of("drill_task_id", id));
         detailVo.setTypeText(DrillType.getName(detailVo.getType()));
         if (ObjectUtil.isNotEmpty(detailVo.getFile())) {
             detailVo.setFileList(JSON.parseArray(detailVo.getFile(), String.class));
@@ -477,12 +477,12 @@ public class CoreDrillTaskServiceImpl extends ServiceImpl<CoreDrillTaskMapper, C
 
     private Map<String, Object> getFtlEdu(CoreDrillTaskDetailVo task) {
         Map<String, Object> data = new HashMap<>();
-        String time = DateUtil.format(task.getTrainingStartDateTime(), "yyyy年MM月dd日");
+        String time = DateUtil.format(task.getDrillTime(), "yyyy年MM月dd日");
         String address = task.getOrgName();
         String hostName = task.getHostName() == null ? StringUtil.EMPTY_STRING : task.getHostName();
         String recorderName = task.getRecorderName() == null ? StringUtil.EMPTY_STRING : task.getRecorderName();
-        String content = task.getContent();
-        String note = task.getNote();
+        String content = "";
+        String note = "";
         data.put("time", StringUtils.isNotEmpty(time) ? time : StringUtil.EMPTY_STRING);
         data.put("address", StringUtils.isNotEmpty(address) ? time : StringUtil.EMPTY_STRING);
         data.put("hostName", StringUtils.isNotEmpty(hostName) ? hostName : StringUtil.EMPTY_STRING);

+ 389 - 287
soc-modules/soc-modules-core/src/main/resources/mapper/drill/CoreDrillPlanMapper.xml

@@ -3,37 +3,61 @@
         PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.xunmei.core.drill.mapper.CoreDrillPlanMapper">
-
     <resultMap type="com.xunmei.common.core.domain.drill.domain.CoreDrillPlan" id="CoreDrillPlanResult">
-                <result property="id" column="id"/>
-                <result property="planName" column="plan_name"/>
-                <result property="planCycle" column="plan_cycle"/>
-                <result property="execTimes" column="exec_times"/>
-                <result property="planStatus" column="plan_status"/>
-                <result property="execOrgType" column="exec_org_type"/>
-                <result property="planStartDate" column="plan_start_date"/>
-                <result property="planEndDate" column="plan_end_date"/>
-                <result property="buildTaskNow" column="build_task_now"/>
-                <result property="createOrgId" column="create_org_id"/>
-                <result property="createOrgName" column="create_org_name"/>
-                <result property="createOrgPath" column="create_org_path"/>
-                <result property="belongOrgId" column="belong_org_id"/>
-                <result property="belongOrgName" column="belong_org_name"/>
-                <result property="belongOrgPath" column="belong_org_path"/>
-                <result property="standard" column="standard"/>
-                <result property="issue" column="issue"/>
-                <result property="beIssue" column="be_issue"/>
-                <result property="parentId" column="parent_id"/>
-                <result property="fileList" column="file_list"/>
-                <result property="deleted" column="deleted"/>
-                <result property="createBy" column="create_by"/>
-                <result property="createTime" column="create_time"/>
-                <result property="updateBy" column="update_by"/>
-                <result property="updateTime" column="update_time"/>
+        <result property="id" column="id"/>
+        <result property="planName" column="plan_name"/>
+        <result property="planCycle" column="plan_cycle"/>
+        <result property="execTimes" column="exec_times"/>
+        <result property="planStatus" column="plan_status"/>
+        <result property="execOrgType" column="exec_org_type"/>
+        <result property="planStartDate" column="plan_start_date"/>
+        <result property="planEndDate" column="plan_end_date"/>
+        <result property="buildTaskNow" column="build_task_now"/>
+        <result property="createOrgId" column="create_org_id"/>
+        <result property="createOrgName" column="create_org_name"/>
+        <result property="createOrgPath" column="create_org_path"/>
+        <result property="belongOrgId" column="belong_org_id"/>
+        <result property="belongOrgName" column="belong_org_name"/>
+        <result property="belongOrgPath" column="belong_org_path"/>
+        <result property="standard" column="standard"/>
+        <result property="issue" column="issue"/>
+        <result property="beIssue" column="be_issue"/>
+        <result property="parentId" column="parent_id"/>
+        <result property="fileList" column="file_list"/>
+        <result property="deleted" column="deleted"/>
+        <result property="createBy" column="create_by"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="updateTime" column="update_time"/>
     </resultMap>
 
     <sql id="selectCoreDrillPlanVo">
-        select id, plan_name, plan_cycle, exec_times, plan_status, exec_org_type, plan_start_date, plan_end_date, build_task_now, remark, create_org_id, create_org_name, create_org_path, belong_org_id, belong_org_name, belong_org_path, standard, issue, be_issue, parent_id, file_list, deleted, create_by, create_time, update_by, update_time
+        select id,
+               plan_name,
+               plan_cycle,
+               exec_times,
+               plan_status,
+               exec_org_type,
+               plan_start_date,
+               plan_end_date,
+               build_task_now,
+               remark,
+               create_org_id,
+               create_org_name,
+               create_org_path,
+               belong_org_id,
+               belong_org_name,
+               belong_org_path,
+               standard,
+               issue,
+               be_issue,
+               parent_id,
+               file_list,
+               deleted,
+               create_by,
+               create_time,
+               update_by,
+               update_time
         from core_drill_plan
     </sql>
 
@@ -41,268 +65,345 @@
             resultMap="CoreDrillPlanResult">
         <include refid="selectCoreDrillPlanVo"/>
         <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="execTimes != null ">
-                            and exec_times = #{execTimes}
-                        </if>
-                        <if test="planStatus != null ">
-                            and plan_status = #{planStatus}
-                        </if>
-                        <if test="execOrgType != null ">
-                            and exec_org_type = #{execOrgType}
-                        </if>
-                        <if test="planStartDate != null ">
-                            and plan_start_date = #{planStartDate}
-                        </if>
-                        <if test="planEndDate != null ">
-                            and plan_end_date = #{planEndDate}
-                        </if>
-                        <if test="buildTaskNow != null ">
-                            and build_task_now = #{buildTaskNow}
-                        </if>
-                        <if test="createOrgId != null ">
-                            and create_org_id = #{createOrgId}
-                        </if>
-                        <if test="createOrgName != null  and createOrgName != ''">
-                            and create_org_name like concat('%', #{createOrgName}, '%')
-                        </if>
-                        <if test="createOrgPath != null  and createOrgPath != ''">
-                            and create_org_path = #{createOrgPath}
-                        </if>
-                        <if test="belongOrgId != null ">
-                            and belong_org_id = #{belongOrgId}
-                        </if>
-                        <if test="belongOrgName != null  and belongOrgName != ''">
-                            and belong_org_name like concat('%', #{belongOrgName}, '%')
-                        </if>
-                        <if test="belongOrgPath != null  and belongOrgPath != ''">
-                            and belong_org_path = #{belongOrgPath}
-                        </if>
-                        <if test="standard != null ">
-                            and standard = #{standard}
-                        </if>
-                        <if test="issue != null ">
-                            and issue = #{issue}
-                        </if>
-                        <if test="beIssue != null ">
-                            and be_issue = #{beIssue}
-                        </if>
-                        <if test="parentId != null ">
-                            and parent_id = #{parentId}
-                        </if>
-                        <if test="fileList != null  and fileList != ''">
-                            and file_list = #{fileList}
-                        </if>
-                        <if test="deleted != null ">
-                            and deleted = #{deleted}
-                        </if>
+            <if test="planName != null  and planName != ''">
+                and plan_name like concat('%', #{planName}, '%')
+            </if>
+            <if test="planCycle != null ">
+                and plan_cycle = #{planCycle}
+            </if>
+            <if test="execTimes != null ">
+                and exec_times = #{execTimes}
+            </if>
+            <if test="planStatus != null ">
+                and plan_status = #{planStatus}
+            </if>
+            <if test="execOrgType != null ">
+                and exec_org_type = #{execOrgType}
+            </if>
+            <if test="planStartDate != null ">
+                and plan_start_date = #{planStartDate}
+            </if>
+            <if test="planEndDate != null ">
+                and plan_end_date = #{planEndDate}
+            </if>
+            <if test="buildTaskNow != null ">
+                and build_task_now = #{buildTaskNow}
+            </if>
+            <if test="createOrgId != null ">
+                and create_org_id = #{createOrgId}
+            </if>
+            <if test="createOrgName != null  and createOrgName != ''">
+                and create_org_name like concat('%', #{createOrgName}, '%')
+            </if>
+            <if test="createOrgPath != null  and createOrgPath != ''">
+                and create_org_path = #{createOrgPath}
+            </if>
+            <if test="belongOrgId != null ">
+                and belong_org_id = #{belongOrgId}
+            </if>
+            <if test="belongOrgName != null  and belongOrgName != ''">
+                and belong_org_name like concat('%', #{belongOrgName}, '%')
+            </if>
+            <if test="belongOrgPath != null  and belongOrgPath != ''">
+                and belong_org_path = #{belongOrgPath}
+            </if>
+            <if test="standard != null ">
+                and standard = #{standard}
+            </if>
+            <if test="issue != null ">
+                and issue = #{issue}
+            </if>
+            <if test="beIssue != null ">
+                and be_issue = #{beIssue}
+            </if>
+            <if test="parentId != null ">
+                and parent_id = #{parentId}
+            </if>
+            <if test="fileList != null  and fileList != ''">
+                and file_list = #{fileList}
+            </if>
+            <if test="deleted != null ">
+                and deleted = #{deleted}
+            </if>
         </where>
     </select>
 
     <select id="selectCoreDrillPlanById" parameterType="Long"
             resultMap="CoreDrillPlanResult">
-            <include refid="selectCoreDrillPlanVo"/>
-            where id = #{id}
+        <include refid="selectCoreDrillPlanVo"/>
+        where id = #{id}
     </select>
 
-    <insert id="insertCoreDrillPlan" parameterType="com.xunmei.common.core.domain.drill.domain.CoreDrillPlan" useGeneratedKeys="true" keyProperty="id">
+    <insert id="insertCoreDrillPlan" parameterType="com.xunmei.common.core.domain.drill.domain.CoreDrillPlan"
+            useGeneratedKeys="true" keyProperty="id">
         insert into core_drill_plan
         <trim prefix="(" suffix=")" suffixOverrides=",">
-                    <if test="planName != null">plan_name,
-                    </if>
-                    <if test="planCycle != null">plan_cycle,
-                    </if>
-                    <if test="execTimes != null">exec_times,
-                    </if>
-                    <if test="planStatus != null">plan_status,
-                    </if>
-                    <if test="execOrgType != null">exec_org_type,
-                    </if>
-                    <if test="planStartDate != null">plan_start_date,
-                    </if>
-                    <if test="planEndDate != null">plan_end_date,
-                    </if>
-                    <if test="buildTaskNow != null">build_task_now,
-                    </if>
-                    <if test="remark != null">remark,
-                    </if>
-                    <if test="createOrgId != null">create_org_id,
-                    </if>
-                    <if test="createOrgName != null">create_org_name,
-                    </if>
-                    <if test="createOrgPath != null">create_org_path,
-                    </if>
-                    <if test="belongOrgId != null">belong_org_id,
-                    </if>
-                    <if test="belongOrgName != null">belong_org_name,
-                    </if>
-                    <if test="belongOrgPath != null">belong_org_path,
-                    </if>
-                    <if test="standard != null">standard,
-                    </if>
-                    <if test="issue != null">issue,
-                    </if>
-                    <if test="beIssue != null">be_issue,
-                    </if>
-                    <if test="parentId != null">parent_id,
-                    </if>
-                    <if test="fileList != null">file_list,
-                    </if>
-                    <if test="deleted != null">deleted,
-                    </if>
-                    <if test="createBy != null">create_by,
-                    </if>
-                    <if test="createTime != null">create_time,
-                    </if>
-                    <if test="updateBy != null">update_by,
-                    </if>
-                    <if test="updateTime != null">update_time,
-                    </if>
+            <if test="planName != null">
+                plan_name,
+            </if>
+            <if test="planCycle != null">
+                plan_cycle,
+            </if>
+            <if test="execTimes != null">
+                exec_times,
+            </if>
+            <if test="planStatus != null">
+                plan_status,
+            </if>
+            <if test="execOrgType != null">
+                exec_org_type,
+            </if>
+            <if test="planStartDate != null">
+                plan_start_date,
+            </if>
+            <if test="planEndDate != null">
+                plan_end_date,
+            </if>
+            <if test="buildTaskNow != null">
+                build_task_now,
+            </if>
+            <if test="remark != null">
+                remark,
+            </if>
+            <if test="createOrgId != null">
+                create_org_id,
+            </if>
+            <if test="createOrgName != null">
+                create_org_name,
+            </if>
+            <if test="createOrgPath != null">
+                create_org_path,
+            </if>
+            <if test="belongOrgId != null">
+                belong_org_id,
+            </if>
+            <if test="belongOrgName != null">
+                belong_org_name,
+            </if>
+            <if test="belongOrgPath != null">
+                belong_org_path,
+            </if>
+            <if test="standard != null">
+                standard,
+            </if>
+            <if test="issue != null">
+                issue,
+            </if>
+            <if test="beIssue != null">
+                be_issue,
+            </if>
+            <if test="parentId != null">
+                parent_id,
+            </if>
+            <if test="fileList != null">
+                file_list,
+            </if>
+            <if test="deleted != null">
+                deleted,
+            </if>
+            <if test="createBy != null">
+                create_by,
+            </if>
+            <if test="createTime != null">
+                create_time,
+            </if>
+            <if test="updateBy != null">
+                update_by,
+            </if>
+            <if test="updateTime != null">
+                update_time,
+            </if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
-                    <if test="planName != null">#{planName},
-                    </if>
-                    <if test="planCycle != null">#{planCycle},
-                    </if>
-                    <if test="execTimes != null">#{execTimes},
-                    </if>
-                    <if test="planStatus != null">#{planStatus},
-                    </if>
-                    <if test="execOrgType != null">#{execOrgType},
-                    </if>
-                    <if test="planStartDate != null">#{planStartDate},
-                    </if>
-                    <if test="planEndDate != null">#{planEndDate},
-                    </if>
-                    <if test="buildTaskNow != null">#{buildTaskNow},
-                    </if>
-                    <if test="remark != null">#{remark},
-                    </if>
-                    <if test="createOrgId != null">#{createOrgId},
-                    </if>
-                    <if test="createOrgName != null">#{createOrgName},
-                    </if>
-                    <if test="createOrgPath != null">#{createOrgPath},
-                    </if>
-                    <if test="belongOrgId != null">#{belongOrgId},
-                    </if>
-                    <if test="belongOrgName != null">#{belongOrgName},
-                    </if>
-                    <if test="belongOrgPath != null">#{belongOrgPath},
-                    </if>
-                    <if test="standard != null">#{standard},
-                    </if>
-                    <if test="issue != null">#{issue},
-                    </if>
-                    <if test="beIssue != null">#{beIssue},
-                    </if>
-                    <if test="parentId != null">#{parentId},
-                    </if>
-                    <if test="fileList != null">#{fileList},
-                    </if>
-                    <if test="deleted != null">#{deleted},
-                    </if>
-                    <if test="createBy != null">#{createBy},
-                    </if>
-                    <if test="createTime != null">#{createTime},
-                    </if>
-                    <if test="updateBy != null">#{updateBy},
-                    </if>
-                    <if test="updateTime != null">#{updateTime},
-                    </if>
+            <if test="planName != null">
+                #{planName},
+            </if>
+            <if test="planCycle != null">
+                #{planCycle},
+            </if>
+            <if test="execTimes != null">
+                #{execTimes},
+            </if>
+            <if test="planStatus != null">
+                #{planStatus},
+            </if>
+            <if test="execOrgType != null">
+                #{execOrgType},
+            </if>
+            <if test="planStartDate != null">
+                #{planStartDate},
+            </if>
+            <if test="planEndDate != null">
+                #{planEndDate},
+            </if>
+            <if test="buildTaskNow != null">
+                #{buildTaskNow},
+            </if>
+            <if test="remark != null">
+                #{remark},
+            </if>
+            <if test="createOrgId != null">
+                #{createOrgId},
+            </if>
+            <if test="createOrgName != null">
+                #{createOrgName},
+            </if>
+            <if test="createOrgPath != null">
+                #{createOrgPath},
+            </if>
+            <if test="belongOrgId != null">
+                #{belongOrgId},
+            </if>
+            <if test="belongOrgName != null">
+                #{belongOrgName},
+            </if>
+            <if test="belongOrgPath != null">
+                #{belongOrgPath},
+            </if>
+            <if test="standard != null">
+                #{standard},
+            </if>
+            <if test="issue != null">
+                #{issue},
+            </if>
+            <if test="beIssue != null">
+                #{beIssue},
+            </if>
+            <if test="parentId != null">
+                #{parentId},
+            </if>
+            <if test="fileList != null">
+                #{fileList},
+            </if>
+            <if test="deleted != null">
+                #{deleted},
+            </if>
+            <if test="createBy != null">
+                #{createBy},
+            </if>
+            <if test="createTime != null">
+                #{createTime},
+            </if>
+            <if test="updateBy != null">
+                #{updateBy},
+            </if>
+            <if test="updateTime != null">
+                #{updateTime},
+            </if>
         </trim>
     </insert>
 
     <update id="updateCoreDrillPlan" parameterType="com.xunmei.common.core.domain.drill.domain.CoreDrillPlan">
         update core_drill_plan
         <trim prefix="SET" suffixOverrides=",">
-                    <if test="planName != null">plan_name =
-                        #{planName},
-                    </if>
-                    <if test="planCycle != null">plan_cycle =
-                        #{planCycle},
-                    </if>
-                    <if test="execTimes != null">exec_times =
-                        #{execTimes},
-                    </if>
-                    <if test="planStatus != null">plan_status =
-                        #{planStatus},
-                    </if>
-                    <if test="execOrgType != null">exec_org_type =
-                        #{execOrgType},
-                    </if>
-                    <if test="planStartDate != null">plan_start_date =
-                        #{planStartDate},
-                    </if>
-                    <if test="planEndDate != null">plan_end_date =
-                        #{planEndDate},
-                    </if>
-                    <if test="buildTaskNow != null">build_task_now =
-                        #{buildTaskNow},
-                    </if>
-                    <if test="remark != null">remark =
-                        #{remark},
-                    </if>
-                    <if test="createOrgId != null">create_org_id =
-                        #{createOrgId},
-                    </if>
-                    <if test="createOrgName != null">create_org_name =
-                        #{createOrgName},
-                    </if>
-                    <if test="createOrgPath != null">create_org_path =
-                        #{createOrgPath},
-                    </if>
-                    <if test="belongOrgId != null">belong_org_id =
-                        #{belongOrgId},
-                    </if>
-                    <if test="belongOrgName != null">belong_org_name =
-                        #{belongOrgName},
-                    </if>
-                    <if test="belongOrgPath != null">belong_org_path =
-                        #{belongOrgPath},
-                    </if>
-                    <if test="standard != null">standard =
-                        #{standard},
-                    </if>
-                    <if test="issue != null">issue =
-                        #{issue},
-                    </if>
-                    <if test="beIssue != null">be_issue =
-                        #{beIssue},
-                    </if>
-                    <if test="parentId != null">parent_id =
-                        #{parentId},
-                    </if>
-                    <if test="fileList != null">file_list =
-                        #{fileList},
-                    </if>
-                    <if test="deleted != null">deleted =
-                        #{deleted},
-                    </if>
-                    <if test="createBy != null">create_by =
-                        #{createBy},
-                    </if>
-                    <if test="createTime != null">create_time =
-                        #{createTime},
-                    </if>
-                    <if test="updateBy != null">update_by =
-                        #{updateBy},
-                    </if>
-                    <if test="updateTime != null">update_time =
-                        #{updateTime},
-                    </if>
+            <if test="planName != null">
+                plan_name =
+                #{planName},
+            </if>
+            <if test="planCycle != null">
+                plan_cycle =
+                #{planCycle},
+            </if>
+            <if test="execTimes != null">
+                exec_times =
+                #{execTimes},
+            </if>
+            <if test="planStatus != null">
+                plan_status =
+                #{planStatus},
+            </if>
+            <if test="execOrgType != null">
+                exec_org_type =
+                #{execOrgType},
+            </if>
+            <if test="planStartDate != null">
+                plan_start_date =
+                #{planStartDate},
+            </if>
+            <if test="planEndDate != null">
+                plan_end_date =
+                #{planEndDate},
+            </if>
+            <if test="buildTaskNow != null">
+                build_task_now =
+                #{buildTaskNow},
+            </if>
+            <if test="remark != null">
+                remark =
+                #{remark},
+            </if>
+            <if test="createOrgId != null">
+                create_org_id =
+                #{createOrgId},
+            </if>
+            <if test="createOrgName != null">
+                create_org_name =
+                #{createOrgName},
+            </if>
+            <if test="createOrgPath != null">
+                create_org_path =
+                #{createOrgPath},
+            </if>
+            <if test="belongOrgId != null">
+                belong_org_id =
+                #{belongOrgId},
+            </if>
+            <if test="belongOrgName != null">
+                belong_org_name =
+                #{belongOrgName},
+            </if>
+            <if test="belongOrgPath != null">
+                belong_org_path =
+                #{belongOrgPath},
+            </if>
+            <if test="standard != null">
+                standard =
+                #{standard},
+            </if>
+            <if test="issue != null">
+                issue =
+                #{issue},
+            </if>
+            <if test="beIssue != null">
+                be_issue =
+                #{beIssue},
+            </if>
+            <if test="parentId != null">
+                parent_id =
+                #{parentId},
+            </if>
+            <if test="fileList != null">
+                file_list =
+                #{fileList},
+            </if>
+            <if test="deleted != null">
+                deleted =
+                #{deleted},
+            </if>
+            <if test="createBy != null">
+                create_by =
+                #{createBy},
+            </if>
+            <if test="createTime != null">
+                create_time =
+                #{createTime},
+            </if>
+            <if test="updateBy != null">
+                update_by =
+                #{updateBy},
+            </if>
+            <if test="updateTime != null">
+                update_time =
+                #{updateTime},
+            </if>
         </trim>
         where id = #{id}
     </update>
 
     <delete id="deleteCoreDrillPlanById" parameterType="Long">
         delete
-        from core_drill_plan where id = #{id}
+        from core_drill_plan
+        where id = #{id}
     </delete>
 
     <delete id="deleteCoreDrillPlanByIds" parameterType="String">
@@ -357,8 +458,8 @@
     </sql>
     <sql id="pageRoleIncludeReuqest">
         select distinct p1.id
-        from core_edu_training_plan p1
-                 inner join core_edu_training_plan_to_role r1 on p1.id = r1.plan_id
+        from core_drill_plan p1
+                 inner join core_drill_plan_to_role r1 on p1.id = r1.plan_id
         where p1.deleted = 0
           and p1.plan_status = 0
           and r1.role_id = #{request.planRoleId}
@@ -366,46 +467,47 @@
     <select id="selectPageData" resultType="com.xunmei.common.core.domain.drill.vo.CoreDrillPlanPageVo">
         select
         p.id as id,
-        p.plan_name,
-        p.create_org_id,
-        p.create_org_name,
-        p.exec_org_type,
-        p.plan_cycle,
-        p.exec_times,
-        p.remark,
+        p.plan_name as planName,
+        p.create_org_id as createOrgId,
+        p.create_org_name as createOrgName,
+        p.exec_org_type as execOrgType,
+        p.plan_cycle as planCycle,
+        p.exec_times as execTimes,
+        p.remark as remark,
         u.name as updateBy,
-        p.plan_status,
-        p.issue,
-        p.standard,
-        P.belong_org_id,
-        P.belong_org_name from core_edu_training_plan p left join sys_user u on p.update_by=u.id
+        p.plan_status as planStatus,
+        p.issue as issue,
+        p.standard as standard,
+        P.belong_org_id as belongOrgId,
+        P.belong_org_name as belongOrgName,
+        p.parent_id as parentId
+
+        from core_drill_plan p left join sys_user u on p.update_by=u.id
         where p.deleted = 0 and p.parent_id is null
         and p.standard=1 and p.issue=1
         <if test="request.planRoleId!=null">
-            and p.id in ( <include refid="pageRoleIncludeReuqest"/>)
+            and p.id in (<include refid="pageRoleIncludeReuqest"/>)
         </if>
-        and p.id in ( select sp.parent_id from core_edu_training_plan sp where sp.deleted = 0 and sp.parent_id is not
+        and p.id in ( select sp.parent_id from core_drill_plan sp where sp.deleted = 0 and sp.parent_id is not
         null<include refid="pageIncludeSP"/>)
         <!-- 不是标准计划但是也没下发: 行社自建的计划 -->
         or ( p.standard=0 and p.issue=0 and p.deleted=0 and p.parent_id is null
         <if test="request.planRoleId!=null">
-            and p.id in ( <include refid="pageRoleIncludeReuqest"/>)
+            and p.id in (<include refid="pageRoleIncludeReuqest"/>)
         </if>
         <include refid="pageIncludeP"/>)
         <!-- 是标准计划但是未下发 -->
         or ( p.standard=1 and p.issue=0 and p.deleted=0 and p.parent_id is null
         <if test="request.planRoleId!=null">
-            and p.id in ( <include refid="pageRoleIncludeReuqest"/>)
+            and p.id in (<include refid="pageRoleIncludeReuqest"/>)
         </if>
         <include refid="pageIncludeP"/>)
         or ( p.standard=1 and p.issue=1 and p.deleted=0 and p.parent_id is null
         <if test="request.planRoleId!=null">
-            and p.id in ( <include refid="pageRoleIncludeReuqest"/>)
+            and p.id in (<include refid="pageRoleIncludeReuqest"/>)
         </if>
         <include refid="pageIncludeP"/>)
         order by p.create_time desc
-
-
     </select>
 
     <select id="selectChildrenPlan" resultType="com.xunmei.common.core.domain.drill.vo.CoreDrillPlanPageVo">

+ 20 - 0
soc-modules/soc-modules-core/src/main/resources/mapper/drill/CoreDrillTaskMapper.xml

@@ -154,6 +154,26 @@
     </select>
 
     <select id="selectDrillTaskDetail" resultType="com.xunmei.common.core.domain.drill.vo.CoreDrillTaskDetailVo">
+        select t.id,
+               plan_id,
+               t.org_id,
+               t.org_name,
+               title,
+               type,
+               start_date,
+               end_date,
+               drill_time,
+               image_list,
+               t.host_id,
+               t.recorder_id,
+               u.name      as hostName,
+               u2.name     as recorderName,
+               t.pdf_url   as pdfUrl,
+               t.file_list as file
+        from core_drill_task t
+                 left join sys_user u on u.id = t.host_id
+                 left join sys_user u2 on u2.id = t.recorder_id
 
+        where t.id = #{id}
     </select>
 </mapper>