From 29e397345d0588f078c40b6bf6515f04c033f2f3 Mon Sep 17 00:00:00 2001 From: shiyang <316555390@qq.com> Date: Mon, 18 Apr 2022 10:03:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E7=AB=A0=E6=9F=A5=E8=AF=A2BUG?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ArticleController.java | 47 +++- .../com/lyms/talkonlineweb/domain/ArticleInfo.java | 5 - .../lyms/talkonlineweb/domain/ArticleInfo2.java | 290 +++++++++++++++++++++ .../talkonlineweb/mapper/ArticleInfo2Mapper.java | 15 ++ .../talkonlineweb/service/ArticleInfo2Service.java | 11 + .../service/impl/ArticleInfo2ServiceImpl.java | 20 ++ .../main/resources/mapper/ArticleInfo2Mapper.xml | 47 ++++ 7 files changed, 429 insertions(+), 6 deletions(-) create mode 100644 talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/ArticleInfo2.java create mode 100644 talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/ArticleInfo2Mapper.java create mode 100644 talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/ArticleInfo2Service.java create mode 100644 talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/ArticleInfo2ServiceImpl.java create mode 100644 talkonlineweb/src/main/resources/mapper/ArticleInfo2Mapper.xml diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/ArticleController.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/ArticleController.java index e38f509..8f7b1d1 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/ArticleController.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/ArticleController.java @@ -44,6 +44,7 @@ public class ArticleController { @Autowired private ArticleInfoService articleInfoService; + private ArticleInfo2Service articleInfoService2; @Autowired private LymsPushedartService lymsPushedartService;//推送记录 @@ -124,7 +125,7 @@ public class ArticleController { } /** - * 获取文章列表 + * PC-获取文章列表 * * @param article * @param current @@ -167,6 +168,50 @@ public class ArticleController { return baseResponse; } + /** + * 小程序-获取文章列表 + * + * @param article + * @param current + * @param size + * @param sort + * @return + */ + @GetMapping("sltArticleLst2") + @TokenRequired + public BaseResponse sltArticleLst2(ArticleInfo2 article, int current, int size, int sort) { + BaseResponse baseResponse = new BaseResponse(); + Page page = new Page<>(current, size); + Page articlePagePage = new Page<>(); + QueryWrapper query=new QueryWrapper(); + if(!StringUtils.isEmpty(article.getIid())){ + query.eq("iid",article.getIid()); + } + if(!StringUtils.isEmpty(article.getAid())){ + query.eq("aid",article.getAid()); + } + + if(StringUtils.isEmpty(article.getTitle())){ + article.setTitle(null); + }else{ + query.like("title",article.getTitle()); + } + + if(null!=article.getArticleType()){ + query.eq("article_type",article.getArticleType()); + } + + if (sort == 1) { + query.orderByDesc("createdtime"); + } + if (sort == 2) { + query.orderByAsc("createdtime"); + } + articlePagePage = articleInfoService2.page(page, query); + baseResponse.setObject(articlePagePage); + + return baseResponse; + } /** * 删除文章 diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/ArticleInfo.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/ArticleInfo.java index 5136d67..0100929 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/ArticleInfo.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/ArticleInfo.java @@ -169,11 +169,6 @@ public class ArticleInfo implements Serializable { @TableField(value = "weix_text_two") private String weixTextTwo; - /** - * 文章推送时间 - */ - @TableField(value = "lpcreatedtime") - private String lpcreatedtime; @Override public boolean equals(Object that) { diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/ArticleInfo2.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/ArticleInfo2.java new file mode 100644 index 0000000..ac3dc83 --- /dev/null +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/ArticleInfo2.java @@ -0,0 +1,290 @@ +package com.lyms.talkonlineweb.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * + * @TableName article_info2 + */ +@TableName(value ="article_info2") +@Data +public class ArticleInfo2 implements Serializable { + + + /** + * + */ + @TableField(value = "aid") + private Integer aid; + + /** + * 科室id + */ + @TableField(value = "did") + private Integer did; + + /** + * 疾病id + */ + @TableField(value = "iid") + private Integer iid; + + /** + * 文章标题 + */ + @TableField(value = "title") + private String title; + + /** + * 文章内容 + */ + @TableField(value = "content") + private String content; + + /** + * 是否发布. 0,否;1是 + */ + @TableField(value = "stat") + private Byte stat; + + /** + * 创建人id + */ + @TableField(value = "createdby") + private Integer createdby; + + /** + * 创建人姓名 + */ + @TableField(value = "cname") + private String cname; + + /** + * 创建时间 + */ + @TableField(value = "createdtime") + private Date createdtime; + + /** + * 更新人id + */ + @TableField(value = "updatedby") + private Integer updatedby; + + /** + * 更新人姓名 + */ + @TableField(value = "uname") + private String uname; + + /** + * 更新时间 + */ + @TableField(value = "updated_time") + private Date updatedTime; + + /** + * 科室标识 + */ + @TableField(value = "hddid") + private Integer hddid; + + /** + * 科室名称 + */ + @TableField(value = "dname") + private String dname; + + /** + * 所属医院id + */ + @TableField(value = "hid") + private Integer hid; + + /** + * 所属医院名称 + */ + @TableField(value = "hname") + private String hname; + + /** + * 详细科目 + */ + @TableField(value = "subcatalog") + private String subcatalog; + + /** + * 科室介绍 + */ + @TableField(value = "intro") + private String intro; + + /** + * + */ + @TableField(value = "id") + private Integer id; + + /** + * 编码 + */ + @TableField(value = "code") + private Integer code; + + /** + * 取值 + */ + @TableField(value = "value") + private String value; + + + /** + * 文章类型,推送文章按类别依次推送1-12 + * 1.治疗2.护理3.病因4.预防5.症状6.相关问题7.好发人群8.分型9.检查10.并发症11.鉴别12.定义 + */ + @TableField(value = "article_type") + private Integer articleType; + + /** + * 每个疾病文章的序号(1-100) + */ + @TableField(value = "serial_number") + private Integer serialNumber; + + /** + * 短文字1(公众号推送内容) + */ + @TableField(value = "weix_text_one") + private String weixTextOne; + + /** + * 短文字2(公众号推送内容) + */ + @TableField(value = "weix_text_two") + private String weixTextTwo; + + /** + * 文章推送时间 + */ + @TableField(value = "lpcreatedtime") + private String lpcreatedtime; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + ArticleInfo2 other = (ArticleInfo2) that; + return (this.getAid() == null ? other.getAid() == null : this.getAid().equals(other.getAid())) + && (this.getDid() == null ? other.getDid() == null : this.getDid().equals(other.getDid())) + && (this.getIid() == null ? other.getIid() == null : this.getIid().equals(other.getIid())) + && (this.getTitle() == null ? other.getTitle() == null : this.getTitle().equals(other.getTitle())) + && (this.getContent() == null ? other.getContent() == null : this.getContent().equals(other.getContent())) + && (this.getStat() == null ? other.getStat() == null : this.getStat().equals(other.getStat())) + && (this.getCreatedby() == null ? other.getCreatedby() == null : this.getCreatedby().equals(other.getCreatedby())) + && (this.getCname() == null ? other.getCname() == null : this.getCname().equals(other.getCname())) + && (this.getCreatedtime() == null ? other.getCreatedtime() == null : this.getCreatedtime().equals(other.getCreatedtime())) + && (this.getUpdatedby() == null ? other.getUpdatedby() == null : this.getUpdatedby().equals(other.getUpdatedby())) + && (this.getUname() == null ? other.getUname() == null : this.getUname().equals(other.getUname())) + && (this.getUpdatedTime() == null ? other.getUpdatedTime() == null : this.getUpdatedTime().equals(other.getUpdatedTime())) + && (this.getArticleType() == null ? other.getArticleType() == null : this.getArticleType().equals(other.getArticleType())) + && (this.getSerialNumber() == null ? other.getSerialNumber() == null : this.getSerialNumber().equals(other.getSerialNumber())) + && (this.getWeixTextOne() == null ? other.getWeixTextOne() == null : this.getWeixTextOne().equals(other.getWeixTextOne())) + && (this.getWeixTextTwo() == null ? other.getWeixTextTwo() == null : this.getWeixTextTwo().equals(other.getWeixTextTwo())) + && (this.getHddid() == null ? other.getHddid() == null : this.getHddid().equals(other.getHddid())) + && (this.getDname() == null ? other.getDname() == null : this.getDname().equals(other.getDname())) + && (this.getHid() == null ? other.getHid() == null : this.getHid().equals(other.getHid())) + && (this.getHname() == null ? other.getHname() == null : this.getHname().equals(other.getHname())) + && (this.getSubcatalog() == null ? other.getSubcatalog() == null : this.getSubcatalog().equals(other.getSubcatalog())) + && (this.getIntro() == null ? other.getIntro() == null : this.getIntro().equals(other.getIntro())) + && (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getCode() == null ? other.getCode() == null : this.getCode().equals(other.getCode())) + && (this.getValue() == null ? other.getValue() == null : this.getValue().equals(other.getValue())) + && (this.getLpcreatedtime() == null ? other.getLpcreatedtime() == null : this.getLpcreatedtime().equals(other.getLpcreatedtime())); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getAid() == null) ? 0 : getAid().hashCode()); + result = prime * result + ((getDid() == null) ? 0 : getDid().hashCode()); + result = prime * result + ((getIid() == null) ? 0 : getIid().hashCode()); + result = prime * result + ((getTitle() == null) ? 0 : getTitle().hashCode()); + result = prime * result + ((getContent() == null) ? 0 : getContent().hashCode()); + result = prime * result + ((getStat() == null) ? 0 : getStat().hashCode()); + result = prime * result + ((getCreatedby() == null) ? 0 : getCreatedby().hashCode()); + result = prime * result + ((getCname() == null) ? 0 : getCname().hashCode()); + result = prime * result + ((getCreatedtime() == null) ? 0 : getCreatedtime().hashCode()); + result = prime * result + ((getUpdatedby() == null) ? 0 : getUpdatedby().hashCode()); + result = prime * result + ((getUname() == null) ? 0 : getUname().hashCode()); + result = prime * result + ((getUpdatedTime() == null) ? 0 : getUpdatedTime().hashCode()); + result = prime * result + ((getArticleType() == null) ? 0 : getArticleType().hashCode()); + result = prime * result + ((getSerialNumber() == null) ? 0 : getSerialNumber().hashCode()); + result = prime * result + ((getWeixTextOne() == null) ? 0 : getWeixTextOne().hashCode()); + result = prime * result + ((getWeixTextTwo() == null) ? 0 : getWeixTextTwo().hashCode()); + result = prime * result + ((getHddid() == null) ? 0 : getHddid().hashCode()); + result = prime * result + ((getDname() == null) ? 0 : getDname().hashCode()); + result = prime * result + ((getHid() == null) ? 0 : getHid().hashCode()); + result = prime * result + ((getHname() == null) ? 0 : getHname().hashCode()); + result = prime * result + ((getSubcatalog() == null) ? 0 : getSubcatalog().hashCode()); + result = prime * result + ((getIntro() == null) ? 0 : getIntro().hashCode()); + result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getCode() == null) ? 0 : getCode().hashCode()); + result = prime * result + ((getValue() == null) ? 0 : getValue().hashCode()); + result = prime * result + ((getLpcreatedtime() == null) ? 0 : getLpcreatedtime().hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", aid=").append(aid); + sb.append(", did=").append(did); + sb.append(", iid=").append(iid); + sb.append(", title=").append(title); + sb.append(", content=").append(content); + sb.append(", stat=").append(stat); + sb.append(", createdby=").append(createdby); + sb.append(", cname=").append(cname); + sb.append(", createdtime=").append(createdtime); + sb.append(", updatedby=").append(updatedby); + sb.append(", uname=").append(uname); + sb.append(", updatedTime=").append(updatedTime); + sb.append(", articleType=").append(articleType); + sb.append(", serialNumber=").append(serialNumber); + sb.append(", weixTextOne=").append(weixTextOne); + sb.append(", weixTextTwo=").append(weixTextTwo); + sb.append(", hddid=").append(hddid); + sb.append(", dname=").append(dname); + sb.append(", hid=").append(hid); + sb.append(", hname=").append(hname); + sb.append(", subcatalog=").append(subcatalog); + sb.append(", intro=").append(intro); + sb.append(", id=").append(id); + sb.append(", code=").append(code); + sb.append(", value=").append(value); + sb.append(", lpcreatedtime=").append(lpcreatedtime); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/ArticleInfo2Mapper.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/ArticleInfo2Mapper.java new file mode 100644 index 0000000..2dfbaa7 --- /dev/null +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/ArticleInfo2Mapper.java @@ -0,0 +1,15 @@ +package com.lyms.talkonlineweb.mapper; + +import com.lyms.talkonlineweb.domain.ArticleInfo2; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Entity com.lyms.talkonlineweb.domain.ArticleInfo2 + */ +public interface ArticleInfo2Mapper extends BaseMapper { + +} + + + + diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/ArticleInfo2Service.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/ArticleInfo2Service.java new file mode 100644 index 0000000..5b9420d --- /dev/null +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/ArticleInfo2Service.java @@ -0,0 +1,11 @@ +package com.lyms.talkonlineweb.service; + +import com.lyms.talkonlineweb.domain.ArticleInfo2; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * + */ +public interface ArticleInfo2Service extends IService { + +} diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/ArticleInfo2ServiceImpl.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/ArticleInfo2ServiceImpl.java new file mode 100644 index 0000000..e378683 --- /dev/null +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/ArticleInfo2ServiceImpl.java @@ -0,0 +1,20 @@ +package com.lyms.talkonlineweb.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.lyms.talkonlineweb.domain.ArticleInfo2; +import com.lyms.talkonlineweb.service.ArticleInfo2Service; +import com.lyms.talkonlineweb.mapper.ArticleInfo2Mapper; +import org.springframework.stereotype.Service; + +/** + * + */ +@Service +public class ArticleInfo2ServiceImpl extends ServiceImpl + implements ArticleInfo2Service{ + +} + + + + diff --git a/talkonlineweb/src/main/resources/mapper/ArticleInfo2Mapper.xml b/talkonlineweb/src/main/resources/mapper/ArticleInfo2Mapper.xml new file mode 100644 index 0000000..6cd415d --- /dev/null +++ b/talkonlineweb/src/main/resources/mapper/ArticleInfo2Mapper.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + aid,did,iid, + title,content,stat, + createdby,cname,createdtime, + updatedby,uname,updated_time, + article_type,serial_number,weix_text_one, + weix_text_two,hddid,dname, + hid,hname,subcatalog, + intro,id,code, + value,lpcreatedtime + + -- 1.8.3.1