书签管理模块
This commit is contained in:
		| @@ -0,0 +1,192 @@ | ||||
| package com.ruoyi.bookmark.domain; | ||||
|  | ||||
| import org.apache.commons.lang3.builder.ToStringBuilder; | ||||
| import org.apache.commons.lang3.builder.ToStringStyle; | ||||
| import com.ruoyi.common.annotation.Excel; | ||||
| import com.ruoyi.common.core.domain.BaseEntity; | ||||
|  | ||||
| /** | ||||
|  * 书签管理对象 sq_bookmark | ||||
|  *  | ||||
|  * @author wanghao | ||||
|  * @date 2020-08-02 | ||||
|  */ | ||||
| public class SqBookmark extends BaseEntity | ||||
| { | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** $column.columnComment */ | ||||
|     private Long bookmarkId; | ||||
|  | ||||
|     /** 所属用户ID */ | ||||
|     @Excel(name = "所属用户ID") | ||||
|     private Long userid; | ||||
|  | ||||
|     /** 书签标题 */ | ||||
|     @Excel(name = "书签标题") | ||||
|     private String title; | ||||
|  | ||||
|     /** 书签地址 */ | ||||
|     @Excel(name = "书签地址") | ||||
|     private String url; | ||||
|  | ||||
|     /** $column.columnComment */ | ||||
|     @Excel(name = "书签地址") | ||||
|     private String urls; | ||||
|  | ||||
|     /** 书签描述 */ | ||||
|     @Excel(name = "书签描述") | ||||
|     private String description; | ||||
|  | ||||
|     /** $column.columnComment */ | ||||
|     @Excel(name = "书签描述") | ||||
|     private String image; | ||||
|  | ||||
|     /** 标签 */ | ||||
|     @Excel(name = "标签") | ||||
|     private String label; | ||||
|  | ||||
|     /** 分类ID */ | ||||
|     @Excel(name = "分类ID") | ||||
|     private Long menuId; | ||||
|  | ||||
|     /** 点赞数 */ | ||||
|     @Excel(name = "点赞数") | ||||
|     private Long zcount; | ||||
|  | ||||
|     /** 0 未删除 1表示删除 */ | ||||
|     @Excel(name = "0 未删除 1表示删除") | ||||
|     private Integer idelete; | ||||
|  | ||||
|     /** 0公开显示 1隐藏显示 2好友显示 3稍后再看 */ | ||||
|     @Excel(name = "0公开显示 1隐藏显示 2好友显示 3稍后再看") | ||||
|     private Integer start; | ||||
|  | ||||
|     public void setBookmarkId(Long bookmarkId)  | ||||
|     { | ||||
|         this.bookmarkId = bookmarkId; | ||||
|     } | ||||
|  | ||||
|     public Long getBookmarkId()  | ||||
|     { | ||||
|         return bookmarkId; | ||||
|     } | ||||
|     public void setUserid(Long userid)  | ||||
|     { | ||||
|         this.userid = userid; | ||||
|     } | ||||
|  | ||||
|     public Long getUserid()  | ||||
|     { | ||||
|         return userid; | ||||
|     } | ||||
|     public void setTitle(String title)  | ||||
|     { | ||||
|         this.title = title; | ||||
|     } | ||||
|  | ||||
|     public String getTitle()  | ||||
|     { | ||||
|         return title; | ||||
|     } | ||||
|     public void setUrl(String url)  | ||||
|     { | ||||
|         this.url = url; | ||||
|     } | ||||
|  | ||||
|     public String getUrl()  | ||||
|     { | ||||
|         return url; | ||||
|     } | ||||
|     public void setUrls(String urls)  | ||||
|     { | ||||
|         this.urls = urls; | ||||
|     } | ||||
|  | ||||
|     public String getUrls()  | ||||
|     { | ||||
|         return urls; | ||||
|     } | ||||
|     public void setDescription(String description)  | ||||
|     { | ||||
|         this.description = description; | ||||
|     } | ||||
|  | ||||
|     public String getDescription()  | ||||
|     { | ||||
|         return description; | ||||
|     } | ||||
|     public void setImage(String image)  | ||||
|     { | ||||
|         this.image = image; | ||||
|     } | ||||
|  | ||||
|     public String getImage()  | ||||
|     { | ||||
|         return image; | ||||
|     } | ||||
|     public void setLabel(String label)  | ||||
|     { | ||||
|         this.label = label; | ||||
|     } | ||||
|  | ||||
|     public String getLabel()  | ||||
|     { | ||||
|         return label; | ||||
|     } | ||||
|     public void setMenuId(Long menuId)  | ||||
|     { | ||||
|         this.menuId = menuId; | ||||
|     } | ||||
|  | ||||
|     public Long getMenuId()  | ||||
|     { | ||||
|         return menuId; | ||||
|     } | ||||
|     public void setZcount(Long zcount)  | ||||
|     { | ||||
|         this.zcount = zcount; | ||||
|     } | ||||
|  | ||||
|     public Long getZcount()  | ||||
|     { | ||||
|         return zcount; | ||||
|     } | ||||
|     public void setIdelete(Integer idelete)  | ||||
|     { | ||||
|         this.idelete = idelete; | ||||
|     } | ||||
|  | ||||
|     public Integer getIdelete()  | ||||
|     { | ||||
|         return idelete; | ||||
|     } | ||||
|     public void setStart(Integer start)  | ||||
|     { | ||||
|         this.start = start; | ||||
|     } | ||||
|  | ||||
|     public Integer getStart()  | ||||
|     { | ||||
|         return start; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public String toString() { | ||||
|         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) | ||||
|             .append("bookmarkId", getBookmarkId()) | ||||
|             .append("userid", getUserid()) | ||||
|             .append("title", getTitle()) | ||||
|             .append("url", getUrl()) | ||||
|             .append("urls", getUrls()) | ||||
|             .append("description", getDescription()) | ||||
|             .append("image", getImage()) | ||||
|             .append("label", getLabel()) | ||||
|             .append("menuId", getMenuId()) | ||||
|             .append("zcount", getZcount()) | ||||
|             .append("idelete", getIdelete()) | ||||
|             .append("start", getStart()) | ||||
|             .append("createTime", getCreateTime()) | ||||
|             .toString(); | ||||
|     } | ||||
| } | ||||
| @@ -0,0 +1,70 @@ | ||||
| package com.ruoyi.bookmark.mapper; | ||||
|  | ||||
| import java.util.List; | ||||
| import com.ruoyi.bookmark.domain.SqBookmark; | ||||
| import org.apache.ibatis.annotations.Param; | ||||
|  | ||||
| /** | ||||
|  * 书签管理Mapper接口 | ||||
|  * | ||||
|  * @author wanghao | ||||
|  * @date 2020-08-02 | ||||
|  */ | ||||
| public interface SqBookmarkMapper | ||||
| { | ||||
|     /** | ||||
|      * 查询栏目下书签管理 | ||||
|      * | ||||
|      * @param menuID 栏目ID | ||||
|      * @param userID 用户ID | ||||
|      * @return 书签管理 | ||||
|      */ | ||||
|     public List<SqBookmark> selectBymenuIdUserID(@Param("menuID") Long menuID,@Param("userID") Long userID); | ||||
|     /** | ||||
|      * 查询书签管理 | ||||
|      * | ||||
|      * @param bookmarkId 书签管理ID | ||||
|      * @return 书签管理 | ||||
|      */ | ||||
|     public SqBookmark selectSqBookmarkById(Long bookmarkId); | ||||
|  | ||||
|     /** | ||||
|      * 查询书签管理列表 | ||||
|      * | ||||
|      * @param sqBookmark 书签管理 | ||||
|      * @return 书签管理集合 | ||||
|      */ | ||||
|     public List<SqBookmark> selectSqBookmarkList(SqBookmark sqBookmark); | ||||
|  | ||||
|     /** | ||||
|      * 新增书签管理 | ||||
|      * | ||||
|      * @param sqBookmark 书签管理 | ||||
|      * @return 结果 | ||||
|      */ | ||||
|     public int insertSqBookmark(SqBookmark sqBookmark); | ||||
|  | ||||
|     /** | ||||
|      * 修改书签管理 | ||||
|      * | ||||
|      * @param sqBookmark 书签管理 | ||||
|      * @return 结果 | ||||
|      */ | ||||
|     public int updateSqBookmark(SqBookmark sqBookmark); | ||||
|  | ||||
|     /** | ||||
|      * 删除书签管理 | ||||
|      * | ||||
|      * @param bookmarkId 书签管理ID | ||||
|      * @return 结果 | ||||
|      */ | ||||
|     public int deleteSqBookmarkById(Long bookmarkId); | ||||
|  | ||||
|     /** | ||||
|      * 批量删除书签管理 | ||||
|      * | ||||
|      * @param bookmarkIds 需要删除的数据ID | ||||
|      * @return 结果 | ||||
|      */ | ||||
|     public int deleteSqBookmarkByIds(Long[] bookmarkIds); | ||||
| } | ||||
| @@ -0,0 +1,72 @@ | ||||
| package com.ruoyi.bookmark.service; | ||||
|  | ||||
| import java.util.List; | ||||
| import com.ruoyi.bookmark.domain.SqBookmark; | ||||
|  | ||||
| /** | ||||
|  * 书签管理Service接口 | ||||
|  * | ||||
|  * @author wanghao | ||||
|  * @date 2020-08-02 | ||||
|  */ | ||||
| public interface ISqBookmarkService | ||||
| { | ||||
|  | ||||
|     /** | ||||
|      * 查询用户栏目下书签管理 | ||||
|      * | ||||
|      * @param menuID 栏目ID | ||||
|      * @param userID 用户ID | ||||
|      * @return 书签管理 | ||||
|      */ | ||||
|     public List<SqBookmark> selectBymenuIdUserID(Long menuID,Long userID); | ||||
|  | ||||
|  | ||||
|     /** | ||||
|      * 查询书签管理 | ||||
|      * | ||||
|      * @param bookmarkId 书签管理ID | ||||
|      * @return 书签管理 | ||||
|      */ | ||||
|     public SqBookmark selectSqBookmarkById(Long bookmarkId); | ||||
|  | ||||
|     /** | ||||
|      * 查询书签管理列表 | ||||
|      * | ||||
|      * @param sqBookmark 书签管理 | ||||
|      * @return 书签管理集合 | ||||
|      */ | ||||
|     public List<SqBookmark> selectSqBookmarkList(SqBookmark sqBookmark); | ||||
|  | ||||
|     /** | ||||
|      * 新增书签管理 | ||||
|      * | ||||
|      * @param sqBookmark 书签管理 | ||||
|      * @return 结果 | ||||
|      */ | ||||
|     public int insertSqBookmark(SqBookmark sqBookmark); | ||||
|  | ||||
|     /** | ||||
|      * 修改书签管理 | ||||
|      * | ||||
|      * @param sqBookmark 书签管理 | ||||
|      * @return 结果 | ||||
|      */ | ||||
|     public int updateSqBookmark(SqBookmark sqBookmark); | ||||
|  | ||||
|     /** | ||||
|      * 批量删除书签管理 | ||||
|      * | ||||
|      * @param bookmarkIds 需要删除的书签管理ID | ||||
|      * @return 结果 | ||||
|      */ | ||||
|     public int deleteSqBookmarkByIds(Long[] bookmarkIds); | ||||
|  | ||||
|     /** | ||||
|      * 删除书签管理信息 | ||||
|      * | ||||
|      * @param bookmarkId 书签管理ID | ||||
|      * @return 结果 | ||||
|      */ | ||||
|     public int deleteSqBookmarkById(Long bookmarkId); | ||||
| } | ||||
| @@ -0,0 +1,107 @@ | ||||
| package com.ruoyi.bookmark.service.impl; | ||||
|  | ||||
| import java.util.List; | ||||
| import com.ruoyi.common.utils.DateUtils; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.stereotype.Service; | ||||
| import com.ruoyi.bookmark.mapper.SqBookmarkMapper; | ||||
| import com.ruoyi.bookmark.domain.SqBookmark; | ||||
| import com.ruoyi.bookmark.service.ISqBookmarkService; | ||||
|  | ||||
| /** | ||||
|  * 书签管理Service业务层处理 | ||||
|  * | ||||
|  * @author wanghao | ||||
|  * @date 2020-08-02 | ||||
|  */ | ||||
| @Service | ||||
| public class SqBookmarkServiceImpl implements ISqBookmarkService | ||||
| { | ||||
|     @Autowired | ||||
|     private SqBookmarkMapper sqBookmarkMapper; | ||||
|  | ||||
|     /** | ||||
|      * 查询书签管理 | ||||
|      * | ||||
|      * @param menuID 栏目ID | ||||
|      * @param userID 用户ID | ||||
|      * @return 书签管理 | ||||
|      */ | ||||
|     @Override | ||||
|     public List<SqBookmark> selectBymenuIdUserID(Long menuID, Long userID) { | ||||
|         return sqBookmarkMapper.selectBymenuIdUserID(menuID,userID); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 查询书签管理 | ||||
|      * | ||||
|      * @param bookmarkId 书签管理ID | ||||
|      * @return 书签管理 | ||||
|      */ | ||||
|     @Override | ||||
|     public SqBookmark selectSqBookmarkById(Long bookmarkId) | ||||
|     { | ||||
|         return sqBookmarkMapper.selectSqBookmarkById(bookmarkId); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 查询书签管理列表 | ||||
|      * | ||||
|      * @param sqBookmark 书签管理 | ||||
|      * @return 书签管理 | ||||
|      */ | ||||
|     @Override | ||||
|     public List<SqBookmark> selectSqBookmarkList(SqBookmark sqBookmark) | ||||
|     { | ||||
|         return sqBookmarkMapper.selectSqBookmarkList(sqBookmark); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 新增书签管理 | ||||
|      * | ||||
|      * @param sqBookmark 书签管理 | ||||
|      * @return 结果 | ||||
|      */ | ||||
|     @Override | ||||
|     public int insertSqBookmark(SqBookmark sqBookmark) | ||||
|     { | ||||
|         sqBookmark.setCreateTime(DateUtils.getNowDate()); | ||||
|         return sqBookmarkMapper.insertSqBookmark(sqBookmark); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 修改书签管理 | ||||
|      * | ||||
|      * @param sqBookmark 书签管理 | ||||
|      * @return 结果 | ||||
|      */ | ||||
|     @Override | ||||
|     public int updateSqBookmark(SqBookmark sqBookmark) | ||||
|     { | ||||
|         return sqBookmarkMapper.updateSqBookmark(sqBookmark); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 批量删除书签管理 | ||||
|      * | ||||
|      * @param bookmarkIds 需要删除的书签管理ID | ||||
|      * @return 结果 | ||||
|      */ | ||||
|     @Override | ||||
|     public int deleteSqBookmarkByIds(Long[] bookmarkIds) | ||||
|     { | ||||
|         return sqBookmarkMapper.deleteSqBookmarkByIds(bookmarkIds); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 删除书签管理信息 | ||||
|      * | ||||
|      * @param bookmarkId 书签管理ID | ||||
|      * @return 结果 | ||||
|      */ | ||||
|     @Override | ||||
|     public int deleteSqBookmarkById(Long bookmarkId) | ||||
|     { | ||||
|         return sqBookmarkMapper.deleteSqBookmarkById(bookmarkId); | ||||
|     } | ||||
| } | ||||
| @@ -0,0 +1,115 @@ | ||||
| <?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.ruoyi.bookmark.mapper.SqBookmarkMapper"> | ||||
|  | ||||
|     <resultMap type="SqBookmark" id="SqBookmarkResult"> | ||||
|         <result property="bookmarkId"    column="bookmark_id"    /> | ||||
|         <result property="userid"    column="userid"    /> | ||||
|         <result property="title"    column="title"    /> | ||||
|         <result property="url"    column="url"    /> | ||||
|         <result property="urls"    column="urls"    /> | ||||
|         <result property="description"    column="description"    /> | ||||
|         <result property="image"    column="image"    /> | ||||
|         <result property="label"    column="Label"    /> | ||||
|         <result property="menuId"    column="menu_id"    /> | ||||
|         <result property="zcount"    column="zcount"    /> | ||||
|         <result property="idelete"    column="IDelete"    /> | ||||
|         <result property="start"    column="Start"    /> | ||||
|         <result property="createTime"    column="create_time"    /> | ||||
|     </resultMap> | ||||
|  | ||||
|     <sql id="selectSqBookmarkVo"> | ||||
|         select bookmark_id, userid, title, url, urls, description, image, Label, menu_id, zcount, IDelete, Start, create_time from sq_bookmark | ||||
|     </sql> | ||||
|  | ||||
|     <select id="selectSqBookmarkList" parameterType="SqBookmark" resultMap="SqBookmarkResult"> | ||||
|         <include refid="selectSqBookmarkVo"/> | ||||
|         <where> | ||||
|             <if test="userid != null "> and userid = #{userid}</if> | ||||
|             <if test="title != null  and title != ''"> and title = #{title}</if> | ||||
|             <if test="url != null  and url != ''"> and url = #{url}</if> | ||||
|             <if test="urls != null  and urls != ''"> and urls = #{urls}</if> | ||||
|             <if test="description != null  and description != ''"> and description = #{description}</if> | ||||
|             <if test="image != null  and image != ''"> and image = #{image}</if> | ||||
|             <if test="label != null  and label != ''"> and Label = #{label}</if> | ||||
|             <if test="menuId != null "> and menu_id = #{menuId}</if> | ||||
|             <if test="zcount != null "> and zcount = #{zcount}</if> | ||||
|             <if test="idelete != null "> and IDelete = #{idelete}</if> | ||||
|             <if test="start != null "> and Start = #{start}</if> | ||||
|         </where> | ||||
|     </select> | ||||
|  | ||||
|     <select id="selectSqBookmarkById" parameterType="Long" resultMap="SqBookmarkResult"> | ||||
|         <include refid="selectSqBookmarkVo"/> | ||||
|         where bookmark_id = #{bookmarkId} | ||||
|     </select> | ||||
|  | ||||
|     <insert id="insertSqBookmark" parameterType="SqBookmark" useGeneratedKeys="true" keyProperty="bookmarkId"> | ||||
|         insert into sq_bookmark | ||||
|         <trim prefix="(" suffix=")" suffixOverrides=","> | ||||
|             <if test="userid != null">userid,</if> | ||||
|             <if test="title != null">title,</if> | ||||
|             <if test="url != null">url,</if> | ||||
|             <if test="urls != null">urls,</if> | ||||
|             <if test="description != null">description,</if> | ||||
|             <if test="image != null">image,</if> | ||||
|             <if test="label != null">Label,</if> | ||||
|             <if test="menuId != null">menu_id,</if> | ||||
|             <if test="zcount != null">zcount,</if> | ||||
|             <if test="idelete != null">IDelete,</if> | ||||
|             <if test="start != null">Start,</if> | ||||
|             <if test="createTime != null">create_time,</if> | ||||
|          </trim> | ||||
|         <trim prefix="values (" suffix=")" suffixOverrides=","> | ||||
|             <if test="userid != null">#{userid},</if> | ||||
|             <if test="title != null">#{title},</if> | ||||
|             <if test="url != null">#{url},</if> | ||||
|             <if test="urls != null">#{urls},</if> | ||||
|             <if test="description != null">#{description},</if> | ||||
|             <if test="image != null">#{image},</if> | ||||
|             <if test="label != null">#{label},</if> | ||||
|             <if test="menuId != null">#{menuId},</if> | ||||
|             <if test="zcount != null">#{zcount},</if> | ||||
|             <if test="idelete != null">#{idelete},</if> | ||||
|             <if test="start != null">#{start},</if> | ||||
|             <if test="createTime != null">#{createTime},</if> | ||||
|          </trim> | ||||
|     </insert> | ||||
|  | ||||
|     <update id="updateSqBookmark" parameterType="SqBookmark"> | ||||
|         update sq_bookmark | ||||
|         <trim prefix="SET" suffixOverrides=","> | ||||
|             <if test="userid != null">userid = #{userid},</if> | ||||
|             <if test="title != null">title = #{title},</if> | ||||
|             <if test="url != null">url = #{url},</if> | ||||
|             <if test="urls != null">urls = #{urls},</if> | ||||
|             <if test="description != null">description = #{description},</if> | ||||
|             <if test="image != null">image = #{image},</if> | ||||
|             <if test="label != null">Label = #{label},</if> | ||||
|             <if test="menuId != null">menu_id = #{menuId},</if> | ||||
|             <if test="zcount != null">zcount = #{zcount},</if> | ||||
|             <if test="idelete != null">IDelete = #{idelete},</if> | ||||
|             <if test="start != null">Start = #{start},</if> | ||||
|             <if test="createTime != null">create_time = #{createTime},</if> | ||||
|         </trim> | ||||
|         where bookmark_id = #{bookmarkId} | ||||
|     </update> | ||||
|  | ||||
|     <delete id="deleteSqBookmarkById" parameterType="Long"> | ||||
|         delete from sq_bookmark where bookmark_id = #{bookmarkId} | ||||
|     </delete> | ||||
|  | ||||
|     <delete id="deleteSqBookmarkByIds" parameterType="String"> | ||||
|         delete from sq_bookmark where bookmark_id in | ||||
|         <foreach item="bookmarkId" collection="array" open="(" separator="," close=")"> | ||||
|             #{bookmarkId} | ||||
|         </foreach> | ||||
|     </delete> | ||||
|  | ||||
|     <select id="selectBymenuIdUserID" parameterType="SqBookmark"  resultMap="SqBookmarkResult"> | ||||
|         <include refid="selectSqBookmarkVo"/> | ||||
|         where menu_id = #{menuID} and userid=#{userID} | ||||
|     </select> | ||||
| </mapper> | ||||
		Reference in New Issue
	
	Block a user