yonge 3 gadi atpakaļ
vecāks
revīzija
3a36affaad

+ 13 - 2
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/queryInfo/SubjectQueryInfo.java

@@ -6,8 +6,11 @@ import com.yonge.cooleshow.biz.dal.enums.YesOrNoEnum;
 import com.yonge.cooleshow.common.page.QueryInfo;
 
 public class SubjectQueryInfo extends QueryInfo {
-    @ApiModelProperty(value = "父节点编号,默认0",required = false)
-    private Long parentId = 0L;
+    @ApiModelProperty(value = "父节点编号",required = false)
+    private Long parentId;
+    
+    @ApiModelProperty(value = "查询类型(category - 分类   list - 列表)",required = false)
+    private String queryType;
 
     @ApiModelProperty(value = "节点状态,默认0未删除,1删除",required = false)
     private YesOrNoEnum delFlag = YesOrNoEnum.NO;
@@ -27,4 +30,12 @@ public class SubjectQueryInfo extends QueryInfo {
     public void setParentId(Long parentId) {
         this.parentId = parentId;
     }
+
+	public String getQueryType() {
+		return queryType;
+	}
+
+	public void setQueryType(String queryType) {
+		this.queryType = queryType;
+	}
 }

+ 0 - 1
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/SubjectService.java

@@ -1,7 +1,6 @@
 package com.yonge.cooleshow.biz.dal.service;
 
 import java.util.List;
-import java.util.Map;
 
 import com.yonge.cooleshow.biz.dal.entity.Subject;
 import com.yonge.cooleshow.biz.dal.queryInfo.SubjectQueryInfo;

+ 6 - 0
cooleshow-user/user-biz/src/main/resources/config/mybatis/SubjectMapper.xml

@@ -94,6 +94,12 @@
             <if test="delFlag != null">
                 AND del_flag_ = #{delFlag,typeHandler=com.yonge.cooleshow.common.dal.CustomEnumTypeHandler}
             </if>
+            <if test="queryType == 'category'">
+            	and (parent_subject_id_ = 0 or parent_subject_id_ is null)
+            </if>
+            <if test="queryType == 'list'">
+            	and parent_subject_id_ > 0
+            </if>
         </where>
     </sql>