develop
hanrenchun 10 months ago
parent 20a9887aa7
commit 3bc7b3a1f1

@ -273,15 +273,10 @@ public class MetaImpUserModelInfoController extends BaseController {
map.put("铁路订票",tlCount); map.put("铁路订票",tlCount);
map.put("旅馆住宿",lgCount); map.put("旅馆住宿",lgCount);
QueryWrapper<MetaImpUserModelInfo> queryWrapper = new QueryWrapper<>(); Map<String, Object> maps = metaImpUserModelInfoService.groupAndCountByField();
queryWrapper.select("imp_user_sub_type", "COUNT(*) as count")
.groupBy("imp_user_sub_type");
Map<String, Object> map1 = metaImpUserModelInfoService.getMap(queryWrapper);
HashMap<String , Map<String, Object>> hashMap = new HashMap<>(); HashMap<String , Map<String, Object>> hashMap = new HashMap<>();
hashMap.put("预警类别",map); hashMap.put("预警类别",map);
hashMap.put("重点人类别",map1); hashMap.put("重点人类别",maps);
return AjaxResult.success(hashMap); return AjaxResult.success(hashMap);
} }

@ -3,6 +3,9 @@ package com.ruoyi.database.service;
import com.ruoyi.database.domain.MetaImpUserModelInfo; import com.ruoyi.database.domain.MetaImpUserModelInfo;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
import java.util.Map;
/** /**
* @author 28758 * @author 28758
* @description meta_imp_user_model_info(?ص???Ԥ??ģ????Ϣ?)Service * @description meta_imp_user_model_info(?ص???Ԥ??ģ????Ϣ?)Service
@ -10,4 +13,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/ */
public interface MetaImpUserModelInfoService extends IService<MetaImpUserModelInfo> { public interface MetaImpUserModelInfoService extends IService<MetaImpUserModelInfo> {
Map<String, Object> groupAndCountByField();
} }

@ -1,11 +1,18 @@
package com.ruoyi.database.service.impl; package com.ruoyi.database.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.database.domain.MetaImpUserModelInfo; import com.ruoyi.database.domain.MetaImpUserModelInfo;
import com.ruoyi.database.service.MetaImpUserModelInfoService; import com.ruoyi.database.service.MetaImpUserModelInfoService;
import com.ruoyi.database.mapper.MetaImpUserModelInfoMapper; import com.ruoyi.database.mapper.MetaImpUserModelInfoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/** /**
* @author 28758 * @author 28758
* @description meta_imp_user_model_info(?ص???Ԥ??ģ????Ϣ?)Service * @description meta_imp_user_model_info(?ص???Ԥ??ģ????Ϣ?)Service
@ -15,6 +22,23 @@ import org.springframework.stereotype.Service;
public class MetaImpUserModelInfoServiceImpl extends ServiceImpl<MetaImpUserModelInfoMapper, MetaImpUserModelInfo> public class MetaImpUserModelInfoServiceImpl extends ServiceImpl<MetaImpUserModelInfoMapper, MetaImpUserModelInfo>
implements MetaImpUserModelInfoService{ implements MetaImpUserModelInfoService{
@Autowired
private MetaImpUserModelInfoMapper metaImpUserModelInfoMapper;
public Map<String, Object> groupAndCountByField() {
QueryWrapper<MetaImpUserModelInfo> queryWrapper = Wrappers.query();
queryWrapper.groupBy("imp_user_sub_type");
List<MetaImpUserModelInfo> metaImpUserModelInfos = metaImpUserModelInfoMapper.selectList(queryWrapper);
Map<String, Object> map = new HashMap<>();
for (MetaImpUserModelInfo metaImpUserModelInfo:metaImpUserModelInfos){
QueryWrapper<MetaImpUserModelInfo> wrapper = new QueryWrapper<>();
wrapper.eq("imp_user_sub_type",metaImpUserModelInfo.getImpUserSubType());
Integer integer = metaImpUserModelInfoMapper.selectCount(wrapper);
map.put(metaImpUserModelInfo.getImpUserSubTypeCn(),integer);
}
return map;
}
} }

Loading…
Cancel
Save