|
@@ -4,7 +4,7 @@
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.ruoyi.system.mapper.ColumnNewsMapper">
|
|
|
|
|
|
- <resultMap type="ColumnNews" id="ColumnNewsResult">
|
|
|
+ <resultMap type="com.ruoyi.common.core.domain.entity.ColumnNews" id="ColumnNewsResult">
|
|
|
<result property="newsId" column="news_id"/>
|
|
|
<result property="newsTitle" column="news_title"/>
|
|
|
<result property="newsImage" column="news_image"/>
|
|
@@ -12,9 +12,14 @@
|
|
|
<result property="columnName" column="column_name"/>
|
|
|
<result property="newsContent" column="news_content"/>
|
|
|
<result property="isTop" column="is_top"/>
|
|
|
+ <result property="isRotation" column="is_rotation"/>
|
|
|
+ <result property="viewsNum" column="views_num"/>
|
|
|
+ <result property="reprintUrl" column="reprint_url"/>
|
|
|
+ <result property="author" column="author"/>
|
|
|
<result property="status" column="status"/>
|
|
|
<result property="isDel" column="is_del"/>
|
|
|
<result property="reason" column="reason"/>
|
|
|
+ <result property="releaseTime" column="release_time"/>
|
|
|
<result property="createBy" column="create_by"/>
|
|
|
<result property="createTime" column="create_time"/>
|
|
|
<result property="updateBy" column="update_by"/>
|
|
@@ -23,7 +28,7 @@
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectColumnNewsVo">
|
|
|
- select n.news_id, n.news_title, n.column_id, n.news_content,n.is_top, n.status, n.reason, n.create_by, n.create_time, n.update_by, n.update_time, n.remark, n.news_image,c.column_name from column_news n
|
|
|
+ select n.news_id, n.news_title, n.column_id, n.news_content,n.is_top,n.is_rotation,n.views_num,n.reprint_url,n.author, n.status,n.release_time, n.reason, n.create_by, n.create_time, n.update_by, n.update_time, n.remark, n.news_image,c.column_name from column_news n
|
|
|
left join column_navigation_bar c on n.column_id = c.column_id
|
|
|
</sql>
|
|
|
|
|
@@ -44,9 +49,9 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="selectColumnNewsListMenHu" parameterType="ColumnNews" resultMap="ColumnNewsResult">
|
|
|
- select n.news_id, n.news_title,n.news_image,n.news_content, n.create_time from column_news n
|
|
|
+ select n.news_id, n.news_title,n.news_image,n.news_content,n.is_rotation,n.views_num,n.reprint_url,n.author,n.release_time, n.create_time from column_news n
|
|
|
<where>
|
|
|
- n.status = '0'
|
|
|
+ n.status = '3'
|
|
|
and n.is_del = 'N'
|
|
|
<if test="newsTitle != null and newsTitle != ''">and (n.news_title like concat('%', #{newsTitle}, '%') or
|
|
|
n.news_content like concat('%', #{newsContent}, '%'))
|
|
@@ -58,9 +63,9 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="selectColumnNewsListMenHuByColumnId" parameterType="Long" resultMap="ColumnNewsResult">
|
|
|
- select n.news_id, n.news_title,n.news_image, n.create_time from column_news n
|
|
|
+ select n.news_id, n.news_title,n.news_image,n.is_rotation,n.views_num,n.reprint_url,n.author,n.release_time, n.create_time from column_news n
|
|
|
<where>
|
|
|
- n.status = '0'
|
|
|
+ n.status = '3'
|
|
|
and n.is_del = 'N'
|
|
|
<if test="columnId != null and columnId != ''">and n.column_id = #{columnId}</if>
|
|
|
</where>
|
|
@@ -73,7 +78,7 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="selectColumnNewsDetailMenHu" parameterType="Integer" resultMap="ColumnNewsResult">
|
|
|
- select n.news_id, n.news_title, n.column_id, n.news_content, n.status, n.reason, n.create_by, n.create_time, n.update_by, n.update_time, n.remark,n.news_image from column_news n
|
|
|
+ select n.news_id, n.news_title, n.column_id, n.news_content,n.is_rotation,n.views_num,n.reprint_url,n.author, n.status,n.release_time, n.reason, n.create_by, n.create_time, n.update_by, n.update_time, n.remark,n.news_image from column_news n
|
|
|
where n.news_id = #{newsId} order by n.create_time DESC,n.update_time DESC
|
|
|
</select>
|
|
|
|
|
@@ -84,9 +89,14 @@
|
|
|
<if test="newsImage != null and newsImage != ''">news_image,</if>
|
|
|
<if test="columnId != null">column_id,</if>
|
|
|
<if test="newsContent != null and newsContent != ''">news_content,</if>
|
|
|
+ <if test="isRotation != null and isRotation != ''">is_rotation,</if>
|
|
|
+ <if test="viewsNum != null">views_num,</if>
|
|
|
+ <if test="reprintUrl != null and reprintUrl != ''">reprint_url,</if>
|
|
|
+ <if test="author != null and author != ''">author,</if>
|
|
|
<if test="isTop != null">is_top,</if>
|
|
|
<if test="isDel != null">is_del,</if>
|
|
|
<if test="reason != null">reason,</if>
|
|
|
+ <if test="releaseTime != null">release_time,</if>
|
|
|
<if test="createBy != null">create_by,</if>
|
|
|
<if test="createTime != null">create_time,</if>
|
|
|
<if test="updateBy != null">update_by,</if>
|
|
@@ -98,9 +108,14 @@
|
|
|
<if test="newsImage != null and newsImage != ''">#{newsImage},</if>
|
|
|
<if test="columnId != null">#{columnId},</if>
|
|
|
<if test="newsContent != null and newsContent != ''">#{newsContent},</if>
|
|
|
+ <if test="isRotation != null and isRotation != ''">#{isRotation},</if>
|
|
|
+ <if test="viewsNum != null">#{viewsNum},</if>
|
|
|
+ <if test="reprintUrl != null and reprintUrl != ''">#{reprintUrl},</if>
|
|
|
+ <if test="author != null and author != ''">#{author},</if>
|
|
|
<if test="isTop != null">#{isTop},</if>
|
|
|
<if test="isDel != null">#{isDel},</if>
|
|
|
<if test="reason != null">#{reason},</if>
|
|
|
+ <if test="releaseTime != null">#{releaseTime},</if>
|
|
|
<if test="createBy != null">#{createBy},</if>
|
|
|
<if test="createTime != null">#{createTime},</if>
|
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
@@ -117,9 +132,14 @@
|
|
|
<if test="columnId != null">column_id = #{columnId},</if>
|
|
|
<if test="newsContent != null and newsContent != ''">news_content = #{newsContent},</if>
|
|
|
<if test="status != null">status = #{status},</if>
|
|
|
+ <if test="isRotation != null and isRotation != ''">is_rotation = #{isRotation},</if>
|
|
|
+ <if test="viewsNum != null"> views_num = #{viewsNum},</if>
|
|
|
+ <if test="reprintUrl != null and reprintUrl != ''">reprint_url = #{reprintUrl},</if>
|
|
|
+ <if test="author != null and author != ''">author = #{author},</if>
|
|
|
<if test="isTop != null">is_top = #{isTop},</if>
|
|
|
<if test="isDel != null">is_del = #{isDel},</if>
|
|
|
<if test="reason != null">reason = #{reason},</if>
|
|
|
+ <if test="releaseTime != null">release_time = #{releaseTime},</if>
|
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
@@ -141,7 +161,7 @@
|
|
|
</update>
|
|
|
|
|
|
<update id="examineColumnNews" parameterType="ColumnNews">
|
|
|
- update column_news set status = '0'
|
|
|
+ update column_news set status = '3'
|
|
|
where news_id = #{newsId}
|
|
|
</update>
|
|
|
|
|
@@ -154,4 +174,8 @@
|
|
|
<if test="endTime != null">and DATE_FORMAT(create_time,'%Y-%m-%d') <= DATE_FORMAT(#{endTime},'%Y-%m-%d')</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
+
|
|
|
+ <select id="getRotation" resultMap="ColumnNewsResult">
|
|
|
+ select news_id,news_image from column_news where is_rotation = 'Y' and is_del = 'N' and status = '3' limit 5
|
|
|
+ </select>
|
|
|
</mapper>
|