|
@@ -1,33 +1,48 @@
|
|
|
<?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">
|
|
|
+ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.ruoyi.system.mapper.CpsContentInfoMapper">
|
|
|
|
|
|
<resultMap type="com.ruoyi.system.domain.CpsContentInfo" id="CpsContentInfoResult">
|
|
|
- <result property="id" column="id" />
|
|
|
- <result property="title" column="title" />
|
|
|
- <result property="content" column="content" />
|
|
|
- <result property="thumbnail" column="thumbnail" />
|
|
|
- <result property="likeCnt" column="like_cnt" />
|
|
|
- <result property="collectedCnt" column="collected_cnt" />
|
|
|
- <result property="contentType" column="content_type" />
|
|
|
- <result property="updateTime" column="update_time" />
|
|
|
- <result property="createTime" column="create_time" />
|
|
|
- <result property="createBy" column="create_by" />
|
|
|
- <result property="updateBy" column="update_by" />
|
|
|
+ <result property="id" column="id"/>
|
|
|
+ <result property="title" column="title"/>
|
|
|
+ <result property="content" column="content"/>
|
|
|
+ <result property="thumbnail" column="thumbnail"/>
|
|
|
+ <result property="likeCnt" column="like_cnt"/>
|
|
|
+ <result property="collectedCnt" column="collected_cnt"/>
|
|
|
+ <result property="contentType" column="content_type"/>
|
|
|
+ <result property="deptId" column="dept_id"/>
|
|
|
+ <result property="updateTime" column="update_time"/>
|
|
|
+ <result property="createTime" column="create_time"/>
|
|
|
+ <result property="createBy" column="create_by"/>
|
|
|
+ <result property="updateBy" column="update_by"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectCpsContentInfoVo">
|
|
|
- select id, title, content, thumbnail, content_type,like_cnt, collected_cnt, update_time, create_time, create_by, update_by from cps_content_info
|
|
|
+ select id,
|
|
|
+ title,
|
|
|
+ content,
|
|
|
+ thumbnail,
|
|
|
+ content_type,
|
|
|
+ like_cnt,
|
|
|
+ collected_cnt,
|
|
|
+ dept_id,
|
|
|
+ update_time,
|
|
|
+ create_time,
|
|
|
+ create_by,
|
|
|
+ update_by
|
|
|
+ from cps_content_info
|
|
|
</sql>
|
|
|
|
|
|
- <select id="selectCpsContentInfoList" parameterType="com.ruoyi.system.domain.CpsContentInfo" resultMap="CpsContentInfoResult">
|
|
|
- select id, title, thumbnail, content_type,like_cnt, collected_cnt, update_time, create_time, create_by, update_by from cps_content_info
|
|
|
+ <select id="selectCpsContentInfoList" parameterType="com.ruoyi.system.domain.CpsContentInfo"
|
|
|
+ resultMap="CpsContentInfoResult">
|
|
|
+ select id, title, thumbnail, content_type,like_cnt, collected_cnt,dept_id, update_time, create_time, create_by,
|
|
|
+ update_by from cps_content_info
|
|
|
<where>
|
|
|
- <if test="title != null and title != ''"> and title like concat('%', #{title}, '%')</if>
|
|
|
- <if test="content != null and content != ''"> and content like concat('%', #{content}, '%')</if>
|
|
|
- <if test="contentType != null "> and content_type = #{contentType}</if>
|
|
|
+ <if test="title != null and title != ''">and title like concat('%', #{title}, '%')</if>
|
|
|
+ <if test="content != null and content != ''">and content like concat('%', #{content}, '%')</if>
|
|
|
+ <if test="contentType != null ">and content_type = #{contentType}</if>
|
|
|
</where>
|
|
|
order by create_time desc
|
|
|
</select>
|
|
@@ -37,28 +52,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
where id = #{id}
|
|
|
</select>
|
|
|
|
|
|
- <insert id="insertCpsContentInfo" parameterType="com.ruoyi.system.domain.CpsContentInfo" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ <insert id="insertCpsContentInfo" parameterType="com.ruoyi.system.domain.CpsContentInfo" useGeneratedKeys="true"
|
|
|
+ keyProperty="id">
|
|
|
insert into cps_content_info
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
<if test="title != null">title,</if>
|
|
|
<if test="content != null">content,</if>
|
|
|
<if test="thumbnail != null">thumbnail,</if>
|
|
|
<if test="contentType != null">content_type,</if>
|
|
|
+ <if test="dept_id !=null">dept_id,</if>
|
|
|
<if test="updateTime != null">update_time,</if>
|
|
|
<if test="createTime != null">create_time,</if>
|
|
|
<if test="createBy != null">create_by,</if>
|
|
|
<if test="updateBy != null">update_by,</if>
|
|
|
- </trim>
|
|
|
+ </trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="title != null">#{title},</if>
|
|
|
<if test="content != null">#{content},</if>
|
|
|
<if test="thumbnail != null">#{thumbnail},</if>
|
|
|
<if test="contentType != null">#{contentType},</if>
|
|
|
+ <if test="dept_id !=null">#{dept_id},</if>
|
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
|
<if test="createTime != null">#{createTime},</if>
|
|
|
<if test="createBy != null">#{createBy},</if>
|
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
|
- </trim>
|
|
|
+ </trim>
|
|
|
</insert>
|
|
|
|
|
|
<update id="updateCpsContentInfo" parameterType="com.ruoyi.system.domain.CpsContentInfo">
|
|
@@ -68,6 +86,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="content != null">content = #{content},</if>
|
|
|
<if test="thumbnail != null">thumbnail = #{thumbnail},</if>
|
|
|
<if test="contentType != null">content_type = #{contentType},</if>
|
|
|
+ <if test="deptId !=null">dept_id = #{deptId},</if>
|
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|
|
@@ -83,24 +102,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</update>
|
|
|
<update id="updateDisCollectContent" parameterType="java.lang.Long">
|
|
|
update cps_content_info
|
|
|
- set collected_cnt = collected_cnt -1,
|
|
|
+ set collected_cnt = collected_cnt - 1,
|
|
|
update_time = now()
|
|
|
where id = #{id}
|
|
|
</update>
|
|
|
<update id="updateLikeContent" parameterType="java.lang.Long">
|
|
|
update cps_content_info
|
|
|
- set like_cnt = like_cnt + 1, update_time = now()
|
|
|
+ set like_cnt = like_cnt + 1,
|
|
|
+ update_time = now()
|
|
|
where id = #{id}
|
|
|
</update>
|
|
|
|
|
|
<update id="updateDisLikeContent" parameterType="java.lang.Long">
|
|
|
update cps_content_info
|
|
|
- set like_cnt = like_cnt -1, update_time = now()
|
|
|
+ set like_cnt = like_cnt - 1,
|
|
|
+ update_time = now()
|
|
|
where id = #{id}
|
|
|
</update>
|
|
|
|
|
|
<delete id="deleteCpsContentInfoById" parameterType="Long">
|
|
|
- delete from cps_content_info where id = #{id}
|
|
|
+ delete
|
|
|
+ from cps_content_info
|
|
|
+ where id = #{id}
|
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteCpsContentInfoByIds" parameterType="String">
|