Преглед на файлове

预案演练资料库代码提交

jingyuanchao преди 2 години
родител
ревизия
94dfa520f1

+ 93 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/drill/controller/CoreDrillDictionaryController.java

@@ -0,0 +1,93 @@
+package com.xunmei.core.drill.controller;
+
+
+
+import com.xunmei.common.core.web.page.TableDataInfo;
+import com.xunmei.core.drill.domain.CoreDrillDictionary;
+import com.xunmei.core.drill.service.ICoreDrillDictionaryService;
+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;
+
+/**
+ * 预案演练库Controller
+ *
+ * @author xunmei
+ * @date 2023-09-06
+ */
+@Api(tags = {"CoreDrillDictionary" })
+@RestController
+@RequestMapping("/drillDictionary")
+public class CoreDrillDictionaryController extends BaseController {
+    @Autowired
+    private ICoreDrillDictionaryService coreDrillDictionaryService;
+
+/**
+ * 查询预案演练库列表
+ */
+@ApiOperation(value = "查询CoreDrillDictionary列表")
+@RequiresPermissions("core:drillDictionary:list")
+@GetMapping("/list")
+    public TableDataInfo<CoreDrillDictionary> list(CoreDrillDictionary coreDrillDictionary) {
+
+        return coreDrillDictionaryService.selectPage( coreDrillDictionary);
+    }
+
+
+
+    /**
+     * 获取预案演练库详细信息
+     */
+    @ApiOperation(value = "获取CoreDrillDictionary详细信息")
+    @RequiresPermissions("core:drillDictionary:query")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        return success(coreDrillDictionaryService.selectCoreDrillDictionaryById(id));
+    }
+
+    /**
+     * 新增预案演练库
+     */
+    @ApiOperation(value = "新增CoreDrillDictionary")
+    @RequiresPermissions("core:drillDictionary:add")
+    @Log(title = "预案演练库" , businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody CoreDrillDictionary coreDrillDictionary) {
+        return toAjax(coreDrillDictionaryService.insertCoreDrillDictionary(coreDrillDictionary));
+    }
+
+    /**
+     * 修改预案演练库
+     */
+    @ApiOperation(value = "修改CoreDrillDictionary")
+    @RequiresPermissions("core:drillDictionary:edit")
+    @Log(title = "预案演练库" , businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody CoreDrillDictionary coreDrillDictionary) {
+        return toAjax(coreDrillDictionaryService.updateCoreDrillDictionary(coreDrillDictionary));
+    }
+
+    /**
+     * 删除预案演练库
+     */
+    @ApiOperation(value = "删除CoreDrillDictionary")
+    @RequiresPermissions("core:drillDictionary:remove")
+    @Log(title = "预案演练库" , businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        return toAjax(coreDrillDictionaryService.deleteCoreDrillDictionaryByIds(ids));
+    }
+}

+ 96 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/drill/domain/CoreDrillDictionary.java

@@ -0,0 +1,96 @@
+package com.xunmei.core.drill.domain;
+
+import com.baomidou.mybatisplus.annotation.*;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+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_drill_dictionary
+ *
+ * @author xunmei
+ * @date 2023-09-06
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("core_drill_dictionary")
+@ApiModel(value = "CoreDrillDictionary对象", description = "预案演练库")
+public class CoreDrillDictionary extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    @TableId
+    private Long id;
+
+    @TableField("drill_type")
+    @ApiModelProperty(value = "演练类型,字典表关联取值")
+    private String drillType;
+    @TableField("drill_type_name")
+    @ApiModelProperty(value = "演练类型名称")
+    private String drillTypeName;
+
+    @TableField("drill_projects")
+    @ApiModelProperty(value = "演练项目")
+    private String drillProjects;
+
+    @TableField("default_cause")
+    @ApiModelProperty(value = "预设案由")
+    private String defaultCause;
+
+    @TableField("org_id")
+    @ApiModelProperty(value = "机构")
+    private Long orgId;
+
+    @TableField("org_name")
+    @ApiModelProperty(value = "机构名称")
+    private String orgName;
+
+    @TableField("org_path")
+    @ApiModelProperty(value = "机构")
+    private String orgPath;
+
+    @ApiModelProperty(value = "删除标志", notes = "0:未删除,1:已删除")
+    @TableLogic(value = "0", delval = "1")
+    @TableField(value = "deleted")
+    private int deleted;
+
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+
+
+                .append("id", getId())
+
+
+                .append("drillType", getDrillType())
+
+
+                .append("drillTypeName", getDrillTypeName())
+
+
+                .append("drillProjects", getDrillProjects())
+
+
+                .append("defaultCause", getDefaultCause())
+
+
+                .append("orgId", getOrgId())
+
+
+                .append("orgName", getOrgName())
+
+
+                .append("orgPath", getOrgPath())
+
+
+                .append("deleted", getDeleted())
+                .toString();
+    }
+}

