护理知识库对象
This commit is contained in:
parent
26dcc57c90
commit
db931c9df2
@ -0,0 +1,91 @@
|
||||
package com.xinelu.manage.controller.basenursinginfo;
|
||||
|
||||
import com.xinelu.common.annotation.Log;
|
||||
import com.xinelu.common.core.controller.BaseController;
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.common.core.page.TableDataInfo;
|
||||
import com.xinelu.common.enums.BusinessType;
|
||||
import com.xinelu.common.utils.poi.ExcelUtil;
|
||||
import com.xinelu.manage.domain.basenursinginfo.BaseNursingInfo;
|
||||
import com.xinelu.manage.service.basenursinginfo.IBaseNursingInfoService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 护理知识库Controller
|
||||
*
|
||||
* @author xinelu
|
||||
* @date 2024-05-17
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/baseNursing")
|
||||
public class BaseNursingInfoController extends BaseController {
|
||||
@Resource
|
||||
private IBaseNursingInfoService baseNursingInfoService;
|
||||
|
||||
/**
|
||||
* 查询护理知识库列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:baseNursing:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BaseNursingInfo baseNursingInfo) {
|
||||
startPage();
|
||||
List<BaseNursingInfo> list = baseNursingInfoService.selectBaseNursingInfoList(baseNursingInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出护理知识库列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:baseNursing:export')")
|
||||
@Log(title = "护理知识库", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BaseNursingInfo baseNursingInfo) {
|
||||
List<BaseNursingInfo> list = baseNursingInfoService.selectBaseNursingInfoList(baseNursingInfo);
|
||||
ExcelUtil<BaseNursingInfo> util = new ExcelUtil<>(BaseNursingInfo.class);
|
||||
util.exportExcel(response, list, "护理知识库数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取护理知识库详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:baseNursing:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(baseNursingInfoService.selectBaseNursingInfoById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增护理知识库
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:baseNursing:add')")
|
||||
@Log(title = "护理知识库", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BaseNursingInfo baseNursingInfo) {
|
||||
return toAjax(baseNursingInfoService.insertBaseNursingInfo(baseNursingInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改护理知识库
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:baseNursing:edit')")
|
||||
@Log(title = "护理知识库", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BaseNursingInfo baseNursingInfo) {
|
||||
return toAjax(baseNursingInfoService.updateBaseNursingInfo(baseNursingInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除护理知识库
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:baseNursing:remove')")
|
||||
@Log(title = "护理知识库", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(baseNursingInfoService.deleteBaseNursingInfoByIds(ids));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,84 @@
|
||||
package com.xinelu.manage.domain.basenursinginfo;
|
||||
|
||||
import com.xinelu.common.annotation.Excel;
|
||||
import com.xinelu.common.core.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 护理知识库对象 base_nursing_info
|
||||
*
|
||||
* @author xinelu
|
||||
* @date 2024-05-17
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "护理知识库对象", description = "base_nursing_info")
|
||||
public class BaseNursingInfo extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* $column.columnComment
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 护理知识名称
|
||||
*/
|
||||
@ApiModelProperty(value = "护理知识名称")
|
||||
@Excel(name = "护理知识名称")
|
||||
private String nursingName;
|
||||
|
||||
/**
|
||||
* 烟酒指导
|
||||
*/
|
||||
@ApiModelProperty(value = "烟酒指导")
|
||||
@Excel(name = "烟酒指导")
|
||||
private String tobaccoWine;
|
||||
|
||||
/**
|
||||
* 睡眠指导
|
||||
*/
|
||||
@ApiModelProperty(value = "睡眠指导")
|
||||
@Excel(name = "睡眠指导")
|
||||
private String sleep;
|
||||
|
||||
/**
|
||||
* 情绪指导
|
||||
*/
|
||||
@ApiModelProperty(value = "情绪指导")
|
||||
@Excel(name = "情绪指导")
|
||||
private String emotion;
|
||||
|
||||
/**
|
||||
* $column.columnComment
|
||||
*/
|
||||
@ApiModelProperty(value = "${comment}")
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String familySecurity;
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("nursingName", getNursingName())
|
||||
.append("tobaccoWine", getTobaccoWine())
|
||||
.append("sleep", getSleep())
|
||||
.append("emotion", getEmotion())
|
||||
.append("familySecurity", getFamilySecurity())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
package com.xinelu.manage.mapper.basenursinginfo;
|
||||
|
||||
import com.xinelu.manage.domain.basenursinginfo.BaseNursingInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 护理知识库Mapper接口
|
||||
*
|
||||
* @author xinelu
|
||||
* @date 2024-05-17
|
||||
*/
|
||||
public interface BaseNursingInfoMapper {
|
||||
/**
|
||||
* 查询护理知识库
|
||||
*
|
||||
* @param id 护理知识库主键
|
||||
* @return 护理知识库
|
||||
*/
|
||||
BaseNursingInfo selectBaseNursingInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询护理知识库列表
|
||||
*
|
||||
* @param baseNursingInfo 护理知识库
|
||||
* @return 护理知识库集合
|
||||
*/
|
||||
List<BaseNursingInfo> selectBaseNursingInfoList(BaseNursingInfo baseNursingInfo);
|
||||
|
||||
/**
|
||||
* 新增护理知识库
|
||||
*
|
||||
* @param baseNursingInfo 护理知识库
|
||||
* @return 结果
|
||||
*/
|
||||
int insertBaseNursingInfo(BaseNursingInfo baseNursingInfo);
|
||||
|
||||
/**
|
||||
* 修改护理知识库
|
||||
*
|
||||
* @param baseNursingInfo 护理知识库
|
||||
* @return 结果
|
||||
*/
|
||||
int updateBaseNursingInfo(BaseNursingInfo baseNursingInfo);
|
||||
|
||||
/**
|
||||
* 删除护理知识库
|
||||
*
|
||||
* @param id 护理知识库主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteBaseNursingInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除护理知识库
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteBaseNursingInfoByIds(Long[] ids);
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
package com.xinelu.manage.service.basenursinginfo;
|
||||
|
||||
import com.xinelu.manage.domain.basenursinginfo.BaseNursingInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 护理知识库Service接口
|
||||
*
|
||||
* @author xinelu
|
||||
* @date 2024-05-17
|
||||
*/
|
||||
public interface IBaseNursingInfoService {
|
||||
/**
|
||||
* 查询护理知识库
|
||||
*
|
||||
* @param id 护理知识库主键
|
||||
* @return 护理知识库
|
||||
*/
|
||||
BaseNursingInfo selectBaseNursingInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询护理知识库列表
|
||||
*
|
||||
* @param baseNursingInfo 护理知识库
|
||||
* @return 护理知识库集合
|
||||
*/
|
||||
List<BaseNursingInfo> selectBaseNursingInfoList(BaseNursingInfo baseNursingInfo);
|
||||
|
||||
/**
|
||||
* 新增护理知识库
|
||||
*
|
||||
* @param baseNursingInfo 护理知识库
|
||||
* @return 结果
|
||||
*/
|
||||
int insertBaseNursingInfo(BaseNursingInfo baseNursingInfo);
|
||||
|
||||
/**
|
||||
* 修改护理知识库
|
||||
*
|
||||
* @param baseNursingInfo 护理知识库
|
||||
* @return 结果
|
||||
*/
|
||||
int updateBaseNursingInfo(BaseNursingInfo baseNursingInfo);
|
||||
|
||||
/**
|
||||
* 批量删除护理知识库
|
||||
*
|
||||
* @param ids 需要删除的护理知识库主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteBaseNursingInfoByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除护理知识库信息
|
||||
*
|
||||
* @param id 护理知识库主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteBaseNursingInfoById(Long id);
|
||||
}
|
||||
@ -0,0 +1,90 @@
|
||||
package com.xinelu.manage.service.basenursinginfo.impl;
|
||||
|
||||
import com.xinelu.manage.domain.basenursinginfo.BaseNursingInfo;
|
||||
import com.xinelu.manage.mapper.basenursinginfo.BaseNursingInfoMapper;
|
||||
import com.xinelu.manage.service.basenursinginfo.IBaseNursingInfoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 护理知识库Service业务层处理
|
||||
*
|
||||
* @author xinelu
|
||||
* @date 2024-05-17
|
||||
*/
|
||||
@Service
|
||||
public class BaseNursingInfoServiceImpl implements IBaseNursingInfoService {
|
||||
@Resource
|
||||
private BaseNursingInfoMapper baseNursingInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询护理知识库
|
||||
*
|
||||
* @param id 护理知识库主键
|
||||
* @return 护理知识库
|
||||
*/
|
||||
@Override
|
||||
public BaseNursingInfo selectBaseNursingInfoById(Long id) {
|
||||
return baseNursingInfoMapper.selectBaseNursingInfoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询护理知识库列表
|
||||
*
|
||||
* @param baseNursingInfo 护理知识库
|
||||
* @return 护理知识库
|
||||
*/
|
||||
@Override
|
||||
public List<BaseNursingInfo> selectBaseNursingInfoList(BaseNursingInfo baseNursingInfo) {
|
||||
return baseNursingInfoMapper.selectBaseNursingInfoList(baseNursingInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增护理知识库
|
||||
*
|
||||
* @param baseNursingInfo 护理知识库
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBaseNursingInfo(BaseNursingInfo baseNursingInfo) {
|
||||
baseNursingInfo.setCreateTime(LocalDateTime.now());
|
||||
return baseNursingInfoMapper.insertBaseNursingInfo(baseNursingInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改护理知识库
|
||||
*
|
||||
* @param baseNursingInfo 护理知识库
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBaseNursingInfo(BaseNursingInfo baseNursingInfo) {
|
||||
baseNursingInfo.setUpdateTime(LocalDateTime.now());
|
||||
return baseNursingInfoMapper.updateBaseNursingInfo(baseNursingInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除护理知识库
|
||||
*
|
||||
* @param ids 需要删除的护理知识库主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBaseNursingInfoByIds(Long[] ids) {
|
||||
return baseNursingInfoMapper.deleteBaseNursingInfoByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除护理知识库信息
|
||||
*
|
||||
* @param id 护理知识库主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBaseNursingInfoById(Long id) {
|
||||
return baseNursingInfoMapper.deleteBaseNursingInfoById(id);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,140 @@
|
||||
<?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.xinelu.manage.mapper.basenursinginfo.BaseNursingInfoMapper">
|
||||
|
||||
<resultMap type="BaseNursingInfo" id="BaseNursingInfoResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="nursingName" column="nursing_name"/>
|
||||
<result property="tobaccoWine" column="tobacco_wine"/>
|
||||
<result property="sleep" column="sleep"/>
|
||||
<result property="emotion" column="emotion"/>
|
||||
<result property="familySecurity" column="family_security"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBaseNursingInfoVo">
|
||||
select id, nursing_name, tobacco_wine, sleep, emotion, family_security, create_time, create_by, update_by, update_time from base_nursing_info
|
||||
</sql>
|
||||
|
||||
<select id="selectBaseNursingInfoList" parameterType="BaseNursingInfo" resultMap="BaseNursingInfoResult">
|
||||
<include refid="selectBaseNursingInfoVo"/>
|
||||
<where>
|
||||
<if test="nursingName != null and nursingName != ''">
|
||||
and nursing_name like concat('%', #{nursingName}, '%')
|
||||
</if>
|
||||
<if test="tobaccoWine != null and tobaccoWine != ''">
|
||||
and tobacco_wine = #{tobaccoWine}
|
||||
</if>
|
||||
<if test="sleep != null and sleep != ''">
|
||||
and sleep = #{sleep}
|
||||
</if>
|
||||
<if test="emotion != null and emotion != ''">
|
||||
and emotion = #{emotion}
|
||||
</if>
|
||||
<if test="familySecurity != null and familySecurity != ''">
|
||||
and family_security = #{familySecurity}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectBaseNursingInfoById" parameterType="Long"
|
||||
resultMap="BaseNursingInfoResult">
|
||||
<include refid="selectBaseNursingInfoVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertBaseNursingInfo" parameterType="BaseNursingInfo" useGeneratedKeys="true"
|
||||
keyProperty="id">
|
||||
insert into base_nursing_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="nursingName != null">nursing_name,
|
||||
</if>
|
||||
<if test="tobaccoWine != null">tobacco_wine,
|
||||
</if>
|
||||
<if test="sleep != null">sleep,
|
||||
</if>
|
||||
<if test="emotion != null">emotion,
|
||||
</if>
|
||||
<if test="familySecurity != null">family_security,
|
||||
</if>
|
||||
<if test="createTime != null">create_time,
|
||||
</if>
|
||||
<if test="createBy != null">create_by,
|
||||
</if>
|
||||
<if test="updateBy != null">update_by,
|
||||
</if>
|
||||
<if test="updateTime != null">update_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="nursingName != null">#{nursingName},
|
||||
</if>
|
||||
<if test="tobaccoWine != null">#{tobaccoWine},
|
||||
</if>
|
||||
<if test="sleep != null">#{sleep},
|
||||
</if>
|
||||
<if test="emotion != null">#{emotion},
|
||||
</if>
|
||||
<if test="familySecurity != null">#{familySecurity},
|
||||
</if>
|
||||
<if test="createTime != null">#{createTime},
|
||||
</if>
|
||||
<if test="createBy != null">#{createBy},
|
||||
</if>
|
||||
<if test="updateBy != null">#{updateBy},
|
||||
</if>
|
||||
<if test="updateTime != null">#{updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateBaseNursingInfo" parameterType="BaseNursingInfo">
|
||||
update base_nursing_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="nursingName != null">nursing_name =
|
||||
#{nursingName},
|
||||
</if>
|
||||
<if test="tobaccoWine != null">tobacco_wine =
|
||||
#{tobaccoWine},
|
||||
</if>
|
||||
<if test="sleep != null">sleep =
|
||||
#{sleep},
|
||||
</if>
|
||||
<if test="emotion != null">emotion =
|
||||
#{emotion},
|
||||
</if>
|
||||
<if test="familySecurity != null">family_security =
|
||||
#{familySecurity},
|
||||
</if>
|
||||
<if test="createTime != null">create_time =
|
||||
#{createTime},
|
||||
</if>
|
||||
<if test="createBy != null">create_by =
|
||||
#{createBy},
|
||||
</if>
|
||||
<if test="updateBy != null">update_by =
|
||||
#{updateBy},
|
||||
</if>
|
||||
<if test="updateTime != null">update_time =
|
||||
#{updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBaseNursingInfoById" parameterType="Long">
|
||||
delete from base_nursing_info where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBaseNursingInfoByIds" parameterType="String">
|
||||
delete from base_nursing_info where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue
Block a user