Commit f25bddba by rongkailun

【新增】图片资讯列表添加id

parent abb54dda
package io.office.modules.manage.controller; package io.office.modules.manage.controller;
import java.util.Arrays; import java.util.*;
import java.util.Map;
import io.office.modules.manage.entity.MedicalEntity; import io.office.modules.manage.entity.MedicalEntity;
import io.office.modules.manage.service.MedicalService; import io.office.modules.manage.service.MedicalService;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.*;
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.PageUtils;
import io.office.common.utils.R; import io.office.common.utils.R;
...@@ -60,9 +55,10 @@ public class MedicalController { ...@@ -60,9 +55,10 @@ public class MedicalController {
@RequestMapping("/save") @RequestMapping("/save")
// @RequiresPermissions("manage:medical:save") // @RequiresPermissions("manage:medical:save")
public R save(@RequestBody MedicalEntity medical){ public R save(@RequestBody MedicalEntity medical){
medicalService.save(medical); medical.setId(UUID.randomUUID().toString());
medical.setInputDate(new Date());
return R.ok(); // medicalService.insertMedical(medical);
return R.ok("新增成功!");
} }
/** /**
...@@ -87,4 +83,10 @@ public class MedicalController { ...@@ -87,4 +83,10 @@ public class MedicalController {
return R.ok(); return R.ok();
} }
@GetMapping("/getMedicalTypeList")
public R getMedicalTypeList(){
List<Map<String,Object>> list = medicalService.getMedicalTypeList();
return R.ok().put("list",list);
}
} }
...@@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.office.modules.manage.entity.MedicalEntity; import io.office.modules.manage.entity.MedicalEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
/** /**
* ${comments} * ${comments}
* *
...@@ -13,5 +16,8 @@ import org.apache.ibatis.annotations.Mapper; ...@@ -13,5 +16,8 @@ import org.apache.ibatis.annotations.Mapper;
*/ */
@Mapper @Mapper
public interface MedicalDao extends BaseMapper<MedicalEntity> { public interface MedicalDao extends BaseMapper<MedicalEntity> {
List<Map<String, Object>> getMedicalTypeList();
} }
...@@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.annotation.TableName; ...@@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
/** /**
...@@ -23,7 +25,7 @@ public class MedicalEntity implements Serializable { ...@@ -23,7 +25,7 @@ public class MedicalEntity implements Serializable {
* $column.comments * $column.comments
*/ */
@TableId @TableId
private Integer id; private String id;
/** /**
* $column.comments * $column.comments
*/ */
...@@ -55,10 +57,12 @@ public class MedicalEntity implements Serializable { ...@@ -55,10 +57,12 @@ public class MedicalEntity implements Serializable {
/** /**
* $column.comments * $column.comments
*/ */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date releasetime; private Date releasetime;
/** /**
* $column.comments * $column.comments
*/ */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date implementationtime; private Date implementationtime;
/** /**
* $column.comments * $column.comments
...@@ -69,4 +73,6 @@ public class MedicalEntity implements Serializable { ...@@ -69,4 +73,6 @@ public class MedicalEntity implements Serializable {
*/ */
private String content; private String content;
private Date inputDate;
} }
...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService; ...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import io.office.common.utils.PageUtils; import io.office.common.utils.PageUtils;
import io.office.modules.manage.entity.MedicalEntity; import io.office.modules.manage.entity.MedicalEntity;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
...@@ -16,5 +17,8 @@ import java.util.Map; ...@@ -16,5 +17,8 @@ import java.util.Map;
public interface MedicalService extends IService<MedicalEntity> { public interface MedicalService extends IService<MedicalEntity> {
PageUtils queryPage(Map<String, Object> params); PageUtils queryPage(Map<String, Object> params);
List<Map<String, Object>> getMedicalTypeList();
} }
...@@ -3,7 +3,10 @@ package io.office.modules.manage.service.impl; ...@@ -3,7 +3,10 @@ package io.office.modules.manage.service.impl;
import io.office.modules.manage.dao.MedicalDao; import io.office.modules.manage.dao.MedicalDao;
import io.office.modules.manage.entity.MedicalEntity; import io.office.modules.manage.entity.MedicalEntity;
import io.office.modules.manage.service.MedicalService; import io.office.modules.manage.service.MedicalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map; import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
...@@ -16,6 +19,9 @@ import io.office.common.utils.Query; ...@@ -16,6 +19,9 @@ import io.office.common.utils.Query;
@Service("medicalService") @Service("medicalService")
public class MedicalServiceImpl extends ServiceImpl<MedicalDao, MedicalEntity> implements MedicalService { public class MedicalServiceImpl extends ServiceImpl<MedicalDao, MedicalEntity> implements MedicalService {
@Autowired
MedicalDao medicalDao;
@Override @Override
public PageUtils queryPage(Map<String, Object> params) { public PageUtils queryPage(Map<String, Object> params) {
IPage<MedicalEntity> page = this.page( IPage<MedicalEntity> page = this.page(
...@@ -26,4 +32,10 @@ public class MedicalServiceImpl extends ServiceImpl<MedicalDao, MedicalEntity> i ...@@ -26,4 +32,10 @@ public class MedicalServiceImpl extends ServiceImpl<MedicalDao, MedicalEntity> i
return new PageUtils(page); 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
...@@ -17,7 +17,11 @@ ...@@ -17,7 +17,11 @@
<result property="implementationtime" column="implementationTime"/> <result property="implementationtime" column="implementationTime"/>
<result property="remarks" column="remarks"/> <result property="remarks" column="remarks"/>
<result property="content" column="content"/> <result property="content" column="content"/>
<result property="inputDate" column="inputDate"/>
</resultMap> </resultMap>
<select id="getMedicalTypeList" resultType="java.util.Map">
select * from medical_type t
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
<select id="selectPictureList" resultMap="pictureMap" parameterType="io.office.modules.manage.entity.dto.PictureParams"> <select id="selectPictureList" resultMap="pictureMap" parameterType="io.office.modules.manage.entity.dto.PictureParams">
SELECT SELECT
t.pictureID,
t.title, t.title,
t.Picture_type, t.Picture_type,
t.showtime, 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