电子围栏树结构适配

pull/4/head
dearlin 2024-01-30 16:33:59 +08:00
parent 8c70ca1a79
commit e358657730
3 changed files with 16 additions and 0 deletions

View File

@ -25,6 +25,7 @@ public interface ElectronicFenceMapper {
List<PageData> listAll(PageData pd); List<PageData> listAll(PageData pd);
List<Map<String, Object>> listTree(PageData pd); List<Map<String, Object>> listTree(PageData pd);
List<Map<String, Object>> listTreeApp(PageData pd);
List<PageData> findByPId(PageData pd); List<PageData> findByPId(PageData pd);
} }

View File

@ -50,6 +50,11 @@ public class ElectronicFenceServiceImpl implements ElectronicFenceService {
@Override @Override
public List<Map<String, Object>> listTree(PageData pd) { public List<Map<String, Object>> listTree(PageData pd) {
if ("children".equals(pd.getString("childKey"))) {
// 手机端
List<Map<String, Object>> dataList = electronicFenceMapper.listTreeApp(pd);
return buildTree(dataList, pd.getString("childKey"));
}
List<Map<String, Object>> dataList = electronicFenceMapper.listTree(pd); List<Map<String, Object>> dataList = electronicFenceMapper.listTree(pd);
return buildTree(dataList, pd.getString("childKey")); return buildTree(dataList, pd.getString("childKey"));
} }

View File

@ -177,6 +177,16 @@
f f
where f.ISDELETE = '0' and f.CORPINFO_ID = #{CORPINFO_ID} and f.PARENT_ID = #{ELECTRONIC_FENCE_AREA_ID} where f.ISDELETE = '0' and f.CORPINFO_ID = #{CORPINFO_ID} and f.PARENT_ID = #{ELECTRONIC_FENCE_AREA_ID}
</select> </select>
<select id="listTreeApp" resultType="java.util.Map">
SELECT
IFNULL(ELECTRONIC_FENCE_ID,ELECTRONIC_FENCE_AREA_ID) id,
ELECTRONIC_FENCE_AREA_NAME name,
PARENT_ID pId
FROM
electronic_fence f
WHERE
f.ISDELETE = '0' and f.CORPINFO_ID = #{CORPINFO_ID}
</select>
<!-- 批量删除 --> <!-- 批量删除 -->