|
|
@@ -43,7 +43,9 @@
|
|
|
jmrh_flag as jmrhFlag,
|
|
|
province_id as provinceId,
|
|
|
audit_status as auditStatus,
|
|
|
- release_status as releaseStatus
|
|
|
+ release_status as releaseStatus,
|
|
|
+ top_number as topNumber,
|
|
|
+ hotspot
|
|
|
from news
|
|
|
where id = #{id,jdbcType=BIGINT}
|
|
|
</select>
|
|
|
@@ -55,13 +57,13 @@
|
|
|
insert into news (id, create_time, edit_time,
|
|
|
title, title_img, author,
|
|
|
type, hot, source,
|
|
|
- source_url, summary, content,jmrh_flag,province_id
|
|
|
+ source_url, summary, content,jmrh_flag,province_id,top_number,hotspot
|
|
|
)
|
|
|
values (#{id,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, #{editTime,jdbcType=TIMESTAMP},
|
|
|
#{title,jdbcType=VARCHAR}, #{titleImg,jdbcType=VARCHAR}, #{author,jdbcType=VARCHAR},
|
|
|
#{type,jdbcType=INTEGER}, #{hot,jdbcType=INTEGER}, #{source,jdbcType=VARCHAR},
|
|
|
#{sourceUrl,jdbcType=VARCHAR}, #{summary,jdbcType=VARCHAR}, #{content,jdbcType=LONGVARCHAR},
|
|
|
- #{jmrhFlag,jdbcType=INTEGER}, #{provinceId,jdbcType=INTEGER}
|
|
|
+ #{jmrhFlag,jdbcType=INTEGER}, #{provinceId,jdbcType=INTEGER}, #{topNumber,jdbcType=INTEGER}, #{hotspot,jdbcType=INTEGER}
|
|
|
)
|
|
|
</insert>
|
|
|
<insert id="insertSelective" parameterType="com.goafanti.common.model.News">
|
|
|
@@ -213,7 +215,9 @@
|
|
|
jmrh_flag = #{jmrhFlag,jdbcType=INTEGER},
|
|
|
province_id = #{provinceId,jdbcType=INTEGER},
|
|
|
audit_status = #{auditStatus,jdbcType=INTEGER},
|
|
|
- release_status = #{releaseStatus,jdbcType=INTEGER}
|
|
|
+ release_status = #{releaseStatus,jdbcType=INTEGER},
|
|
|
+ top_number = #{topNumber,jdbcType=INTEGER},
|
|
|
+ hotspot = #{hotspot,jdbcType=INTEGER}
|
|
|
where id = #{id,jdbcType=BIGINT}
|
|
|
</update>
|
|
|
<update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.News">
|
|
|
@@ -329,5 +333,50 @@
|
|
|
</select>
|
|
|
|
|
|
|
|
|
+ <select id="appNewsList" resultType="com.goafanti.news.bo.NewsPortalList">
|
|
|
+ select
|
|
|
+ a.id,
|
|
|
+ DATE_FORMAT(a.create_time,'%Y-%m-%d') as createTime,
|
|
|
+ a.title,
|
|
|
+ a.title_img as titleImg,
|
|
|
+ a.type,
|
|
|
+ a.hot,
|
|
|
+ a.summary,
|
|
|
+ a.source,
|
|
|
+ a.content,
|
|
|
+ top_number as topNumber,
|
|
|
+ hotspot
|
|
|
+ from news a
|
|
|
+ left join district_glossory d on a.province_id=d.id
|
|
|
+ where
|
|
|
+ a.type != 1 and a.type != 2
|
|
|
+ <if test="param != null">
|
|
|
+ and a.title like concat('%',#{param},'%')
|
|
|
+ or a.source like concat('%',#{param},'%')
|
|
|
+ or d.name like concat('%',#{param},'%')
|
|
|
+ </if>
|
|
|
+ order by IF(ISNULL(top_number),1,0) ,top_number asc,
|
|
|
+ IF(ISNULL(hotspot),1,0),hotspot asc,
|
|
|
+ create_time desc
|
|
|
+ <if test="page_sql != null">
|
|
|
+ ${page_sql}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="appNewsCount" resultType="java.lang.Integer">
|
|
|
+ select
|
|
|
+ count(0)
|
|
|
+ from news a
|
|
|
+ left join district_glossory d on a.province_id=d.id
|
|
|
+ where
|
|
|
+ a.type != 1 and a.type != 2
|
|
|
+ <if test="param != null">
|
|
|
+ and a.title like concat('%',#{param},'%')
|
|
|
+ or a.source like concat('%',#{param},'%')
|
|
|
+ or d.name like concat('%',#{param},'%')
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
|
|
|
</mapper>
|