+ 63 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/drill/mapper/CoreDrillDictionaryMapper.java

@@ -0,0 +1,63 @@
+package com.xunmei.core.drill.mapper;
+
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.xunmei.core.drill.domain.CoreDrillDictionary;
+
+import java.util.List;
+
+/**
+ * 预案演练库Mapper接口
+ *
+ * @author xunmei
+ * @date 2023-09-06
+ */
+public interface CoreDrillDictionaryMapper extends BaseMapper<CoreDrillDictionary> {
+    /**
+     * 查询预案演练库
+     *
+     * @param id 预案演练库主键
+     * @return 预案演练库
+     */
+    CoreDrillDictionary selectCoreDrillDictionaryById(Long id);
+
+    /**
+     * 查询预案演练库列表
+     *
+     * @param coreDrillDictionary 预案演练库
+     * @return 预案演练库集合
+     */
+    List<CoreDrillDictionary> selectCoreDrillDictionaryList(CoreDrillDictionary coreDrillDictionary);
+
+    /**
+     * 新增预案演练库
+     *
+     * @param coreDrillDictionary 预案演练库
+     * @return 结果
+     */
+    int insertCoreDrillDictionary(CoreDrillDictionary coreDrillDictionary);
+
+    /**
+     * 修改预案演练库
+     *
+     * @param coreDrillDictionary 预案演练库
+     * @return 结果
+     */
+    int updateCoreDrillDictionary(CoreDrillDictionary coreDrillDictionary);
+
+    /**
+     * 删除预案演练库
+     *
+     * @param id 预案演练库主键
+     * @return 结果
+     */
+    int deleteCoreDrillDictionaryById(Long id);
+
+    /**
+     * 批量删除预案演练库
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    int deleteCoreDrillDictionaryByIds(Long[] ids);
+}

+ 72 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/drill/service/ICoreDrillDictionaryService.java

@@ -0,0 +1,72 @@
+package com.xunmei.core.drill.service;
+
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.xunmei.common.core.web.page.TableDataInfo;
+import com.xunmei.core.drill.domain.CoreDrillDictionary;
+
+import java.util.List;
+
+/**
+ * 预案演练库Service接口
+ *
+ * @author xunmei
+ * @date 2023-09-06
+ */
+public interface ICoreDrillDictionaryService extends IService<CoreDrillDictionary> {
+    /**
+     * 查询预案演练库
+     *
+     * @param id 预案演练库主键
+     * @return 预案演练库
+     */
+     CoreDrillDictionary selectCoreDrillDictionaryById(Long id);
+
+    /**
+     * 查询预案演练库列表
+     *
+     * @param coreDrillDictionary 预案演练库
+     * @return 预案演练库集合
+     */
+    List<CoreDrillDictionary> selectCoreDrillDictionaryList(CoreDrillDictionary coreDrillDictionary);
+
+    /**
+     * 新增预案演练库
+     *
+     * @param coreDrillDictionary 预案演练库
+     * @return 结果
+     */
+    int insertCoreDrillDictionary(CoreDrillDictionary coreDrillDictionary);
+
+    /**
+     * 修改预案演练库
+     *
+     * @param coreDrillDictionary 预案演练库
+     * @return 结果
+     */
+    int updateCoreDrillDictionary(CoreDrillDictionary coreDrillDictionary);
+
+    /**
+     * 批量删除预案演练库
+     *
+     * @param ids 需要删除的预案演练库主键集合
+     * @return 结果
+     */
+    int deleteCoreDrillDictionaryByIds(Long[] ids);
+
+    /**
+     * 删除预案演练库信息
+     *
+     * @param id 预案演练库主键
+     * @return 结果
+     */
+    int deleteCoreDrillDictionaryById(Long id);
+
+    /**
+     * 查询预案演练库分页数据
+     *
+     * @param coreDrillDictionary 查询条件对象
+     * @return Page
+     */
+    TableDataInfo<CoreDrillDictionary> selectPage(CoreDrillDictionary coreDrillDictionary);
+}

+ 116 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/drill/service/impl/CoreDrillDictionaryServiceImpl.java

@@ -0,0 +1,116 @@
+package com.xunmei.core.drill.service.impl;
+
+import java.util.List;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.xunmei.core.drill.domain.CoreDrillDictionary;
+import com.xunmei.core.drill.mapper.CoreDrillDictionaryMapper;
+import com.xunmei.core.drill.service.ICoreDrillDictionaryService;
+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.plugins.pagination.Page;
+import com.xunmei.common.core.web.page.TableDataInfo;
+
+
+/**
+ * 预案演练库Service业务层处理
+ *
+ * @author xunmei
+ * @date 2023-09-06
+ */
+@Service
+public class CoreDrillDictionaryServiceImpl extends ServiceImpl<CoreDrillDictionaryMapper, CoreDrillDictionary> implements ICoreDrillDictionaryService {
+    @Autowired
+    private CoreDrillDictionaryMapper coreDrillDictionaryMapper;
+    @Autowired
+    private RemoteOrgService orgService;
+
+    @Override
+    public TableDataInfo<CoreDrillDictionary> selectPage(CoreDrillDictionary coreDrillDictionary) {
+        Page<CoreDrillDictionary> page;
+        if (coreDrillDictionary.getPageNum() != null && coreDrillDictionary.getPageSize() != null) {
+            page = new Page<>(coreDrillDictionary.getPageNum(), coreDrillDictionary.getPageSize());
+        } else {
+            page = new Page<>();
+        }
+
+        //获取数据
+        page = coreDrillDictionaryMapper.selectPage(page, null);
+        //抓换为TableDataInfo适配前端
+        return TableDataInfo.build(page);
+
+
+    }
+
+
+    /**
+     * 查询预案演练库
+     *
+     * @param id 预案演练库主键
+     * @return 预案演练库
+     */
+    @Override
+    public CoreDrillDictionary selectCoreDrillDictionaryById(Long id) {
+        return coreDrillDictionaryMapper.selectById(id);
+    }
+
+    /**
+     * 查询预案演练库列表
+     *
+     * @param coreDrillDictionary 预案演练库
+     * @return 预案演练库
+     */
+    @Override
+    public List<CoreDrillDictionary> selectCoreDrillDictionaryList(CoreDrillDictionary coreDrillDictionary) {
+        return coreDrillDictionaryMapper.selectList(new QueryWrapper<>(coreDrillDictionary));
+    }
+
+    /**
+     * 新增预案演练库
+     *
+     * @param coreDrillDictionary 预案演练库
+     * @return 结果
+     */
+    @Override
+    public int insertCoreDrillDictionary(CoreDrillDictionary coreDrillDictionary) {
+        return coreDrillDictionaryMapper.insert(coreDrillDictionary);
+    }
+
+    /**
+     * 修改预案演练库
+     *
+     * @param coreDrillDictionary 预案演练库
+     * @return 结果
+     */
+    @Override
+    public int updateCoreDrillDictionary(CoreDrillDictionary coreDrillDictionary) {
+        return coreDrillDictionaryMapper.updateById(coreDrillDictionary);
+    }
+
+    /**
+     * 批量删除预案演练库
+     *
+     * @param ids 需要删除的预案演练库主键
+     * @return 结果
+     */
+    @Override
+    public int deleteCoreDrillDictionaryByIds(Long[] ids) {
+        return coreDrillDictionaryMapper.deleteBatchIds(Arrays.asList((ids)));
+    }
+
+    /**
+     * 删除预案演练库信息
+     *
+     * @param id 预案演练库主键
+     * @return 结果
+     */
+    @Override
+    public int deleteCoreDrillDictionaryById(Long id) {
+        return coreDrillDictionaryMapper.deleteById(id);
+    }
+}

+ 141 - 0
soc-modules/soc-modules-core/src/main/resources/mapper/drill/CoreDrillDictionaryMapper.xml

@@ -0,0 +1,141 @@
+<?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.drill.mapper.CoreDrillDictionaryMapper">
+
+    <resultMap type="com.xunmei.core.drill.domain.CoreDrillDictionary" id="CoreDrillDictionaryResult">
+                <result property="id" column="id"/>
+                <result property="drillType" column="drill_type"/>
+                <result property="drillTypeName" column="drill_type_name"/>
+                <result property="drillProjects" column="drill_projects"/>
+                <result property="defaultCause" column="default_cause"/>
+                <result property="orgId" column="org_id"/>
+                <result property="orgName" column="org_name"/>
+                <result property="orgPath" column="org_path"/>
+                <result property="deleted" column="deleted"/>
+    </resultMap>
+
+    <sql id="selectCoreDrillDictionaryVo">
+        select id, drill_type, drill_type_name, drill_projects, default_cause, org_id, org_name, org_path, deleted
+        from core_drill_dictionary
+    </sql>
+
+    <select id="selectCoreDrillDictionaryList" parameterType="com.xunmei.core.drill.domain.CoreDrillDictionary"
+            resultMap="CoreDrillDictionaryResult">
+        <include refid="selectCoreDrillDictionaryVo"/>
+        <where>
+                        <if test="drillType != null  and drillType != ''">
+                            and drill_type = #{drillType}
+                        </if>
+                        <if test="drillTypeName != null  and drillTypeName != ''">
+                            and drill_type_name like concat('%', #{drillTypeName}, '%')
+                        </if>
+                        <if test="drillProjects != null  and drillProjects != ''">
+                            and drill_projects = #{drillProjects}
+                        </if>
+                        <if test="defaultCause != null  and defaultCause != ''">
+                            and default_cause = #{defaultCause}
+                        </if>
+                        <if test="orgId != null ">
+                            and org_id = #{orgId}
+                        </if>
+                        <if test="orgName != null  and orgName != ''">
+                            and org_name like concat('%', #{orgName}, '%')
+                        </if>
+        </where>
+    </select>
+
+    <select id="selectCoreDrillDictionaryById" parameterType="Long"
+            resultMap="CoreDrillDictionaryResult">
+            <include refid="selectCoreDrillDictionaryVo"/>
+            where id = #{id}
+    </select>
+
+    <insert id="insertCoreDrillDictionary" parameterType="com.xunmei.core.drill.domain.CoreDrillDictionary">
+        insert into core_drill_dictionary
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+                    <if test="id != null">id,
+                    </if>
+                    <if test="drillType != null">drill_type,
+                    </if>
+                    <if test="drillTypeName != null">drill_type_name,
+                    </if>
+                    <if test="drillProjects != null">drill_projects,
+                    </if>
+                    <if test="defaultCause != null">default_cause,
+                    </if>
+                    <if test="orgId != null">org_id,
+                    </if>
+                    <if test="orgName != null">org_name,
+                    </if>
+                    <if test="orgPath != null">org_path,
+                    </if>
+                    <if test="deleted != null">deleted,
+                    </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+                    <if test="id != null">#{id},
+                    </if>
+                    <if test="drillType != null">#{drillType},
+                    </if>
+                    <if test="drillTypeName != null">#{drillTypeName},
+                    </if>
+                    <if test="drillProjects != null">#{drillProjects},
+                    </if>
+                    <if test="defaultCause != null">#{defaultCause},
+                    </if>
+                    <if test="orgId != null">#{orgId},
+                    </if>
+                    <if test="orgName != null">#{orgName},
+                    </if>
+                    <if test="orgPath != null">#{orgPath},
+                    </if>
+                    <if test="deleted != null">#{deleted},
+                    </if>
+        </trim>
+    </insert>
+
+    <update id="updateCoreDrillDictionary" parameterType="com.xunmei.core.drill.domain.CoreDrillDictionary">
+        update core_drill_dictionary
+        <trim prefix="SET" suffixOverrides=",">
+                    <if test="drillType != null">drill_type =
+                        #{drillType},
+                    </if>
+                    <if test="drillTypeName != null">drill_type_name =
+                        #{drillTypeName},
+                    </if>
+                    <if test="drillProjects != null">drill_projects =
+                        #{drillProjects},
+                    </if>
+                    <if test="defaultCause != null">default_cause =
+                        #{defaultCause},
+                    </if>
+                    <if test="orgId != null">org_id =
+                        #{orgId},
+                    </if>
+                    <if test="orgName != null">org_name =
+                        #{orgName},
+                    </if>
+                    <if test="orgPath != null">org_path =
+                        #{orgPath},
+                    </if>
+                    <if test="deleted != null">deleted =
+                        #{deleted},
+                    </if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteCoreDrillDictionaryById" parameterType="Long">
+        delete
+        from core_drill_dictionary where id = #{id}
+    </delete>
+
+    <delete id="deleteCoreDrillDictionaryByIds" parameterType="String">
+        delete from core_drill_dictionary where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>