TbNewAreaTier tier = new TbNewAreaTier(); tier.setLv(tbUserInfo.getLv()); tier.setName(tbUserInfo.getCity()); tier.setSuperiorid(tier.getId()); List<TbNewAreaTier>tierList = tbNewAreaTierService.findList(tier); // List<Map<String, Object>> tierCity = tbNewAreaTierService.findCustom("select * from TB_NEW_AREA_TIER where lv = 1 and name=#{p[0]}", new Object[]{tbUserInfo.getCity()}); // List<Map<String, Object>> qxCity = tbNewAreaTierService.findCustom("select * from TB_NEW_AREA_TIER where superiorId = #{p[0]}", new Object[]{tierCity.get(0).get("ID")}); for (Map<String, Object> qx: tierList) { qx.put("xz", tbNewAreaTierService.findCustom("select * from TB_NEW_AREA_TIER where lv = 3 and superiorId= #{p[0]}", new Object[]{qx.get("ID")})); } json.fluentPut("gsqxs", qxCity); TbNewAreaTier tier = new TbNewAreaTier(); tier.setLv(1); tier.setName(tbUserInfo.getCity()); List<TbNewAreaTier>findListTierCity = tbNewAreaTierService.findList(tier); json.fluentPut("tier",findListTierCity.get(0));怎么改
时间: 2024-04-21 16:22:12 浏览: 155
CCP.zip_givingnx5_tier1_tier1开发
根据您提供的代码片段,我看到您想要对其中的一部分进行修改。以下是您提供的代码片段的修改版本:
```java
TbNewAreaTier tier = new TbNewAreaTier();
tier.setLv(tbUserInfo.getLv());
tier.setName(tbUserInfo.getCity());
tier.setSuperiorid(tier.getId());
List<TbNewAreaTier> tierList = tbNewAreaTierService.findList(tier);
for (TbNewAreaTier qx : tierList) {
qx.setXz(tbNewAreaTierService.findCustom("select * from TB_NEW_AREA_TIER where lv = 3 and superiorId= #{p[0]}", new Object[]{qx.getId()}));
}
TbNewAreaTier tierCity = new TbNewAreaTier();
tierCity.setLv(1);
tierCity.setName(tbUserInfo.getCity());
List<TbNewAreaTier> findListTierCity = tbNewAreaTierService.findList(tierCity);
json.fluentPut("gsqxs", findListTierCity);
json.fluentPut("tier", findListTierCity.get(0));
```
在这个修改版本中,我做了以下更改:
- 将 `qx.put("xz", ...)` 修改为 `qx.setXz(...)`
- 将 `List<Map<String, Object>> qxCity = ...` 修改为 `TbNewAreaTier tierCity = ...`
- 在 `json.fluentPut("tier", ...)` 中使用 `findListTierCity.get(0)` 替代之前的 `tierCity.get(0)`
请注意,这只是根据您提供的代码片段进行的修改,可能还有其他上下文和变量信息未提供。请根据您的实际需求进行适当调整。
阅读全文