|
@@ -33,6 +33,7 @@
|
|
|
a.create_time create_time,
|
|
|
a.update_time update_time
|
|
|
</sql>
|
|
|
+
|
|
|
<sql id="includeArticleTranslation">
|
|
|
id,
|
|
|
article_id,
|
|
@@ -53,6 +54,29 @@
|
|
|
LEFT JOIN cms_article_i18n at ON a.id = at.article_id
|
|
|
</sql>
|
|
|
|
|
|
+ <sql id="includeArticleDetailFull">
|
|
|
+ a.id id,
|
|
|
+ a.id article_id,
|
|
|
+ at.language,
|
|
|
+ a.uid uid,
|
|
|
+ COALESCE(a.thumb, '') thumb,
|
|
|
+ uf.user_id user_id,
|
|
|
+ COALESCE(uf.nickname, '') user_nickname,
|
|
|
+ ac.id category_id,
|
|
|
+ ac.category_name category_name,
|
|
|
+
|
|
|
+ at.title,
|
|
|
+ at.description,
|
|
|
+ at.content,
|
|
|
+ COALESCE(at.meta_keyword, '') meta_keyword,
|
|
|
+ COALESCE(at.meta_description, '') meta_description,
|
|
|
+
|
|
|
+ a.status status,
|
|
|
+ a.is_top is_top,
|
|
|
+ a.create_time create_time,
|
|
|
+ a.update_time update_time
|
|
|
+ </sql>
|
|
|
+
|
|
|
<!-- <resultMap id="resultMapArticle" type="com.backendsys.modules.cms.article.entity.Article">-->
|
|
|
<resultMap id="resultMapArticle" type="java.util.LinkedHashMap">
|
|
|
<id property="id" column="id" jdbcType="BIGINT" />
|
|
@@ -99,6 +123,29 @@
|
|
|
</collection>
|
|
|
</resultMap>
|
|
|
|
|
|
+ <resultMap id="resultMapArticleDetailFull" type="java.util.LinkedHashMap">
|
|
|
+ <id property="id" column="id" jdbcType="BIGINT" />
|
|
|
+ <result property="article_id" column="article_id" javaType="java.lang.Long" />
|
|
|
+ <result property="uid" column="uid" />
|
|
|
+ <result property="language" column="language" />
|
|
|
+ <result property="thumb" column="thumb" />
|
|
|
+ <result property="user_id" column="user_id" javaType="java.lang.Long" />
|
|
|
+ <result property="user_nickname" column="user_nickname" />
|
|
|
+ <result property="category_id" column="category_id" javaType="java.lang.Long" />
|
|
|
+ <result property="category_name" column="category_name" />
|
|
|
+
|
|
|
+ <result property="title" column="title" />
|
|
|
+ <result property="content" column="content" />
|
|
|
+ <result property="description" column="description" />
|
|
|
+ <result property="meta_keyword" column="meta_keyword" />
|
|
|
+ <result property="meta_description" column="meta_description" />
|
|
|
+
|
|
|
+ <result property="status" column="status" javaType="java.lang.Integer" />
|
|
|
+ <result property="is_top" column="is_top" javaType="java.lang.Integer" />
|
|
|
+ <result property="create_time" column="create_time" />
|
|
|
+ <result property="update_time" column="update_time" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
|
|
|
<!-- 查 列表 -->
|
|
|
<select id="selectArticleList" resultMap="resultMapArticle">
|
|
@@ -146,6 +193,19 @@
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
|
+ <!-- 查 详情 完整 -->
|
|
|
+ <select id="selectArticleDetailFull" resultMap="resultMapArticleDetailFull">
|
|
|
+ SELECT <include refid="includeArticleDetailFull" />
|
|
|
+ FROM cms_article a
|
|
|
+ <include refid="leftJoinCategory" />
|
|
|
+ <include refid="leftJoinUser" />
|
|
|
+ <include refid="leftJoinTranslations" />
|
|
|
+ WHERE
|
|
|
+ at.language = #{lang}
|
|
|
+ AND a.uid = #{uid}
|
|
|
+ AND a.status = #{status}
|
|
|
+ </select>
|
|
|
+
|
|
|
<!-- 查 翻译详情 (子查询) -->
|
|
|
<select id="queryTranslationsById" resultType="java.util.LinkedHashMap">
|
|
|
SELECT <include refid="includeArticleTranslation" />
|