Commit 29e397345d0588f078c40b6bf6515f04c033f2f3

Authored by shiyang
1 parent c14dfcf9d9
Exists in master

文章查询BUG修复

Showing 7 changed files with 429 additions and 6 deletions

talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/ArticleController.java View file @ 29e3973
... ... @@ -44,6 +44,7 @@
44 44  
45 45 @Autowired
46 46 private ArticleInfoService articleInfoService;
  47 + private ArticleInfo2Service articleInfoService2;
47 48  
48 49 @Autowired
49 50 private LymsPushedartService lymsPushedartService;//推送记录
... ... @@ -124,7 +125,7 @@
124 125 }
125 126  
126 127 /**
127   - * 获取文章列表
  128 + * PC-获取文章列表
128 129 *
129 130 * @param article
130 131 * @param current
... ... @@ -163,6 +164,50 @@
163 164 query.orderByAsc("createdtime");
164 165 }
165 166 articlePagePage = articleInfoService.page(page, query);
  167 + baseResponse.setObject(articlePagePage);
  168 +
  169 + return baseResponse;
  170 + }
  171 + /**
  172 + * 小程序-获取文章列表
  173 + *
  174 + * @param article
  175 + * @param current
  176 + * @param size
  177 + * @param sort
  178 + * @return
  179 + */
  180 + @GetMapping("sltArticleLst2")
  181 + @TokenRequired
  182 + public BaseResponse sltArticleLst2(ArticleInfo2 article, int current, int size, int sort) {
  183 + BaseResponse baseResponse = new BaseResponse();
  184 + Page<ArticleInfo2> page = new Page<>(current, size);
  185 + Page<ArticleInfo2> articlePagePage = new Page<>();
  186 + QueryWrapper query=new QueryWrapper();
  187 + if(!StringUtils.isEmpty(article.getIid())){
  188 + query.eq("iid",article.getIid());
  189 + }
  190 + if(!StringUtils.isEmpty(article.getAid())){
  191 + query.eq("aid",article.getAid());
  192 + }
  193 +
  194 + if(StringUtils.isEmpty(article.getTitle())){
  195 + article.setTitle(null);
  196 + }else{
  197 + query.like("title",article.getTitle());
  198 + }
  199 +
  200 + if(null!=article.getArticleType()){
  201 + query.eq("article_type",article.getArticleType());
  202 + }
  203 +
  204 + if (sort == 1) {
  205 + query.orderByDesc("createdtime");
  206 + }
  207 + if (sort == 2) {
  208 + query.orderByAsc("createdtime");
  209 + }
  210 + articlePagePage = articleInfoService2.page(page, query);
166 211 baseResponse.setObject(articlePagePage);
167 212  
168 213 return baseResponse;
talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/ArticleInfo.java View file @ 29e3973
... ... @@ -169,11 +169,6 @@
169 169 @TableField(value = "weix_text_two")
170 170 private String weixTextTwo;
171 171  
172   - /**
173   - * 文章推送时间
174   - */
175   - @TableField(value = "lpcreatedtime")
176   - private String lpcreatedtime;
177 172  
178 173 @Override
179 174 public boolean equals(Object that) {
talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/ArticleInfo2.java View file @ 29e3973
  1 +package com.lyms.talkonlineweb.domain;
  2 +
  3 +import com.baomidou.mybatisplus.annotation.IdType;
  4 +import com.baomidou.mybatisplus.annotation.TableField;
  5 +import com.baomidou.mybatisplus.annotation.TableId;
  6 +import com.baomidou.mybatisplus.annotation.TableName;
  7 +import java.io.Serializable;
  8 +import java.util.Date;
  9 +import lombok.Data;
  10 +
  11 +/**
  12 + *
  13 + * @TableName article_info2
  14 + */
  15 +@TableName(value ="article_info2")
  16 +@Data
  17 +public class ArticleInfo2 implements Serializable {
  18 +
  19 +
  20 + /**
  21 + *
  22 + */
  23 + @TableField(value = "aid")
  24 + private Integer aid;
  25 +
  26 + /**
  27 + * 科室id
  28 + */
  29 + @TableField(value = "did")
  30 + private Integer did;
  31 +
  32 + /**
  33 + * 疾病id
  34 + */
  35 + @TableField(value = "iid")
  36 + private Integer iid;
  37 +
  38 + /**
  39 + * 文章标题
  40 + */
  41 + @TableField(value = "title")
  42 + private String title;
  43 +
  44 + /**
  45 + * 文章内容
  46 + */
  47 + @TableField(value = "content")
  48 + private String content;
  49 +
  50 + /**
  51 + * 是否发布. 0,否;1是
  52 + */
  53 + @TableField(value = "stat")
  54 + private Byte stat;
  55 +
  56 + /**
  57 + * 创建人id
  58 + */
  59 + @TableField(value = "createdby")
  60 + private Integer createdby;
  61 +
  62 + /**
  63 + * 创建人姓名
  64 + */
  65 + @TableField(value = "cname")
  66 + private String cname;
  67 +
  68 + /**
  69 + * 创建时间
  70 + */
  71 + @TableField(value = "createdtime")
  72 + private Date createdtime;
  73 +
  74 + /**
  75 + * 更新人id
  76 + */
  77 + @TableField(value = "updatedby")
  78 + private Integer updatedby;
  79 +
  80 + /**
  81 + * 更新人姓名
  82 + */
  83 + @TableField(value = "uname")
  84 + private String uname;
  85 +
  86 + /**
  87 + * 更新时间
  88 + */
  89 + @TableField(value = "updated_time")
  90 + private Date updatedTime;
  91 +
  92 + /**
  93 + * 科室标识
  94 + */
  95 + @TableField(value = "hddid")
  96 + private Integer hddid;
  97 +
  98 + /**
  99 + * 科室名称
  100 + */
  101 + @TableField(value = "dname")
  102 + private String dname;
  103 +
  104 + /**
  105 + * 所属医院id
  106 + */
  107 + @TableField(value = "hid")
  108 + private Integer hid;
  109 +
  110 + /**
  111 + * 所属医院名称
  112 + */
  113 + @TableField(value = "hname")
  114 + private String hname;
  115 +
  116 + /**
  117 + * 详细科目
  118 + */
  119 + @TableField(value = "subcatalog")
  120 + private String subcatalog;
  121 +
  122 + /**
  123 + * 科室介绍
  124 + */
  125 + @TableField(value = "intro")
  126 + private String intro;
  127 +
  128 + /**
  129 + *
  130 + */
  131 + @TableField(value = "id")
  132 + private Integer id;
  133 +
  134 + /**
  135 + * 编码
  136 + */
  137 + @TableField(value = "code")
  138 + private Integer code;
  139 +
  140 + /**
  141 + * 取值
  142 + */
  143 + @TableField(value = "value")
  144 + private String value;
  145 +
  146 +
  147 + /**
  148 + * 文章类型,推送文章按类别依次推送1-12
  149 + * 1.治疗2.护理3.病因4.预防5.症状6.相关问题7.好发人群8.分型9.检查10.并发症11.鉴别12.定义
  150 + */
  151 + @TableField(value = "article_type")
  152 + private Integer articleType;
  153 +
  154 + /**
  155 + * 每个疾病文章的序号(1-100)
  156 + */
  157 + @TableField(value = "serial_number")
  158 + private Integer serialNumber;
  159 +
  160 + /**
  161 + * 短文字1(公众号推送内容)
  162 + */
  163 + @TableField(value = "weix_text_one")
  164 + private String weixTextOne;
  165 +
  166 + /**
  167 + * 短文字2(公众号推送内容)
  168 + */
  169 + @TableField(value = "weix_text_two")
  170 + private String weixTextTwo;
  171 +
  172 + /**
  173 + * 文章推送时间
  174 + */
  175 + @TableField(value = "lpcreatedtime")
  176 + private String lpcreatedtime;
  177 +
  178 + @TableField(exist = false)
  179 + private static final long serialVersionUID = 1L;
  180 +
  181 + @Override
  182 + public boolean equals(Object that) {
  183 + if (this == that) {
  184 + return true;
  185 + }
  186 + if (that == null) {
  187 + return false;
  188 + }
  189 + if (getClass() != that.getClass()) {
  190 + return false;
  191 + }
  192 + ArticleInfo2 other = (ArticleInfo2) that;
  193 + return (this.getAid() == null ? other.getAid() == null : this.getAid().equals(other.getAid()))
  194 + && (this.getDid() == null ? other.getDid() == null : this.getDid().equals(other.getDid()))
  195 + && (this.getIid() == null ? other.getIid() == null : this.getIid().equals(other.getIid()))
  196 + && (this.getTitle() == null ? other.getTitle() == null : this.getTitle().equals(other.getTitle()))
  197 + && (this.getContent() == null ? other.getContent() == null : this.getContent().equals(other.getContent()))
  198 + && (this.getStat() == null ? other.getStat() == null : this.getStat().equals(other.getStat()))
  199 + && (this.getCreatedby() == null ? other.getCreatedby() == null : this.getCreatedby().equals(other.getCreatedby()))
  200 + && (this.getCname() == null ? other.getCname() == null : this.getCname().equals(other.getCname()))
  201 + && (this.getCreatedtime() == null ? other.getCreatedtime() == null : this.getCreatedtime().equals(other.getCreatedtime()))
  202 + && (this.getUpdatedby() == null ? other.getUpdatedby() == null : this.getUpdatedby().equals(other.getUpdatedby()))
  203 + && (this.getUname() == null ? other.getUname() == null : this.getUname().equals(other.getUname()))
  204 + && (this.getUpdatedTime() == null ? other.getUpdatedTime() == null : this.getUpdatedTime().equals(other.getUpdatedTime()))
  205 + && (this.getArticleType() == null ? other.getArticleType() == null : this.getArticleType().equals(other.getArticleType()))
  206 + && (this.getSerialNumber() == null ? other.getSerialNumber() == null : this.getSerialNumber().equals(other.getSerialNumber()))
  207 + && (this.getWeixTextOne() == null ? other.getWeixTextOne() == null : this.getWeixTextOne().equals(other.getWeixTextOne()))
  208 + && (this.getWeixTextTwo() == null ? other.getWeixTextTwo() == null : this.getWeixTextTwo().equals(other.getWeixTextTwo()))
  209 + && (this.getHddid() == null ? other.getHddid() == null : this.getHddid().equals(other.getHddid()))
  210 + && (this.getDname() == null ? other.getDname() == null : this.getDname().equals(other.getDname()))
  211 + && (this.getHid() == null ? other.getHid() == null : this.getHid().equals(other.getHid()))
  212 + && (this.getHname() == null ? other.getHname() == null : this.getHname().equals(other.getHname()))
  213 + && (this.getSubcatalog() == null ? other.getSubcatalog() == null : this.getSubcatalog().equals(other.getSubcatalog()))
  214 + && (this.getIntro() == null ? other.getIntro() == null : this.getIntro().equals(other.getIntro()))
  215 + && (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
  216 + && (this.getCode() == null ? other.getCode() == null : this.getCode().equals(other.getCode()))
  217 + && (this.getValue() == null ? other.getValue() == null : this.getValue().equals(other.getValue()))
  218 + && (this.getLpcreatedtime() == null ? other.getLpcreatedtime() == null : this.getLpcreatedtime().equals(other.getLpcreatedtime()));
  219 + }
  220 +
  221 + @Override
  222 + public int hashCode() {
  223 + final int prime = 31;
  224 + int result = 1;
  225 + result = prime * result + ((getAid() == null) ? 0 : getAid().hashCode());
  226 + result = prime * result + ((getDid() == null) ? 0 : getDid().hashCode());
  227 + result = prime * result + ((getIid() == null) ? 0 : getIid().hashCode());
  228 + result = prime * result + ((getTitle() == null) ? 0 : getTitle().hashCode());
  229 + result = prime * result + ((getContent() == null) ? 0 : getContent().hashCode());
  230 + result = prime * result + ((getStat() == null) ? 0 : getStat().hashCode());
  231 + result = prime * result + ((getCreatedby() == null) ? 0 : getCreatedby().hashCode());
  232 + result = prime * result + ((getCname() == null) ? 0 : getCname().hashCode());
  233 + result = prime * result + ((getCreatedtime() == null) ? 0 : getCreatedtime().hashCode());
  234 + result = prime * result + ((getUpdatedby() == null) ? 0 : getUpdatedby().hashCode());
  235 + result = prime * result + ((getUname() == null) ? 0 : getUname().hashCode());
  236 + result = prime * result + ((getUpdatedTime() == null) ? 0 : getUpdatedTime().hashCode());
  237 + result = prime * result + ((getArticleType() == null) ? 0 : getArticleType().hashCode());
  238 + result = prime * result + ((getSerialNumber() == null) ? 0 : getSerialNumber().hashCode());
  239 + result = prime * result + ((getWeixTextOne() == null) ? 0 : getWeixTextOne().hashCode());
  240 + result = prime * result + ((getWeixTextTwo() == null) ? 0 : getWeixTextTwo().hashCode());
  241 + result = prime * result + ((getHddid() == null) ? 0 : getHddid().hashCode());
  242 + result = prime * result + ((getDname() == null) ? 0 : getDname().hashCode());
  243 + result = prime * result + ((getHid() == null) ? 0 : getHid().hashCode());
  244 + result = prime * result + ((getHname() == null) ? 0 : getHname().hashCode());
  245 + result = prime * result + ((getSubcatalog() == null) ? 0 : getSubcatalog().hashCode());
  246 + result = prime * result + ((getIntro() == null) ? 0 : getIntro().hashCode());
  247 + result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
  248 + result = prime * result + ((getCode() == null) ? 0 : getCode().hashCode());
  249 + result = prime * result + ((getValue() == null) ? 0 : getValue().hashCode());
  250 + result = prime * result + ((getLpcreatedtime() == null) ? 0 : getLpcreatedtime().hashCode());
  251 + return result;
  252 + }
  253 +
  254 + @Override
  255 + public String toString() {
  256 + StringBuilder sb = new StringBuilder();
  257 + sb.append(getClass().getSimpleName());
  258 + sb.append(" [");
  259 + sb.append("Hash = ").append(hashCode());
  260 + sb.append(", aid=").append(aid);
  261 + sb.append(", did=").append(did);
  262 + sb.append(", iid=").append(iid);
  263 + sb.append(", title=").append(title);
  264 + sb.append(", content=").append(content);
  265 + sb.append(", stat=").append(stat);
  266 + sb.append(", createdby=").append(createdby);
  267 + sb.append(", cname=").append(cname);
  268 + sb.append(", createdtime=").append(createdtime);
  269 + sb.append(", updatedby=").append(updatedby);
  270 + sb.append(", uname=").append(uname);
  271 + sb.append(", updatedTime=").append(updatedTime);
  272 + sb.append(", articleType=").append(articleType);
  273 + sb.append(", serialNumber=").append(serialNumber);
  274 + sb.append(", weixTextOne=").append(weixTextOne);
  275 + sb.append(", weixTextTwo=").append(weixTextTwo);
  276 + sb.append(", hddid=").append(hddid);
  277 + sb.append(", dname=").append(dname);
  278 + sb.append(", hid=").append(hid);
  279 + sb.append(", hname=").append(hname);
  280 + sb.append(", subcatalog=").append(subcatalog);
  281 + sb.append(", intro=").append(intro);
  282 + sb.append(", id=").append(id);
  283 + sb.append(", code=").append(code);
  284 + sb.append(", value=").append(value);
  285 + sb.append(", lpcreatedtime=").append(lpcreatedtime);
  286 + sb.append(", serialVersionUID=").append(serialVersionUID);
  287 + sb.append("]");
  288 + return sb.toString();
  289 + }
  290 +}
talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/ArticleInfo2Mapper.java View file @ 29e3973
  1 +package com.lyms.talkonlineweb.mapper;
  2 +
  3 +import com.lyms.talkonlineweb.domain.ArticleInfo2;
  4 +import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  5 +
  6 +/**
  7 + * @Entity com.lyms.talkonlineweb.domain.ArticleInfo2
  8 + */
  9 +public interface ArticleInfo2Mapper extends BaseMapper<ArticleInfo2> {
  10 +
  11 +}
talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/ArticleInfo2Service.java View file @ 29e3973
  1 +package com.lyms.talkonlineweb.service;
  2 +
  3 +import com.lyms.talkonlineweb.domain.ArticleInfo2;
  4 +import com.baomidou.mybatisplus.extension.service.IService;
  5 +
  6 +/**
  7 + *
  8 + */
  9 +public interface ArticleInfo2Service extends IService<ArticleInfo2> {
  10 +
  11 +}
talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/ArticleInfo2ServiceImpl.java View file @ 29e3973
  1 +package com.lyms.talkonlineweb.service.impl;
  2 +
  3 +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
  4 +import com.lyms.talkonlineweb.domain.ArticleInfo2;
  5 +import com.lyms.talkonlineweb.service.ArticleInfo2Service;
  6 +import com.lyms.talkonlineweb.mapper.ArticleInfo2Mapper;
  7 +import org.springframework.stereotype.Service;
  8 +
  9 +/**
  10 + *
  11 + */
  12 +@Service
  13 +public class ArticleInfo2ServiceImpl extends ServiceImpl<ArticleInfo2Mapper, ArticleInfo2>
  14 + implements ArticleInfo2Service{
  15 +
  16 +}
talkonlineweb/src/main/resources/mapper/ArticleInfo2Mapper.xml View file @ 29e3973
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE mapper
  3 + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4 + "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5 +<mapper namespace="com.lyms.talkonlineweb.mapper.ArticleInfo2Mapper">
  6 +
  7 + <resultMap id="BaseResultMap" type="com.lyms.talkonlineweb.domain.ArticleInfo2">
  8 + <result property="aid" column="aid" jdbcType="INTEGER"/>
  9 + <result property="did" column="did" jdbcType="INTEGER"/>
  10 + <result property="iid" column="iid" jdbcType="INTEGER"/>
  11 + <result property="title" column="title" jdbcType="VARCHAR"/>
  12 + <result property="content" column="content" jdbcType="VARCHAR"/>
  13 + <result property="stat" column="stat" jdbcType="TINYINT"/>
  14 + <result property="createdby" column="createdby" jdbcType="INTEGER"/>
  15 + <result property="cname" column="cname" jdbcType="VARCHAR"/>
  16 + <result property="createdtime" column="createdtime" jdbcType="TIMESTAMP"/>
  17 + <result property="updatedby" column="updatedby" jdbcType="INTEGER"/>
  18 + <result property="uname" column="uname" jdbcType="VARCHAR"/>
  19 + <result property="updatedTime" column="updated_time" jdbcType="TIMESTAMP"/>
  20 + <result property="articleType" column="article_type" jdbcType="INTEGER"/>
  21 + <result property="serialNumber" column="serial_number" jdbcType="INTEGER"/>
  22 + <result property="weixTextOne" column="weix_text_one" jdbcType="VARCHAR"/>
  23 + <result property="weixTextTwo" column="weix_text_two" jdbcType="VARCHAR"/>
  24 + <result property="hddid" column="hddid" jdbcType="INTEGER"/>
  25 + <result property="dname" column="dname" jdbcType="VARCHAR"/>
  26 + <result property="hid" column="hid" jdbcType="INTEGER"/>
  27 + <result property="hname" column="hname" jdbcType="VARCHAR"/>
  28 + <result property="subcatalog" column="subcatalog" jdbcType="VARCHAR"/>
  29 + <result property="intro" column="intro" jdbcType="VARCHAR"/>
  30 + <result property="id" column="id" jdbcType="INTEGER"/>
  31 + <result property="code" column="code" jdbcType="INTEGER"/>
  32 + <result property="value" column="value" jdbcType="VARCHAR"/>
  33 + <result property="lpcreatedtime" column="lpcreatedtime" jdbcType="TIMESTAMP"/>
  34 + </resultMap>
  35 +
  36 + <sql id="Base_Column_List">
  37 + aid,did,iid,
  38 + title,content,stat,
  39 + createdby,cname,createdtime,
  40 + updatedby,uname,updated_time,
  41 + article_type,serial_number,weix_text_one,
  42 + weix_text_two,hddid,dname,
  43 + hid,hname,subcatalog,
  44 + intro,id,code,
  45 + value,lpcreatedtime
  46 + </sql>
  47 +</mapper>