sq_user_tag新增字段tagName
This commit is contained in:
		| @@ -36,6 +36,11 @@ public class SqUserTag extends BaseEntity | ||||
|     @Column(name = "tag_id") | ||||
|     private Long tagId; | ||||
|  | ||||
|     /** 书签排序 */ | ||||
|     @Excel(name = "书签名字") | ||||
|     @Column(name = "tag_name") | ||||
|     private String tagName; | ||||
|  | ||||
|     /** 书签引用的数量 */ | ||||
|     @Excel(name = "书签引用的数量") | ||||
|     @Column(name = "icount") | ||||
| @@ -46,6 +51,15 @@ public class SqUserTag extends BaseEntity | ||||
|     @Column(name = "iorder") | ||||
|     private Integer iorder; | ||||
|  | ||||
|  | ||||
|     public String getTagName() { | ||||
|         return tagName; | ||||
|     } | ||||
|  | ||||
|     public void setTagName(String tagName) { | ||||
|         this.tagName = tagName; | ||||
|     } | ||||
|  | ||||
|     public void setId(Long id) | ||||
|     { | ||||
|         this.id = id; | ||||
| @@ -100,6 +114,7 @@ public class SqUserTag extends BaseEntity | ||||
|             .append("tagId", getTagId()) | ||||
|             .append("icount", getIcount()) | ||||
|             .append("iorder", getIorder()) | ||||
|             .append("tagName", getTagName()) | ||||
|             .toString(); | ||||
|     } | ||||
|     public SqUserTag(){ | ||||
|   | ||||
| @@ -67,4 +67,6 @@ public interface ISqTagService | ||||
|      * 功能描述:修改书签 标签检测传入的标签是否 需要添加 | ||||
|      */ | ||||
|     public Map<String,Object> addtag(String tagName, Long userId); | ||||
|  | ||||
|  | ||||
| } | ||||
|   | ||||
| @@ -103,11 +103,8 @@ public class SqBookmarkServiceImpl implements ISqBookmarkService | ||||
|     @Override | ||||
|     public int insertSqBookmark(SqBookmark sqBookmark) | ||||
|     { | ||||
|  | ||||
|         sqBookmark.setCreateTime(DateUtil.date(System.currentTimeMillis())); | ||||
|       int i= sqBookmarkMapper.insertUseGeneratedKeys(sqBookmark); | ||||
|  | ||||
|  | ||||
|         sqBookmark.setCreateTime(DateUtils.getNowDate()); | ||||
|         //传入的标签 | ||||
|         List<Map<String, Object>> listmap = sqBookmark.getSqTags(); | ||||
|         if (listmap==null||listmap.isEmpty()||listmap.size()==0){ | ||||
| @@ -216,7 +213,7 @@ public class SqBookmarkServiceImpl implements ISqBookmarkService | ||||
|             addtag=addtag.substring(0,addtag.length()-1); | ||||
|             String[] add = addtag.split(","); | ||||
|             Long[] num = (Long[]) ConvertUtils.convert(add,Long.class); | ||||
|             sqUserTagMapper.updateCountReduce(num, sqBookmark.getUserid()); | ||||
|             sqUserTagMapper.updateCountAdd(num, sqBookmark.getUserid()); | ||||
|         } | ||||
|  | ||||
|         return sqBookmarkMapper.updateSqBookmark(sqBookmark); | ||||
|   | ||||
| @@ -7,6 +7,7 @@ import java.util.HashMap; | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
|  | ||||
| import com.github.wujun234.uid.UidGenerator; | ||||
| import com.ruoyi.bookmark.domain.SqUserTag; | ||||
| import com.ruoyi.bookmark.mapper.SqUserTagMapper; | ||||
| import com.ruoyi.common.utils.DateUtils; | ||||
| @@ -18,6 +19,8 @@ import com.ruoyi.bookmark.mapper.SqTagMapper; | ||||
| import com.ruoyi.bookmark.domain.SqTag; | ||||
| import com.ruoyi.bookmark.service.ISqTagService; | ||||
|  | ||||
| import javax.annotation.Resource; | ||||
|  | ||||
| /** | ||||
|  * 书签_标签Service业务层处理 | ||||
|  * | ||||
| @@ -140,22 +143,25 @@ public class SqTagServiceImpl implements ISqTagService | ||||
|             }else { | ||||
|                 sqUserTag.setIcount(1); | ||||
|                 sqUserTag.setIorder(1); | ||||
|                 sqUserTag.setTagName(tagName); | ||||
|                 sqUserTagMapper.insertSqUserTag(sqUserTag); | ||||
|             } | ||||
|  | ||||
|         }else { | ||||
|             //不存在 >>创建 返回ID | ||||
|  | ||||
|             sqTag.setUserId(userId); | ||||
|             sqTag.setTagType("P"); | ||||
|             sqTag.setIcount(1); | ||||
|             sqTag.setStatus(0); | ||||
|             sqTag.setCreateTime(DateUtils.getNowDate()); | ||||
|             sqTagMapper.insertUseGeneratedKeys(sqTag); | ||||
|             sqTagMapper.insertSqTag(sqTag); | ||||
|             logger.debug("传入的新标签 tagid="+sqTag.getId()); | ||||
|             map.put("tagId",sqTag.getId()); | ||||
|             //添加到用戶个人书签里面去 | ||||
|             sqUserTag.setUserId(userId); | ||||
|             sqUserTag.setTagId(Long.valueOf(sqTag.getId())); | ||||
|             sqUserTag.setTagName(sqTag.getName()); | ||||
|             sqUserTag.setIcount(1); | ||||
|             sqUserTag.setIorder(1); | ||||
|             sqUserTagMapper.insertSqUserTag(sqUserTag); | ||||
|   | ||||
| @@ -10,10 +10,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||||
|         <result property="tagId"    column="tag_id"    /> | ||||
|         <result property="icount"    column="icount"    /> | ||||
|         <result property="iorder"    column="iorder"    /> | ||||
|         <result property="tagName"    column="tag_name"    /> | ||||
|     </resultMap> | ||||
|  | ||||
|     <sql id="selectSqUserTagVo"> | ||||
|         select id, user_id, tag_id, icount, iorder from sq_user_tag | ||||
|         select id, user_id, tag_id,tag_name,icount, iorder from sq_user_tag | ||||
|     </sql> | ||||
|  | ||||
|     <select id="selectSqUserTagList" parameterType="SqUserTag" resultMap="SqUserTagResult"> | ||||
| @@ -23,6 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||||
|             <if test="tagId != null "> and tag_id = #{tagId}</if> | ||||
|             <if test="icount != null "> and icount = #{icount}</if> | ||||
|             <if test="iorder != null "> and iorder = #{iorder}</if> | ||||
|             <if test="tagName != null "> and tagName = #{tagName}</if> | ||||
|         </where> | ||||
|     </select> | ||||
|  | ||||
| @@ -38,12 +40,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||||
|             <if test="tagId != null">tag_id,</if> | ||||
|             <if test="icount != null">icount,</if> | ||||
|             <if test="iorder != null">iorder,</if> | ||||
|             <if test="tagName != null ">tag_name,</if> | ||||
|          </trim> | ||||
|         <trim prefix="values (" suffix=")" suffixOverrides=","> | ||||
|             <if test="userId != null">#{userId},</if> | ||||
|             <if test="tagId != null">#{tagId},</if> | ||||
|             <if test="icount != null">#{icount},</if> | ||||
|             <if test="iorder != null">#{iorder},</if> | ||||
|             <if test="tagName != null ">#{tagName},</if> | ||||
|          </trim> | ||||
|     </insert> | ||||
|  | ||||
| @@ -54,6 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||||
|             <if test="tagId != null">tag_id = #{tagId},</if> | ||||
|             <if test="icount != null">icount = #{icount},</if> | ||||
|             <if test="iorder != null">iorder = #{iorder},</if> | ||||
|             <if test="tagName != null">tagName = #{tagName},</if> | ||||
|         </trim> | ||||
|         where id = #{id} | ||||
|     </update> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user