Commit 139898e1ecb1a0b9a7445372e1923d99bb87f212

Authored by gaohan
1 parent 73ae278079
Exists in dev

开发评价列表,添加评价

Showing 3 changed files with 204 additions and 0 deletions

platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/ReviewDao.java View file @ 139898e
  1 +package com.lyms.platform.biz.dal;
  2 +
  3 +import com.lyms.platform.common.dao.operator.MongoQuery;
  4 +import com.lyms.platform.pojo.ReviewModel;
  5 +
  6 +import java.util.List;
  7 +
  8 +public interface ReviewDao {
  9 + List<ReviewModel> queryMsgList(MongoQuery created);
  10 +
  11 + void reviewAdd(ReviewModel reviewModel);
  12 +}
platform-dal/src/main/java/com/lyms/platform/pojo/ReviewModel.java View file @ 139898e
  1 +package com.lyms.platform.pojo;
  2 +
  3 +import com.lyms.platform.common.result.BaseModel;
  4 +import org.springframework.data.mongodb.core.mapping.Document;
  5 +
  6 +@Document(collection="lyms_review")
  7 +public class ReviewModel extends BaseModel {
  8 + //评价id
  9 + private String id;
  10 +
  11 + //评论内容
  12 + private String content;
  13 +
  14 + //评论者id
  15 + private String reviewId;
  16 +
  17 + //父级评论id
  18 + private String parentId;
  19 +
  20 + //评论时间
  21 + private String createDate;
  22 +
  23 + //课程id
  24 + private String couresId;
  25 +
  26 + //是
  27 + private Integer yn;
  28 +
  29 +
  30 + public Integer getYn() {
  31 + return yn;
  32 + }
  33 +
  34 + public void setYn(Integer yn) {
  35 + this.yn = yn;
  36 + }
  37 +
  38 + public String getCouresId() {
  39 + return couresId;
  40 + }
  41 +
  42 + public void setCouresId(String couresId) {
  43 + this.couresId = couresId;
  44 + }
  45 +
  46 + public String getId() {
  47 + return id;
  48 + }
  49 +
  50 + public void setId(String id) {
  51 + this.id = id;
  52 + }
  53 +
  54 + public String getContent() {
  55 + return content;
  56 + }
  57 +
  58 + public void setContent(String content) {
  59 + this.content = content;
  60 + }
  61 +
  62 + public String getReviewId() {
  63 + return reviewId;
  64 + }
  65 +
  66 + public void setReviewId(String reviewId) {
  67 + this.reviewId = reviewId;
  68 + }
  69 +
  70 + public String getParentId() {
  71 + return parentId;
  72 + }
  73 +
  74 + public void setParentId(String parentId) {
  75 + this.parentId = parentId;
  76 + }
  77 +
  78 + public String getCreateDate() {
  79 + return createDate;
  80 + }
  81 +
  82 + public void setCreateDate(String createDate) {
  83 + this.createDate = createDate;
  84 + }
  85 +}
platform-dal/src/main/java/com/lyms/platform/query/ReviewQuery.java View file @ 139898e
  1 +package com.lyms.platform.query;
  2 +
  3 +import com.lyms.platform.common.base.IConvertToNativeQuery;
  4 +import com.lyms.platform.common.dao.BaseQuery;
  5 +import com.lyms.platform.common.dao.operator.MongoCondition;
  6 +import com.lyms.platform.common.dao.operator.MongoOper;
  7 +import com.lyms.platform.common.dao.operator.MongoQuery;
  8 +
  9 +public class ReviewQuery extends BaseQuery implements IConvertToNativeQuery {
  10 + //评价id
  11 + private String id;
  12 +
  13 + //评论内容
  14 + private String content;
  15 +
  16 + //评论者id
  17 + private String reviewId;
  18 +
  19 + //父级评论id
  20 + private String parentId;
  21 +
  22 + //评论时间
  23 + private String createDate;
  24 +
  25 + //课程id
  26 + private String couresId;
  27 +
  28 + //yn
  29 + private Integer yn;
  30 +
  31 + public String getId() {
  32 + return id;
  33 + }
  34 +
  35 + public void setId(String id) {
  36 + this.id = id;
  37 + }
  38 +
  39 + public String getContent() {
  40 + return content;
  41 + }
  42 +
  43 + public void setContent(String content) {
  44 + this.content = content;
  45 + }
  46 +
  47 + public String getReviewId() {
  48 + return reviewId;
  49 + }
  50 +
  51 + public void setReviewId(String reviewId) {
  52 + this.reviewId = reviewId;
  53 + }
  54 +
  55 + public String getParentId() {
  56 + return parentId;
  57 + }
  58 +
  59 + public void setParentId(String parentId) {
  60 + this.parentId = parentId;
  61 + }
  62 +
  63 + public String getCreateDate() {
  64 + return createDate;
  65 + }
  66 +
  67 + public void setCreateDate(String createDate) {
  68 + this.createDate = createDate;
  69 + }
  70 +
  71 + public String getCouresId() {
  72 + return couresId;
  73 + }
  74 +
  75 + public void setCouresId(String couresId) {
  76 + this.couresId = couresId;
  77 + }
  78 +
  79 + public Integer getYn() {
  80 + return yn;
  81 + }
  82 +
  83 + public void setYn(Integer yn) {
  84 + this.yn = yn;
  85 + }
  86 +
  87 + @Override
  88 + public MongoQuery convertToQuery() {
  89 + MongoCondition condition = MongoCondition.newInstance();
  90 + if(null != id){
  91 + condition = condition.and("id", id, MongoOper.IS);
  92 + }
  93 + if(null != content){
  94 + condition = condition.and("content", content, MongoOper.IS);
  95 + }
  96 + if(null != reviewId){
  97 + condition = condition.and("reviewId", reviewId, MongoOper.IS);
  98 + }if(null != parentId){
  99 + condition = condition.and("parentId", parentId, MongoOper.IS);
  100 + }if(null != createDate){
  101 + condition = condition.and("createDate", createDate, MongoOper.IS);
  102 + }if(null != couresId){
  103 + condition = condition.and("couresId", couresId, MongoOper.IS);
  104 + }
  105 + return condition.toMongoQuery();
  106 + }
  107 +}