Commit a5ad37d0 by wenyang

增加上级标签的显示

parent 9eac7750
package com.yd.api.metadata.service.impl;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -142,7 +141,7 @@ public class MetadataServiceImpl implements MetadataService {
List<MdTagNew> objectListSelect,
List<TagQueryInfo> tagQueryInfos,Map<Long,String> userMap) {
BeanPropertyValueEqualsPredicate predicateClause;
List<MdTagNew> upperMdTagNew;
// List<MdTagNew> upperMdTagNew;
for (MdTagNew mdTagNew : objectListSelect) {
Long id = mdTagNew.getId();
TagQueryInfo tagQueryInfo = new TagQueryInfo();
......@@ -153,11 +152,11 @@ public class MetadataServiceImpl implements MetadataService {
tagQueryInfo.setUpdatedBy(userMap.get(mdTagNew.getCreatedBy()));
tagQueryInfo.setUpdatedAt(CommonUtil.dateParseString(mdTagNew.getUpdatedAt(),"yyyy-MM-dd HH:mm:ss"));
}
predicateClause = new BeanPropertyValueEqualsPredicate("id", tagQueryInfo.getUpperTagId());
upperMdTagNew = (List<MdTagNew>) CollectionUtils.select(mdTagNewList, predicateClause);
if(upperMdTagNew != null && upperMdTagNew.size() > 0){
tagQueryInfo.setUpperTagName(upperMdTagNew.get(0).getTagName());
}
// predicateClause = new BeanPropertyValueEqualsPredicate("id", tagQueryInfo.getUpperTagId());
// upperMdTagNew = (List<MdTagNew>) CollectionUtils.select(mdTagNewList, predicateClause);
// if(upperMdTagNew != null && upperMdTagNew.size() > 0){
// tagQueryInfo.setUpperTagName(upperMdTagNew.get(0).getTagName());
// }
predicateClause = new BeanPropertyValueEqualsPredicate("upperTagId", id);
List<MdTagNew> mdTagNewListSelect= (List<MdTagNew>) CollectionUtils.select(mdTagNewList, predicateClause);
if (mdTagNewListSelect.isEmpty()){
......@@ -293,7 +292,6 @@ public class MetadataServiceImpl implements MetadataService {
taglevel = "1";
}
}
Map<Long,String> userMap = getUserMap();
List<TagViewQueryInfo> tagViewQueryInfos = new ArrayList<>(16);
if(isActive == null || isActive == 1L || (taglevel != null || upperTagViewId != null || !CommonUtil.isNullOrBlank(requestVO.getTagName()))){
......@@ -330,7 +328,7 @@ public class MetadataServiceImpl implements MetadataService {
List<MdTagView> objectListSelect,
List<TagViewQueryInfo> tagViewQueryInfos,Map<Long,String> userMap) {
BeanPropertyValueEqualsPredicate predicateClause;
List<MdTagView> upperMdTagView;
// List<MdTagView> upperMdTagView;
for (MdTagView mdTagView : objectListSelect) {
Long id = mdTagView.getId();
TagViewQueryInfo tagViewQueryInfo = new TagViewQueryInfo();
......@@ -342,11 +340,11 @@ public class MetadataServiceImpl implements MetadataService {
tagViewQueryInfo.setUpdatedAt(CommonUtil.dateParseString(mdTagView.getUpdatedAt(),"yyyy-MM-dd HH:mm:ss"));
}
predicateClause = new BeanPropertyValueEqualsPredicate("id", tagViewQueryInfo.getUpperTagViewId());
upperMdTagView = (List<MdTagView>) CollectionUtils.select(mdTagViewList, predicateClause);
if(upperMdTagView != null && upperMdTagView.size() > 0){
tagViewQueryInfo.setUpperTagViewName(upperMdTagView.get(0).getTagName());
}
// predicateClause = new BeanPropertyValueEqualsPredicate("id", tagViewQueryInfo.getUpperTagViewId());
// upperMdTagView = (List<MdTagView>) CollectionUtils.select(mdTagViewList, predicateClause);
// if(upperMdTagView != null && upperMdTagView.size() > 0){
// tagViewQueryInfo.setUpperTagViewName(upperMdTagView.get(0).getTagName());
// }
predicateClause = new BeanPropertyValueEqualsPredicate( "upperTagViewId", id);
List<MdTagView> mdTagNewListSelect = (List<MdTagView>) CollectionUtils.select(mdTagViewList, predicateClause);
......
......@@ -25,6 +25,8 @@ public class MdTagNew {
private Date updatedAt;
private Long updatedBy;
private String upperTagName;
/**
* Gets the value of id. *
......@@ -201,8 +203,22 @@ public class MdTagNew {
public void setUpdatedBy(Long 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() {
return "MdTagNew{" +
"id=" + id +
......
......@@ -77,6 +77,8 @@ public class MdTagView {
* FK ag_acl_user.id
*/
private Long updatedBy;
private String upperTagViewName;
/**
* Gets the value of id. *
......@@ -330,7 +332,21 @@ public class MdTagView {
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() {
return "MdTagView{" +
"id=" + id +
......
......@@ -15,11 +15,30 @@
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="updated_by" jdbcType="BIGINT" property="updatedBy" />
</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">
<!--@mbg.generated-->
id, config_level, upper_tag_id, tag_name, tag_type, is_active, created_at, created_by, updated_at,
updated_by
</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">
<!--@mbg.generated-->
select
......@@ -292,26 +311,26 @@
</foreach>
</insert>
<select id="selectByIsActive" resultMap="BaseResultMap">
<select id="selectByIsActive" resultMap="BaseResultMap2">
select
<include refid="Base_Column_List" />
from ag_md_tag_new
<include refid="Base_Column_List2" />
from ag_md_tag_new t LEFT JOIN ag_md_tag_new u ON t.upper_tag_id = u.id
<where>
1 = 1
<if test="isActive != null">
and is_active = #{isActive,jdbcType=BIGINT}
and t.is_active = #{isActive,jdbcType=BIGINT}
</if>
<if test="configLevel != null">
and config_level = #{configLevel,jdbcType=BIGINT}
and t.config_level = #{configLevel,jdbcType=BIGINT}
</if>
<if test="upperTagId != null">
and upper_tag_id = #{upperTagId,jdbcType=BIGINT}
and t.upper_tag_id = #{upperTagId,jdbcType=BIGINT}
</if>
<if test="tagName != null">
and tag_name like #{tagName,jdbcType=VARCHAR}
and t.tag_name like #{tagName,jdbcType=VARCHAR}
</if>
<if test="tagType != null">
and tag_type = #{tagType,jdbcType=BIGINT}
and t.tag_type = #{tagType,jdbcType=BIGINT}
</if>
</where>
</select>
......
......@@ -19,11 +19,35 @@
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="updated_by" jdbcType="BIGINT" property="updatedBy" />
</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">
<!--@mbg.generated-->
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
</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">
<!--@mbg.generated-->
select
......@@ -391,28 +415,29 @@
</insert>
<select id="selectByIsActive" resultMap="BaseResultMap">
<select id="selectByIsActive" resultMap="BaseResultMap2">
select
<include refid="Base_Column_List" />
from ag_md_tag_view
<include refid="Base_Column_List2" />
from ag_md_tag_view t LEFT JOIN ag_md_tag_view u ON t.upper_tag_view_id = u.id
<where>
1 = 1
<if test="isActive != null">
and is_active = #{isActive,jdbcType=BIGINT}
and t.is_active = #{isActive,jdbcType=BIGINT}
</if>
<if test="upperTagViewId != null">
and upper_tag_view_id = #{upperTagViewId,jdbcType=BIGINT}
and t.upper_tag_view_id = #{upperTagViewId,jdbcType=BIGINT}
</if>
<if test="taglevel != null">
and tag_level = #{taglevel,jdbcType=VARCHAR}
and t.tag_level = #{taglevel,jdbcType=VARCHAR}
</if>
<if test="tagViewType != null">
and tag_view_type = #{tagViewType,jdbcType=VARCHAR}
and t.tag_view_type = #{tagViewType,jdbcType=VARCHAR}
</if>
<if test="tagName != null">
and tag_name like #{tagName,jdbcType=VARCHAR}
and t.tag_name like #{tagName,jdbcType=VARCHAR}
</if>
</where>
ORDER BY t.display_order
</select>
</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