CmsUtils.getArticleList 的 isQueryArticleData 参数不生效问题 #I6HN74

This commit is contained in:
thinkgem
2023-02-27 10:35:35 +08:00
parent 0a95c15ff0
commit c81d96a6d4
3 changed files with 32 additions and 29 deletions

View File

@@ -4,13 +4,6 @@
*/ */
package com.jeesite.modules.cms.entity; package com.jeesite.modules.cms.entity;
import java.util.Date;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.jeesite.common.entity.BaseEntity; import com.jeesite.common.entity.BaseEntity;
import com.jeesite.common.entity.DataEntity; import com.jeesite.common.entity.DataEntity;
@@ -20,6 +13,11 @@ import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType; import com.jeesite.common.mybatis.mapper.query.QueryType;
import com.jeesite.modules.cms.utils.CmsUtils; import com.jeesite.modules.cms.utils.CmsUtils;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;
/** /**
* 文章表Entity * 文章表Entity
* @author 长春叭哥、ThinkGem * @author 长春叭哥、ThinkGem
@@ -83,12 +81,13 @@ public class Article extends DataEntity<Article> {
private Integer wordCount; // 字数不包含html private Integer wordCount; // 字数不包含html
private String customContentView; // 自定义内容视图 private String customContentView; // 自定义内容视图
private String viewConfig; // 视图配置 private String viewConfig; // 视图配置
private ArticleData articleData; //文章副表 private ArticleData articleData; //文章副表
private Boolean isQueryArticleData; // 是否查询文章内容
private Date beginDate; // 开始时间 private Date beginDate; // 开始时间
private Date endDate; // 结束时间 private Date endDate; // 结束时间
private Boolean isQueryArticleData; // 是否查询文章内容
public Article() { public Article() {
super(); super();
//this.weight = 0; //this.weight = 0;
@@ -223,8 +222,6 @@ public class Article extends DataEntity<Article> {
this.hits = hits; this.hits = hits;
} }
public Integer getHitsPlus() { public Integer getHitsPlus() {
return hitsPlus; return hitsPlus;
} }
@@ -275,6 +272,18 @@ public class Article extends DataEntity<Article> {
this.articleData = articleData; this.articleData = articleData;
} }
/**
* 是否查询文章内容
* @return
*/
public Boolean getIsQueryArticleData() {
return isQueryArticleData;
}
public void setIsQueryArticleData(Boolean isQueryArticleData) {
this.isQueryArticleData = isQueryArticleData;
}
public Date getBeginDate() { public Date getBeginDate() {
return beginDate; return beginDate;
} }
@@ -291,20 +300,6 @@ public class Article extends DataEntity<Article> {
this.endDate = endDate; this.endDate = endDate;
} }
/**
* 是否查询文章内容
* @return
*/
public Boolean getIsQueryArticleData() {
return isQueryArticleData;
}
public void setIsQueryArticleData(Boolean isQueryArticleData) {
this.isQueryArticleData = isQueryArticleData;
}
public String getUrl() { public String getUrl() {
return CmsUtils.getUrlDynamic(this); return CmsUtils.getUrlDynamic(this);
} }

View File

@@ -79,7 +79,7 @@ public class ArticleService extends CrudService<ArticleDao, Article> {
/** /**
* 查询分页数据 * 查询分页数据
* @param article 查询条件 * @param article 查询条件
* @param article.page 分页对象 * @param article page 分页对象
* @return * @return
*/ */
@Override @Override

View File

@@ -2,15 +2,23 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.jeesite.modules.cms.dao.ArticleDao"> <mapper namespace="com.jeesite.modules.cms.dao.ArticleDao">
<!-- 查询数据 <!-- 查询数据 -->
<select id="findList" resultType="CmsArticle"> <select id="findList" resultType="Article">
SELECT ${sqlMap.column.toSql()} SELECT ${sqlMap.column.toSql()}
<if test="isQueryArticleData">,
ad.content AS "articleData.content",
ad.relation AS "articleData.relation",
ad.is_can_comment AS "articleData.isCanComment"
</if>
FROM ${sqlMap.table.toSql()} FROM ${sqlMap.table.toSql()}
<if test="isQueryArticleData">
JOIN ${_prefix}cms_article_data ad ON ad.id = a.id
</if>
<where> <where>
${sqlMap.where.toSql()} ${sqlMap.where.toSql()}
</where> </where>
ORDER BY ${sqlMap.order.toSql()} ORDER BY ${sqlMap.order.toSql()}
</select> --> </select>
<update id="updateExpiredWeight"> <update id="updateExpiredWeight">
update ${_prefix}cms_article SET weight = 0 update ${_prefix}cms_article SET weight = 0