|
|
@@ -15,31 +15,31 @@
|
|
|
<result column="summary" jdbcType="VARCHAR" property="summary" />
|
|
|
<result column="jmrh_flag" jdbcType="INTEGER" property="jmrhFlag" />
|
|
|
<result column="province_id" jdbcType="INTEGER" property="provinceId" />
|
|
|
- <result column="keyword" jdbcType="VARCHAR" property="keyword" />
|
|
|
+ <result column="keyword" jdbcType="VARCHAR" property="keyword" />
|
|
|
</resultMap>
|
|
|
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.goafanti.common.model.News">
|
|
|
<result column="content" jdbcType="LONGVARCHAR" property="content" />
|
|
|
</resultMap>
|
|
|
<sql id="Base_Column_List">
|
|
|
- id, create_time, edit_time, title, title_img, author, type, hot, source, source_url,
|
|
|
+ id, create_time, edit_time, title, title_img, author, type, hot, source, source_url,
|
|
|
summary,jmrh_flag,province_id,keyword
|
|
|
</sql>
|
|
|
<sql id="Blob_Column_List">
|
|
|
content
|
|
|
</sql>
|
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultType="com.goafanti.news.bo.NewsResult">
|
|
|
- select
|
|
|
+ select
|
|
|
n.id,
|
|
|
n.content,
|
|
|
- n.create_time as createTime,
|
|
|
- n.edit_time as editTime,
|
|
|
- n.title,
|
|
|
- n.title_img as titleImg,
|
|
|
- n.author,
|
|
|
- n.type,
|
|
|
+ n.create_time as createTime,
|
|
|
+ n.edit_time as editTime,
|
|
|
+ n.title,
|
|
|
+ n.title_img as titleImg,
|
|
|
+ n.author,
|
|
|
+ n.type,
|
|
|
n.hot,
|
|
|
- n.source,
|
|
|
- n.source_url as sourceUrl,
|
|
|
+ n.source,
|
|
|
+ n.source_url as sourceUrl,
|
|
|
n.summary,
|
|
|
n.province_id as provinceId,
|
|
|
n.audit_status as auditStatus,
|
|
|
@@ -56,14 +56,14 @@
|
|
|
where id = #{id,jdbcType=BIGINT}
|
|
|
</delete>
|
|
|
<insert id="insert" parameterType="com.goafanti.common.model.News">
|
|
|
- insert into news (id, create_time, edit_time,
|
|
|
- title, title_img, author,
|
|
|
- type, hot, source,
|
|
|
+ insert into news (id, create_time, edit_time,
|
|
|
+ title, title_img, author,
|
|
|
+ type, hot, source,
|
|
|
source_url, summary, content,province_id,top_number,hotspot,audit_status,release_status,release_date,keyword
|
|
|
)
|
|
|
- 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},
|
|
|
+ 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},
|
|
|
#{provinceId,jdbcType=INTEGER}, #{topNumber,jdbcType=INTEGER}, #{hotspot,jdbcType=INTEGER},#{auditStatus,jdbcType=INTEGER},
|
|
|
#{releaseStatus,jdbcType=INTEGER},#{releaseDate,jdbcType=TIMESTAMP},#{keyword,jdbcType=VARCHAR}
|
|
|
@@ -276,38 +276,38 @@
|
|
|
a.summary,
|
|
|
a.source,
|
|
|
a.content,
|
|
|
- release_date as releaseDate
|
|
|
+ DATE_FORMAT(a.release_date,'%Y-%m-%d') as releaseDate
|
|
|
from news a
|
|
|
where 1=1
|
|
|
- and (a.type = 0 or a.type = 99 or a.type =98)
|
|
|
+ and (a.type = 0 or a.type = 99 or a.type =98)
|
|
|
<if test="provinceId != null">
|
|
|
and a.province_id = #{provinceId,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
<if test="type != null" >
|
|
|
and a.type = #{type,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
- <!--
|
|
|
+ <!--
|
|
|
<if test="hot != null">
|
|
|
and a.hot = #{hot,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
+ </if>
|
|
|
-->
|
|
|
<if test="keyword != null">
|
|
|
and a.title like concat('%',#{keyword},'%')
|
|
|
</if>
|
|
|
<if test="auditStatus!=null">
|
|
|
and a.audit_status=#{auditStatus,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
+ </if>
|
|
|
order by release_date desc
|
|
|
<if test="page_sql != null">
|
|
|
${page_sql}
|
|
|
</if>
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="portalNewsCount" resultType="java.lang.Integer">
|
|
|
- select
|
|
|
+ select
|
|
|
count(0)
|
|
|
from news a
|
|
|
- where
|
|
|
+ where
|
|
|
(a.type = 0 or a.type = 99 or a.type =98)
|
|
|
<if test="provinceId != null">
|
|
|
and a.province_id = #{provinceId,jdbcType=INTEGER}
|
|
|
@@ -315,7 +315,7 @@
|
|
|
<if test="type != null and type != 0 and type != 1 and type != 2" >
|
|
|
and a.type = #{type,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
- <!--
|
|
|
+ <!--
|
|
|
<if test="hot != null">
|
|
|
and a.hot = #{hot,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
@@ -325,7 +325,7 @@
|
|
|
</if>
|
|
|
<if test="auditStatus!=null">
|
|
|
and a.audit_status=#{auditStatus,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
+ </if>
|
|
|
</select>
|
|
|
<select id="portalNewsPolicy" resultType="com.goafanti.news.bo.NewsPortalList">
|
|
|
select
|
|
|
@@ -366,9 +366,9 @@
|
|
|
LEFT join news n on ni.new_id=n.id
|
|
|
where uid=#{uid,jdbcType=VARCHAR}
|
|
|
</select>
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
<select id="getNewsList" resultType="com.goafanti.common.model.News">
|
|
|
select
|
|
|
title,
|
|
|
@@ -378,17 +378,17 @@ from
|
|
|
news
|
|
|
order by
|
|
|
create_time desc limit #{0}
|
|
|
-</select>
|
|
|
+</select>
|
|
|
<select id="getPolicyDetail" resultType="com.goafanti.common.bo.PolicyEntity">
|
|
|
select p.id,p.title,p.title_img as titleImg,p.summary,
|
|
|
-p.content,dg1.name as provinceS,dg2.name as cityS,edit_time as editTime ,create_time as createTime,p.id,p.source,p.source_url as sourceUrl from policy p
|
|
|
+p.content,dg1.name as provinceS,dg2.name as cityS,edit_time as editTime ,create_time as createTime,p.id,p.source,p.source_url as sourceUrl from policy p
|
|
|
left join district_glossory dg1 on dg1.id=p.province
|
|
|
left join district_glossory dg2 on dg2.id=p.city
|
|
|
where audit_status = 2 and p.id=#{0}
|
|
|
</select>
|
|
|
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
<select id="selectTypeNewsList" resultType="com.goafanti.app.bo.AppDiscoveryBo">
|
|
|
select
|
|
|
a.id,
|
|
|
@@ -399,7 +399,7 @@ where audit_status = 2 and p.id=#{0}
|
|
|
from news a
|
|
|
left join district_glossory d on a.province_id=d.id
|
|
|
where audit_status=2
|
|
|
- <if test="type != null">
|
|
|
+ <if test="type != null">
|
|
|
and a.type =#{type}
|
|
|
</if>
|
|
|
order by a.release_date desc
|
|
|
@@ -407,17 +407,17 @@ where audit_status = 2 and p.id=#{0}
|
|
|
${page_sql}
|
|
|
</if>
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="selectTypeNewsCount" resultType="java.lang.Integer">
|
|
|
- select
|
|
|
+ select
|
|
|
count(0)
|
|
|
from news a
|
|
|
left join district_glossory d on a.province_id=d.id
|
|
|
- where audit_status=2
|
|
|
- <if test="type != null">
|
|
|
+ where audit_status=2
|
|
|
+ <if test="type != null">
|
|
|
and a.type =#{type}
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
|
|
|
-</mapper>
|
|
|
+</mapper>
|