1.implement代码
public Result<List<盘点计划表>> search计划编号(String 计划编号) {
Result<List<盘点计划表>> res = new Result<>();
try {
计划编号 = "%" + 计划编号 + "%";
List<盘点计划表> data = 盘点计划表Dao.search计划编号(计划编号);
res.setFlag(true);
res.setCount((long) data.size());
res.setData(data);
} catch (Exception e) {
e.printStackTrace();
logger.error(e.getMessage());
res.setFlag(false);
res.setMessage(e.getMessage());
}
return res;
}
2.xml代码
select
from IMOS_PD_CheckPlan
where CheckPlan_Code like #{计划编号} and CheckPlan_Result = '未执行'
3.报错
16:16:12 [http-nio-8080-exec-3] DEBUG o.s.web.servlet.DispatcherServlet - DispatcherServlet with name 'dispatcherServlet' processing POST request for [/%E7%9B%98%E7%82%B9%E8%AE%A1%E5%88%92%E8%A1%A8/%E6%A0%B9%E6%8D%AE%E8%AE%A1%E5%88%92%E7%BC%96%E5%8F%B7%E8%8E%B7%E5%8F%96%E7%9B%98%E7%82%B9%E8%AE%A1%E5%88%92]
16:16:12 [http-nio-8080-exec-3] DEBUG o.s.w.s.m.m.a.RequestMappingHandlerMapping - Looking up handler method for path /盘点计划表/根据计划编号获取盘点计划
16:16:12 [http-nio-8080-exec-3] DEBUG o.s.w.s.m.m.a.RequestMappingHandlerMapping - Returning handler method [public com.bean.Result> com.controller.盘点计划表Controller.根据计划编号获取盘点计划(javax.servlet.http.HttpServletRequest,java.lang.String)]
16:16:12 [http-nio-8080-exec-3] DEBUG o.s.w.s.m.m.a.RequestResponseBodyMethodProcessor - Read [class java.lang.String] as "application/json;charset=UTF-8" with [org.springframework.http.converter.StringHttpMessageConverter@2092b072]
16:16:27 [http-nio-8080-exec-3] DEBUG com.dao.盘点计划表Dao.search计划编号 - ==> Preparing: select CheckPlan_Code ,CheckPlan_Name ,CheckPlan_Way ,CheckPlan_Project ,CheckPlan_OperatorCode ,CheckPlan_OperatorName ,CheckPlan_StartDate ,CheckPlan_EndDate ,CheckPlan_Result from IMOS_PD_CheckPlan where CheckPlan_Code like ? and CheckPlan_Result = '未执行'
16:16:27 [http-nio-8080-exec-3] DEBUG com.dao.盘点计划表Dao.search计划编号 - ==> Parameters: %{"计划编号":""}%(String)
16:16:28 [http-nio-8080-exec-3] DEBUG com.dao.盘点计划表Dao.search计划编号 - <== Total: 0
16:16:30 [http-nio-8080-exec-3] DEBUG o.s.w.s.m.m.a.RequestResponseBodyMethodProcessor - Written [com.bean.Result@6607bb55] as "application/json" using [org.springframework.http.converter.json.MappingJackson2HttpMessageConverter@504521ae]
16:16:30 [http-nio-8080-exec-3] DEBUG o.s.web.servlet.DispatcherServlet - Null ModelAndView returned to DispatcherServlet with name 'dispatcherServlet': assuming HandlerAdapter completed request handling
16:16:30 [http-nio-8080-exec-3] DEBUG o.s.web.servlet.DispatcherServlet - Successfully completed request
NullModelAndViewreturnedtoDispatcherServletwithname'dispatcherServlet':assumingHandlerAdaptercompletedrequesthandling
这里应该是错误根源了,看下这个是什么请求,为什么没有设置返回值。
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。