疾病信息表 热部署的配置

This commit is contained in:
piaobo 2025-07-09 16:38:34 +08:00
parent 69fb8678e3
commit 56ec33cc9b
7 changed files with 474 additions and 0 deletions

View File

@ -175,6 +175,12 @@
<artifactId>jjwt</artifactId>
<version>${jwt.version}</version>
</dependency>
<!--热部署-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
<!-- 验证码 -->
<dependency>
@ -249,6 +255,7 @@
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
</plugins>
</build>

View File

@ -0,0 +1,103 @@
package com.zhyc.module.biosafety.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.zhyc.module.biosafety.domain.SwDisease;
import com.zhyc.module.biosafety.service.ISwDiseaseService;
import org.springframework.security.access.prepost.PreAuthorize;
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.zhyc.common.annotation.Log;
import com.zhyc.common.core.controller.BaseController;
import com.zhyc.common.core.domain.AjaxResult;
import com.zhyc.common.enums.BusinessType;
import com.zhyc.common.utils.poi.ExcelUtil;
/**
* 疾病Controller
*
* @author ruoyi
* @date 2025-07-09
*/
@RestController
@RequestMapping("/biosafety/disease")
public class SwDiseaseController extends BaseController
{
@Autowired
private ISwDiseaseService swDiseaseService;
/**
* 查询疾病列表
*/
@PreAuthorize("@ss.hasPermi('disease:disease:list')")
@GetMapping("/list")
public AjaxResult list(SwDisease swDisease)
{
List<SwDisease> list = swDiseaseService.selectSwDiseaseList(swDisease);
return success(list);
}
/**
* 导出疾病列表
*/
@PreAuthorize("@ss.hasPermi('disease:disease:export')")
@Log(title = "疾病", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, SwDisease swDisease)
{
List<SwDisease> list = swDiseaseService.selectSwDiseaseList(swDisease);
ExcelUtil<SwDisease> util = new ExcelUtil<SwDisease>(SwDisease.class);
util.exportExcel(response, list, "疾病数据");
}
/**
* 获取疾病详细信息
*/
@PreAuthorize("@ss.hasPermi('disease:disease:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(swDiseaseService.selectSwDiseaseById(id));
}
/**
* 新增疾病
*/
@PreAuthorize("@ss.hasPermi('disease:disease:add')")
@Log(title = "疾病", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SwDisease swDisease)
{
return toAjax(swDiseaseService.insertSwDisease(swDisease));
}
/**
* 修改疾病
*/
@PreAuthorize("@ss.hasPermi('disease:disease:edit')")
@Log(title = "疾病", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody SwDisease swDisease)
{
return toAjax(swDiseaseService.updateSwDisease(swDisease));
}
/**
* 删除疾病
*/
@PreAuthorize("@ss.hasPermi('disease:disease:remove')")
@Log(title = "疾病", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(swDiseaseService.deleteSwDiseaseByIds(ids));
}
}

View File

@ -0,0 +1,82 @@
package com.zhyc.module.biosafety.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zhyc.common.annotation.Excel;
import com.zhyc.common.core.domain.TreeEntity;
/**
* 疾病对象 sw_disease
*
* @author ruoyi
* @date 2025-07-09
*/
public class SwDisease extends TreeEntity
{
private static final long serialVersionUID = 1L;
/** id */
private Long id;
/** 名称 */
@Excel(name = "名称")
private String name;
/** 描述 */
@Excel(name = "描述")
private String comment;
/** */
@Excel(name = "")
private Long pid;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return name;
}
public void setComment(String comment)
{
this.comment = comment;
}
public String getComment()
{
return comment;
}
public void setPid(Long pid)
{
this.pid = pid;
}
public Long getPid()
{
return pid;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("name", getName())
.append("comment", getComment())
.append("pid", getPid())
.toString();
}
}

View File

