Commit 807f2032 by rongkailun

【新增】医疗管理基础代码

parent 9302282c
package io.office.modules.manage.controller;
import java.util.Arrays;
import java.util.Map;
import io.office.modules.manage.entity.MedicalEntity;
import io.office.modules.manage.service.MedicalService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import io.office.common.utils.PageUtils;
import io.office.common.utils.R;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2021-11-21 12:15:48
*/
@RestController
@RequestMapping("/medical")
public class MedicalController {
@Autowired
private MedicalService medicalService;
/**
* 列表
*/
@RequestMapping("/list")
// @RequiresPermissions("manage:medical:list")
public R list(@RequestParam Map<String, Object> params){
PageUtils page = medicalService.queryPage(params);
return R.ok().put("page", page);
}
/**
* 信息
*/
@RequestMapping("/info/{id}")
// @RequiresPermissions("manage:medical:info")
public R info(@PathVariable("id") Integer id){
MedicalEntity medical = medicalService.getById(id);
return R.ok().put("medical", medical);
}
/**
* 保存
*/
@RequestMapping("/save")
// @RequiresPermissions("manage:medical:save")
public R save(@RequestBody MedicalEntity medical){
medicalService.save(medical);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
// @RequiresPermissions("manage:medical:update")
public R update(@RequestBody MedicalEntity medical){
medicalService.updateById(medical);
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
// @RequiresPermissions("manage:medical:delete")
public R delete(@RequestBody Integer[] ids){
medicalService.removeByIds(Arrays.asList(ids));
return R.ok();
}
}
package io.office.modules.manage.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.office.modules.manage.entity.MedicalEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2021-11-21 12:15:48
*/
@Mapper
public interface MedicalDao extends BaseMapper<MedicalEntity> {
}
package io.office.modules.manage.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* ${comments}
*
* @author rkl
* @email
* @date 2021-11-21 12:15:48
*/
@Data
@TableName("medical")
public class MedicalEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* $column.comments
*/
@TableId
private Integer id;
/**
* $column.comments
*/
private String title;
/**
* $column.comments
*/
private String type;
/**
* $column.comments
*/
private Integer level;
/**
* $column.comments
*/
private String jumppath;
/**
* $column.comments
*/
private String keyword;
/**
* $column.comments
*/
private String source;
/**
* $column.comments
*/
private String author;
/**
* $column.comments
*/
private Date releasetime;
/**
* $column.comments
*/
private Date implementationtime;
/**
* $column.comments
*/
private String remarks;
/**
* $column.comments
*/
private String content;
}
package io.office.modules.manage.service;
import com.baomidou.mybatisplus.extension.service.IService;
import io.office.common.utils.PageUtils;
import io.office.modules.manage.entity.MedicalEntity;
import java.util.Map;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2021-11-21 12:15:48
*/
public interface MedicalService extends IService<MedicalEntity> {
PageUtils queryPage(Map<String, Object> params);
}
package io.office.modules.manage.service.impl;
import io.office.modules.manage.dao.MedicalDao;
import io.office.modules.manage.entity.MedicalEntity;
import io.office.modules.manage.service.MedicalService;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.office.common.utils.PageUtils;
import io.office.common.utils.Query;
@Service("medicalService")
public class MedicalServiceImpl extends ServiceImpl<MedicalDao, MedicalEntity> implements MedicalService {
@Override
public PageUtils queryPage(Map<String, Object> params) {
IPage<MedicalEntity> page = this.page(
new Query<MedicalEntity>().getPage(params),
new QueryWrapper<MedicalEntity>()
);
return new PageUtils(page);
}
}
\ No newline at end of file
<?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="modules.manage.dao.MedicalDao">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="modules.manage.entity.MedicalEntity" id="medicalMap">
<result property="id" column="id"/>
<result property="title" column="title"/>
<result property="type" column="type"/>
<result property="level" column="level"/>
<result property="jumppath" column="jumppath"/>
<result property="keyword" column="keyword"/>
<result property="source" column="source"/>
<result property="author" column="author"/>
<result property="releasetime" column="releaseTime"/>
<result property="implementationtime" column="implementationTime"/>
<result property="remarks" column="remarks"/>
<result property="content" column="content"/>
</resultMap>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment