Commit a5ad37d0 by wenyang

增加上级标签的显示

parent 9eac7750
package com.yd.api.metadata.service.impl; package com.yd.api.metadata.service.impl;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -142,7 +141,7 @@ public class MetadataServiceImpl implements MetadataService { ...@@ -142,7 +141,7 @@ public class MetadataServiceImpl implements MetadataService {
List<MdTagNew> objectListSelect, List<MdTagNew> objectListSelect,
List<TagQueryInfo> tagQueryInfos,Map<Long,String> userMap) { List<TagQueryInfo> tagQueryInfos,Map<Long,String> userMap) {
BeanPropertyValueEqualsPredicate predicateClause; BeanPropertyValueEqualsPredicate predicateClause;
List<MdTagNew> upperMdTagNew; // List<MdTagNew> upperMdTagNew;
for (MdTagNew mdTagNew : objectListSelect) { for (MdTagNew mdTagNew : objectListSelect) {
Long id = mdTagNew.getId(); Long id = mdTagNew.getId();
TagQueryInfo tagQueryInfo = new TagQueryInfo(); TagQueryInfo tagQueryInfo = new TagQueryInfo();
...@@ -153,11 +152,11 @@ public class MetadataServiceImpl implements MetadataService { ...@@ -153,11 +152,11 @@ public class MetadataServiceImpl implements MetadataService {
tagQueryInfo.setUpdatedBy(userMap.get(mdTagNew.getCreatedBy())); tagQueryInfo.setUpdatedBy(userMap.get(mdTagNew.getCreatedBy()));
tagQueryInfo.setUpdatedAt(CommonUtil.dateParseString(mdTagNew.getUpdatedAt(),"yyyy-MM-dd HH:mm:ss")); tagQueryInfo.setUpdatedAt(CommonUtil.dateParseString(mdTagNew.getUpdatedAt(),"yyyy-MM-dd HH:mm:ss"));
} }
predicateClause = new BeanPropertyValueEqualsPredicate("id", tagQueryInfo.getUpperTagId()); // predicateClause = new BeanPropertyValueEqualsPredicate("id", tagQueryInfo.getUpperTagId());
upperMdTagNew = (List<MdTagNew>) CollectionUtils.select(mdTagNewList, predicateClause); // upperMdTagNew = (List<MdTagNew>) CollectionUtils.select(mdTagNewList, predicateClause);
if(upperMdTagNew != null && upperMdTagNew.size() > 0){ // if(upperMdTagNew != null && upperMdTagNew.size() > 0){
tagQueryInfo.setUpperTagName(upperMdTagNew.get(0).getTagName()); // tagQueryInfo.setUpperTagName(upperMdTagNew.get(0).getTagName());
} // }
predicateClause = new BeanPropertyValueEqualsPredicate("upperTagId", id); predicateClause = new BeanPropertyValueEqualsPredicate("upperTagId", id);
List<MdTagNew> mdTagNewListSelect= (List<MdTagNew>) CollectionUtils.select(mdTagNewList, predicateClause); List<MdTagNew> mdTagNewListSelect= (List<MdTagNew>) CollectionUtils.select(mdTagNewList, predicateClause);
if (mdTagNewListSelect.isEmpty()){ if (mdTagNewListSelect.isEmpty()){
...@@ -293,7 +292,6 @@ public class MetadataServiceImpl implements MetadataService { ...@@ -293,7 +292,6 @@ public class MetadataServiceImpl implements MetadataService {
taglevel = "1"; taglevel = "1";
} }
} }
Map<Long,String> userMap = getUserMap(); Map<Long,String> userMap = getUserMap();
List<TagViewQueryInfo> tagViewQueryInfos = new ArrayList<>(16); List<TagViewQueryInfo> tagViewQueryInfos = new ArrayList<>(16);
if(isActive == null || isActive == 1L || (taglevel != null || upperTagViewId != null || !CommonUtil.isNullOrBlank(requestVO.getTagName()))){ if(isActive == null || isActive == 1L || (taglevel != null || upperTagViewId != null || !CommonUtil.isNullOrBlank(requestVO.getTagName()))){
...@@ -330,7 +328,7 @@ public class MetadataServiceImpl implements MetadataService { ...@@ -330,7 +328,7 @@ public class MetadataServiceImpl implements MetadataService {
List<MdTagView> objectListSelect, List<MdTagView> objectListSelect,
List<TagViewQueryInfo> tagViewQueryInfos,Map<Long,String> userMap) { List<TagViewQueryInfo> tagViewQueryInfos,Map<Long,String> userMap) {
BeanPropertyValueEqualsPredicate predicateClause; BeanPropertyValueEqualsPredicate predicateClause;
List<MdTagView> upperMdTagView; // List<MdTagView> upperMdTagView;
for (MdTagView mdTagView : objectListSelect) { for (MdTagView mdTagView : objectListSelect) {
Long id = mdTagView.getId(); Long id = mdTagView.getId();
TagViewQueryInfo tagViewQueryInfo = new TagViewQueryInfo(); TagViewQueryInfo tagViewQueryInfo = new TagViewQueryInfo();
...@@ -342,11 +340,11 @@ public class MetadataServiceImpl implements MetadataService { ...@@ -342,11 +340,11 @@ public class MetadataServiceImpl implements MetadataService {
tagViewQueryInfo.setUpdatedAt(CommonUtil.dateParseString(mdTagView.getUpdatedAt(),"yyyy-MM-dd HH:mm:ss")); tagViewQueryInfo.setUpdatedAt(CommonUtil.dateParseString(mdTagView.getUpdatedAt(),"yyyy-MM-dd HH:mm:ss"));
} }
predicateClause = new BeanPropertyValueEqualsPredicate("id", tagViewQueryInfo.getUpperTagViewId()); // predicateClause = new BeanPropertyValueEqualsPredicate("id", tagViewQueryInfo.getUpperTagViewId());
upperMdTagView = (List<MdTagView>) CollectionUtils.select(mdTagViewList, predicateClause); // upperMdTagView = (List<MdTagView>) CollectionUtils.select(mdTagViewList, predicateClause);
if(upperMdTagView != null && upperMdTagView.size() > 0){ // if(upperMdTagView != null && upperMdTagView.size() > 0){
tagViewQueryInfo.setUpperTagViewName(upperMdTagView.get(0).getTagName()); // tagViewQueryInfo.setUpperTagViewName(upperMdTagView.get(0).getTagName());
} // }
predicateClause = new BeanPropertyValueEqualsPredicate( "upperTagViewId", id); predicateClause = new BeanPropertyValueEqualsPredicate( "upperTagViewId", id);
List<MdTagView> mdTagNewListSelect = (List<MdTagView>) CollectionUtils.select(mdTagViewList, predicateClause); List<MdTagView> mdTagNewListSelect = (List<MdTagView>) CollectionUtils.select(mdTagViewList, predicateClause);
......
...@@ -25,6 +25,8 @@ public class MdTagNew { ...@@ -25,6 +25,8 @@ public class MdTagNew {
private Date updatedAt; private Date updatedAt;
private Long updatedBy; private Long updatedBy;
private String upperTagName;
/** /**
* Gets the value of id. * * Gets the value of id. *
...@@ -201,8 +203,22 @@ public class MdTagNew { ...@@ -201,8 +203,22 @@ public class MdTagNew {
public void setUpdatedBy(Long updatedBy) { public void setUpdatedBy(Long updatedBy) {
this.updatedBy = updatedBy; this.updatedBy = updatedBy;
} }
/**
* @return the upperTagName
*/
public String getUpperTagName() {
return upperTagName;
}
/**
* @param upperTagName the upperTagName to set
*/
public void setUpperTagName(String upperTagName) {
this.upperTagName = upperTagName;
}
@Override @Override
public String toString() { public String toString() {
return "MdTagNew{" + return "MdTagNew{" +
"id=" + id + "id=" + id +
......
...@@ -77,6 +77,8 @@ public class MdTagView { ...@@ -77,6 +77,8 @@ public class MdTagView {
* FK ag_acl_user.id * FK ag_acl_user.id
*/ */
private Long updatedBy; private Long updatedBy;
private String upperTagViewName;
/** /**
* Gets the value of id. * * Gets the value of id. *
...@@ -330,7 +332,21 @@ public class MdTagView { ...@@ -330,7 +332,21 @@ public class MdTagView {
this.updatedBy = updatedBy; this.updatedBy = updatedBy;
} }
@Override /**
* @return the upperTagViewName
*/
public String getUpperTagViewName() {
return upperTagViewName;
}
/**
* @param upperTagViewName the upperTagViewName to set
*/
public void setUpperTagViewName(String upperTagViewName) {
this.upperTagViewName = upperTagViewName;
}
@Override
public String toString() { public String toString() {
return "MdTagView{" + return "MdTagView{" +
"id=" + id + "id=" + id +
......
...@@ -15,11 +15,30 @@ ...@@ -15,11 +15,30 @@
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" /> <result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="updated_by" jdbcType="BIGINT" property="updatedBy" /> <result column="updated_by" jdbcType="BIGINT" property="updatedBy" />
</resultMap> </resultMap>
<resultMap id="BaseResultMap2" type="com.yd.dal.entity.meta.MdTagNew">
<!--@mbg.generated-->
<!--@Table ag_md_tag_new-->
<id column="id" jdbcType="BIGINT" property="id" />
<result column="config_level" jdbcType="BIGINT" property="configLevel" />
<result column="upper_tag_id" jdbcType="BIGINT" property="upperTagId" />
<result column="tag_name" jdbcType="VARCHAR" property="tagName" />
<result column="tag_type" jdbcType="VARCHAR" property="tagType" />
<result column="is_active" jdbcType="INTEGER" property="isActive" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="created_by" jdbcType="BIGINT" property="createdBy" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="updated_by" jdbcType="BIGINT" property="updatedBy" />
<result column="upperTagName" jdbcType="VARCHAR" property="upperTagName" />
</resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
<!--@mbg.generated--> <!--@mbg.generated-->
id, config_level, upper_tag_id, tag_name, tag_type, is_active, created_at, created_by, updated_at, id, config_level, upper_tag_id, tag_name, tag_type, is_active, created_at, created_by, updated_at,
updated_by updated_by
</sql> </sql>
<sql id="Base_Column_List2">
<!--@mbg.generated-->
t.id, t.config_level, t.upper_tag_id, t.tag_name, t.tag_type, t.is_active, t.created_at, t.created_by, t.updated_at, t.updated_by,u.tag_name upperTagName
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
<!--@mbg.generated--> <!--@mbg.generated-->
select select
...@@ -292,26 +311,26 @@ ...@@ -292,26 +311,26 @@
</foreach> </foreach>
</insert> </insert>
<select id="selectByIsActive" resultMap="BaseResultMap"> <select id="selectByIsActive" resultMap="BaseResultMap2">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List2" />
from ag_md_tag_new from ag_md_tag_new t LEFT JOIN ag_md_tag_new u ON t.upper_tag_id = u.id
<where> <where>
1 = 1 1 = 1
<if test="isActive != null"> <if test="isActive != null">
and is_active = #{isActive,jdbcType=BIGINT} and t.is_active = #{isActive,jdbcType=BIGINT}
</if> </if>
<if test="configLevel != null"> <if test="configLevel != null">
and config_level = #{configLevel,jdbcType=BIGINT} and t.config_level = #{configLevel,jdbcType=BIGINT}
</if> </if>
<if test="upperTagId != null"> <if test="upperTagId != null">
and upper_tag_id = #{upperTagId,jdbcType=BIGINT} and t.upper_tag_id = #{upperTagId,jdbcType=BIGINT}
</if> </if>
<if test="tagName != null"> <if test="tagName != null">
and tag_name like #{tagName,jdbcType=VARCHAR} and t.tag_name like #{tagName,jdbcType=VARCHAR}
</if> </if>
<if test="tagType != null"> <if test="tagType != null">
and tag_type = #{tagType,jdbcType=BIGINT} and t.tag_type = #{tagType,jdbcType=BIGINT}
</if> </if>
</where> </where>
</select> </select>
......
...@@ -19,11 +19,35 @@ ...@@ -19,11 +19,35 @@
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" /> <result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="updated_by" jdbcType="BIGINT" property="updatedBy" /> <result column="updated_by" jdbcType="BIGINT" property="updatedBy" />
</resultMap> </resultMap>
<resultMap id="BaseResultMap2" type="com.yd.dal.entity.meta.MdTagView">
<!--@mbg.generated-->
<!--@Table ag_md_tag_view-->
<id column="id" jdbcType="BIGINT" property="id" />
<result column="tag_view_type" jdbcType="VARCHAR" property="tagViewType" />
<result column="tag_id" jdbcType="BIGINT" property="tagId" />
<result column="tag_name" jdbcType="VARCHAR" property="tagName" />
<result column="tag_level" jdbcType="VARCHAR" property="tagLevel" />
<result column="upper_tag_view_id" jdbcType="BIGINT" property="upperTagViewId" />
<result column="display_image" jdbcType="VARCHAR" property="displayImage" />
<result column="display_order" jdbcType="INTEGER" property="displayOrder" />
<result column="is_active" jdbcType="INTEGER" property="isActive" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="created_by" jdbcType="BIGINT" property="createdBy" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="updated_by" jdbcType="BIGINT" property="updatedBy" />
<result column="upperTagViewName" jdbcType="VARCHAR" property="upperTagViewName" />
</resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
<!--@mbg.generated--> <!--@mbg.generated-->
id, tag_view_type, tag_id, tag_name, tag_level, upper_tag_view_id, display_image, id, tag_view_type, tag_id, tag_name, tag_level, upper_tag_view_id, display_image,
display_order, is_active, remark, created_at, created_by, updated_at, updated_by display_order, is_active, remark, created_at, created_by, updated_at, updated_by
</sql> </sql>
<sql id="Base_Column_List2">
<!--@mbg.generated-->
t.id, t.tag_view_type, t.tag_id, t.tag_name, t.tag_level, t.upper_tag_view_id, t.display_image,
t.display_order, t.is_active, t.remark, t.created_at, t.created_by, t.updated_at, t.updated_by,u.tag_name upperTagViewName
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
<!--@mbg.generated--> <!--@mbg.generated-->
select select
...@@ -391,28 +415,29 @@ ...@@ -391,28 +415,29 @@
</insert> </insert>
<select id="selectByIsActive" resultMap="BaseResultMap"> <select id="selectByIsActive" resultMap="BaseResultMap2">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List2" />
from ag_md_tag_view from ag_md_tag_view t LEFT JOIN ag_md_tag_view u ON t.upper_tag_view_id = u.id
<where> <where>
1 = 1 1 = 1
<if test="isActive != null"> <if test="isActive != null">
and is_active = #{isActive,jdbcType=BIGINT} and t.is_active = #{isActive,jdbcType=BIGINT}
</if> </if>
<if test="upperTagViewId != null"> <if test="upperTagViewId != null">
and upper_tag_view_id = #{upperTagViewId,jdbcType=BIGINT} and t.upper_tag_view_id = #{upperTagViewId,jdbcType=BIGINT}
</if> </if>
<if test="taglevel != null"> <if test="taglevel != null">
and tag_level = #{taglevel,jdbcType=VARCHAR} and t.tag_level = #{taglevel,jdbcType=VARCHAR}
</if> </if>
<if test="tagViewType != null"> <if test="tagViewType != null">
and tag_view_type = #{tagViewType,jdbcType=VARCHAR} and t.tag_view_type = #{tagViewType,jdbcType=VARCHAR}
</if> </if>
<if test="tagName != null"> <if test="tagName != null">
and tag_name like #{tagName,jdbcType=VARCHAR} and t.tag_name like #{tagName,jdbcType=VARCHAR}
</if> </if>
</where> </where>
ORDER BY t.display_order
</select> </select>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment