|
|
@@ -0,0 +1,198 @@
|
|
|
+<?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" />
|
|
|
+ </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
|
|
|
+ </sql>
|
|
|
+ <sql id="Blob_Column_List">
|
|
|
+ content
|
|
|
+ </sql>
|
|
|
+ <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List" />
|
|
|
+ ,
|
|
|
+ <include refid="Blob_Column_List" />
|
|
|
+ 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
|
|
|
+ )
|
|
|
+ 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}
|
|
|
+ )
|
|
|
+ </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>
|
|
|
+ </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>
|
|
|
+ </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>
|
|
|
+ </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}
|
|
|
+ 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}
|
|
|
+ where id = #{id,jdbcType=BIGINT}
|
|
|
+ </update>
|
|
|
+</mapper>
|