Commit bae28f80 by 吴迪

Merge remote-tracking branch 'origin/master'

parents 7a7b4fa1 f25bddba
package io.office.modules.manage.controller;
import java.util.*;
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.*;
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){
medical.setId(UUID.randomUUID().toString());
medical.setInputDate(new Date());
// medicalService.insertMedical(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();
}
@GetMapping("/getMedicalTypeList")
public R getMedicalTypeList(){
List<Map<String,Object>> list = medicalService.getMedicalTypeList();
return R.ok().put("list",list);
}
}
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;
import java.util.List;
import java.util.Map;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2021-11-21 12:15:48
*/
@Mapper
public interface MedicalDao extends BaseMapper<MedicalEntity> {
List<Map<String, Object>> getMedicalTypeList();
}
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 com.fasterxml.jackson.annotation.JsonFormat;
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 String 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
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date releasetime;
/**
* $column.comments
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date implementationtime;
/**
* $column.comments
*/
private String remarks;
/**
* $column.comments
*/
private String content;
private Date inputDate;
}
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.List;
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);
List<Map<String, Object>> getMedicalTypeList();
}
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.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
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 {
@Autowired
MedicalDao medicalDao;
@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);
}
@Override
public List<Map<String, Object>> getMedicalTypeList() {
List<Map<String, Object>> list = this.medicalDao.getMedicalTypeList();
return list;
}
}
\ 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="io.office.modules.manage.dao.MedicalDao">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="io.office.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"/>
<result property="inputDate" column="inputDate"/>
</resultMap>
<select id="getMedicalTypeList" resultType="java.util.Map">
select * from medical_type t
</select>
</mapper>
\ No newline at end of file
......@@ -25,6 +25,7 @@
<select id="selectPictureList" resultMap="pictureMap" parameterType="io.office.modules.manage.entity.dto.PictureParams">
SELECT
t.pictureID,
t.title,
t.Picture_type,
t.showtime,
......
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