完善>>編輯目录菜单,自动修改对应的上下级目录,书签数量统计
This commit is contained in:
		| @@ -55,7 +55,7 @@ public class SqMenu | ||||
|     /** 下级书签数量 */ | ||||
|  | ||||
|     @Column(name = "bookmark_count") | ||||
|     private Date bookmarkCount; | ||||
|     private Integer bookmarkCount; | ||||
|  | ||||
|     /** 创建时间 */ | ||||
|     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | ||||
| @@ -68,11 +68,11 @@ public class SqMenu | ||||
|     private Date updateTime; | ||||
|  | ||||
|  | ||||
|     public Date getBookmarkCount() { | ||||
|     public Integer getBookmarkCount() { | ||||
|         return bookmarkCount; | ||||
|     } | ||||
|  | ||||
|     public void setBookmarkCount(Date bookmarkCount) { | ||||
|     public void setBookmarkCount(Integer bookmarkCount) { | ||||
|         this.bookmarkCount = bookmarkCount; | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -92,4 +92,11 @@ public interface ISqBookmarkService | ||||
|      * @return | ||||
|      */ | ||||
|     List<SqBookmark> selectByUseridList(Long userId); | ||||
|  | ||||
|  | ||||
|     /** | ||||
|      * 根据MenuId查询当前目录下 有多少书签数量 | ||||
|      * @return | ||||
|      */ | ||||
|     public int selectByMenuIdCount(Long menuId); | ||||
| } | ||||
|   | ||||
| @@ -14,7 +14,7 @@ public interface ISqMenuService | ||||
|  | ||||
|  | ||||
|     /** | ||||
|      * 查询 目录菜单的 所有下级ID | ||||
|      * 查询 目录菜单的 所有下级MenuId | ||||
|      * | ||||
|      * @param menuId 目录ID | ||||
|      * @return 结果 | ||||
|   | ||||
| @@ -115,9 +115,9 @@ public class SqBookmarkServiceImpl implements ISqBookmarkService | ||||
|  | ||||
|  | ||||
|     /** | ||||
|      * 修改目录下书签状态为 删除状态 | ||||
|      * 根据menuID 修改目录下所有书签状态为 删除状态 | ||||
|      * | ||||
|      * @param | ||||
|      * @param menuId | ||||
|      * @return 结果 | ||||
|      */ | ||||
|     @Override | ||||
| @@ -147,4 +147,25 @@ public class SqBookmarkServiceImpl implements ISqBookmarkService | ||||
|         sqBookmark.setIdelete(0); //未删除的书签 | ||||
|         return sqBookmarkMapper.select(sqBookmark); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 根据MenuId查询当前目录下 有多少书签数量 | ||||
|      * | ||||
|      * @param  menuId | ||||
|      * @return 结果 | ||||
|      */ | ||||
|     @Override | ||||
|     public int selectByMenuIdCount(Long menuId) | ||||
|     { | ||||
|         SqBookmark sqBookmark=new SqBookmark(); | ||||
|         sqBookmark.setMenuId(menuId); | ||||
|        List<SqBookmark> sqBookmarks=sqBookmarkMapper.select(sqBookmark); | ||||
|        if (sqBookmarks!=null&&!sqBookmarks.isEmpty()){ | ||||
|            return sqBookmarks.size(); | ||||
|        }else { | ||||
|            return 0; | ||||
|        } | ||||
|     } | ||||
|  | ||||
|  | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user