|
|
|
@ -3,15 +3,15 @@
|
|
|
|
|
<mapper namespace="com.jingcheng.cms.mapper.ArticleMapper">
|
|
|
|
|
|
|
|
|
|
<insert id="addArticle" parameterType="com.jingcheng.cms.model.Article">
|
|
|
|
|
INSERT INTO article(`title`,`first_category`,`second_category`,`keyword`,`file_type`,`content`,`state`,`describe`,`video_url`)
|
|
|
|
|
values (#{title},#{firstCategory},#{secondCategory},#{keyword},#{fileType},#{content},#{state},#{describe},#{videoUrl})
|
|
|
|
|
INSERT INTO article(`title`,`first_category`,`second_category`,`keyword`,`file_type`,`content`,`state`,`describe`,`video_url`,`is_recommend`)
|
|
|
|
|
values (#{title},#{firstCategory},#{secondCategory},#{keyword},#{fileType},#{content},#{state},#{describe},#{videoUrl},#{isRecommend})
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
<select id="getArticleListByCondition" resultType="com.jingcheng.cms.vo.ArticleVo">
|
|
|
|
|
select ar.`id`,ar.`title`,c1.`name` as `first_category_name`,c2.`name` as `second_category_name`,
|
|
|
|
|
ar.`keyword`,ar.`file_type`,ar.`content`,ar.`create_date_time`,ar.`update_date_time`,ar.`state`,
|
|
|
|
|
c1.level as `first_level`,c2.level as `second_level`,c1.`sort_num` as `first_sort_num`,c2.`sort_num` as `second_sort_num`,
|
|
|
|
|
ar.`keyword`,ar.`file_type`,ar.`describe`,ar.`video_url`
|
|
|
|
|
ar.`keyword`,ar.`file_type`,ar.`describe`,ar.`video_url`,ar.`is_recommend`
|
|
|
|
|
FROM article ar
|
|
|
|
|
left join category c1
|
|
|
|
|
on
|
|
|
|
@ -36,6 +36,7 @@
|
|
|
|
|
<if test="state != null ">
|
|
|
|
|
and ar.state = #{state}
|
|
|
|
|
</if>
|
|
|
|
|
ORDER BY is_recommend Desc
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="getFirstCategory" resultType="com.jingcheng.cms.model.Category">
|
|
|
|
@ -67,7 +68,7 @@
|
|
|
|
|
select ar.`id`,ar.`title`,c1.`name` as `first_category_name`,c2.`name` as `second_category_name`,
|
|
|
|
|
ar.`keyword`,ar.`file_type`,ar.`content`,ar.`create_date_time`,ar.`update_date_time`,ar.`state`,
|
|
|
|
|
c1.level as `first_level`,c2.level as `second_level`,c1.`sort_num` as `first_sort_num`,c2.`sort_num` as `second_sort_num`,
|
|
|
|
|
ar.`keyword`,ar.`file_type`,ar.`describe`,ar.`video_url`
|
|
|
|
|
ar.`keyword`,ar.`file_type`,ar.`describe`,ar.`video_url`,ar.`is_recommend`
|
|
|
|
|
FROM article ar
|
|
|
|
|
left join category c1
|
|
|
|
|
on
|
|
|
|
@ -90,5 +91,6 @@
|
|
|
|
|
and ar.second_category = #{secondCategory}
|
|
|
|
|
</if>
|
|
|
|
|
and ar.state = 1
|
|
|
|
|
ORDER BY is_recommend Desc
|
|
|
|
|
</select>
|
|
|
|
|
</mapper>
|