@ -0,0 +1,61 @@
package com.zhyc.module.biosafety.mapper;
import java.util.List;
import com.zhyc.module.biosafety.domain.SwDisease;
/**
* 疾病Mapper接口
*
* @author ruoyi
* @date 2025-07-09
*/
public interface SwDiseaseMapper
{
/**
* 查询疾病
*
* @param id 疾病主键
* @return 疾病
*/
public SwDisease selectSwDiseaseById(Long id);
/**
* 查询疾病列表
*
* @param swDisease 疾病
* @return 疾病集合
*/
public List<SwDisease> selectSwDiseaseList(SwDisease swDisease);
/**
* 新增疾病
*
* @param swDisease 疾病
* @return 结果
*/
public int insertSwDisease(SwDisease swDisease);
/**
* 修改疾病
*
* @param swDisease 疾病
* @return 结果
*/
public int updateSwDisease(SwDisease swDisease);
/**
* 删除疾病
*
* @param id 疾病主键
* @return 结果
*/
public int deleteSwDiseaseById(Long id);
/**
* 批量删除疾病
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteSwDiseaseByIds(Long[] ids);
}

View File

@ -0,0 +1,61 @@
package com.zhyc.module.biosafety.service;
import java.util.List;
import com.zhyc.module.biosafety.domain.SwDisease;
/**
* 疾病Service接口
*
* @author ruoyi
* @date 2025-07-09
*/
public interface ISwDiseaseService
{
/**
* 查询疾病
*
* @param id 疾病主键
* @return 疾病
*/
public SwDisease selectSwDiseaseById(Long id);
/**
* 查询疾病列表
*
* @param swDisease 疾病
* @return 疾病集合
*/
public List<SwDisease> selectSwDiseaseList(SwDisease swDisease);
/**
* 新增疾病
*
* @param swDisease 疾病
* @return 结果
*/
public int insertSwDisease(SwDisease swDisease);
/**
* 修改疾病
*
* @param swDisease 疾病
* @return 结果
*/
public int updateSwDisease(SwDisease swDisease);
/**
* 批量删除疾病
*
* @param ids 需要删除的疾病主键集合
* @return 结果
*/
public int deleteSwDiseaseByIds(Long[] ids);
/**
* 删除疾病信息
*
* @param id 疾病主键
* @return 结果
*/
public int deleteSwDiseaseById(Long id);
}

View File

@ -0,0 +1,94 @@
package com.zhyc.module.biosafety.service.impl;
import java.util.List;
import com.zhyc.module.biosafety.domain.SwDisease;
import com.zhyc.module.biosafety.mapper.SwDiseaseMapper;
import com.zhyc.module.biosafety.service.ISwDiseaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* 疾病Service业务层处理
*
* @author ruoyi
* @date 2025-07-09
*/
@Service
public class SwDiseaseServiceImpl implements ISwDiseaseService
{
@Autowired
private SwDiseaseMapper swDiseaseMapper;
/**
* 查询疾病
*
* @param id 疾病主键
* @return 疾病
*/
@Override
public SwDisease selectSwDiseaseById(Long id)
{
return swDiseaseMapper.selectSwDiseaseById(id);
}
/**
* 查询疾病列表
*
* @param swDisease 疾病
* @return 疾病
*/
@Override
public List<SwDisease> selectSwDiseaseList(SwDisease swDisease)
{
return swDiseaseMapper.selectSwDiseaseList(swDisease);
}
/**
* 新增疾病
*
* @param swDisease 疾病
* @return 结果
*/
@Override
public int insertSwDisease(SwDisease swDisease)
{
return swDiseaseMapper.insertSwDisease(swDisease);
}
/**
* 修改疾病
*
* @param swDisease 疾病
* @return 结果
*/
@Override
public int updateSwDisease(SwDisease swDisease)
{
return swDiseaseMapper.updateSwDisease(swDisease);
}
/**
* 批量删除疾病
*
* @param ids 需要删除的疾病主键
* @return 结果
*/
@Override
public int deleteSwDiseaseByIds(Long[] ids)
{
return swDiseaseMapper.deleteSwDiseaseByIds(ids);
}
/**
* 删除疾病信息
*
* @param id 疾病主键
* @return 结果
*/
@Override
public int deleteSwDiseaseById(Long id)
{
return swDiseaseMapper.deleteSwDiseaseById(id);
}
}

View File

@ -0,0 +1,66 @@
<?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.zhyc.module.biosafety.mapper.SwDiseaseMapper">
<resultMap type="SwDisease" id="SwDiseaseResult">
<result property="id" column="id" />
<result property="name" column="name" />
<result property="comment" column="comment" />
<result property="pid" column="pid" />
</resultMap>
<sql id="selectSwDiseaseVo">
select id, name, comment, pid from sw_disease
</sql>
<select id="selectSwDiseaseList" parameterType="SwDisease" resultMap="SwDiseaseResult">
<include refid="selectSwDiseaseVo"/>
<where>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="comment != null and comment != ''"> and comment = #{comment}</if>
<if test="pid != null "> and pid = #{pid}</if>
</where>
</select>
<select id="selectSwDiseaseById" parameterType="Long" resultMap="SwDiseaseResult">
<include refid="selectSwDiseaseVo"/>
where id = #{id}
</select>
<insert id="insertSwDisease" parameterType="SwDisease" useGeneratedKeys="true" keyProperty="id">
insert into sw_disease
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null">name,</if>
<if test="comment != null">comment,</if>
<if test="pid != null">pid,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null">#{name},</if>
<if test="comment != null">#{comment},</if>
<if test="pid != null">#{pid},</if>
</trim>
</insert>
<update id="updateSwDisease" parameterType="SwDisease">
update sw_disease
<trim prefix="SET" suffixOverrides=",">
<if test="name != null">name = #{name},</if>
<if test="comment != null">comment = #{comment},</if>
<if test="pid != null">pid = #{pid},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteSwDiseaseById" parameterType="Long">
delete from sw_disease where id = #{id}
</delete>
<delete id="deleteSwDiseaseByIds" parameterType="String">
delete from sw_disease where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>