目录菜单表 添加下级书签统计字段和修改时间字段
This commit is contained in:
		| @@ -52,11 +52,38 @@ public class SqMenu | ||||
|     @Column(name = "parent_id") | ||||
|     private Long parentId; | ||||
|  | ||||
|     /** 下级书签数量 */ | ||||
|  | ||||
|     @Column(name = "bookmark_count") | ||||
|     private Date bookmarkCount; | ||||
|  | ||||
|     /** 创建时间 */ | ||||
|     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | ||||
|     @Column(name = "create_time") | ||||
|     private Date createTime; | ||||
|  | ||||
|     /** 修改时间 */ | ||||
|     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") | ||||
|     @Column(name = "update_time") | ||||
|     private Date updateTime; | ||||
|  | ||||
|  | ||||
|     public Date getBookmarkCount() { | ||||
|         return bookmarkCount; | ||||
|     } | ||||
|  | ||||
|     public void setBookmarkCount(Date bookmarkCount) { | ||||
|         this.bookmarkCount = bookmarkCount; | ||||
|     } | ||||
|  | ||||
|     public Date getUpdateTime() { | ||||
|         return updateTime; | ||||
|     } | ||||
|  | ||||
|     public void setUpdateTime(Date updateTime) { | ||||
|         this.updateTime = updateTime; | ||||
|     } | ||||
|  | ||||
|     public Date getCreateTime() { | ||||
|         return createTime; | ||||
|     } | ||||
| @@ -138,7 +165,9 @@ public class SqMenu | ||||
|             .append("menuIcon", getMenuIcon()) | ||||
|             .append("parentId", getParentId()) | ||||
|             .append("menuOrder", getMenuOrder()) | ||||
|             .append("bookmarkCount", getBookmarkCount()) | ||||
|             .append("createTime", getCreateTime()) | ||||
|             .append("updateTime", getUpdateTime()) | ||||
|             .toString(); | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -114,8 +114,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||||
|  | ||||
|     <select id="selectBymenuIdUserID" parameterType="SqBookmark"  resultMap="SqBookmarkResult"> | ||||
|         <include refid="selectSqBookmarkVo"/> | ||||
|         where menu_id = #{menuID} and userid=#{userID} and IDelete=0 | ||||
|         where menu_id = #{menuID} and userid=#{userID} | ||||
|     </select> | ||||
|  | ||||
|  | ||||
| </mapper> | ||||
|   | ||||
| @@ -12,11 +12,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||||
|         <result property="menuIcon"    column="menu_icon"    /> | ||||
|         <result property="parentId"    column="parent_id"    /> | ||||
|         <result property="menuOrder"    column="menu_order"    /> | ||||
|         <result property="bookmarkCount"    column="bookmark_count"    /> | ||||
|         <result property="createTime"    column="create_time"    /> | ||||
|         <result property="updateTime"    column="update_time"    /> | ||||
|     </resultMap> | ||||
|  | ||||
|     <sql id="selectSqMenuVo"> | ||||
|         select menu_id, user_id, menu_name, menu_url, menu_icon, parent_id, menu_order, create_time from sq_menu | ||||
|         select menu_id, user_id, menu_name, menu_url, menu_icon, parent_id, menu_order,bookmark_count,create_time,update_time from sq_menu | ||||
|     </sql> | ||||
|  | ||||
|     <select id="selectSqMenuList" parameterType="SqMenu" resultMap="SqMenuResult"> | ||||
| @@ -47,7 +49,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||||
|             <if test="menuIcon != null">menu_icon,</if> | ||||
|             <if test="parentId != null">parent_id,</if> | ||||
|             <if test="menuOrder != null">menu_order,</if> | ||||
|             <if test="createTime != null">create_time,</if> | ||||
|             <if test="bookmarkCount != null">bookmark_count,</if> | ||||
|                 create_time,update_time | ||||
|          </trim> | ||||
|         <trim prefix="values (" suffix=")" suffixOverrides=","> | ||||
|             <if test="userId != null">#{userId},</if> | ||||
| @@ -56,7 +59,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||||
|             <if test="menuIcon != null">#{menuIcon},</if> | ||||
|             <if test="parentId != null">#{parentId},</if> | ||||
|             <if test="menuOrder != null">#{menuOrder},</if> | ||||
|             <if test="createTime != null">#{createTime},</if> | ||||
|             <if test="bookmarkCount != null">#{bookmarkCount},</if> | ||||
|             now(),now() | ||||
|          </trim> | ||||
|     </insert> | ||||
|  | ||||
| @@ -69,7 +73,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||||
|             <if test="menuIcon != null">menu_icon = #{menuIcon},</if> | ||||
|             <if test="parentId != null">parent_id = #{parentId},</if> | ||||
|             <if test="menuOrder != null">menu_order = #{menuOrder},</if> | ||||
|             <if test="bookmarkCount != null">bookmark_count = #{bookmarkCount},</if> | ||||
|             <if test="createTime != null">create_time = #{createTime},</if> | ||||
|             update_time = now() | ||||
|         </trim> | ||||
|         where menu_id = #{menuId} | ||||
|     </update> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user