|
@@ -0,0 +1,123 @@
|
|
|
+<?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.sooka.jnb.information.mapper.InformationMapper">
|
|
|
+
|
|
|
+ <resultMap type="Information" id="InformationResult">
|
|
|
+ <result property="id" column="id"/>
|
|
|
+ <result property="titleName" column="title_name"/>
|
|
|
+ <result property="textDetails" column="text_details"/>
|
|
|
+ <result property="type" column="type"/>
|
|
|
+ <result property="isGovernment" column="is_government"/>
|
|
|
+ <result property="likeNum" column="like_num"/>
|
|
|
+ <result property="watchNum" column="watch_num"/>
|
|
|
+ <result property="isTop" column="is_top"/>
|
|
|
+ <result property="createBy" column="create_by"/>
|
|
|
+ <result property="createTime" column="create_time"/>
|
|
|
+ <result property="updateBy" column="update_by"/>
|
|
|
+ <result property="updateTime" column="update_time"/>
|
|
|
+ <result property="delFlag" column="del_flag"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectInformationVo">
|
|
|
+ select id,
|
|
|
+ title_name,
|
|
|
+ text_details,
|
|
|
+ type,
|
|
|
+ create_by,
|
|
|
+ create_time,
|
|
|
+ update_by,
|
|
|
+ update_time,
|
|
|
+ del_flag,
|
|
|
+ is_government,
|
|
|
+ is_top,
|
|
|
+ like_num,
|
|
|
+ watch_num
|
|
|
+ from jnb_high_server
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectInformationList" parameterType="Information" resultMap="InformationResult">
|
|
|
+ <include refid="selectInformationVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="titleName != null and titleName != ''">and title_name like concat('%', #{titleName}, '%')</if>
|
|
|
+ <if test="type != null and type != ''">and type = #{type}</if>
|
|
|
+ <if test="isGovernment != null and isGovernment != ''">and is_government = #{isGovernment}</if>
|
|
|
+ <if test="isTop != null and isTop != ''">and is_top = #{isTop}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectInformationById" parameterType="Long" resultMap="InformationResult">
|
|
|
+ <include refid="selectInformationVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertInformation" parameterType="Information" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into jnb_high_server
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="titleName != null">title_name,</if>
|
|
|
+ <if test="textDetails != null">text_details,</if>
|
|
|
+ <if test="type != null">type,</if>
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="updateBy != null">update_by,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+
|
|
|
+ <if test="watchNum != null">watch_num,</if>
|
|
|
+ <if test="likeNum != null">like_time,</if>
|
|
|
+ <if test="isTop != null">is_top,</if>
|
|
|
+ <if test="isGovernment != null">is_government,</if>
|
|
|
+ <if test="delFlag != null">del_flag</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="titleName != null">#{titleName},</if>
|
|
|
+ <if test="textDetails != null">#{textDetails},</if>
|
|
|
+ <if test="type != null">#{type},</if>
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="updateBy != null">#{updateBy},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ <if test="watchNum != null">watch_num,</if>
|
|
|
+ <if test="likeNum != null">like_num,</if>
|
|
|
+ <if test="isTop != null">is_top,</if>
|
|
|
+ <if test="isGovernment != null">is_government,</if>
|
|
|
+ <if test="delFlag != null">del_flag</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateInformation" parameterType="Information">
|
|
|
+ update jnb_high_server
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="titleName != null">title_name = #{titleName},</if>
|
|
|
+ <if test="textDetails != null">text_details = #{textDetails},</if>
|
|
|
+ <if test="type != null">type = #{type},</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>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+
|
|
|
+ <if test="watchNum != null">watch_num=#{watchNum},</if>
|
|
|
+ <if test="likeNum != null">like_num=#{likeNum},</if>
|
|
|
+ <if test="isTop != null">is_top=#{isTop},</if>
|
|
|
+ <if test="isGovernment != null">is_government=#{isGovernment},</if>
|
|
|
+ <if test="delFlag != null">del_flag=#{delFlag}</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <update id="deleteInformationById" parameterType="Long">
|
|
|
+ UPDATE jnb_high_server
|
|
|
+ SET del_flag = 2
|
|
|
+ WHERE id = #{id};
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteInformationByIds" parameterType="Long">
|
|
|
+ UPDATE jnb_high_server
|
|
|
+ SET del_flag = 2
|
|
|
+ WHERE id IN
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>;
|
|
|
+
|
|
|
+ </delete>
|
|
|
+</mapper>
|