提交 55024c62 authored 作者: 张龙发's avatar 张龙发

智慧养护工程信息树结构代码修改

上级 b225584e
...@@ -3,6 +3,8 @@ package com.elephant.framework.galaxy.aroad.module.zhyh.mapper; ...@@ -3,6 +3,8 @@ package com.elephant.framework.galaxy.aroad.module.zhyh.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.elephant.framework.galaxy.aroad.module.zhyh.entity.ZhyhDzxgcglGcxx; import com.elephant.framework.galaxy.aroad.module.zhyh.entity.ZhyhDzxgcglGcxx;
import java.util.List;
/** /**
* 智慧养护_大中修工程管理_工程信息 * 智慧养护_大中修工程管理_工程信息
* *
...@@ -10,5 +12,5 @@ import com.elephant.framework.galaxy.aroad.module.zhyh.entity.ZhyhDzxgcglGcxx; ...@@ -10,5 +12,5 @@ import com.elephant.framework.galaxy.aroad.module.zhyh.entity.ZhyhDzxgcglGcxx;
* @date 2019-04-23 17:00:31 * @date 2019-04-23 17:00:31
*/ */
public interface ZhyhDzxgcglGcxxMapper extends BaseMapper<ZhyhDzxgcglGcxx> { public interface ZhyhDzxgcglGcxxMapper extends BaseMapper<ZhyhDzxgcglGcxx> {
List<String> selectGcxxTreeGroupByGydw();
} }
...@@ -55,12 +55,13 @@ public class ZhyhDzxgcglGcxxServiceImpl extends ServiceImpl<ZhyhDzxgcglGcxxMappe ...@@ -55,12 +55,13 @@ public class ZhyhDzxgcglGcxxServiceImpl extends ServiceImpl<ZhyhDzxgcglGcxxMappe
//获取tree树结构 //获取tree树结构
public List<ZhyhDzxgcglGcxxTreeOne> getTreeGydwNameGroupBy() { public List<ZhyhDzxgcglGcxxTreeOne> getTreeGydwNameGroupBy() {
List<ZhyhDzxgcglGcxx> zhyhDzxgcglGcxxs = zhyhDzxgcglGcxxMapper.selectList(Wrappers.<ZhyhDzxgcglGcxx>query().groupBy("gydw")); List<String> treeGydws = zhyhDzxgcglGcxxMapper.selectGcxxTreeGroupByGydw();
List<ZhyhDzxgcglGcxxTreeOne> zhyhDzxgcglGcxxTreeOnes = new ArrayList<ZhyhDzxgcglGcxxTreeOne>(); List<ZhyhDzxgcglGcxxTreeOne> zhyhDzxgcglGcxxTreeOnes = new ArrayList<ZhyhDzxgcglGcxxTreeOne>();
for(ZhyhDzxgcglGcxx zhyhDzxgcglGcxx : zhyhDzxgcglGcxxs) { for(String treeGydw : treeGydws) {
ZhyhDzxgcglGcxxTreeOne zhyhDzxgcglGcxxTreeOne = new ZhyhDzxgcglGcxxTreeOne(); ZhyhDzxgcglGcxxTreeOne zhyhDzxgcglGcxxTreeOne = new ZhyhDzxgcglGcxxTreeOne();
List<ZhyhDzxgcglGcxxTreeTwo> children = new ArrayList<ZhyhDzxgcglGcxxTreeTwo>(); List<ZhyhDzxgcglGcxxTreeTwo> children = new ArrayList<ZhyhDzxgcglGcxxTreeTwo>();
zhyhDzxgcglGcxxTreeOne.setLabel(zhyhDzxgcglGcxx.getGydw()); zhyhDzxgcglGcxxTreeOne.setLabel(treeGydw);
zhyhDzxgcglGcxxTreeOne.setChildren(children); zhyhDzxgcglGcxxTreeOne.setChildren(children);
zhyhDzxgcglGcxxTreeOnes.add(zhyhDzxgcglGcxxTreeOne); zhyhDzxgcglGcxxTreeOnes.add(zhyhDzxgcglGcxxTreeOne);
} }
......
...@@ -33,4 +33,7 @@ ...@@ -33,4 +33,7 @@
<result property="delFlag" column="del_flag"/> <result property="delFlag" column="del_flag"/>
<result property="remarks" column="remarks"/> <result property="remarks" column="remarks"/>
</resultMap> </resultMap>
<select id="selectGcxxTreeGroupByGydw" resultType="String">
select gydw from t_zhyh_dzxgcgl_gcxx GROUP BY gydw
</select>
</mapper> </mapper>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论