| | |
| | | //根据查询条件得到所有设备 |
| | | List<EquipmentVO> pages = null; |
| | | |
| | | List<Map<String, Object>> treedatas = catalogService.selectCatalogEqNUmber(pid); |
| | | List<Map<String, Object>> treedatas = catalogService.selectCatalogEqNUmber(); |
| | | //根据传入的id递归出该节点下所有的设备 |
| | | List<Map<String, Object>> childList = treeMenuList(treedatas, Integer.parseInt(pid)); |
| | | |
| | |
| | | //根据查询条件得到所有设备 |
| | | List<EquipmentVO> pages = null; |
| | | |
| | | List<Map<String, Object>> treedatas = catalogService.selectCatalogEqNUmber(pid); |
| | | List<Map<String, Object>> treedatas = catalogService.selectCatalogEqNUmber(); |
| | | //根据传入的id递归出该节点下所有的设备 |
| | | List<Map<String, Object>> childList = treeMenuList(treedatas, Integer.parseInt(pid)); |
| | | |
| | |
| | | List<Map<String, Object>> selectEq(); |
| | | List<Map<String, Object>> selectWar(String beginTime,String endTime); |
| | | |
| | | List selectCatalogEqNUmber(String pid); |
| | | List<Map<String, Object>> selectCatalogEqNUmber(); |
| | | |
| | | List<catalogVO> lazyTree(String tenantId, Long parentId); |
| | | } |
| | |
| | | <select id="selectCatalogEqNUmber" resultType="java.util.HashMap"> |
| | | |
| | | SELECT |
| | | * |
| | | id,name,pId,eqid |
| | | FROM |
| | | sys_catalog |
| | | |
| | |
| | | */ |
| | | public interface catalogService extends IService<catalog> { |
| | | List<Map<String, Object>> selectCatalogList(); |
| | | List<Map<String, Object>> selectCatalogEqNUmber(String pid); |
| | | List<Map<String, Object>> selectCatalogEqNUmber(); |
| | | List<Map<String, Object>> selectCount(); |
| | | List<Map<String, Object>> selectAddvcd(); |
| | | List<Map<String, Object>> selectEq(); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List selectCatalogEqNUmber(String pid) { |
| | | return baseMapper.selectCatalogEqNUmber(pid); |
| | | public List selectCatalogEqNUmber() { |
| | | return baseMapper.selectCatalogEqNUmber(); |
| | | } |
| | | |
| | | @Override |
| | |
| | | response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE"); |
| | | response.setHeader("Access-Control-Allow-Credentials", "true"); |
| | | |
| | | List<Map<String, Object>> treedatas = catalogService.selectCatalogEqNUmber(pid); |
| | | IPage<EquipmentVO> page = null; |
| | | //清空全局参数 |
| | | childMenu = new ArrayList(); |
| | | |
| | | if (pid == null || pid.equals("")) { |
| | | //根据查询条件得到所有设备 |
| | | page = equipmentService.selectEquipmentPage(Condition.getPage(query), equipment, null); |
| | | } else { |
| | | List<Map<String, Object>> treedatas = catalogService.selectCatalogEqNUmber(); |
| | | //根据传入的id递归出该节点下所有的设备 |
| | | List<Map<String, Object>> childList = treeIdList(treedatas, pid); |
| | | |
| | | //根据查询条件得到所有设备 |
| | | page = equipmentService.selectEquipmentPage(Condition.getPage(query), equipment, childList); |
| | | } |
| | | |
| | | System.out.println(childList); |
| | | |
| | | |
| | | |
| | | |
| | | return R.data(null); |
| | | return R.data(page); |
| | | } |
| | | |
| | | /** |
| | |
| | | childMenu = new ArrayList(); |
| | | |
| | | //根据查询条件得到所有设备 |
| | | IPage<EquipmentVO> pageData = equipmentService.selectEquipmentPage(Condition.getPage(query), equipment); |
| | | IPage<EquipmentVO> pageData = equipmentService.selectEquipmentPage(Condition.getPage(query), equipment, null); |
| | | |
| | | List<EquipmentVO> pages = pageData.getRecords(); |
| | | List<EquipmentVO> datas = new ArrayList(); |
| | | |
| | | |
| | | |
| | | if (pid == null || pid.equals("")) { |
| | |
| | | } |
| | | datas = pages; |
| | | } else { |
| | | List<Map<String, Object>> treedatas = catalogService.selectCatalogEqNUmber(pid); |
| | | List<Map<String, Object>> treedatas = catalogService.selectCatalogEqNUmber(); |
| | | //根据传入的id递归出该节点下所有的设备 |
| | | List<Map<String, Object>> childList = treeMenuList(treedatas, pid); |
| | | //将得到的设备与查询所得设备进行匹配 |
| | |
| | | pages.get(j).setType(0); |
| | | } |
| | | |
| | | if (childList.get(i).get("eqid") != null) { |
| | | if (childList.get(i).get("eqid") != null && !childList.get(i).get("eqid").equals("")) { |
| | | if (childList.get(i).get("eqid").equals(pages.get(j).getDeviceNumber())) { |
| | | datas.add(pages.get(j)); |
| | | } |
| | |
| | | if (menuList.get(i).get("pId").toString().equals(pid) ) { |
| | | //递归遍历下一级 |
| | | treeIdList(menuList, menuList.get(i).get("id").toString()); |
| | | if (menuList.get(i).get("eqid") != null || menuList.get(i).get("eqid") != "") { |
| | | if (menuList.get(i).get("eqid") != null && !menuList.get(i).get("eqid").equals("")) { |
| | | childMenu.add(menuList.get(i).get("eqid")); |
| | | } |
| | | } |
| | |
| | | */ |
| | | public interface EquipmentMapper extends BaseMapper<Equipment> { |
| | | |
| | | List<EquipmentVO> selectEquipmentPage(IPage page, EquipmentVO equipment); |
| | | List<EquipmentVO> selectEquipmentPage(IPage page, EquipmentVO equipment,List childList); |
| | | |
| | | void s(Equipment equipment); |
| | | void updateOne(Equipment equipment); |
| | |
| | | <if test="equipment.dtype!=null"> |
| | | and dtype=#{equipment.dtype} |
| | | </if> |
| | | |
| | | <if test="childList!=null and childList.size>0"> |
| | | and deviceNumber in |
| | | <foreach collection="childList" index="index" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | <!--新增--> |
| | |
| | | */ |
| | | public interface IEquipmentService extends IService<Equipment> { |
| | | |
| | | IPage<EquipmentVO> selectEquipmentPage(IPage<EquipmentVO> page, EquipmentVO equipment); |
| | | IPage<EquipmentVO> selectEquipmentPage(IPage<EquipmentVO> page, EquipmentVO equipment,List childList); |
| | | IPage<EquipmentVO> selectPage(IPage<EquipmentVO> page, EquipmentVO equipment,String pid); |
| | | /** |
| | | * 树形结构 |
| | |
| | | private static final String PARENT_ID = "parentId"; |
| | | |
| | | @Override |
| | | public IPage<EquipmentVO> selectEquipmentPage(IPage<EquipmentVO> page, EquipmentVO equipment) { |
| | | return page.setRecords(baseMapper.selectEquipmentPage(page,equipment)); |
| | | public IPage<EquipmentVO> selectEquipmentPage(IPage<EquipmentVO> page, EquipmentVO equipment,List childList) { |
| | | return page.setRecords(baseMapper.selectEquipmentPage(page,equipment,childList)); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<EquipmentVO> selectPage(IPage<EquipmentVO> page, EquipmentVO equipment,String pid) { |
| | | |
| | | return page.setRecords(baseMapper.selectEquipmentPage(page,equipment)); |
| | | return page.setRecords(baseMapper.selectEquipmentPage(page,equipment,null)); |
| | | } |
| | | |
| | | @Override |