| | |
| | | import com.moral.entity.Sensor;
|
| | | import com.moral.mapper.DeviceMapper;
|
| | | import com.moral.mapper.HistoryMapper;
|
| | | import com.moral.mapper.ProfessionMapper;
|
| | | import com.moral.mapper.SensorMapper;
|
| | | import com.moral.service.AccountService;
|
| | | import com.moral.service.HistoryService;
|
| | | import com.moral.service.ProfessionService;
|
| | |
|
| | | @Service
|
| | | public class HistoryServiceImpl implements HistoryService {
|
| | |
| | | private SensorMapper sensorMapper;
|
| | |
|
| | | @Resource
|
| | | private ProfessionMapper professionMapper;
|
| | | private ProfessionService professionService;
|
| | |
|
| | | @Override
|
| | | public Map<String, Object> getAllSensorAverageByDevice(Map<String, Object> parameters) throws Exception {
|
| | |
| | | ValidateUtil.notNull(parameters.get("accountId"), "param.is.null");
|
| | |
|
| | | String regionCode = parameters.get("regionCode").toString();
|
| | | parameters.put("provinceCode", regionCode.substring(0,2).concat("0000"));
|
| | | String regionType = "village";
|
| | | String nextLevel = "";
|
| | | if (regionCode.length() == 6) {
|
| | |
| | | }
|
| | | }
|
| | | if ("profession".equals(parameters.get("dimension"))) {
|
| | | List<Profession> professions = professionMapper.selectAll();
|
| | | List<Profession> professions = professionService.getProfessiontList(parameters);
|
| | | for (Map<String, Object> map : result) {
|
| | | for (Profession profession : professions) {
|
| | | if (map.get("name").equals(profession.getName())) {
|