|
|
@@ -0,0 +1,173 @@
|
|
|
+<?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.JtNewsMapper">
|
|
|
+ <resultMap id="BaseResultMap" type="com.goafanti.common.model.JtNews">
|
|
|
+ <id column="id" jdbcType="INTEGER" property="id" />
|
|
|
+ <result column="title" jdbcType="VARCHAR" property="title" />
|
|
|
+ <result column="publisher" jdbcType="VARCHAR" property="publisher" />
|
|
|
+ <result column="type" jdbcType="INTEGER" property="type" />
|
|
|
+ <result column="picture_url" jdbcType="VARCHAR" property="pictureUrl" />
|
|
|
+ <result column="status" jdbcType="INTEGER" property="status" />
|
|
|
+ <result column="sort" jdbcType="INTEGER" property="sort" />
|
|
|
+ <result column="content" jdbcType="VARCHAR" property="content" />
|
|
|
+ <result column="release_status" jdbcType="INTEGER" property="releaseStatus" />
|
|
|
+ <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
|
|
+ <result column="release_time" jdbcType="TIMESTAMP" property="releaseTime" />
|
|
|
+ </resultMap>
|
|
|
+ <sql id="Base_Column_List">
|
|
|
+ id, title, publisher, `type`, picture_url, `status`, sort, content, release_status,
|
|
|
+ create_time, release_time
|
|
|
+ </sql>
|
|
|
+ <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List" />
|
|
|
+ from jt_news
|
|
|
+ where id = #{id,jdbcType=INTEGER}
|
|
|
+ </select>
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
|
|
+ delete from jt_news
|
|
|
+ where id = #{id,jdbcType=INTEGER}
|
|
|
+ </delete>
|
|
|
+ <insert id="insert" parameterType="com.goafanti.common.model.JtNews">
|
|
|
+ insert into jt_news (id, title, publisher,
|
|
|
+ `type`, picture_url, `status`,
|
|
|
+ sort, content, release_status,
|
|
|
+ create_time, release_time)
|
|
|
+ values (#{id,jdbcType=INTEGER}, #{title,jdbcType=VARCHAR}, #{publisher,jdbcType=VARCHAR},
|
|
|
+ #{type,jdbcType=INTEGER}, #{pictureUrl,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER},
|
|
|
+ #{sort,jdbcType=INTEGER}, #{content,jdbcType=VARCHAR}, #{releaseStatus,jdbcType=INTEGER},
|
|
|
+ #{createTime,jdbcType=TIMESTAMP}, #{releaseTime,jdbcType=TIMESTAMP})
|
|
|
+ </insert>
|
|
|
+ <insert id="insertSelective" parameterType="com.goafanti.common.model.JtNews">
|
|
|
+ insert into jt_news
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">
|
|
|
+ id,
|
|
|
+ </if>
|
|
|
+ <if test="title != null">
|
|
|
+ title,
|
|
|
+ </if>
|
|
|
+ <if test="publisher != null">
|
|
|
+ publisher,
|
|
|
+ </if>
|
|
|
+ <if test="type != null">
|
|
|
+ `type`,
|
|
|
+ </if>
|
|
|
+ <if test="pictureUrl != null">
|
|
|
+ picture_url,
|
|
|
+ </if>
|
|
|
+ <if test="status != null">
|
|
|
+ `status`,
|
|
|
+ </if>
|
|
|
+ <if test="sort != null">
|
|
|
+ sort,
|
|
|
+ </if>
|
|
|
+ <if test="content != null">
|
|
|
+ content,
|
|
|
+ </if>
|
|
|
+ <if test="releaseStatus != null">
|
|
|
+ release_status,
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ create_time,
|
|
|
+ </if>
|
|
|
+ <if test="releaseTime != null">
|
|
|
+ release_time,
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">
|
|
|
+ #{id,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="title != null">
|
|
|
+ #{title,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="publisher != null">
|
|
|
+ #{publisher,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="type != null">
|
|
|
+ #{type,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="pictureUrl != null">
|
|
|
+ #{pictureUrl,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="status != null">
|
|
|
+ #{status,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="sort != null">
|
|
|
+ #{sort,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="content != null">
|
|
|
+ #{content,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="releaseStatus != null">
|
|
|
+ #{releaseStatus,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="releaseTime != null">
|
|
|
+ #{releaseTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.JtNews">
|
|
|
+ update jt_news
|
|
|
+ <set>
|
|
|
+ <if test="title != null">
|
|
|
+ title = #{title,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="publisher != null">
|
|
|
+ publisher = #{publisher,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="type != null">
|
|
|
+ `type` = #{type,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="pictureUrl != null">
|
|
|
+ picture_url = #{pictureUrl,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="status != null">
|
|
|
+ `status` = #{status,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="sort != null">
|
|
|
+ sort = #{sort,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="content != null">
|
|
|
+ content = #{content,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="releaseStatus != null">
|
|
|
+ release_status = #{releaseStatus,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="releaseTime != null">
|
|
|
+ release_time = #{releaseTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where id = #{id,jdbcType=INTEGER}
|
|
|
+ </update>
|
|
|
+ <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.JtNews">
|
|
|
+ update jt_news
|
|
|
+ set title = #{title,jdbcType=VARCHAR},
|
|
|
+ publisher = #{publisher,jdbcType=VARCHAR},
|
|
|
+ `type` = #{type,jdbcType=INTEGER},
|
|
|
+ picture_url = #{pictureUrl,jdbcType=VARCHAR},
|
|
|
+ `status` = #{status,jdbcType=INTEGER},
|
|
|
+ sort = #{sort,jdbcType=INTEGER},
|
|
|
+ content = #{content,jdbcType=VARCHAR},
|
|
|
+ release_status = #{releaseStatus,jdbcType=INTEGER},
|
|
|
+ create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ release_time = #{releaseTime,jdbcType=TIMESTAMP}
|
|
|
+ where id = #{id,jdbcType=INTEGER}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <select id="JtNewsList" resultType="com.goafanti.common.model.JtNews">
|
|
|
+ select id,title,publisher,`type`,picture_url pictureUrl,status,sort,content,release_status releaseStatus,
|
|
|
+ date_format(create_time,'%Y-%m-%d' ) as createTimes,date_format(release_time,'%Y-%m-%d' ) as releaseTimes
|
|
|
+ from jt_news
|
|
|
+ </select>
|
|
|
+ <select id="JtNewsCount">
|
|
|
+
|
|
|
+ </select>
|
|
|
+</mapper>
|