|
|
@@ -391,19 +391,24 @@ public class DataboardController {
|
|
|
sql += " group by t1.city_in ";
|
|
|
list = SqlRunnerAdapter.db().selectList(sql);
|
|
|
List<ItemCountAmountVo> amountList = new ArrayList<>();
|
|
|
- for (Map<String, Object> objectMap : list) {
|
|
|
- Object cityInObj = objectMap.get("city_in");
|
|
|
- String item = "";
|
|
|
- if (cityInObj != null && Integer.parseInt(cityInObj.toString()) == 1) {
|
|
|
- item = "市外";
|
|
|
- } else if (cityInObj != null && Integer.parseInt(cityInObj.toString()) == 0) {
|
|
|
- item = "室内";
|
|
|
+ List<Integer> city_in = new ArrayList<>();
|
|
|
+ city_in.add(1);city_in.add(0);
|
|
|
+ for (Integer i : city_in) {
|
|
|
+ for (Map<String, Object> objectMap : list) {
|
|
|
+ Object cityInObj = objectMap.get("city_in");
|
|
|
+ String item = "";
|
|
|
+ if (cityInObj != null && Integer.parseInt(cityInObj.toString()) == i) {
|
|
|
+ item = "市外";
|
|
|
+ } else if (cityInObj != null && Integer.parseInt(cityInObj.toString()) == i) {
|
|
|
+ item = "室内";
|
|
|
+ }
|
|
|
+ ItemCountAmountVo amountVo = new ItemCountAmountVo();
|
|
|
+ amountVo.setItem(item);
|
|
|
+ amountVo.setAmount(Double.parseDouble(objectMap.get("total_amount").toString()));
|
|
|
+ amountList.add(amountVo);
|
|
|
}
|
|
|
- ItemCountAmountVo amountVo = new ItemCountAmountVo();
|
|
|
- amountVo.setItem(item);
|
|
|
- amountVo.setAmount(Double.parseDouble(objectMap.get("total_amount").toString()));
|
|
|
- amountList.add(amountVo);
|
|
|
}
|
|
|
+
|
|
|
result.setAmountList(amountList);
|
|
|
return RT.ok(result);
|
|
|
}
|