| | |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 主键ID |
| | | */ |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Integer ids; |
| | | |
| | | /** |
| | | * 名称 |
| | | */ |
| | | private String name; |
| | |
| | | <select id="getTreeList" resultType="org.springblade.common.node.TreeIntegerNode"> |
| | | SELECT |
| | | jc.category_no AS id, |
| | | jc.id AS ids, |
| | | jc.category_no, |
| | | jc.parent_no AS parentId, |
| | | jc.category_name AS name, |
| | |
| | | |
| | | private void recursion(TreeIntegerNode node) { |
| | | if (node.getChildren() != null && node.getChildren().size() > 0) { |
| | | if(node.getId().equals(1030)){ |
| | | int sum = node.getChildren().stream().mapToInt(TreeIntegerNode::getCount).sum(); |
| | | node.setCount(sum); |
| | | } |
| | | if(node.getId().equals(1031)){ |
| | | int sum = node.getChildren().stream().mapToInt(TreeIntegerNode::getCount).sum(); |
| | | node.setCount(sum); |
| | | } |
| | | node.getChildren().forEach(node2 -> recursion(node2)); |
| | | } else { |
| | | node.setChildren(null); |