Commit 19d271261ff138e23066d5800614a6ecf5f0f6b4
1 parent
63e68cd243
Exists in
master
医院消息内容
Showing 7 changed files with 183 additions and 3 deletions
- parent/base.common/src/main/java/com/lyms/base/common/dao/content/HospitalMessageTagsMapper.java
- parent/base.common/src/main/java/com/lyms/base/common/dao/content/HospitalMessageTagsMapper.xml
- parent/base.common/src/main/java/com/lyms/base/common/entity/content/HospitalMessageTags.java
- parent/base.common/src/main/java/com/lyms/base/common/service/content/HospitalMessageTagsService.java
- parent/base.common/src/main/java/com/lyms/base/common/service/content/impl/HospitalMessageTagsServiceImpl.java
- parent/center.manager/src/main/java/com/lyms/cm/controller/content/ContentDoctorMessageController.java
- parent/mybatis-plus/src/test/java/com/baomidou/mybatisplus/test/generator/MysqlGenerator.java
parent/base.common/src/main/java/com/lyms/base/common/dao/content/HospitalMessageTagsMapper.java
View file @
19d2712
1 | +package com.lyms.base.common.dao.content; | |
2 | + | |
3 | +import com.lyms.base.common.entity.content.HospitalMessageTags; | |
4 | +import com.baomidou.mybatisplus.mapper.BaseMapper; | |
5 | +import org.springframework.stereotype.Repository; | |
6 | +import java.io.Serializable; | |
7 | +/** | |
8 | + * <p> | |
9 | + * Mapper接口 | |
10 | + * </p> | |
11 | + * | |
12 | + * @author yangfei | |
13 | + * @since 2017-05-31 | |
14 | + */ | |
15 | +@Repository | |
16 | +public interface HospitalMessageTagsMapper extends BaseMapper<HospitalMessageTags> { | |
17 | + | |
18 | + public Integer deleteLogicById(Serializable id); | |
19 | + | |
20 | +} |
parent/base.common/src/main/java/com/lyms/base/common/dao/content/HospitalMessageTagsMapper.xml
View file @
19d2712
1 | +<?xml version="1.0" encoding="UTF-8"?> | |
2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
3 | +<mapper namespace="com.lyms.base.common.dao.content.HospitalMessageTagsMapper"> | |
4 | + | |
5 | + <!-- 通用查询映射结果 --> | |
6 | + <resultMap id="BaseResultMap" type="com.lyms.base.common.entity.content.HospitalMessageTags"> | |
7 | + <result column="ID" property="id" /> | |
8 | + <result column="HOSPITAL_MESSAGE_ID" property="hospitalMessageId" /> | |
9 | + <result column="TAGS_IDS" property="tagsIds" /> | |
10 | + </resultMap> | |
11 | + | |
12 | + <!-- 通用查询结果列 --> | |
13 | + <sql id="Base_Column_List"> | |
14 | + ID AS id, HOSPITAL_MESSAGE_ID AS hospitalMessageId, TAGS_IDS AS tagsIds | |
15 | + </sql> | |
16 | +</mapper> |
parent/base.common/src/main/java/com/lyms/base/common/entity/content/HospitalMessageTags.java
View file @
19d2712
1 | +package com.lyms.base.common.entity.content; | |
2 | + | |
3 | +import com.baomidou.mybatisplus.annotations.TableField; | |
4 | +import com.baomidou.mybatisplus.annotations.TableName; | |
5 | + | |
6 | +import java.io.Serializable; | |
7 | + | |
8 | +/** | |
9 | + * <p> | |
10 | + * | |
11 | + * </p> | |
12 | + * | |
13 | + * @author yangfei | |
14 | + * @since 2017-05-31 | |
15 | + */ | |
16 | +@TableName("HOSPITAL_MESSAGE_TAGS") | |
17 | +public class HospitalMessageTags implements Serializable { | |
18 | + | |
19 | + private static final long serialVersionUID = 1L; | |
20 | + | |
21 | + /** | |
22 | + * 主键 | |
23 | + */ | |
24 | + @TableField(value="ID") | |
25 | + private String id; | |
26 | + /** | |
27 | + * 医院消息ID | |
28 | + */ | |
29 | + @TableField(value="HOSPITAL_MESSAGE_ID") | |
30 | + private String hospitalMessageId; | |
31 | + /** | |
32 | + * 标签IDS | |
33 | + */ | |
34 | + @TableField(value="TAGS_IDS") | |
35 | + private String tagsIds; | |
36 | + | |
37 | + | |
38 | + public String getId() { | |
39 | + return id; | |
40 | + } | |
41 | + | |
42 | + public void setId(String id) { | |
43 | + this.id = id; | |
44 | + } | |
45 | + | |
46 | + public String getHospitalMessageId() { | |
47 | + return hospitalMessageId; | |
48 | + } | |
49 | + | |
50 | + public void setHospitalMessageId(String hospitalMessageId) { | |
51 | + this.hospitalMessageId = hospitalMessageId; | |
52 | + } | |
53 | + | |
54 | + public String getTagsIds() { | |
55 | + return tagsIds; | |
56 | + } | |
57 | + | |
58 | + public void setTagsIds(String tagsIds) { | |
59 | + this.tagsIds = tagsIds; | |
60 | + } | |
61 | + | |
62 | +} |
parent/base.common/src/main/java/com/lyms/base/common/service/content/HospitalMessageTagsService.java
View file @
19d2712
1 | +package com.lyms.base.common.service.content; | |
2 | + | |
3 | +import com.lyms.base.common.entity.content.HospitalMessageTags; | |
4 | +import com.lyms.web.service.BaseService; | |
5 | +import java.io.Serializable; | |
6 | + | |
7 | +/** | |
8 | + * <p> | |
9 | + * 服务类 | |
10 | + * </p> | |
11 | + * | |
12 | + * @author yangfei | |
13 | + * @since 2017-05-31 | |
14 | + */ | |
15 | +public interface HospitalMessageTagsService extends BaseService<HospitalMessageTags> { | |
16 | + | |
17 | + /** | |
18 | + * <li>@Description:逻辑删除,ifDel = 1 为删除,否则为没有删除 | |
19 | + * <li>@param id 删除主键id | |
20 | + * <li>@return 大于0修改成功,否则为失败 | |
21 | + */ | |
22 | + public Integer deleteLogicById(Serializable id); | |
23 | + | |
24 | +} |
parent/base.common/src/main/java/com/lyms/base/common/service/content/impl/HospitalMessageTagsServiceImpl.java
View file @
19d2712
1 | +package com.lyms.base.common.service.content.impl; | |
2 | + | |
3 | +import com.lyms.base.common.entity.content.HospitalMessageTags; | |
4 | +import com.lyms.base.common.dao.content.HospitalMessageTagsMapper; | |
5 | +import com.lyms.base.common.service.content.HospitalMessageTagsService; | |
6 | +import com.baomidou.mybatisplus.service.impl.ServiceImpl; | |
7 | +import org.springframework.stereotype.Service; | |
8 | +import java.io.Serializable; | |
9 | + | |
10 | +/** | |
11 | + * <p> | |
12 | + * 服务实现类 | |
13 | + * </p> | |
14 | + * | |
15 | + * @author yangfei | |
16 | + * @since 2017-05-31 | |
17 | + */ | |
18 | +@Service | |
19 | +public class HospitalMessageTagsServiceImpl extends ServiceImpl<HospitalMessageTagsMapper, HospitalMessageTags> implements HospitalMessageTagsService { | |
20 | + | |
21 | + public Integer deleteLogicById(Serializable id){ | |
22 | + return baseMapper.deleteLogicById(id); | |
23 | + } | |
24 | +} |
parent/center.manager/src/main/java/com/lyms/cm/controller/content/ContentDoctorMessageController.java
View file @
19d2712
1 | 1 | package com.lyms.cm.controller.content; |
2 | 2 | |
3 | +import com.baomidou.mybatisplus.mapper.EntityWrapper; | |
4 | +import com.baomidou.mybatisplus.mapper.Wrapper; | |
5 | +import com.baomidou.mybatisplus.plugins.Page; | |
6 | +import com.lyms.base.common.entity.content.ContentDoctorMessage; | |
7 | +import com.lyms.base.common.service.content.ContentDoctorMessageService; | |
3 | 8 | import com.lyms.web.controller.BaseController; |
9 | +import org.apache.commons.lang.StringUtils; | |
10 | +import org.springframework.beans.factory.annotation.Autowired; | |
4 | 11 | import org.springframework.stereotype.Controller; |
5 | 12 | import org.springframework.web.bind.annotation.RequestMapping; |
13 | +import org.springframework.web.bind.annotation.ResponseBody; | |
6 | 14 | |
15 | +import java.util.Map; | |
16 | + | |
7 | 17 | /** |
8 | 18 | * <p> |
9 | 19 | * 医院消息 前端控制器 |
... | ... | @@ -15,6 +25,30 @@ |
15 | 25 | @Controller |
16 | 26 | @RequestMapping("/contentDoctorMessage") |
17 | 27 | public class ContentDoctorMessageController extends BaseController { |
18 | - | |
28 | + //医院信息 | |
29 | + @Autowired | |
30 | + private ContentDoctorMessageService contentDoctorMessageService; | |
31 | + | |
32 | + /** | |
33 | + * 获取消息内容列表 | |
34 | + * | |
35 | + * @param cdMsg 医院消息对象 | |
36 | + * @return 医院消息列表 | |
37 | + */ | |
38 | + @ResponseBody | |
39 | + public Map<String, Object> list(ContentDoctorMessage cdMsg) { | |
40 | + Page<ContentDoctorMessage> page = getPage(); | |
41 | + Wrapper<ContentDoctorMessage> wrapper = new EntityWrapper<ContentDoctorMessage>(); | |
42 | + if (StringUtils.isNotEmpty(cdMsg.getContent())) { | |
43 | + wrapper.like("CONTENT", cdMsg.getContent()); | |
44 | + } | |
45 | + // | |
46 | + // if(cdMsg.gett){ | |
47 | + // | |
48 | + // } | |
49 | + contentDoctorMessageService.selectMapsPage(page, wrapper); | |
50 | + return null; | |
51 | + | |
52 | + } | |
19 | 53 | } |
parent/mybatis-plus/src/test/java/com/baomidou/mybatisplus/test/generator/MysqlGenerator.java
View file @
19d2712
... | ... | @@ -47,7 +47,7 @@ |
47 | 47 | |
48 | 48 | // strategy.setInclude(new String[] { |
49 | 49 | // "SYS_USERS","SYS_USER_ROLE_MAPS","SYS_ROLES" }); // 需要生成的表 |
50 | - strategy.setInclude(new String[] { "HOSPITAL_MESSAGE_VERSION"}); // 需要生成的表 | |
50 | + strategy.setInclude(new String[] { "HOSPITAL_MESSAGE_TAGS"}); // 需要生成的表 | |
51 | 51 | pc.setParent("com.lyms.base.common"); |
52 | 52 | // pc.setParent("com.lyms.base.common"); |
53 | 53 | |
... | ... | @@ -111,7 +111,7 @@ |
111 | 111 | StrategyConfig strategy = new StrategyConfig(); |
112 | 112 | // strategy.setTablePrefix("bmd_");// 此处可以修改为您的表前缀 |
113 | 113 | strategy.setNaming(NamingStrategy.underline_to_camel);// 表名生成策略 |
114 | - strategy.setInclude(new String[] { "user" }); // 需要生成的表 | |
114 | + strategy.setInclude(new String[] { "HOSPITAL_MESSAGE_TAGS" }); // 需要生成的表 | |
115 | 115 | // strategy.setExclude(new String[]{"test"}); // 排除生成的表 |
116 | 116 | // 字段名生成策略 |
117 | 117 | strategy.setFieldNaming(NamingStrategy.underline_to_camel); |