|
@@ -0,0 +1,102 @@
|
|
|
+<?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.highServer.mapper.JnbHighServerMapper">
|
|
|
+
|
|
|
+ <resultMap type="JnbHighServer" id="JnbHighServerResult">
|
|
|
+ <result property="id" column="id"/>
|
|
|
+ <result property="titleName" column="title_name"/>
|
|
|
+ <result property="textDetails" column="text_details"/>
|
|
|
+ <result property="type" column="type"/>
|
|
|
+ <result property="likeNum" column="like_num"/>
|
|
|
+ <result property="watchNum" column="watch_num"/>
|
|
|
+ <result property="createBy" column="create_by"/>
|
|
|
+ <result property="createTime" column="create_time"/>
|
|
|
+ <result property="updateBy" column="update_by"/>
|
|
|
+ <result property="updateTime" column="update_time"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectJnbHighServerVo">
|
|
|
+ SELECT jhs.id,
|
|
|
+ title_name,
|
|
|
+ text_details,
|
|
|
+ jhs.type as type,
|
|
|
+ jhs.create_by,
|
|
|
+ jhs.create_time,
|
|
|
+ jhs.update_by,
|
|
|
+ jhs.update_time,
|
|
|
+ GROUP_CONCAT(jhsi.id) AS imgId,
|
|
|
+ GROUP_CONCAT(jhsi.img_name) AS imgNameList,
|
|
|
+ GROUP_CONCAT(jhsi.img_url) AS imgUrlList
|
|
|
+ FROM jnb_high_server jhs
|
|
|
+ left JOIN jnb_high_server_img jhsi ON jhs.id = jhsi.server_id and jhsi.del_flag = 0
|
|
|
+ where jhs.del_flag = 0
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectJnbHighServerList" resultType="com.sooka.jnb.highServer.vo.JnbHighServerVO">
|
|
|
+ <include refid="selectJnbHighServerVo"/>
|
|
|
+ <if test="titleName != null and titleName != ''">and title_name like concat('%', #{titleName}, '%')</if>
|
|
|
+ <if test="textDetails != null and textDetails != ''">and text_details = #{textDetails}</if>
|
|
|
+ <if test="type != null ">and jhs.type = #{type}</if>
|
|
|
+ GROUP BY jhs.id
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectJnbHighServerById" resultType="com.sooka.jnb.highServer.vo.JnbHighServerVO">
|
|
|
+ <include refid="selectJnbHighServerVo"/>
|
|
|
+ and jhs.id = #{id}
|
|
|
+ GROUP BY jhs.id
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertJnbHighServer" parameterType="JnbHighServer" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ <selectKey keyProperty="id" resultType="java.lang.Long" order="AFTER">
|
|
|
+ SELECT LAST_INSERT_ID() AS id
|
|
|
+ </selectKey>
|
|
|
+ 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>
|
|
|
+ </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>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateJnbHighServer" parameterType="JnbHighServer">
|
|
|
+ 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>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteJnbHighServerById" parameterType="Long">
|
|
|
+ delete
|
|
|
+ from jnb_high_server
|
|
|
+ where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteJnbHighServerByIds" parameterType="String">
|
|
|
+ update jnb_high_server set del_flag = 1 where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|