| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652 |
- <?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.JtKnowledgeBaseMapper">
- <resultMap id="BaseResultMap" type="com.goafanti.common.model.JtKnowledgeBase">
- <!--
- WARNING - @mbggenerated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Wed Nov 07 10:11:18 CST 2018.
- -->
- <result column="id" jdbcType="VARCHAR" property="id" />
- <result column="category" jdbcType="INTEGER" property="category" />
- <result column="title" jdbcType="VARCHAR" property="title" />
- <result column="summary" jdbcType="VARCHAR" property="summary" />
- <result column="source" jdbcType="VARCHAR" property="source" />
- <result column="status" jdbcType="INTEGER" property="status" />
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
- <result column="owner" jdbcType="VARCHAR" property="owner" />
- <result column="release_time" jdbcType="TIMESTAMP" property="releaseTime" />
- <result column="read_number" jdbcType="INTEGER" property="readNumber" />
- <result column="comment_number" jdbcType="INTEGER" property="commentNumber" />
- <result column="star_number" jdbcType="INTEGER" property="starNumber" />
- <result column="keyword" jdbcType="VARCHAR" property="keyword" />
- <result column="pic_url" jdbcType="VARCHAR" property="picUrl" />
- <result column="top" jdbcType="INTEGER" property="top" />
- <result column="recommend" jdbcType="INTEGER" property="recommend" />
- </resultMap>
- <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.goafanti.common.model.JtKnowledgeBase">
- <!--
- WARNING - @mbggenerated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Wed Nov 07 10:11:18 CST 2018.
- -->
- <result column="content" jdbcType="LONGVARCHAR" property="content" />
- </resultMap>
- <sql id="Example_Where_Clause">
- <!--
- WARNING - @mbggenerated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Wed Nov 07 10:11:18 CST 2018.
- -->
- <where>
- <foreach collection="oredCriteria" item="criteria" separator="or">
- <if test="criteria.valid">
- <trim prefix="(" prefixOverrides="and" suffix=")">
- <foreach collection="criteria.criteria" item="criterion">
- <choose>
- <when test="criterion.noValue">
- and ${criterion.condition}
- </when>
- <when test="criterion.singleValue">
- and ${criterion.condition} #{criterion.value}
- </when>
- <when test="criterion.betweenValue">
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
- </when>
- <when test="criterion.listValue">
- and ${criterion.condition}
- <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
- #{listItem}
- </foreach>
- </when>
- </choose>
- </foreach>
- </trim>
- </if>
- </foreach>
- </where>
- </sql>
- <sql id="Update_By_Example_Where_Clause">
- <!--
- WARNING - @mbggenerated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Wed Nov 07 10:11:18 CST 2018.
- -->
- <where>
- <foreach collection="example.oredCriteria" item="criteria" separator="or">
- <if test="criteria.valid">
- <trim prefix="(" prefixOverrides="and" suffix=")">
- <foreach collection="criteria.criteria" item="criterion">
- <choose>
- <when test="criterion.noValue">
- and ${criterion.condition}
- </when>
- <when test="criterion.singleValue">
- and ${criterion.condition} #{criterion.value}
- </when>
- <when test="criterion.betweenValue">
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
- </when>
- <when test="criterion.listValue">
- and ${criterion.condition}
- <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
- #{listItem}
- </foreach>
- </when>
- </choose>
- </foreach>
- </trim>
- </if>
- </foreach>
- </where>
- </sql>
- <sql id="Base_Column_List">
- <!--
- WARNING - @mbggenerated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Wed Nov 07 10:11:18 CST 2018.
- -->
- id, category, title, summary, source, status, create_time, owner, release_time, read_number,
- comment_number, star_number, keyword, pic_url, top, recommend
- </sql>
- <sql id="Blob_Column_List">
- <!--
- WARNING - @mbggenerated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Wed Nov 07 10:11:18 CST 2018.
- -->
- content
- </sql>
- <select id="selectByExampleWithBLOBs" parameterType="com.goafanti.common.model.JtKnowledgeBaseExample" resultMap="ResultMapWithBLOBs">
- <!--
- WARNING - @mbggenerated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Wed Nov 07 10:11:18 CST 2018.
- -->
- select
- <if test="distinct">
- distinct
- </if>
- <include refid="Base_Column_List" />
- ,
- <include refid="Blob_Column_List" />
- from jt_knowledge_base
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- <if test="orderByClause != null">
- order by ${orderByClause}
- </if>
- </select>
- <select id="selectByExample" parameterType="com.goafanti.common.model.JtKnowledgeBaseExample" resultMap="BaseResultMap">
- <!--
- WARNING - @mbggenerated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Wed Nov 07 10:11:18 CST 2018.
- -->
- select
- <if test="distinct">
- distinct
- </if>
- <include refid="Base_Column_List" />
- from jt_knowledge_base
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- <if test="orderByClause != null">
- order by ${orderByClause}
- </if>
- </select>
- <delete id="deleteByExample" parameterType="com.goafanti.common.model.JtKnowledgeBaseExample">
- <!--
- WARNING - @mbggenerated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Wed Nov 07 10:11:18 CST 2018.
- -->
- delete from jt_knowledge_base
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- </delete>
- <insert id="insert" parameterType="com.goafanti.common.model.JtKnowledgeBase">
- <!--
- WARNING - @mbggenerated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Wed Nov 07 10:11:18 CST 2018.
- -->
- insert into jt_knowledge_base (id, category, title,
- summary, source, status,
- create_time, owner, release_time,
- read_number, comment_number, star_number,
- keyword, pic_url, top,
- recommend, content)
- values (#{id,jdbcType=VARCHAR}, #{category,jdbcType=INTEGER}, #{title,jdbcType=VARCHAR},
- #{summary,jdbcType=VARCHAR}, #{source,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER},
- #{createTime,jdbcType=TIMESTAMP}, #{owner,jdbcType=VARCHAR}, #{releaseTime,jdbcType=TIMESTAMP},
- #{readNumber,jdbcType=INTEGER}, #{commentNumber,jdbcType=INTEGER}, #{starNumber,jdbcType=INTEGER},
- #{keyword,jdbcType=VARCHAR}, #{picUrl,jdbcType=VARCHAR}, #{top,jdbcType=INTEGER},
- #{recommend,jdbcType=INTEGER}, #{content,jdbcType=LONGVARCHAR})
- </insert>
- <insert id="insertSelective" parameterType="com.goafanti.common.model.JtKnowledgeBase">
- <!--
- WARNING - @mbggenerated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Wed Nov 07 10:11:18 CST 2018.
- -->
- insert into jt_knowledge_base
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">
- id,
- </if>
- <if test="category != null">
- category,
- </if>
- <if test="title != null">
- title,
- </if>
- <if test="summary != null">
- summary,
- </if>
- <if test="source != null">
- source,
- </if>
- <if test="status != null">
- status,
- </if>
- <if test="createTime != null">
- create_time,
- </if>
- <if test="owner != null">
- owner,
- </if>
- <if test="releaseTime != null">
- release_time,
- </if>
- <if test="readNumber != null">
- read_number,
- </if>
- <if test="commentNumber != null">
- comment_number,
- </if>
- <if test="starNumber != null">
- star_number,
- </if>
- <if test="keyword != null">
- keyword,
- </if>
- <if test="picUrl != null">
- pic_url,
- </if>
- <if test="top != null">
- top,
- </if>
- <if test="recommend != null">
- recommend,
- </if>
- <if test="content != null">
- content,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">
- #{id,jdbcType=VARCHAR},
- </if>
- <if test="category != null">
- #{category,jdbcType=INTEGER},
- </if>
- <if test="title != null">
- #{title,jdbcType=VARCHAR},
- </if>
- <if test="summary != null">
- #{summary,jdbcType=VARCHAR},
- </if>
- <if test="source != null">
- #{source,jdbcType=VARCHAR},
- </if>
- <if test="status != null">
- #{status,jdbcType=INTEGER},
- </if>
- <if test="createTime != null">
- #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="owner != null">
- #{owner,jdbcType=VARCHAR},
- </if>
- <if test="releaseTime != null">
- #{releaseTime,jdbcType=TIMESTAMP},
- </if>
- <if test="readNumber != null">
- #{readNumber,jdbcType=INTEGER},
- </if>
- <if test="commentNumber != null">
- #{commentNumber,jdbcType=INTEGER},
- </if>
- <if test="starNumber != null">
- #{starNumber,jdbcType=INTEGER},
- </if>
- <if test="keyword != null">
- #{keyword,jdbcType=VARCHAR},
- </if>
- <if test="picUrl != null">
- #{picUrl,jdbcType=VARCHAR},
- </if>
- <if test="top != null">
- #{top,jdbcType=INTEGER},
- </if>
- <if test="recommend != null">
- #{recommend,jdbcType=INTEGER},
- </if>
- <if test="content != null">
- #{content,jdbcType=LONGVARCHAR},
- </if>
- </trim>
- </insert>
- <select id="countByExample" parameterType="com.goafanti.common.model.JtKnowledgeBaseExample" resultType="java.lang.Integer">
- <!--
- WARNING - @mbggenerated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Wed Nov 07 10:11:18 CST 2018.
- -->
- select count(*) from jt_knowledge_base
- <if test="_parameter != null">
- <include refid="Example_Where_Clause" />
- </if>
- </select>
- <update id="updateByExampleSelective" parameterType="map">
- <!--
- WARNING - @mbggenerated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Wed Nov 07 10:11:18 CST 2018.
- -->
- update jt_knowledge_base
- <set>
- <if test="record.id != null">
- id = #{record.id,jdbcType=VARCHAR},
- </if>
- <if test="record.category != null">
- category = #{record.category,jdbcType=INTEGER},
- </if>
- <if test="record.title != null">
- title = #{record.title,jdbcType=VARCHAR},
- </if>
- <if test="record.summary != null">
- summary = #{record.summary,jdbcType=VARCHAR},
- </if>
- <if test="record.source != null">
- source = #{record.source,jdbcType=VARCHAR},
- </if>
- <if test="record.status != null">
- status = #{record.status,jdbcType=INTEGER},
- </if>
- <if test="record.createTime != null">
- create_time = #{record.createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="record.owner != null">
- owner = #{record.owner,jdbcType=VARCHAR},
- </if>
- <if test="record.releaseTime != null">
- release_time = #{record.releaseTime,jdbcType=TIMESTAMP},
- </if>
- <if test="record.readNumber != null">
- read_number = #{record.readNumber,jdbcType=INTEGER},
- </if>
- <if test="record.commentNumber != null">
- comment_number = #{record.commentNumber,jdbcType=INTEGER},
- </if>
- <if test="record.starNumber != null">
- star_number = #{record.starNumber,jdbcType=INTEGER},
- </if>
- <if test="record.keyword != null">
- keyword = #{record.keyword,jdbcType=VARCHAR},
- </if>
- <if test="record.picUrl != null">
- pic_url = #{record.picUrl,jdbcType=VARCHAR},
- </if>
- <if test="record.top != null">
- top = #{record.top,jdbcType=INTEGER},
- </if>
- <if test="record.recommend != null">
- recommend = #{record.recommend,jdbcType=INTEGER},
- </if>
- <if test="record.content != null">
- content = #{record.content,jdbcType=LONGVARCHAR},
- </if>
- </set>
- <if test="_parameter != null">
- <include refid="Update_By_Example_Where_Clause" />
- </if>
- </update>
- <update id="updateByExampleWithBLOBs" parameterType="map">
- <!--
- WARNING - @mbggenerated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Wed Nov 07 10:11:18 CST 2018.
- -->
- update jt_knowledge_base
- set id = #{record.id,jdbcType=VARCHAR},
- category = #{record.category,jdbcType=INTEGER},
- title = #{record.title,jdbcType=VARCHAR},
- summary = #{record.summary,jdbcType=VARCHAR},
- source = #{record.source,jdbcType=VARCHAR},
- status = #{record.status,jdbcType=INTEGER},
- create_time = #{record.createTime,jdbcType=TIMESTAMP},
- owner = #{record.owner,jdbcType=VARCHAR},
- release_time = #{record.releaseTime,jdbcType=TIMESTAMP},
- read_number = #{record.readNumber,jdbcType=INTEGER},
- comment_number = #{record.commentNumber,jdbcType=INTEGER},
- star_number = #{record.starNumber,jdbcType=INTEGER},
- keyword = #{record.keyword,jdbcType=VARCHAR},
- pic_url = #{record.picUrl,jdbcType=VARCHAR},
- top = #{record.top,jdbcType=INTEGER},
- recommend = #{record.recommend,jdbcType=INTEGER},
- content = #{record.content,jdbcType=LONGVARCHAR}
- <if test="_parameter != null">
- <include refid="Update_By_Example_Where_Clause" />
- </if>
- </update>
- <update id="updateByExample" parameterType="map">
- <!--
- WARNING - @mbggenerated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Wed Nov 07 10:11:18 CST 2018.
- -->
- update jt_knowledge_base
- set id = #{record.id,jdbcType=VARCHAR},
- category = #{record.category,jdbcType=INTEGER},
- title = #{record.title,jdbcType=VARCHAR},
- summary = #{record.summary,jdbcType=VARCHAR},
- source = #{record.source,jdbcType=VARCHAR},
- status = #{record.status,jdbcType=INTEGER},
- create_time = #{record.createTime,jdbcType=TIMESTAMP},
- owner = #{record.owner,jdbcType=VARCHAR},
- release_time = #{record.releaseTime,jdbcType=TIMESTAMP},
- read_number = #{record.readNumber,jdbcType=INTEGER},
- comment_number = #{record.commentNumber,jdbcType=INTEGER},
- star_number = #{record.starNumber,jdbcType=INTEGER},
- keyword = #{record.keyword,jdbcType=VARCHAR},
- pic_url = #{record.picUrl,jdbcType=VARCHAR},
- top = #{record.top,jdbcType=INTEGER},
- recommend = #{record.recommend,jdbcType=INTEGER}
- <if test="_parameter != null">
- <include refid="Update_By_Example_Where_Clause" />
- </if>
- </update>
-
- <!-- 获得列表 -->
- <select id="getKnowledgeBaseListBySome" parameterType="java.util.Map" resultType="com.goafanti.admin.bo.KnowledgeBaseBo">
- select
- v.id, v.category, v.title, v.summary, v.source, v.status, v.create_time as createTime, v.owner, v.release_time as releaseTime,
- v.read_number as readNumber,
- v.comment_number as commentNumber, v.star_number as starNumber, v.keyword, v.pic_url as picUrl, v.top, v.recommend, a.name as ownerName
- from jt_knowledge_base v
- left join admin a on v.owner = a.id
- where 1=1
- <if test='v.title != null and v.title != ""'>
- <bind name="n" value="'%' + v.title + '%' " />
- and v.title like #{n,jdbcType=VARCHAR}
- </if>
- <if test="v.category != null">
- and v.category = #{v.category,jdbcType=INTEGER}
- </if>
- <if test="v.status != null">
- and v.status = #{v.status,jdbcType=INTEGER}
- </if>
- <if test="v.status == null">
- and v.status <> 2
- </if>
- <if test="v.owner != null">
- and v.owner = #{v.owner,jdbcType=VARCHAR}
- </if>
- <if test='v.keyword != null and v.keyword != ""'>
- <bind name="kw" value="'%' + v.keyword + '%' "/>
- and v.keyword like #{kw,jdbcType=VARCHAR}
- </if>
- <if test="v.startTime != null and v.endTime != null">
- <bind name="st" value=" v.startTime + ' 00:00:00' "/>
- <bind name="et" value=" v.endTime + ' 23:59:59' "/>
- and v.release_time between #{st,jdbcType=VARCHAR} and #{et,jdbcType=VARCHAR}
- </if>
- <if test="v.top != null">
- and v.top = #{v.top,jdbcType=INTEGER}
- </if>
- <if test="v.recommend != null">
- and v.recommend = #{v.recommend,jdbcType=INTEGER}
- </if>
- <if test="ob == 1">
- order by v.create_time desc
- </if>
- <if test="ob == 2">
- order by v.release_time desc
- </if>
- <if test="page_sql!=null">
- ${page_sql}
- </if>
- </select>
- <!-- 获得总数 -->
- <select id="getKnowledgeBaseCountBySome" parameterType="java.util.Map" resultType="java.lang.Integer">
- select count(*)
- from jt_knowledge_base v
- left join admin a on v.owner = a.id
- where 1=1
- <if test='v.title != null and v.title != ""'>
- <bind name="n" value="'%' + v.title + '%' " />
- and v.title like #{n,jdbcType=VARCHAR}
- </if>
- <if test="v.category != null">
- and v.category = #{v.category,jdbcType=INTEGER}
- </if>
- <if test="v.status != null">
- and v.status = #{v.status,jdbcType=INTEGER}
- </if>
- <if test="v.status == null">
- and v.status <> 2
- </if>
- <if test="v.owner != null">
- and v.owner = #{v.owner,jdbcType=VARCHAR}
- </if>
- <if test='v.keyword != null and v.keyword != ""'>
- <bind name="kw" value="'%' + v.keyword + '%' "/>
- and v.keyword like #{kw,jdbcType=VARCHAR}
- </if>
- <if test="v.startTime != null and v.endTime != null">
- <bind name="st" value=" v.startTime + ' 00:00:00' "/>
- <bind name="et" value=" v.endTime + ' 23:59:59' "/>
- and v.release_time between #{st,jdbcType=VARCHAR} and #{et,jdbcType=VARCHAR}
- </if>
- <if test="v.top != null">
- and v.top = #{v.top,jdbcType=INTEGER}
- </if>
- <if test="v.recommend != null">
- and v.recommend = #{v.recommend,jdbcType=INTEGER}
- </if>
- <if test="ob == 1">
- order by v.create_time desc
- </if>
- <if test="ob == 2">
- order by v.release_time desc
- </if>
- </select>
-
- <!-- 获得一个知识详情数据 -->
- <select id="getKnowledgeBaseById" parameterType="com.goafanti.common.model.JtKnowledgeBase" resultType="com.goafanti.admin.bo.KnowledgeBaseBo">
- select
- v.id, v.category, v.title, v.summary, v.source, v.status, v.create_time as createTime, v.owner, v.release_time as releaseTime, v.read_number as readNumber,
- v.comment_number as commentNumber, v.star_number as starNumber, v.keyword, v.pic_url as picUrl, v.top, v.recommend, v.content, a.name as ownerName
- from jt_knowledge_base v
- left join admin a on v.owner = a.id
- where 1=1
- <if test="id != null">
- and v.id = #{id,jdbcType=VARCHAR}
- </if>
- <if test="category != null">
- and v.category = #{category,jdbcType=INTEGER}
- </if>
- <if test='title != null and title != ""'>
- <bind name="n" value="'%' + title + '%' " />
- and v.title like #{n,jdbcType=VARCHAR}
- </if>
- <if test="summary != null">
- <bind name="s" value="'%' + summary + '%' " />
- and v.summary like #{s,jdbcType=VARCHAR}
- </if>
- <if test="source != null">
- and v.source = #{source,jdbcType=VARCHAR}
- </if>
- <if test="status != null">
- and v.status = #{status,jdbcType=INTEGER}
- </if>
- <if test="owner != null">
- and v.owner #{owner,jdbcType=VARCHAR}
- </if>
- <if test="readNumber != null">
- and v.read_number = #{readNumber,jdbcType=INTEGER}
- </if>
- <if test="commentNumber != null">
- and v.comment_number = #{commentNumber,jdbcType=INTEGER}
- </if>
- <if test="starNumber != null">
- and v.star_Number = #{starNumber,jdbcType=INTEGER}
- </if>
- <if test="keyword != null">
- <bind name="kw" value="'%' + keyword + '%' "/>
- and v.keyword like #{kw,jdbcType=VARCHAR}
- </if>
- <if test="picUrl != null">
- and v.pic_url = #{picUrl,jdbcType=VARCHAR}
- </if>
- <if test="top != null">
- and v.top = #{top,jdbcType=INTEGER}
- </if>
- <if test="recommend != null">
- and v.recommend = #{recommend,jdbcType=INTEGER}
- </if>
- </select>
- <!-- 修改 -->
- <update id="updateBySome" parameterType="com.goafanti.common.model.JtKnowledgeBase">
- update jt_knowledge_base
- <set>
- <if test="category != null">
- category = #{category,jdbcType=INTEGER},
- </if>
- <if test="title != null">
- title = #{title,jdbcType=VARCHAR},
- </if>
- <if test="summary != null">
- summary = #{summary,jdbcType=VARCHAR},
- </if>
- <if test="source != null">
- source = #{source,jdbcType=VARCHAR},
- </if>
- <if test="status != null">
- status = #{status,jdbcType=INTEGER},
- </if>
- <if test="createTime != null">
- create_time = #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="owner != null">
- owner = #{owner,jdbcType=VARCHAR},
- </if>
- <if test="releaseTime != null">
- release_time = #{releaseTime,jdbcType=TIMESTAMP},
- </if>
- <if test="picUrl != null">
- pic_url = #{picUrl,jdbcType=VARCHAR},
- </if>
- <if test="top != null">
- top = #{top,jdbcType=INTEGER},
- </if>
- <if test="recommend != null">
- recommend = #{recommend,jdbcType=INTEGER},
- </if>
- <if test="keyword != null">
- keyword = #{keyword,jdbcType=VARCHAR},
- </if>
- <if test="content != null">
- content = #{content,jdbcType=LONGVARCHAR},
- </if>
- </set>
- where id = #{id,jdbcType=VARCHAR}
- </update>
- <!-- 新增一个阅读量 -->
- <update id="addOneRead" parameterType="java.lang.String">
- update jt_knowledge_base set read_number = read_number +1
- where
- id = #{_parameter,jdbcType=VARCHAR}
- </update>
- <!-- 新增一个评论量 -->
- <update id="addOneComment" parameterType="java.lang.String">
- update jt_knowledge_base set comment_number = comment_number +1
- where
- id = #{_parameter,jdbcType=VARCHAR}
- </update>
- <!-- 新增一个点赞量 -->
- <update id="addOneStar" parameterType="java.lang.String">
- update jt_knowledge_base set star_number = star_number +1
- where
- id = #{_parameter,jdbcType=VARCHAR}
- </update>
- <!-- 标题检查 -->
- <select id="nameCheck" parameterType="java.lang.String" resultType="java.lang.Integer">
- select count(*) from jt_knowledge_base where title = #{_parameter,jdbcType=VARCHAR}
- </select>
- </mapper>
|