|
@@ -11,6 +11,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
11
|
11
|
<result property="content" column="content" />
|
12
|
12
|
<result property="viewCount" column="view_count" />
|
13
|
13
|
<result property="isTop" column="is_top" />
|
|
14
|
+ <result property="carousel" column="is_carousel" />
|
14
|
15
|
<result property="thumbnail" column="thumbnail" />
|
15
|
16
|
<result property="videoUrl" column="video_url" />
|
16
|
17
|
<result property="createBy" column="create_by" />
|
|
@@ -28,7 +29,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
28
|
29
|
</resultMap>
|
29
|
30
|
|
30
|
31
|
<sql id="selectCmsNewsVo">
|
31
|
|
- select t1.news_id, t1.category_id, t1.title, t1.content, t1.view_count, t1.is_top, t1.thumbnail, t1.focus_imgs, t1.video_url, t1.create_by, t1.create_time, t1.update_by, t1.update_time, t1.remark, t2.name as category_name from cms_news as t1
|
|
32
|
+ select t1.news_id, t1.category_id, t1.title, t1.content, t1.view_count, t1.is_top, t1.is_carousel, t1.thumbnail, t1.focus_imgs, t1.video_url, t1.create_by, t1.create_time, t1.update_by, t1.update_time, t1.remark, t2.name as category_name from cms_news as t1
|
32
|
33
|
left join cms_category as t2 on t1.category_id = t2.category_id
|
33
|
34
|
</sql>
|
34
|
35
|
|
|
@@ -37,10 +38,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
37
|
38
|
<where>
|
38
|
39
|
<if test="title != null and title != ''"> and t1.title like concat('%', #{title}, '%')</if>
|
39
|
40
|
<if test="isTop != null "> and t1.is_top = #{isTop}</if>
|
|
41
|
+ <if test="carousel != null"> and t1.is_carousel = #{carousel}</if>
|
40
|
42
|
<if test="categoryId != null"> and (t1.category_id = #{categoryId} or t1.category_id in ( SELECT t.category_id FROM cms_category t WHERE parent_id = #{categoryId} ))</if>
|
41
|
43
|
</where>
|
42
|
|
- order by t1.create_time desc
|
43
|
|
-
|
|
44
|
+ order by t1.is_top desc, t1.create_time desc
|
44
|
45
|
</select>
|
45
|
46
|
|
46
|
47
|
<select id="selectCmsNewsByNewsId" parameterType="String" resultMap="CmsNewsResult">
|
|
@@ -62,6 +63,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
62
|
63
|
<if test="title != null and title != ''">content,</if>
|
63
|
64
|
<if test="viewCount != null">view_count,</if>
|
64
|
65
|
<if test="isTop != null">is_top,</if>
|
|
66
|
+ <if test="carousel != null">is_carousel,</if>
|
65
|
67
|
<if test="thumbnail != null and thumbnail != ''">thumbnail,</if>
|
66
|
68
|
<if test="focusImgs != null">focus_imgs,</if>
|
67
|
69
|
<if test="videoUrl != null and videoUrl != ''">video_url,</if>
|
|
@@ -78,6 +80,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
78
|
80
|
<if test="content != null and content != ''">#{content},</if>
|
79
|
81
|
<if test="viewCount != null">#{viewCount},</if>
|
80
|
82
|
<if test="isTop != null">#{isTop},</if>
|
|
83
|
+ <if test="carousel != null">#{carousel},</if>
|
81
|
84
|
<if test="thumbnail != null and thumbnail != ''">#{thumbnail},</if>
|
82
|
85
|
<if test="focusImgs != null">#{focusImgs,jdbcType=OTHER,typeHandler=com.lqkj.framework.sql.JsonbTypeHandler},</if>
|
83
|
86
|
<if test="videoUrl != null and videoUrl != ''">#{videoUrl},</if>
|
|
@@ -88,6 +91,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
88
|
91
|
<if test="remark != null and remark != ''">#{remark},</if>
|
89
|
92
|
</trim>
|
90
|
93
|
</insert>
|
|
94
|
+ <update id="updateCarouselStatus" parameterType="CmsNews">
|
|
95
|
+ update cms_news set is_carousel = #{carousel} where news_id = #{newsId}
|
|
96
|
+ </update>
|
91
|
97
|
<update id="updateTopStatus" parameterType="CmsNews">
|
92
|
98
|
update cms_news set is_top = #{isTop} where news_id = #{newsId}
|
93
|
99
|
</update>
|
|
@@ -102,6 +108,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
102
|
108
|
content = #{content},
|
103
|
109
|
<if test="viewCount != null ">view_count = #{viewCount},</if>
|
104
|
110
|
<if test="isTop != null ">is_top = #{isTop},</if>
|
|
111
|
+ <if test="carousel != null ">is_carousel = #{carousel},</if>
|
105
|
112
|
thumbnail = #{thumbnail},
|
106
|
113
|
focus_imgs = #{focusImgs, jdbcType=OTHER, typeHandler=com.lqkj.framework.sql.JsonbTypeHandler},
|
107
|
114
|
video_url = #{videoUrl},
|