Browse Source

阿米巴开发

anderx 3 years ago
parent
commit
2ca960f453

+ 2 - 2
src/main/java/com/goafanti/ambSystem/service/Impl/AmbServiceImpl.java

@@ -65,7 +65,7 @@ public class AmbServiceImpl extends BaseMybatisDao<AmbSystemMapper> implements A
         List<AmbAll> list = ambSystemMapper.getAncestorsList(null);
         List<AmbAll> all=new ArrayList<>();
         for (AmbAll a : list) {
-            if (a.getLvl()==1){
+            if (a.getLvl()==0){
                 pushLvl(a,list);
                 all.add(a);
             }
@@ -90,7 +90,7 @@ public class AmbServiceImpl extends BaseMybatisDao<AmbSystemMapper> implements A
         if (a.getLvl()<7){
             List<AmbAll> all=new ArrayList<>();
             for (AmbAll as : list) {
-                if (as.getLvl()>1 && as.getParentId().equals(a.getId())){
+                if (as.getParentId().equals(a.getId())){
                     pushLvl(as,list);
                     all.add(as);
                 }

+ 2 - 2
src/main/java/com/goafanti/common/mapper/AmbSystemMapper.xml

@@ -231,7 +231,7 @@
       and a.name  like concat('%',#{name},'%')
     </if>
     <if test="ancestors !=null">
-      and find_in_set( #{ancestors} ,a.ancestors)
+      and (a.id=#{ancestors} or find_in_set( #{ancestors} ,a.ancestors))
     </if>
     order by id
     <if test="page_sql !=null">
@@ -255,7 +255,7 @@
       and a.name  like concat('%',#{name},'%')
     </if>
     <if test="ancestors !=null">
-      and find_in_set( #{ancestors} ,a.ancestors)
+      and (a.id=#{ancestors} or find_in_set( #{ancestors} ,a.ancestors))
     </if>
   </select>
     <select id="selectByParentId"  parameterType="java.lang.Long" resultMap="BaseResultMap">