|
|
@@ -1,382 +1,337 @@
|
|
|
-<?xml version="1.0" encoding="UTF-8"?>
|
|
|
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
-<mapper namespace="com.goafanti.common.dao.NewsMapper">
|
|
|
- <resultMap id="BaseResultMap" type="com.goafanti.common.model.News">
|
|
|
- <id column="id" jdbcType="BIGINT" property="id" />
|
|
|
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
|
|
- <result column="edit_time" jdbcType="TIMESTAMP" property="editTime" />
|
|
|
- <result column="title" jdbcType="VARCHAR" property="title" />
|
|
|
- <result column="title_img" jdbcType="VARCHAR" property="titleImg" />
|
|
|
- <result column="author" jdbcType="VARCHAR" property="author" />
|
|
|
- <result column="type" jdbcType="INTEGER" property="type" />
|
|
|
- <result column="hot" jdbcType="INTEGER" property="hot" />
|
|
|
- <result column="source" jdbcType="VARCHAR" property="source" />
|
|
|
- <result column="source_url" jdbcType="VARCHAR" property="sourceUrl" />
|
|
|
- <result column="summary" jdbcType="VARCHAR" property="summary" />
|
|
|
- <result column="jmrh_flag" jdbcType="INTEGER" property="jmrhFlag" />
|
|
|
- <result column="province_id" jdbcType="INTEGER" property="provinceId" />
|
|
|
- </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,
|
|
|
- summary,jmrh_flag,province_id
|
|
|
- </sql>
|
|
|
- <sql id="Blob_Column_List">
|
|
|
- content
|
|
|
- </sql>
|
|
|
- <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
|
|
|
- select
|
|
|
- id,
|
|
|
- content,
|
|
|
- create_time as createTime,
|
|
|
- edit_time as editTime,
|
|
|
- title,
|
|
|
- title_img as titleImg,
|
|
|
- author,
|
|
|
- type,
|
|
|
- hot,
|
|
|
- source,
|
|
|
- source_url as sourceUrl,
|
|
|
- summary,
|
|
|
- jmrh_flag as jmrhFlag,
|
|
|
- province_id as provinceId,
|
|
|
- audit_status as auditStatus,
|
|
|
- release_status as releaseStatus,
|
|
|
- top_number as topNumber,
|
|
|
- hotspot
|
|
|
- from news
|
|
|
- where id = #{id,jdbcType=BIGINT}
|
|
|
- </select>
|
|
|
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
|
|
- delete from news
|
|
|
- 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,
|
|
|
- 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}, #{topNumber,jdbcType=INTEGER}, #{hotspot,jdbcType=INTEGER}
|
|
|
- )
|
|
|
- </insert>
|
|
|
- <insert id="insertSelective" parameterType="com.goafanti.common.model.News">
|
|
|
- insert into news
|
|
|
- <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
- <if test="id != null">
|
|
|
- id,
|
|
|
- </if>
|
|
|
- <if test="createTime != null">
|
|
|
- create_time,
|
|
|
- </if>
|
|
|
- <if test="editTime != null">
|
|
|
- edit_time,
|
|
|
- </if>
|
|
|
- <if test="title != null">
|
|
|
- title,
|
|
|
- </if>
|
|
|
- <if test="titleImg != null">
|
|
|
- title_img,
|
|
|
- </if>
|
|
|
- <if test="author != null">
|
|
|
- author,
|
|
|
- </if>
|
|
|
- <if test="type != null">
|
|
|
- type,
|
|
|
- </if>
|
|
|
- <if test="hot != null">
|
|
|
- hot,
|
|
|
- </if>
|
|
|
- <if test="source != null">
|
|
|
- source,
|
|
|
- </if>
|
|
|
- <if test="sourceUrl != null">
|
|
|
- source_url,
|
|
|
- </if>
|
|
|
- <if test="summary != null">
|
|
|
- summary,
|
|
|
- </if>
|
|
|
- <if test="content != null">
|
|
|
- content,
|
|
|
- </if>
|
|
|
- <if test="jmrhFlag != null">
|
|
|
- jmrh_flag,
|
|
|
- </if>
|
|
|
- <if test="provinceId != null">
|
|
|
- province_id,
|
|
|
- </if>
|
|
|
- </trim>
|
|
|
- <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
- <if test="id != null">
|
|
|
- #{id,jdbcType=BIGINT},
|
|
|
- </if>
|
|
|
- <if test="createTime != null">
|
|
|
- #{createTime,jdbcType=TIMESTAMP},
|
|
|
- </if>
|
|
|
- <if test="editTime != null">
|
|
|
- #{editTime,jdbcType=TIMESTAMP},
|
|
|
- </if>
|
|
|
- <if test="title != null">
|
|
|
- #{title,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="titleImg != null">
|
|
|
- #{titleImg,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="author != null">
|
|
|
- #{author,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="type != null">
|
|
|
- #{type,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="hot != null">
|
|
|
- #{hot,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="source != null">
|
|
|
- #{source,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="sourceUrl != null">
|
|
|
- #{sourceUrl,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="summary != null">
|
|
|
- #{summary,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="content != null">
|
|
|
- #{content,jdbcType=LONGVARCHAR},
|
|
|
- </if>
|
|
|
- <if test="jmrhFlag != null">
|
|
|
- #{jmrhFlag,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="provinceId != null">
|
|
|
- #{provinceId,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- </trim>
|
|
|
- </insert>
|
|
|
- <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.News">
|
|
|
- update news
|
|
|
- <set>
|
|
|
- <if test="createTime != null">
|
|
|
- create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
- </if>
|
|
|
- <if test="editTime != null">
|
|
|
- edit_time = #{editTime,jdbcType=TIMESTAMP},
|
|
|
- </if>
|
|
|
- <if test="title != null">
|
|
|
- title = #{title,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="titleImg != null">
|
|
|
- title_img = #{titleImg,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="author != null">
|
|
|
- author = #{author,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="type != null">
|
|
|
- type = #{type,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="hot != null">
|
|
|
- hot = #{hot,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- <if test="source != null">
|
|
|
- source = #{source,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="sourceUrl != null">
|
|
|
- source_url = #{sourceUrl,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="summary != null">
|
|
|
- summary = #{summary,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="content != null">
|
|
|
- content = #{content,jdbcType=LONGVARCHAR},
|
|
|
- </if>
|
|
|
- <if test="jmrhFlag != null">
|
|
|
- content = #{jmrhFlag,jdbcType=INTEGER},
|
|
|
- </if>
|
|
|
- </set>
|
|
|
- where id = #{id,jdbcType=BIGINT}
|
|
|
- </update>
|
|
|
- <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.goafanti.common.model.News">
|
|
|
- update news
|
|
|
- set create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
- edit_time = #{editTime,jdbcType=TIMESTAMP},
|
|
|
- title = #{title,jdbcType=VARCHAR},
|
|
|
- title_img = #{titleImg,jdbcType=VARCHAR},
|
|
|
- author = #{author,jdbcType=VARCHAR},
|
|
|
- type = #{type,jdbcType=INTEGER},
|
|
|
- hot = #{hot,jdbcType=INTEGER},
|
|
|
- source = #{source,jdbcType=VARCHAR},
|
|
|
- source_url = #{sourceUrl,jdbcType=VARCHAR},
|
|
|
- summary = #{summary,jdbcType=VARCHAR},
|
|
|
- content = #{content,jdbcType=LONGVARCHAR},
|
|
|
- jmrh_flag = #{jmrhFlag,jdbcType=INTEGER},
|
|
|
- province_id = #{provinceId,jdbcType=INTEGER},
|
|
|
- audit_status = #{auditStatus,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">
|
|
|
- update news
|
|
|
- set create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
- edit_time = #{editTime,jdbcType=TIMESTAMP},
|
|
|
- title = #{title,jdbcType=VARCHAR},
|
|
|
- title_img = #{titleImg,jdbcType=VARCHAR},
|
|
|
- author = #{author,jdbcType=VARCHAR},
|
|
|
- type = #{type,jdbcType=INTEGER},
|
|
|
- hot = #{hot,jdbcType=INTEGER},
|
|
|
- source = #{source,jdbcType=VARCHAR},
|
|
|
- source_url = #{sourceUrl,jdbcType=VARCHAR},
|
|
|
- summary = #{summary,jdbcType=VARCHAR},
|
|
|
- jmrh_flag = #{jmrhFlag,jdbcType=INTEGER},
|
|
|
- province_id = #{provinceId,jdbcType=INTEGER}
|
|
|
- where id = #{id,jdbcType=BIGINT}
|
|
|
- </update>
|
|
|
- <select id="portalNewsList" 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
|
|
|
- from news a
|
|
|
- where
|
|
|
- a.type != 1 and a.type != 2
|
|
|
- <if test="provinceId != null">
|
|
|
- and a.province_id = #{provinceId,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
-
|
|
|
- <if test="type != null and type != 0 " >
|
|
|
- and a.type = #{type,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- <!--
|
|
|
- <if test="hot != null">
|
|
|
- and a.hot = #{hot,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- -->
|
|
|
- <if test="keyword != null">
|
|
|
- and a.title like concat('%',#{keyword},'%')
|
|
|
- </if>
|
|
|
- order by create_time desc
|
|
|
- <if test="page_sql != null">
|
|
|
- ${page_sql}
|
|
|
- </if>
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="portalNewsCount" resultType="java.lang.Integer">
|
|
|
- select
|
|
|
- count(0)
|
|
|
- from news a
|
|
|
- where
|
|
|
- a.type != 1 and a.type != 2
|
|
|
- <if test="provinceId != null">
|
|
|
- and a.province_id = #{provinceId,jdbcType=INTEGER}
|
|
|
- </if>
|
|
|
- <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>
|
|
|
- -->
|
|
|
- <if test="keyword != null">
|
|
|
- and a.title like concat('%',#{keyword},'%')
|
|
|
- </if>
|
|
|
- </select>
|
|
|
- <select id="portalNewsPolicy" resultType="com.goafanti.news.bo.NewsPortalList">
|
|
|
- select
|
|
|
- a.id,
|
|
|
- DATE_FORMAT(a.create_time,'%Y-%d-%m') as createTime,
|
|
|
- a.title,
|
|
|
- a.title_img as titleImg,
|
|
|
- a.type,
|
|
|
- a.hot,
|
|
|
- a.summary,
|
|
|
- a.source,
|
|
|
- a.content
|
|
|
- from news a
|
|
|
- where
|
|
|
- a.type =5 or a.type =4
|
|
|
- order by create_time desc
|
|
|
- </select>
|
|
|
- <select id="portalNewsQuestion" resultType="com.goafanti.news.bo.NewsPortalList">
|
|
|
- select
|
|
|
- a.id,
|
|
|
- DATE_FORMAT(a.create_time,'%Y-%d-%m') as createTime,
|
|
|
- a.title,
|
|
|
- a.title_img as titleImg,
|
|
|
- a.type,
|
|
|
- a.hot,
|
|
|
- a.summary,
|
|
|
- a.source,
|
|
|
- a.content
|
|
|
- from news a
|
|
|
- where
|
|
|
- a.type =2
|
|
|
- order by create_time desc
|
|
|
- </select>
|
|
|
- <select id="newsInterest" resultType="com.goafanti.news.bo.newsInterestBo">
|
|
|
- select
|
|
|
- n.id,n.title ,n.create_time as createTime
|
|
|
- from news_interest ni
|
|
|
- LEFT join news n on ni.new_id=n.id
|
|
|
- where uid=#{uid,jdbcType=VARCHAR}
|
|
|
- </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>
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+<?xml version="1.0" encoding="UTF-8"?>
|
|
|
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
+<mapper namespace="com.goafanti.common.dao.NewsMapper">
|
|
|
+ <resultMap id="BaseResultMap" type="com.goafanti.common.model.News">
|
|
|
+ <id column="id" jdbcType="BIGINT" property="id" />
|
|
|
+ <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
|
|
+ <result column="edit_time" jdbcType="TIMESTAMP" property="editTime" />
|
|
|
+ <result column="title" jdbcType="VARCHAR" property="title" />
|
|
|
+ <result column="title_img" jdbcType="VARCHAR" property="titleImg" />
|
|
|
+ <result column="author" jdbcType="VARCHAR" property="author" />
|
|
|
+ <result column="type" jdbcType="INTEGER" property="type" />
|
|
|
+ <result column="hot" jdbcType="INTEGER" property="hot" />
|
|
|
+ <result column="source" jdbcType="VARCHAR" property="source" />
|
|
|
+ <result column="source_url" jdbcType="VARCHAR" property="sourceUrl" />
|
|
|
+ <result column="summary" jdbcType="VARCHAR" property="summary" />
|
|
|
+ <result column="jmrh_flag" jdbcType="INTEGER" property="jmrhFlag" />
|
|
|
+ <result column="province_id" jdbcType="INTEGER" property="provinceId" />
|
|
|
+ </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,
|
|
|
+ summary,jmrh_flag,province_id
|
|
|
+ </sql>
|
|
|
+ <sql id="Blob_Column_List">
|
|
|
+ content
|
|
|
+ </sql>
|
|
|
+ <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
|
|
|
+ select
|
|
|
+ id,
|
|
|
+ content,
|
|
|
+ create_time as createTime,
|
|
|
+ edit_time as editTime,
|
|
|
+ title,
|
|
|
+ title_img as titleImg,
|
|
|
+ author,
|
|
|
+ type,
|
|
|
+ hot,
|
|
|
+ source,
|
|
|
+ source_url as sourceUrl,
|
|
|
+ summary,
|
|
|
+ jmrh_flag as jmrhFlag,
|
|
|
+ province_id as provinceId,
|
|
|
+ audit_status as auditStatus,
|
|
|
+ release_status as releaseStatus,
|
|
|
+ top_number as topNumber,
|
|
|
+ hotspot
|
|
|
+ from news
|
|
|
+ where id = #{id,jdbcType=BIGINT}
|
|
|
+ </select>
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
|
|
+ delete from news
|
|
|
+ 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,
|
|
|
+ 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}, #{topNumber,jdbcType=INTEGER}, #{hotspot,jdbcType=INTEGER}
|
|
|
+ )
|
|
|
+ </insert>
|
|
|
+ <insert id="insertSelective" parameterType="com.goafanti.common.model.News">
|
|
|
+ insert into news
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">
|
|
|
+ id,
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ create_time,
|
|
|
+ </if>
|
|
|
+ <if test="editTime != null">
|
|
|
+ edit_time,
|
|
|
+ </if>
|
|
|
+ <if test="title != null">
|
|
|
+ title,
|
|
|
+ </if>
|
|
|
+ <if test="titleImg != null">
|
|
|
+ title_img,
|
|
|
+ </if>
|
|
|
+ <if test="author != null">
|
|
|
+ author,
|
|
|
+ </if>
|
|
|
+ <if test="type != null">
|
|
|
+ type,
|
|
|
+ </if>
|
|
|
+ <if test="hot != null">
|
|
|
+ hot,
|
|
|
+ </if>
|
|
|
+ <if test="source != null">
|
|
|
+ source,
|
|
|
+ </if>
|
|
|
+ <if test="sourceUrl != null">
|
|
|
+ source_url,
|
|
|
+ </if>
|
|
|
+ <if test="summary != null">
|
|
|
+ summary,
|
|
|
+ </if>
|
|
|
+ <if test="content != null">
|
|
|
+ content,
|
|
|
+ </if>
|
|
|
+ <if test="jmrhFlag != null">
|
|
|
+ jmrh_flag,
|
|
|
+ </if>
|
|
|
+ <if test="provinceId != null">
|
|
|
+ province_id,
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">
|
|
|
+ #{id,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="editTime != null">
|
|
|
+ #{editTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="title != null">
|
|
|
+ #{title,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="titleImg != null">
|
|
|
+ #{titleImg,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="author != null">
|
|
|
+ #{author,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="type != null">
|
|
|
+ #{type,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="hot != null">
|
|
|
+ #{hot,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="source != null">
|
|
|
+ #{source,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="sourceUrl != null">
|
|
|
+ #{sourceUrl,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="summary != null">
|
|
|
+ #{summary,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="content != null">
|
|
|
+ #{content,jdbcType=LONGVARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="jmrhFlag != null">
|
|
|
+ #{jmrhFlag,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="provinceId != null">
|
|
|
+ #{provinceId,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.News">
|
|
|
+ update news
|
|
|
+ <set>
|
|
|
+ <if test="createTime != null">
|
|
|
+ create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="editTime != null">
|
|
|
+ edit_time = #{editTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="title != null">
|
|
|
+ title = #{title,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="titleImg != null">
|
|
|
+ title_img = #{titleImg,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="author != null">
|
|
|
+ author = #{author,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="type != null">
|
|
|
+ type = #{type,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="hot != null">
|
|
|
+ hot = #{hot,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="source != null">
|
|
|
+ source = #{source,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="sourceUrl != null">
|
|
|
+ source_url = #{sourceUrl,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="summary != null">
|
|
|
+ summary = #{summary,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="content != null">
|
|
|
+ content = #{content,jdbcType=LONGVARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="jmrhFlag != null">
|
|
|
+ content = #{jmrhFlag,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where id = #{id,jdbcType=BIGINT}
|
|
|
+ </update>
|
|
|
+ <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.goafanti.common.model.News">
|
|
|
+ update news
|
|
|
+ set create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ edit_time = #{editTime,jdbcType=TIMESTAMP},
|
|
|
+ title = #{title,jdbcType=VARCHAR},
|
|
|
+ title_img = #{titleImg,jdbcType=VARCHAR},
|
|
|
+ author = #{author,jdbcType=VARCHAR},
|
|
|
+ type = #{type,jdbcType=INTEGER},
|
|
|
+ hot = #{hot,jdbcType=INTEGER},
|
|
|
+ source = #{source,jdbcType=VARCHAR},
|
|
|
+ source_url = #{sourceUrl,jdbcType=VARCHAR},
|
|
|
+ summary = #{summary,jdbcType=VARCHAR},
|
|
|
+ content = #{content,jdbcType=LONGVARCHAR},
|
|
|
+ jmrh_flag = #{jmrhFlag,jdbcType=INTEGER},
|
|
|
+ province_id = #{provinceId,jdbcType=INTEGER},
|
|
|
+ audit_status = #{auditStatus,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">
|
|
|
+ update news
|
|
|
+ set create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ edit_time = #{editTime,jdbcType=TIMESTAMP},
|
|
|
+ title = #{title,jdbcType=VARCHAR},
|
|
|
+ title_img = #{titleImg,jdbcType=VARCHAR},
|
|
|
+ author = #{author,jdbcType=VARCHAR},
|
|
|
+ type = #{type,jdbcType=INTEGER},
|
|
|
+ hot = #{hot,jdbcType=INTEGER},
|
|
|
+ source = #{source,jdbcType=VARCHAR},
|
|
|
+ source_url = #{sourceUrl,jdbcType=VARCHAR},
|
|
|
+ summary = #{summary,jdbcType=VARCHAR},
|
|
|
+ jmrh_flag = #{jmrhFlag,jdbcType=INTEGER},
|
|
|
+ province_id = #{provinceId,jdbcType=INTEGER}
|
|
|
+ where id = #{id,jdbcType=BIGINT}
|
|
|
+ </update>
|
|
|
+ <select id="portalNewsList" 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
|
|
|
+ from news a
|
|
|
+ where
|
|
|
+ a.type != 1 and a.type != 2
|
|
|
+ <if test="provinceId != null">
|
|
|
+ and a.province_id = #{provinceId,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="type != null and type != 0 " >
|
|
|
+ and a.type = #{type,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <!--
|
|
|
+ <if test="hot != null">
|
|
|
+ and a.hot = #{hot,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ -->
|
|
|
+ <if test="keyword != null">
|
|
|
+ and a.title like concat('%',#{keyword},'%')
|
|
|
+ </if>
|
|
|
+ order by create_time desc
|
|
|
+ <if test="page_sql != null">
|
|
|
+ ${page_sql}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="portalNewsCount" resultType="java.lang.Integer">
|
|
|
+ select
|
|
|
+ count(0)
|
|
|
+ from news a
|
|
|
+ where
|
|
|
+ a.type != 1 and a.type != 2
|
|
|
+ <if test="provinceId != null">
|
|
|
+ and a.province_id = #{provinceId,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <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>
|
|
|
+ -->
|
|
|
+ <if test="keyword != null">
|
|
|
+ and a.title like concat('%',#{keyword},'%')
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+ <select id="portalNewsPolicy" resultType="com.goafanti.news.bo.NewsPortalList">
|
|
|
+ select
|
|
|
+ a.id,
|
|
|
+ DATE_FORMAT(a.create_time,'%Y-%d-%m') as createTime,
|
|
|
+ a.title,
|
|
|
+ a.title_img as titleImg,
|
|
|
+ a.type,
|
|
|
+ a.hot,
|
|
|
+ a.summary,
|
|
|
+ a.source,
|
|
|
+ a.content
|
|
|
+ from news a
|
|
|
+ where
|
|
|
+ a.type =5 or a.type =4
|
|
|
+ order by create_time desc
|
|
|
+ </select>
|
|
|
+ <select id="portalNewsQuestion" resultType="com.goafanti.news.bo.NewsPortalList">
|
|
|
+ select
|
|
|
+ a.id,
|
|
|
+ DATE_FORMAT(a.create_time,'%Y-%d-%m') as createTime,
|
|
|
+ a.title,
|
|
|
+ a.title_img as titleImg,
|
|
|
+ a.type,
|
|
|
+ a.hot,
|
|
|
+ a.summary,
|
|
|
+ a.source,
|
|
|
+ a.content
|
|
|
+ from news a
|
|
|
+ where
|
|
|
+ a.type =2
|
|
|
+ order by create_time desc
|
|
|
+ </select>
|
|
|
+ <select id="newsInterest" resultType="com.goafanti.news.bo.newsInterestBo">
|
|
|
+ select
|
|
|
+ n.id,n.title ,n.create_time as createTime
|
|
|
+ from news_interest ni
|
|
|
+ LEFT join news n on ni.new_id=n.id
|
|
|
+ where uid=#{uid,jdbcType=VARCHAR}
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
</mapper>
|