|
@@ -0,0 +1,309 @@
|
|
|
+<?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.example.nngkxxdp.program.dao.HlwCommentsDao">
|
|
|
+
|
|
|
+ <resultMap type="com.example.nngkxxdp.program.entity.jsonobj.HlwComments" id="HlwCommentsMap">
|
|
|
+ <result property="replyId" column="replyId" jdbcType="INTEGER"/>
|
|
|
+ <result property="userId" column="userId" jdbcType="INTEGER"/>
|
|
|
+ <result property="userName" column="userName" jdbcType="VARCHAR"/>
|
|
|
+ <result property="headerImg" column="headerImg" jdbcType="VARCHAR"/>
|
|
|
+ <result property="passiveReplyUserId" column="passiveReplyUserId" jdbcType="INTEGER"/>
|
|
|
+ <result property="passiveReplyName" column="passiveReplyName" jdbcType="VARCHAR"/>
|
|
|
+ <result property="passiveReplyContent" column="passiveReplyContent" jdbcType="VARCHAR"/>
|
|
|
+ <result property="passiveRelpsyStatus" column="passiveRelpsyStatus" jdbcType="VARCHAR"/>
|
|
|
+ <result property="content" column="content" jdbcType="VARCHAR"/>
|
|
|
+ <result property="commentTime" column="commentTime" jdbcType="VARCHAR"/>
|
|
|
+ <result property="praiseCount" column="praiseCount" jdbcType="INTEGER"/>
|
|
|
+ <result property="replyCount" column="replyCount" jdbcType="INTEGER"/>
|
|
|
+ <result property="sourceId" column="sourceId" jdbcType="INTEGER"/>
|
|
|
+ <result property="sourceTitle" column="sourceTitle" jdbcType="VARCHAR"/>
|
|
|
+ <result property="sourceType" column="sourceType" jdbcType="INTEGER"/>
|
|
|
+ <result property="imageUrl" column="imageUrl" jdbcType="VARCHAR"/>
|
|
|
+ <result property="passiveReplyImageUrl" column="passiveReplyImageUrl" jdbcType="VARCHAR"/>
|
|
|
+ <result property="circleLavelName" column="circleLavelName" jdbcType="VARCHAR"/>
|
|
|
+ <result property="ipLocal" column="ipLocal" jdbcType="VARCHAR"/>
|
|
|
+ <result property="listSuffix" column="listSuffix" jdbcType="VARCHAR"/>
|
|
|
+ <result property="detailSuffix" column="detailSuffix" jdbcType="VARCHAR"/>
|
|
|
+ <result property="dimension" column="dimension" jdbcType="INTEGER"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <!--查询单个-->
|
|
|
+ <select id="queryById" resultMap="HlwCommentsMap">
|
|
|
+ select
|
|
|
+ replyId, userId, userName, headerImg, passiveReplyUserId, passiveReplyName, passiveReplyContent, passiveRelpsyStatus, content, commentTime, praiseCount, replyCount, sourceId, sourceTitle, sourceType, imageUrl, passiveReplyImageUrl, circleLavelName, ipLocal, listSuffix, detailSuffix, dimension
|
|
|
+ from hlw_comments
|
|
|
+ where replyId = #{replyid}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--查询指定行数据-->
|
|
|
+ <select id="queryAllByLimit" resultMap="HlwCommentsMap">
|
|
|
+ select
|
|
|
+ replyId, userId, userName, headerImg, passiveReplyUserId, passiveReplyName, passiveReplyContent, passiveRelpsyStatus, content, commentTime, praiseCount, replyCount, sourceId, sourceTitle, sourceType, imageUrl, passiveReplyImageUrl, circleLavelName, ipLocal, listSuffix, detailSuffix, dimension
|
|
|
+ from hlw_comments
|
|
|
+ <where>
|
|
|
+ <if test="replyid != null">
|
|
|
+ and replyId = #{replyid}
|
|
|
+ </if>
|
|
|
+ <if test="userid != null">
|
|
|
+ and userId = #{userid}
|
|
|
+ </if>
|
|
|
+ <if test="username != null and username != ''">
|
|
|
+ and userName = #{username}
|
|
|
+ </if>
|
|
|
+ <if test="headerimg != null and headerimg != ''">
|
|
|
+ and headerImg = #{headerimg}
|
|
|
+ </if>
|
|
|
+ <if test="passivereplyuserid != null">
|
|
|
+ and passiveReplyUserId = #{passivereplyuserid}
|
|
|
+ </if>
|
|
|
+ <if test="passivereplyname != null and passivereplyname != ''">
|
|
|
+ and passiveReplyName = #{passivereplyname}
|
|
|
+ </if>
|
|
|
+ <if test="passivereplycontent != null and passivereplycontent != ''">
|
|
|
+ and passiveReplyContent = #{passivereplycontent}
|
|
|
+ </if>
|
|
|
+ <if test="passiverelpsystatus != null and passiverelpsystatus != ''">
|
|
|
+ and passiveRelpsyStatus = #{passiverelpsystatus}
|
|
|
+ </if>
|
|
|
+ <if test="content != null and content != ''">
|
|
|
+ and content = #{content}
|
|
|
+ </if>
|
|
|
+ <if test="commenttime != null and commenttime != ''">
|
|
|
+ and commentTime = #{commenttime}
|
|
|
+ </if>
|
|
|
+ <if test="praisecount != null">
|
|
|
+ and praiseCount = #{praisecount}
|
|
|
+ </if>
|
|
|
+ <if test="replycount != null">
|
|
|
+ and replyCount = #{replycount}
|
|
|
+ </if>
|
|
|
+ <if test="sourceid != null">
|
|
|
+ and sourceId = #{sourceid}
|
|
|
+ </if>
|
|
|
+ <if test="sourcetitle != null and sourcetitle != ''">
|
|
|
+ and sourceTitle = #{sourcetitle}
|
|
|
+ </if>
|
|
|
+ <if test="sourcetype != null">
|
|
|
+ and sourceType = #{sourcetype}
|
|
|
+ </if>
|
|
|
+ <if test="imageurl != null and imageurl != ''">
|
|
|
+ and imageUrl = #{imageurl}
|
|
|
+ </if>
|
|
|
+ <if test="passivereplyimageurl != null and passivereplyimageurl != ''">
|
|
|
+ and passiveReplyImageUrl = #{passivereplyimageurl}
|
|
|
+ </if>
|
|
|
+ <if test="circlelavelname != null and circlelavelname != ''">
|
|
|
+ and circleLavelName = #{circlelavelname}
|
|
|
+ </if>
|
|
|
+ <if test="iplocal != null and iplocal != ''">
|
|
|
+ and ipLocal = #{iplocal}
|
|
|
+ </if>
|
|
|
+ <if test="listsuffix != null and listsuffix != ''">
|
|
|
+ and listSuffix = #{listsuffix}
|
|
|
+ </if>
|
|
|
+ <if test="detailsuffix != null and detailsuffix != ''">
|
|
|
+ and detailSuffix = #{detailsuffix}
|
|
|
+ </if>
|
|
|
+ <if test="dimension != null">
|
|
|
+ and dimension = #{dimension}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ limit #{pageable.offset}, #{pageable.pageSize}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--统计总行数-->
|
|
|
+ <select id="count" resultType="java.lang.Long">
|
|
|
+ select count(1)
|
|
|
+ from hlw_comments
|
|
|
+ <where>
|
|
|
+ <if test="replyid != null">
|
|
|
+ and replyId = #{replyid}
|
|
|
+ </if>
|
|
|
+ <if test="userid != null">
|
|
|
+ and userId = #{userid}
|
|
|
+ </if>
|
|
|
+ <if test="username != null and username != ''">
|
|
|
+ and userName = #{username}
|
|
|
+ </if>
|
|
|
+ <if test="headerimg != null and headerimg != ''">
|
|
|
+ and headerImg = #{headerimg}
|
|
|
+ </if>
|
|
|
+ <if test="passivereplyuserid != null">
|
|
|
+ and passiveReplyUserId = #{passivereplyuserid}
|
|
|
+ </if>
|
|
|
+ <if test="passivereplyname != null and passivereplyname != ''">
|
|
|
+ and passiveReplyName = #{passivereplyname}
|
|
|
+ </if>
|
|
|
+ <if test="passivereplycontent != null and passivereplycontent != ''">
|
|
|
+ and passiveReplyContent = #{passivereplycontent}
|
|
|
+ </if>
|
|
|
+ <if test="passiverelpsystatus != null and passiverelpsystatus != ''">
|
|
|
+ and passiveRelpsyStatus = #{passiverelpsystatus}
|
|
|
+ </if>
|
|
|
+ <if test="content != null and content != ''">
|
|
|
+ and content = #{content}
|
|
|
+ </if>
|
|
|
+ <if test="commenttime != null and commenttime != ''">
|
|
|
+ and commentTime = #{commenttime}
|
|
|
+ </if>
|
|
|
+ <if test="praisecount != null">
|
|
|
+ and praiseCount = #{praisecount}
|
|
|
+ </if>
|
|
|
+ <if test="replycount != null">
|
|
|
+ and replyCount = #{replycount}
|
|
|
+ </if>
|
|
|
+ <if test="sourceid != null">
|
|
|
+ and sourceId = #{sourceid}
|
|
|
+ </if>
|
|
|
+ <if test="sourcetitle != null and sourcetitle != ''">
|
|
|
+ and sourceTitle = #{sourcetitle}
|
|
|
+ </if>
|
|
|
+ <if test="sourcetype != null">
|
|
|
+ and sourceType = #{sourcetype}
|
|
|
+ </if>
|
|
|
+ <if test="imageurl != null and imageurl != ''">
|
|
|
+ and imageUrl = #{imageurl}
|
|
|
+ </if>
|
|
|
+ <if test="passivereplyimageurl != null and passivereplyimageurl != ''">
|
|
|
+ and passiveReplyImageUrl = #{passivereplyimageurl}
|
|
|
+ </if>
|
|
|
+ <if test="circlelavelname != null and circlelavelname != ''">
|
|
|
+ and circleLavelName = #{circlelavelname}
|
|
|
+ </if>
|
|
|
+ <if test="iplocal != null and iplocal != ''">
|
|
|
+ and ipLocal = #{iplocal}
|
|
|
+ </if>
|
|
|
+ <if test="listsuffix != null and listsuffix != ''">
|
|
|
+ and listSuffix = #{listsuffix}
|
|
|
+ </if>
|
|
|
+ <if test="detailsuffix != null and detailsuffix != ''">
|
|
|
+ and detailSuffix = #{detailsuffix}
|
|
|
+ </if>
|
|
|
+ <if test="dimension != null">
|
|
|
+ and dimension = #{dimension}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--新增所有列-->
|
|
|
+ <insert id="insert" keyProperty="replyid" useGeneratedKeys="true">
|
|
|
+ insert into hlw_comments(userId, userName, headerImg, passiveReplyUserId, passiveReplyName, passiveReplyContent, passiveRelpsyStatus, content, commentTime, praiseCount, replyCount, sourceId, sourceTitle, sourceType, imageUrl, passiveReplyImageUrl, circleLavelName, ipLocal, listSuffix, detailSuffix, dimension)
|
|
|
+ values (#{userid}, #{username}, #{headerimg}, #{passivereplyuserid}, #{passivereplyname}, #{passivereplycontent}, #{passiverelpsystatus}, #{content}, #{commenttime}, #{praisecount}, #{replycount}, #{sourceid}, #{sourcetitle}, #{sourcetype}, #{imageurl}, #{passivereplyimageurl}, #{circlelavelname}, #{iplocal}, #{listsuffix}, #{detailsuffix}, #{dimension})
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <insert id="insertBatch" keyProperty="replyid" useGeneratedKeys="true">
|
|
|
+ insert into hlw_comments(userId, userName, headerImg, passiveReplyUserId, passiveReplyName, passiveReplyContent, passiveRelpsyStatus, content, commentTime, praiseCount, replyCount, sourceId, sourceTitle, sourceType, imageUrl, passiveReplyImageUrl, circleLavelName, ipLocal, listSuffix, detailSuffix, dimension)
|
|
|
+ values
|
|
|
+ <foreach collection="entities" item="entity" separator=",">
|
|
|
+ (#{entity.userid}, #{entity.username}, #{entity.headerimg}, #{entity.passivereplyuserid}, #{entity.passivereplyname}, #{entity.passivereplycontent}, #{entity.passiverelpsystatus}, #{entity.content}, #{entity.commenttime}, #{entity.praisecount}, #{entity.replycount}, #{entity.sourceid}, #{entity.sourcetitle}, #{entity.sourcetype}, #{entity.imageurl}, #{entity.passivereplyimageurl}, #{entity.circlelavelname}, #{entity.iplocal}, #{entity.listsuffix}, #{entity.detailsuffix}, #{entity.dimension})
|
|
|
+ </foreach>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <insert id="insertOrUpdateBatch" keyProperty="replyid" useGeneratedKeys="true">
|
|
|
+ insert into hlw_comments(userId, userName, headerImg, passiveReplyUserId, passiveReplyName, passiveReplyContent, passiveRelpsyStatus, content, commentTime, praiseCount, replyCount, sourceId, sourceTitle, sourceType, imageUrl, passiveReplyImageUrl, circleLavelName, ipLocal, listSuffix, detailSuffix, dimension)
|
|
|
+ values
|
|
|
+ <foreach collection="entities" item="entity" separator=",">
|
|
|
+ (#{entity.userid}, #{entity.username}, #{entity.headerimg}, #{entity.passivereplyuserid}, #{entity.passivereplyname}, #{entity.passivereplycontent}, #{entity.passiverelpsystatus}, #{entity.content}, #{entity.commenttime}, #{entity.praisecount}, #{entity.replycount}, #{entity.sourceid}, #{entity.sourcetitle}, #{entity.sourcetype}, #{entity.imageurl}, #{entity.passivereplyimageurl}, #{entity.circlelavelname}, #{entity.iplocal}, #{entity.listsuffix}, #{entity.detailsuffix}, #{entity.dimension})
|
|
|
+ </foreach>
|
|
|
+ on duplicate key update
|
|
|
+ userId = values(userId),
|
|
|
+ userName = values(userName),
|
|
|
+ headerImg = values(headerImg),
|
|
|
+ passiveReplyUserId = values(passiveReplyUserId),
|
|
|
+ passiveReplyName = values(passiveReplyName),
|
|
|
+ passiveReplyContent = values(passiveReplyContent),
|
|
|
+ passiveRelpsyStatus = values(passiveRelpsyStatus),
|
|
|
+ content = values(content),
|
|
|
+ commentTime = values(commentTime),
|
|
|
+ praiseCount = values(praiseCount),
|
|
|
+ replyCount = values(replyCount),
|
|
|
+ sourceId = values(sourceId),
|
|
|
+ sourceTitle = values(sourceTitle),
|
|
|
+ sourceType = values(sourceType),
|
|
|
+ imageUrl = values(imageUrl),
|
|
|
+ passiveReplyImageUrl = values(passiveReplyImageUrl),
|
|
|
+ circleLavelName = values(circleLavelName),
|
|
|
+ ipLocal = values(ipLocal),
|
|
|
+ listSuffix = values(listSuffix),
|
|
|
+ detailSuffix = values(detailSuffix),
|
|
|
+ dimension = values(dimension)
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <!--通过主键修改数据-->
|
|
|
+ <update id="update">
|
|
|
+ update hlw_comments
|
|
|
+ <set>
|
|
|
+ <if test="userid != null">
|
|
|
+ userId = #{userid},
|
|
|
+ </if>
|
|
|
+ <if test="username != null and username != ''">
|
|
|
+ userName = #{username},
|
|
|
+ </if>
|
|
|
+ <if test="headerimg != null and headerimg != ''">
|
|
|
+ headerImg = #{headerimg},
|
|
|
+ </if>
|
|
|
+ <if test="passivereplyuserid != null">
|
|
|
+ passiveReplyUserId = #{passivereplyuserid},
|
|
|
+ </if>
|
|
|
+ <if test="passivereplyname != null and passivereplyname != ''">
|
|
|
+ passiveReplyName = #{passivereplyname},
|
|
|
+ </if>
|
|
|
+ <if test="passivereplycontent != null and passivereplycontent != ''">
|
|
|
+ passiveReplyContent = #{passivereplycontent},
|
|
|
+ </if>
|
|
|
+ <if test="passiverelpsystatus != null and passiverelpsystatus != ''">
|
|
|
+ passiveRelpsyStatus = #{passiverelpsystatus},
|
|
|
+ </if>
|
|
|
+ <if test="content != null and content != ''">
|
|
|
+ content = #{content},
|
|
|
+ </if>
|
|
|
+ <if test="commenttime != null and commenttime != ''">
|
|
|
+ commentTime = #{commenttime},
|
|
|
+ </if>
|
|
|
+ <if test="praisecount != null">
|
|
|
+ praiseCount = #{praisecount},
|
|
|
+ </if>
|
|
|
+ <if test="replycount != null">
|
|
|
+ replyCount = #{replycount},
|
|
|
+ </if>
|
|
|
+ <if test="sourceid != null">
|
|
|
+ sourceId = #{sourceid},
|
|
|
+ </if>
|
|
|
+ <if test="sourcetitle != null and sourcetitle != ''">
|
|
|
+ sourceTitle = #{sourcetitle},
|
|
|
+ </if>
|
|
|
+ <if test="sourcetype != null">
|
|
|
+ sourceType = #{sourcetype},
|
|
|
+ </if>
|
|
|
+ <if test="imageurl != null and imageurl != ''">
|
|
|
+ imageUrl = #{imageurl},
|
|
|
+ </if>
|
|
|
+ <if test="passivereplyimageurl != null and passivereplyimageurl != ''">
|
|
|
+ passiveReplyImageUrl = #{passivereplyimageurl},
|
|
|
+ </if>
|
|
|
+ <if test="circlelavelname != null and circlelavelname != ''">
|
|
|
+ circleLavelName = #{circlelavelname},
|
|
|
+ </if>
|
|
|
+ <if test="iplocal != null and iplocal != ''">
|
|
|
+ ipLocal = #{iplocal},
|
|
|
+ </if>
|
|
|
+ <if test="listsuffix != null and listsuffix != ''">
|
|
|
+ listSuffix = #{listsuffix},
|
|
|
+ </if>
|
|
|
+ <if test="detailsuffix != null and detailsuffix != ''">
|
|
|
+ detailSuffix = #{detailsuffix},
|
|
|
+ </if>
|
|
|
+ <if test="dimension != null">
|
|
|
+ dimension = #{dimension},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where replyId = #{replyid}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <!--通过主键删除-->
|
|
|
+ <delete id="deleteById">
|
|
|
+ delete from hlw_comments where replyId = #{replyid}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+</mapper>
|
|
|
+
|