Commit 91b73aff authored by 董国亮's avatar 董国亮

fix:修复mybatis 根据map查询的bug

parent f4340281
...@@ -10,6 +10,7 @@ import net.wanji.common.framework.i18n.I18nResourceBundle; ...@@ -10,6 +10,7 @@ import net.wanji.common.framework.i18n.I18nResourceBundle;
import net.wanji.common.framework.rest.JsonViewObject; import net.wanji.common.framework.rest.JsonViewObject;
import net.wanji.common.framework.rest.Page; import net.wanji.common.framework.rest.Page;
import net.wanji.common.framework.rest.ValidationGroups; import net.wanji.common.framework.rest.ValidationGroups;
import net.wanji.common.utils.tool.StringUtils;
import net.wanji.databus.dao.entity.GreenwaveInfoPO; import net.wanji.databus.dao.entity.GreenwaveInfoPO;
import net.wanji.databus.dao.mapper.GreenwaveInfoMapper; import net.wanji.databus.dao.mapper.GreenwaveInfoMapper;
import net.wanji.opt.dto.induce.GreenwaveDTO; import net.wanji.opt.dto.induce.GreenwaveDTO;
...@@ -141,7 +142,9 @@ public class GreenwaveInducesController { ...@@ -141,7 +142,9 @@ public class GreenwaveInducesController {
String jsonStr = JSON.toJSONString(GreenwaveInduces); String jsonStr = JSON.toJSONString(GreenwaveInduces);
try { try {
//参数校验过程中修改,兼容实现,restful入参不用map,便于进行参数逐个校验 //参数校验过程中修改,兼容实现,restful入参不用map,便于进行参数逐个校验
Map params = JSONObject.parseObject(JSONObject.toJSONString(GreenwaveInduces), Map.class); //Map params = JSONObject.parseObject(JSONObject.toJSONString(GreenwaveInduces), Map.class);
Map<String, Object> params = new HashMap<>();
JSONObject.parseObject(JSONObject.toJSONString(GreenwaveInduces), Map.class).forEach((k,v) -> params.put(StringUtils.camelToCapital(k.toString()).toLowerCase(), v));
List<GreenwaveInduces> greenwaveInducesList = this.greenwaveInducesService.listByMap(params); List<GreenwaveInduces> greenwaveInducesList = this.greenwaveInducesService.listByMap(params);
List<InduceTemplate> induceTemplateList = induceTemplateService.list(); List<InduceTemplate> induceTemplateList = induceTemplateService.list();
List<DeviceInduces> deviceInducesList = deviceInducesService.list(); List<DeviceInduces> deviceInducesList = deviceInducesService.list();
......
...@@ -10,6 +10,7 @@ import net.wanji.common.framework.i18n.I18nResourceBundle; ...@@ -10,6 +10,7 @@ import net.wanji.common.framework.i18n.I18nResourceBundle;
import net.wanji.common.framework.rest.JsonViewObject; import net.wanji.common.framework.rest.JsonViewObject;
import net.wanji.common.framework.rest.Page; import net.wanji.common.framework.rest.Page;
import net.wanji.common.framework.rest.ValidationGroups; import net.wanji.common.framework.rest.ValidationGroups;
import net.wanji.common.utils.tool.StringUtils;
import net.wanji.databus.dao.entity.GreenwaveInfoPO; import net.wanji.databus.dao.entity.GreenwaveInfoPO;
import net.wanji.databus.dao.mapper.GreenwaveInfoMapper; import net.wanji.databus.dao.mapper.GreenwaveInfoMapper;
import net.wanji.opt.dto.induce.GreenwaveInducesDTO; import net.wanji.opt.dto.induce.GreenwaveInducesDTO;
...@@ -146,7 +147,10 @@ public class GreenwaveInducesHistController { ...@@ -146,7 +147,10 @@ public class GreenwaveInducesHistController {
String jsonStr = JSON.toJSONString(GreenwaveInducesHist); String jsonStr = JSON.toJSONString(GreenwaveInducesHist);
try { try {
//参数校验过程中修改,兼容实现,restful入参不用map,便于进行参数逐个校验 //参数校验过程中修改,兼容实现,restful入参不用map,便于进行参数逐个校验
Map params = JSONObject.parseObject(JSONObject.toJSONString(GreenwaveInducesHist), Map.class); // Map params = JSONObject.parseObject(JSONObject.toJSONString(GreenwaveInducesHist), Map.class);
Map<String, Object> params = new HashMap<>();
JSONObject.parseObject(JSONObject.toJSONString(GreenwaveInducesHist), Map.class).forEach((k,v) -> params.put(StringUtils.camelToCapital(k.toString()).toLowerCase(), v));
List<GreenwaveInducesDTO> list = new ArrayList<>(); List<GreenwaveInducesDTO> list = new ArrayList<>();
List<GreenwaveInducesHist> greenwaveInducesHistList = this.greenwaveInducesHistService.listByMap(params); List<GreenwaveInducesHist> greenwaveInducesHistList = this.greenwaveInducesHistService.listByMap(params);
List<GreenwaveInfoPO> greenwaveInfoPOList = greenwaveInfoMapper.selectAll(); List<GreenwaveInfoPO> greenwaveInfoPOList = greenwaveInfoMapper.selectAll();
......
...@@ -10,6 +10,7 @@ import net.wanji.common.framework.i18n.I18nResourceBundle; ...@@ -10,6 +10,7 @@ import net.wanji.common.framework.i18n.I18nResourceBundle;
import net.wanji.common.framework.rest.JsonViewObject; import net.wanji.common.framework.rest.JsonViewObject;
import net.wanji.common.framework.rest.Page; import net.wanji.common.framework.rest.Page;
import net.wanji.common.framework.rest.ValidationGroups; import net.wanji.common.framework.rest.ValidationGroups;
import net.wanji.common.utils.tool.StringUtils;
import net.wanji.opt.dto.induce.InduceDTO; import net.wanji.opt.dto.induce.InduceDTO;
import net.wanji.opt.entity.InduceHist; import net.wanji.opt.entity.InduceHist;
import net.wanji.opt.service.induce.InduceHistService; import net.wanji.opt.service.induce.InduceHistService;
...@@ -20,10 +21,7 @@ import javax.annotation.Resource; ...@@ -20,10 +21,7 @@ import javax.annotation.Resource;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import javax.ws.rs.QueryParam; import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MediaType;
import java.util.ArrayList; import java.util.*;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/** /**
* <p> * <p>
...@@ -78,7 +76,10 @@ public class InduceHistController { ...@@ -78,7 +76,10 @@ public class InduceHistController {
String jsonStr = JSON.toJSONString(InduceHist); String jsonStr = JSON.toJSONString(InduceHist);
try { try {
//参数校验过程中修改,兼容实现,restful入参不用map,便于进行参数逐个校验 //参数校验过程中修改,兼容实现,restful入参不用map,便于进行参数逐个校验
Map params = JSONObject.parseObject(JSONObject.toJSONString(InduceHist), Map.class); // Map params = JSONObject.parseObject(JSONObject.toJSONString(InduceHist), Map.class);
Map<String, Object> params = new HashMap<>();
JSONObject.parseObject(JSONObject.toJSONString(InduceHist), Map.class).forEach((k,v) -> params.put(StringUtils.camelToCapital(k.toString()).toLowerCase(), v));
List list = this.induceHistService.listByMap(params); List list = this.induceHistService.listByMap(params);
jsonView.success(list); jsonView.success(list);
} catch (Exception e) { } catch (Exception e) {
......
...@@ -10,6 +10,7 @@ import net.wanji.common.framework.i18n.I18nResourceBundle; ...@@ -10,6 +10,7 @@ import net.wanji.common.framework.i18n.I18nResourceBundle;
import net.wanji.common.framework.rest.JsonViewObject; import net.wanji.common.framework.rest.JsonViewObject;
import net.wanji.common.framework.rest.Page; import net.wanji.common.framework.rest.Page;
import net.wanji.common.framework.rest.ValidationGroups; import net.wanji.common.framework.rest.ValidationGroups;
import net.wanji.common.utils.tool.StringUtils;
import net.wanji.opt.entity.InduceTemplate; import net.wanji.opt.entity.InduceTemplate;
import net.wanji.opt.service.induce.InduceTemplateService; import net.wanji.opt.service.induce.InduceTemplateService;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
...@@ -20,6 +21,7 @@ import javax.validation.constraints.NotBlank; ...@@ -20,6 +21,7 @@ import javax.validation.constraints.NotBlank;
import javax.ws.rs.QueryParam; import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MediaType;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -77,7 +79,10 @@ public class InduceTemplateController { ...@@ -77,7 +79,10 @@ public class InduceTemplateController {
String jsonStr = JSON.toJSONString(InduceTemplate); String jsonStr = JSON.toJSONString(InduceTemplate);
try { try {
//参数校验过程中修改,兼容实现,restful入参不用map,便于进行参数逐个校验 //参数校验过程中修改,兼容实现,restful入参不用map,便于进行参数逐个校验
Map params = JSONObject.parseObject(JSONObject.toJSONString(InduceTemplate), Map.class); // Map params = JSONObject.parseObject(JSONObject.toJSONString(InduceTemplate), Map.class);
Map<String, Object> params = new HashMap<>();
JSONObject.parseObject(JSONObject.toJSONString(InduceTemplate), Map.class).forEach((k,v) -> params.put(StringUtils.camelToCapital(k.toString()).toLowerCase(), v));
List list = this.induceTemplateService.listByMap(params); List list = this.induceTemplateService.listByMap(params);
jsonView.success(list); jsonView.success(list);
} catch (Exception e) { } catch (Exception e) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment