Spring MVC 4 出现 MyBatis 错误。
Spring MVC 4 with MyBatis error.
我已经用 MyBatis 创建了 Spring MVC 4。我非常确定我的设置都正确。出于某种原因,我收到此错误。感谢任何帮助
Apr 30, 2015 7:22:56 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [myBatisServlet] in context with path [/APMS] threw exception [Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter 'one' not found. Available parameters are [0, 1, 2, param5, 3, 4, param3, param4, param1, param2]] with root cause
org.apache.ibatis.binding.BindingException: Parameter 'one' not found. Available parameters are [0, 1, 2, param5, 3, 4, param3, param4, param1, param2]
at org.apache.ibatis.binding.MapperMethod$ParamMap.get(MapperMethod.java:165)
at org.apache.ibatis.reflection.wrapper.MapWrapper.get(MapWrapper.java:44)
at org.apache.ibatis.reflection.MetaObject.getValue(MetaObject.java:116)
at org.apache.ibatis.executor.BaseExecutor.createCacheKey(BaseExecutor.java:186)
at org.apache.ibatis.executor.CachingExecutor.createCacheKey(CachingExecutor.java:129)
at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:76)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:108)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:102)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:358)
at com.sun.proxy.$Proxy17.selectList(Unknown Source)
at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:198)
at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:119)
at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:63)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:52)
at com.sun.proxy.$Proxy30.getResult(Unknown Source)
at com.gm.app.apms.service.WbbCodeService.getTableResult(WbbCodeService.java:24)
at com.gm.app.apms.controller.WbbOrderStatusController.getAllOrdersResults(WbbOrderStatusController.java:46)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:776)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:705)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:868)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:668)
at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:223)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1517)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1474)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)
控制器class
package com.gm.app.apms.controller;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.SessionAttributes;
import org.springframework.web.servlet.ModelAndView;
import com.gm.app.apms.model.WbbOrderStatusForm;
import com.gm.app.apms.model.WbbOrderStatusResult;
import com.gm.app.apms.service.IWbbCodeService;
@Controller
@SessionAttributes("wbborderstatusform")
public class WbbOrderStatusController {
@Autowired
private IWbbCodeService iWbbCodeService;
@RequestMapping(value="/viewallorders", method=RequestMethod.POST)
public ModelAndView getAllOrdersResults (@ModelAttribute("wbbOrderStatusForm") WbbOrderStatusForm wbbOrderStatusForm) throws Exception
{
System.out.println(" I AM HERE");
String DateFrom = wbbOrderStatusForm.getDateFrom();
String DateTo = wbbOrderStatusForm.getDateTo();
String orderType = wbbOrderStatusForm.getOrderType();
String distCode = wbbOrderStatusForm.getDistCode();
String packingCode = wbbOrderStatusForm.getPackingCode();
System.out.println("DateFrom "+DateFrom);
System.out.println("DateTo "+DateTo);
System.out.println("orderType "+orderType);
System.out.println("distCode "+distCode);
System.out.println("packingCode "+packingCode);
ModelAndView showresult = new ModelAndView("showresults");
List <WbbOrderStatusResult> tablelist = new ArrayList<WbbOrderStatusResult>();
if (!DateFrom.isEmpty() && !DateTo.isEmpty() && !orderType.isEmpty() && !distCode.isEmpty() && !packingCode.isEmpty()){
tablelist = iWbbCodeService.getTableResult(DateFrom, DateTo, orderType, distCode, packingCode);
showresult.addObject("tablelist", tablelist);
}
return showresult;
}
@RequestMapping(value="/viewallorders", method=RequestMethod.GET)
public String signup(Model model) {
System.out.println("FIRST PART");
WbbOrderStatusForm wbbOrderStatusForm = new WbbOrderStatusForm();
model.addAttribute("wbbOrderStatusForm", wbbOrderStatusForm);
return "viewallorders";
}
}
映射器class
package com.gm.app.apms.mappers;
import java.util.List;
import org.apache.ibatis.annotations.Select;
import com.gm.app.apms.model.WbbOrderStatusResult;
public interface WbbCodeMapper
{
@Select("SELECT p1.P3ORDRM0.BUYER_ORDR_NO as distOrderNo, p1.P3ORDRM0.ORDR_YEAR||p1.P3ORDRM0.ORDR_CUST_CD||p1.P3ORDRM0.ORDR_TYPE||p1.P3ORDRM0.ORDR_SEQ as gmdatOrderNo, "
+ "p1.P3ORDRM0.CNFM_DT as cnfmDt, p1.P3ORDRM0.PORT_DEST_CD as packingCode, p1.P9ORDRV1.ORDR_ITEM as orderedItem, "
+ "p1.P9ORDRV1.ORDR_QTY as orderedPcs, Round(p1.P9ORDRV1.ORDR_AMT*decode(p1.P3ORDRM0.MULTI_EXCH_RATE,1000,1,p1.P3ORDRM0.MULTI_EXCH_RATE),2) as orderedAmt, "
+ "p1.P9ORDRV1.DSTR_ITEM as allocationItem, p1.P9ORDRV1.DSTR_QTY as allocationPcs, Round(p1.P9ORDRV1.DSTR_AMT*decode(p1.P3ORDRM0.MULTI_EXCH_RATE,1000,1,p1.P3ORDRM0.MULTI_EXCH_RATE),2) as allocationAmt, "
+ "DECODE(p1.P9ORDRV1.ORDR_QTY,0,0,Round((p1.P9ORDRV1.DSTR_QTY / p1.P9ORDRV1.ORDR_QTY )*100,2)) as allocationRate, p1.P9ORDRV1.PICK_ITEM as pickItem, "
+ "p1.P9ORDRV1.PICK_QTY as pickPcs, Round(p1.P9ORDRV1.PICK_AMT*decode(p1.P3ORDRM0.MULTI_EXCH_RATE,1000,1,p1.P3ORDRM0.MULTI_EXCH_RATE),2) as pickAmt, "
+ "DECODE(p1.P9ORDRV1.ORDR_QTY,0,0,Round((p1.P9ORDRV1.PICK_QTY / p1.P9ORDRV1.ORDR_QTY )*100,2)) as pickRate, p1.P9ORDRV1.PACK_ITEM as packItem, "
+ "p1.P9ORDRV1.PACK_QTY as packPcs, Round(p1.P9ORDRV1.PACK_AMT*decode(p1.P3ORDRM0.MULTI_EXCH_RATE,1000,1,p1.P3ORDRM0.MULTI_EXCH_RATE),2) as packAmt, "
+ "DECODE(p1.P9ORDRV1.ORDR_QTY,0,0,Round((p1.P9ORDRV1.PICK_QTY / p1.P9ORDRV1.ORDR_QTY )*100,2)) as packRate, p1.P9ORDRV1.CASE_OUT_ITEM as cargoReadyItem, "
+ "p1.P9ORDRV1.CASE_OUT_QTY as cargoReadyPcs, Round(p1.P9ORDRV1.CASE_OUT_AMT*decode(p1.P3ORDRM0.MULTI_EXCH_RATE,1000,1,p1.P3ORDRM0.MULTI_EXCH_RATE),2) as cargoReadyAmt, "
+ "DECODE(p1.P9ORDRV1.ORDR_QTY,0,0,Round((p1.P9ORDRV1.CASE_OUT_QTY / p1.P9ORDRV1.ORDR_QTY )*100,2)) as cargoReadyRate, p1.P9ORDRV1.SHIP_PEND_ITEM as vanningItem, "
+ "p1.P9ORDRV1.SHIP_PEND_QTY as vanningPcs, Round(p1.P9ORDRV1.SHIP_PEND_AMT*decode(p1.P3ORDRM0.MULTI_EXCH_RATE,1000,1,p1.P3ORDRM0.MULTI_EXCH_RATE),2) as vanningAmt, "
+ "DECODE(p1.P9ORDRV1.ORDR_QTY,0,0,Round((p1.P9ORDRV1.SHIP_PEND_QTY / p1.P9ORDRV1.ORDR_QTY )*100,2)) as vanningRate, p1.P9ORDRV1.SHIP_ITEM as shippedItem, "
+ "p1.P9ORDRV1.SHIP_QTY as shippedPcs, Round(p1.P9ORDRV1.SHIP_AMT*decode(p1.P3ORDRM0.MULTI_EXCH_RATE,1000,1,p1.P3ORDRM0.MULTI_EXCH_RATE),2) as shippedAmt, "
+ "DECODE(p1.P9ORDRV1.ORDR_QTY,0,0,Round((p1.P9ORDRV1.SHIP_QTY / p1.P9ORDRV1.ORDR_QTY )*100,2)) as shippedRate, p1.P9ORDRV1.BACK_ORDR_ITEM as balanceItem, "
+ "p1.P9ORDRV1.BACK_ORDR_QTY as balancePcs, Round(p1.P9ORDRV1.BACK_ORDR_AMT*decode(p1.P3ORDRM0.MULTI_EXCH_RATE,1000,1,p1.P3ORDRM0.MULTI_EXCH_RATE),2) as balanceAmt, "
+ "DECODE(p1.P9ORDRV1.ORDR_QTY,0,0,Round((p1.P9ORDRV1.BACK_ORDR_QTY / p1.P9ORDRV1.ORDR_QTY )*100,2)) as balanceRate, decode(p1.P3ORDRM0.CURR,'KRW','USD',p1.P3ORDRM0.CURR) as cur FROM p1.P3ORDRM0, "
+ "p1.P9ORDRV1 WHERE p1.p3ordrm0.ordr_year = p1.P9ORDRV1.ordr_year(+) AND p1.p3ordrm0.ordr_cust_cd = p1.P9ORDRV1.ordr_cust_cd(+) AND p1.p3ordrm0.ordr_type = p1.P9ORDRV1.ordr_type(+) "
+ "AND p1.p3ordrm0.ordr_seq = p1.P9ORDRV1.ordr_seq (+) "
+ "AND p1.P3ORDRM0.CNFM_DT >= #{one} "
+ "AND p1.P3ORDRM0.CNFM_DT <= #{two} "
+ "AND p1.P3ORDRM0.ORDR_TYPE like '%#{three}%' "
+ "AND p1.P3ORDRM0.ORDR_CUST_CD = '#{four}' "
+ "AND p1.P3ORDRM0.ORDRM0_STAT in ('400','500','700') "
+ "AND p1.P3ORDRM0.PORT_DEST_CD LIKE '%#{five}%';")
public List <WbbOrderStatusResult> getResult(String one, String two, String three, String four, String five);
}
表格型号
package com.gm.app.apms.model;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
public class WbbOrderStatusForm
{
private String dateFrom;
private String dateTo;
private String orderType;
private String packingCode;
private String distCode;
private String partNo;
private String radioCond;
private String distOrderNo;
private String suppPartNo;
private String suppSrc;
private String caseStatus;
private String caseYear;
private String caseCustCd;
private String caseSm;
private String caseSeq;
private String chk;
private String mod;
private String gmPartNo;
private String suzukiPartNo;
private Collection orderTypeCollection;
private Collection packingCodeCollection;
public WbbOrderStatusForm() {}
public Collection getOrderTypeCollection()
{
ArrayList list = new ArrayList();
//list.add(new LabelValueBean("ALL", ""));
HashMap searchMap = new HashMap();
searchMap.put("cdNo", "E0001");
List result = null;
//List result = (List) WbbCodeService.getInstance().getCodeList(searchMap);
String str = "";
for (int i = 0; i < result.size(); i++)
{
HashMap resultMap = (HashMap) result.get(i);
str = (String) resultMap.get("cdItem");
//list.add(new LabelValueBean(str, (String) resultMap.get("cdValue")));
}
return list;
}
public void setOrderTypeCollection(Collection collection)
{
orderTypeCollection = collection;
}
public Collection getPackingCodeCollection()
{
ArrayList list = new ArrayList();
//list.add(new LabelValueBean("ALL", ""));
HashMap searchMap = new HashMap();
searchMap.put("distCode", distCode);
List result = null;
//List result = (List) WbbCodeService.getInstance().getPackingCodeList(searchMap);
String str = "";
for (int i = 0; i < result.size(); i++)
{
HashMap resultMap = (HashMap) result.get(i);
str = (String) resultMap.get("cdValue");
//list.add(new LabelValueBean(str, (String) resultMap.get("cdValue")));
}
// ������ ���� ��� 1�� ����
if (list.size() == 1)
{
//list.add(new LabelValueBean("1", "1"));
}
return list;
}
public void setPackingCodeCollection(Collection collection)
{
packingCodeCollection = collection;
}
public String getDateFrom()
{
return dateFrom;
}
public void setDateFrom(String dateFrom)
{
this.dateFrom = dateFrom;
}
public String getDateTo()
{
return dateTo;
}
public void setDateTo(String dateTo)
{
this.dateTo = dateTo;
}
public String getOrderType()
{
return orderType;
}
public void setOrderType(String orderType)
{
this.orderType = orderType;
}
public String getPackingCode()
{
return packingCode;
}
public void setPackingCode(String packingCode)
{
this.packingCode = packingCode;
}
public String getDistCode()
{
return distCode;
}
public void setDistCode(String distCode)
{
this.distCode = distCode;
}
public String getPartNo()
{
return partNo;
}
public void setPartNo(String partNo)
{
this.partNo = partNo;
}
public String getRadioCond()
{
return radioCond;
}
public void setRadioCond(String radioCond)
{
this.radioCond = radioCond;
}
public String getDistOrderNo()
{
return distOrderNo;
}
public void setDistOrderNo(String distOrderNo)
{
this.distOrderNo = distOrderNo;
}
public String getSuppPartNo()
{
return suppPartNo;
}
public void setSuppPartNo(String suppPartNo)
{
this.suppPartNo = suppPartNo;
}
public String getSuppSrc()
{
return suppSrc;
}
public void setSuppSrc(String suppSrc)
{
this.suppSrc = suppSrc;
}
public String getCaseStatus()
{
return caseStatus;
}
public void setCaseStatus(String caseStatus)
{
this.caseStatus = caseStatus;
}
public String getCaseYear()
{
return caseYear;
}
public void setCaseYear(String caseYear)
{
this.caseYear = caseYear;
}
public String getCaseCustCd()
{
return caseCustCd;
}
public void setCaseCustCd(String caseCustCd)
{
this.caseCustCd = caseCustCd;
}
public String getCaseSm()
{
return caseSm;
}
public void setCaseSm(String caseSm)
{
this.caseSm = caseSm;
}
public String getCaseSeq()
{
return caseSeq;
}
public void setCaseSeq(String caseSeq)
{
this.caseSeq = caseSeq;
}
public String getChk()
{
return chk;
}
public void setChk(String chk)
{
this.chk = chk;
}
public String getMod()
{
return mod;
}
public void setMod(String mod)
{
this.mod = mod;
}
public String getGmPartNo()
{
return gmPartNo;
}
public void setGmPartNo(String gmPartNo)
{
this.gmPartNo = gmPartNo;
}
public String getSuzukiPartNo()
{
return suzukiPartNo;
}
public void setSuzukiPartNo(String suzukiPartNo)
{
this.suzukiPartNo = suzukiPartNo;
}
}
结果模型
package com.gm.app.apms.model;
public class WbbOrderStatusResult {
private String distOrderNo;
private String gmdatOrderNo;
private String cnfmDt;
private String packingCode;
private String orderedItem;
private String orderedPcs;
private String orderedAmt;
private String allocationItem;
private String allocationPcs;
private String allocationAmt;
private String allocationRate;
private String pickItem;
private String pickPcs;
private String pickAmt;
private String pickRate;
private String packItem;
private String packPcs;
private String packAmt;
private String packRate;
private String cargoReadyItem;
private String cargoReadyPcs;
private String cargoReadyAmt;
private String cargoReadyRate;
private String vanningItem;
private String vanningPcs;
private String vanningAmt;
private String vanningRate;
private String shippedItem;
private String shippedPcs;
private String shippedAmt;
private String shippedRate;
private String balanceItem;
private String balancePcs;
private String balanceAmt;
private String balanceRate;
private String cur;
public String getDistOrderNo() {
return distOrderNo;
}
public void setDistOrderNo(String distOrderNo) {
this.distOrderNo = distOrderNo;
}
public String getGmdatOrderNo() {
return gmdatOrderNo;
}
public void setGmdatOrderNo(String gmdatOrderNo) {
this.gmdatOrderNo = gmdatOrderNo;
}
public String getCnfmDt() {
return cnfmDt;
}
public void setCnfmDt(String cnfmDt) {
this.cnfmDt = cnfmDt;
}
public String getPackingCode() {
return packingCode;
}
public void setPackingCode(String packingCode) {
this.packingCode = packingCode;
}
public String getOrderedItem() {
return orderedItem;
}
public void setOrderedItem(String orderedItem) {
this.orderedItem = orderedItem;
}
public String getOrderedPcs() {
return orderedPcs;
}
public void setOrderedPcs(String orderedPcs) {
this.orderedPcs = orderedPcs;
}
public String getOrderedAmt() {
return orderedAmt;
}
public void setOrderedAmt(String orderedAmt) {
this.orderedAmt = orderedAmt;
}
public String getAllocationItem() {
return allocationItem;
}
public void setAllocationItem(String allocationItem) {
this.allocationItem = allocationItem;
}
public String getAllocationPcs() {
return allocationPcs;
}
public void setAllocationPcs(String allocationPcs) {
this.allocationPcs = allocationPcs;
}
public String getAllocationAmt() {
return allocationAmt;
}
public void setAllocationAmt(String allocationAmt) {
this.allocationAmt = allocationAmt;
}
public String getAllocationRate() {
return allocationRate;
}
public void setAllocationRate(String allocationRate) {
this.allocationRate = allocationRate;
}
public String getPickItem() {
return pickItem;
}
public void setPickItem(String pickItem) {
this.pickItem = pickItem;
}
public String getPickPcs() {
return pickPcs;
}
public void setPickPcs(String pickPcs) {
this.pickPcs = pickPcs;
}
public String getPickAmt() {
return pickAmt;
}
public void setPickAmt(String pickAmt) {
this.pickAmt = pickAmt;
}
public String getPickRate() {
return pickRate;
}
public void setPickRate(String pickRate) {
this.pickRate = pickRate;
}
public String getPackItem() {
return packItem;
}
public void setPackItem(String packItem) {
this.packItem = packItem;
}
public String getPackPcs() {
return packPcs;
}
public void setPackPcs(String packPcs) {
this.packPcs = packPcs;
}
public String getPackAmt() {
return packAmt;
}
public void setPackAmt(String packAmt) {
this.packAmt = packAmt;
}
public String getPackRate() {
return packRate;
}
public void setPackRate(String packRate) {
this.packRate = packRate;
}
public String getCargoReadyItem() {
return cargoReadyItem;
}
public void setCargoReadyItem(String cargoReadyItem) {
this.cargoReadyItem = cargoReadyItem;
}
public String getCargoReadyPcs() {
return cargoReadyPcs;
}
public void setCargoReadyPcs(String cargoReadyPcs) {
this.cargoReadyPcs = cargoReadyPcs;
}
public String getCargoReadyAmt() {
return cargoReadyAmt;
}
public void setCargoReadyAmt(String cargoReadyAmt) {
this.cargoReadyAmt = cargoReadyAmt;
}
public String getCargoReadyRate() {
return cargoReadyRate;
}
public void setCargoReadyRate(String cargoReadyRate) {
this.cargoReadyRate = cargoReadyRate;
}
public String getVanningItem() {
return vanningItem;
}
public void setVanningItem(String vanningItem) {
this.vanningItem = vanningItem;
}
public String getVanningPcs() {
return vanningPcs;
}
public void setVanningPcs(String vanningPcs) {
this.vanningPcs = vanningPcs;
}
public String getVanningAmt() {
return vanningAmt;
}
public void setVanningAmt(String vanningAmt) {
this.vanningAmt = vanningAmt;
}
public String getVanningRate() {
return vanningRate;
}
public void setVanningRate(String vanningRate) {
this.vanningRate = vanningRate;
}
public String getShippedItem() {
return shippedItem;
}
public void setShippedItem(String shippedItem) {
this.shippedItem = shippedItem;
}
public String getShippedPcs() {
return shippedPcs;
}
public void setShippedPcs(String shippedPcs) {
this.shippedPcs = shippedPcs;
}
public String getShippedAmt() {
return shippedAmt;
}
public void setShippedAmt(String shippedAmt) {
this.shippedAmt = shippedAmt;
}
public String getShippedRate() {
return shippedRate;
}
public void setShippedRate(String shippedRate) {
this.shippedRate = shippedRate;
}
public String getBalanceItem() {
return balanceItem;
}
public void setBalanceItem(String balanceItem) {
this.balanceItem = balanceItem;
}
public String getBalancePcs() {
return balancePcs;
}
public void setBalancePcs(String balancePcs) {
this.balancePcs = balancePcs;
}
public String getBalanceAmt() {
return balanceAmt;
}
public void setBalanceAmt(String balanceAmt) {
this.balanceAmt = balanceAmt;
}
public String getBalanceRate() {
return balanceRate;
}
public void setBalanceRate(String balanceRate) {
this.balanceRate = balanceRate;
}
public String getCur() {
return cur;
}
public void setCur(String cur) {
this.cur = cur;
}
}
服务接口
package com.gm.app.apms.service;
import java.util.List;
import com.gm.app.apms.model.WbbOrderStatusResult;
public interface IWbbCodeService
{
public List<WbbOrderStatusResult> getTableResult(String one, String two, String three, String four, String five);
}
服务实施
package com.gm.app.apms.service;
import java.util.HashMap;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gm.app.apms.mappers.StudentMapper;
import com.gm.app.apms.mappers.WbbCodeMapper;
import com.gm.app.apms.model.WbbOrderStatusResult;
@Service("IWbbCodeService")
public class WbbCodeService implements IWbbCodeService
{
@Autowired
private WbbCodeMapper wbbCodeMapper;
@Override
public List<WbbOrderStatusResult> getTableResult(String one, String two,
String three, String four, String five) {
return wbbCodeMapper.getResult(one, two, three, four, five);
}
}
解决方案是使用@Param 注释
public List <WbbOrderStatusResult> getResult(@Param("one")String one, @Param("two")String two, @Param("three")String three, @Param("four")String four, @Param("five")String five);
Kothari 自己的答案是可行的,但在您的 xml 映射中您可以这样做
{param1,jdbcType=xxx} #{param2,jdbcType=xxx} 等等.....
我已经用 MyBatis 创建了 Spring MVC 4。我非常确定我的设置都正确。出于某种原因,我收到此错误。感谢任何帮助
Apr 30, 2015 7:22:56 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [myBatisServlet] in context with path [/APMS] threw exception [Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter 'one' not found. Available parameters are [0, 1, 2, param5, 3, 4, param3, param4, param1, param2]] with root cause
org.apache.ibatis.binding.BindingException: Parameter 'one' not found. Available parameters are [0, 1, 2, param5, 3, 4, param3, param4, param1, param2]
at org.apache.ibatis.binding.MapperMethod$ParamMap.get(MapperMethod.java:165)
at org.apache.ibatis.reflection.wrapper.MapWrapper.get(MapWrapper.java:44)
at org.apache.ibatis.reflection.MetaObject.getValue(MetaObject.java:116)
at org.apache.ibatis.executor.BaseExecutor.createCacheKey(BaseExecutor.java:186)
at org.apache.ibatis.executor.CachingExecutor.createCacheKey(CachingExecutor.java:129)
at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:76)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:108)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:102)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:358)
at com.sun.proxy.$Proxy17.selectList(Unknown Source)
at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:198)
at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:119)
at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:63)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:52)
at com.sun.proxy.$Proxy30.getResult(Unknown Source)
at com.gm.app.apms.service.WbbCodeService.getTableResult(WbbCodeService.java:24)
at com.gm.app.apms.controller.WbbOrderStatusController.getAllOrdersResults(WbbOrderStatusController.java:46)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:776)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:705)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:868)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:668)
at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:223)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1517)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1474)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)
控制器class
package com.gm.app.apms.controller;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.SessionAttributes;
import org.springframework.web.servlet.ModelAndView;
import com.gm.app.apms.model.WbbOrderStatusForm;
import com.gm.app.apms.model.WbbOrderStatusResult;
import com.gm.app.apms.service.IWbbCodeService;
@Controller
@SessionAttributes("wbborderstatusform")
public class WbbOrderStatusController {
@Autowired
private IWbbCodeService iWbbCodeService;
@RequestMapping(value="/viewallorders", method=RequestMethod.POST)
public ModelAndView getAllOrdersResults (@ModelAttribute("wbbOrderStatusForm") WbbOrderStatusForm wbbOrderStatusForm) throws Exception
{
System.out.println(" I AM HERE");
String DateFrom = wbbOrderStatusForm.getDateFrom();
String DateTo = wbbOrderStatusForm.getDateTo();
String orderType = wbbOrderStatusForm.getOrderType();
String distCode = wbbOrderStatusForm.getDistCode();
String packingCode = wbbOrderStatusForm.getPackingCode();
System.out.println("DateFrom "+DateFrom);
System.out.println("DateTo "+DateTo);
System.out.println("orderType "+orderType);
System.out.println("distCode "+distCode);
System.out.println("packingCode "+packingCode);
ModelAndView showresult = new ModelAndView("showresults");
List <WbbOrderStatusResult> tablelist = new ArrayList<WbbOrderStatusResult>();
if (!DateFrom.isEmpty() && !DateTo.isEmpty() && !orderType.isEmpty() && !distCode.isEmpty() && !packingCode.isEmpty()){
tablelist = iWbbCodeService.getTableResult(DateFrom, DateTo, orderType, distCode, packingCode);
showresult.addObject("tablelist", tablelist);
}
return showresult;
}
@RequestMapping(value="/viewallorders", method=RequestMethod.GET)
public String signup(Model model) {
System.out.println("FIRST PART");
WbbOrderStatusForm wbbOrderStatusForm = new WbbOrderStatusForm();
model.addAttribute("wbbOrderStatusForm", wbbOrderStatusForm);
return "viewallorders";
}
}
映射器class
package com.gm.app.apms.mappers;
import java.util.List;
import org.apache.ibatis.annotations.Select;
import com.gm.app.apms.model.WbbOrderStatusResult;
public interface WbbCodeMapper
{
@Select("SELECT p1.P3ORDRM0.BUYER_ORDR_NO as distOrderNo, p1.P3ORDRM0.ORDR_YEAR||p1.P3ORDRM0.ORDR_CUST_CD||p1.P3ORDRM0.ORDR_TYPE||p1.P3ORDRM0.ORDR_SEQ as gmdatOrderNo, "
+ "p1.P3ORDRM0.CNFM_DT as cnfmDt, p1.P3ORDRM0.PORT_DEST_CD as packingCode, p1.P9ORDRV1.ORDR_ITEM as orderedItem, "
+ "p1.P9ORDRV1.ORDR_QTY as orderedPcs, Round(p1.P9ORDRV1.ORDR_AMT*decode(p1.P3ORDRM0.MULTI_EXCH_RATE,1000,1,p1.P3ORDRM0.MULTI_EXCH_RATE),2) as orderedAmt, "
+ "p1.P9ORDRV1.DSTR_ITEM as allocationItem, p1.P9ORDRV1.DSTR_QTY as allocationPcs, Round(p1.P9ORDRV1.DSTR_AMT*decode(p1.P3ORDRM0.MULTI_EXCH_RATE,1000,1,p1.P3ORDRM0.MULTI_EXCH_RATE),2) as allocationAmt, "
+ "DECODE(p1.P9ORDRV1.ORDR_QTY,0,0,Round((p1.P9ORDRV1.DSTR_QTY / p1.P9ORDRV1.ORDR_QTY )*100,2)) as allocationRate, p1.P9ORDRV1.PICK_ITEM as pickItem, "
+ "p1.P9ORDRV1.PICK_QTY as pickPcs, Round(p1.P9ORDRV1.PICK_AMT*decode(p1.P3ORDRM0.MULTI_EXCH_RATE,1000,1,p1.P3ORDRM0.MULTI_EXCH_RATE),2) as pickAmt, "
+ "DECODE(p1.P9ORDRV1.ORDR_QTY,0,0,Round((p1.P9ORDRV1.PICK_QTY / p1.P9ORDRV1.ORDR_QTY )*100,2)) as pickRate, p1.P9ORDRV1.PACK_ITEM as packItem, "
+ "p1.P9ORDRV1.PACK_QTY as packPcs, Round(p1.P9ORDRV1.PACK_AMT*decode(p1.P3ORDRM0.MULTI_EXCH_RATE,1000,1,p1.P3ORDRM0.MULTI_EXCH_RATE),2) as packAmt, "
+ "DECODE(p1.P9ORDRV1.ORDR_QTY,0,0,Round((p1.P9ORDRV1.PICK_QTY / p1.P9ORDRV1.ORDR_QTY )*100,2)) as packRate, p1.P9ORDRV1.CASE_OUT_ITEM as cargoReadyItem, "
+ "p1.P9ORDRV1.CASE_OUT_QTY as cargoReadyPcs, Round(p1.P9ORDRV1.CASE_OUT_AMT*decode(p1.P3ORDRM0.MULTI_EXCH_RATE,1000,1,p1.P3ORDRM0.MULTI_EXCH_RATE),2) as cargoReadyAmt, "
+ "DECODE(p1.P9ORDRV1.ORDR_QTY,0,0,Round((p1.P9ORDRV1.CASE_OUT_QTY / p1.P9ORDRV1.ORDR_QTY )*100,2)) as cargoReadyRate, p1.P9ORDRV1.SHIP_PEND_ITEM as vanningItem, "
+ "p1.P9ORDRV1.SHIP_PEND_QTY as vanningPcs, Round(p1.P9ORDRV1.SHIP_PEND_AMT*decode(p1.P3ORDRM0.MULTI_EXCH_RATE,1000,1,p1.P3ORDRM0.MULTI_EXCH_RATE),2) as vanningAmt, "
+ "DECODE(p1.P9ORDRV1.ORDR_QTY,0,0,Round((p1.P9ORDRV1.SHIP_PEND_QTY / p1.P9ORDRV1.ORDR_QTY )*100,2)) as vanningRate, p1.P9ORDRV1.SHIP_ITEM as shippedItem, "
+ "p1.P9ORDRV1.SHIP_QTY as shippedPcs, Round(p1.P9ORDRV1.SHIP_AMT*decode(p1.P3ORDRM0.MULTI_EXCH_RATE,1000,1,p1.P3ORDRM0.MULTI_EXCH_RATE),2) as shippedAmt, "
+ "DECODE(p1.P9ORDRV1.ORDR_QTY,0,0,Round((p1.P9ORDRV1.SHIP_QTY / p1.P9ORDRV1.ORDR_QTY )*100,2)) as shippedRate, p1.P9ORDRV1.BACK_ORDR_ITEM as balanceItem, "
+ "p1.P9ORDRV1.BACK_ORDR_QTY as balancePcs, Round(p1.P9ORDRV1.BACK_ORDR_AMT*decode(p1.P3ORDRM0.MULTI_EXCH_RATE,1000,1,p1.P3ORDRM0.MULTI_EXCH_RATE),2) as balanceAmt, "
+ "DECODE(p1.P9ORDRV1.ORDR_QTY,0,0,Round((p1.P9ORDRV1.BACK_ORDR_QTY / p1.P9ORDRV1.ORDR_QTY )*100,2)) as balanceRate, decode(p1.P3ORDRM0.CURR,'KRW','USD',p1.P3ORDRM0.CURR) as cur FROM p1.P3ORDRM0, "
+ "p1.P9ORDRV1 WHERE p1.p3ordrm0.ordr_year = p1.P9ORDRV1.ordr_year(+) AND p1.p3ordrm0.ordr_cust_cd = p1.P9ORDRV1.ordr_cust_cd(+) AND p1.p3ordrm0.ordr_type = p1.P9ORDRV1.ordr_type(+) "
+ "AND p1.p3ordrm0.ordr_seq = p1.P9ORDRV1.ordr_seq (+) "
+ "AND p1.P3ORDRM0.CNFM_DT >= #{one} "
+ "AND p1.P3ORDRM0.CNFM_DT <= #{two} "
+ "AND p1.P3ORDRM0.ORDR_TYPE like '%#{three}%' "
+ "AND p1.P3ORDRM0.ORDR_CUST_CD = '#{four}' "
+ "AND p1.P3ORDRM0.ORDRM0_STAT in ('400','500','700') "
+ "AND p1.P3ORDRM0.PORT_DEST_CD LIKE '%#{five}%';")
public List <WbbOrderStatusResult> getResult(String one, String two, String three, String four, String five);
}
表格型号
package com.gm.app.apms.model;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
public class WbbOrderStatusForm
{
private String dateFrom;
private String dateTo;
private String orderType;
private String packingCode;
private String distCode;
private String partNo;
private String radioCond;
private String distOrderNo;
private String suppPartNo;
private String suppSrc;
private String caseStatus;
private String caseYear;
private String caseCustCd;
private String caseSm;
private String caseSeq;
private String chk;
private String mod;
private String gmPartNo;
private String suzukiPartNo;
private Collection orderTypeCollection;
private Collection packingCodeCollection;
public WbbOrderStatusForm() {}
public Collection getOrderTypeCollection()
{
ArrayList list = new ArrayList();
//list.add(new LabelValueBean("ALL", ""));
HashMap searchMap = new HashMap();
searchMap.put("cdNo", "E0001");
List result = null;
//List result = (List) WbbCodeService.getInstance().getCodeList(searchMap);
String str = "";
for (int i = 0; i < result.size(); i++)
{
HashMap resultMap = (HashMap) result.get(i);
str = (String) resultMap.get("cdItem");
//list.add(new LabelValueBean(str, (String) resultMap.get("cdValue")));
}
return list;
}
public void setOrderTypeCollection(Collection collection)
{
orderTypeCollection = collection;
}
public Collection getPackingCodeCollection()
{
ArrayList list = new ArrayList();
//list.add(new LabelValueBean("ALL", ""));
HashMap searchMap = new HashMap();
searchMap.put("distCode", distCode);
List result = null;
//List result = (List) WbbCodeService.getInstance().getPackingCodeList(searchMap);
String str = "";
for (int i = 0; i < result.size(); i++)
{
HashMap resultMap = (HashMap) result.get(i);
str = (String) resultMap.get("cdValue");
//list.add(new LabelValueBean(str, (String) resultMap.get("cdValue")));
}
// ������ ���� ��� 1�� ����
if (list.size() == 1)
{
//list.add(new LabelValueBean("1", "1"));
}
return list;
}
public void setPackingCodeCollection(Collection collection)
{
packingCodeCollection = collection;
}
public String getDateFrom()
{
return dateFrom;
}
public void setDateFrom(String dateFrom)
{
this.dateFrom = dateFrom;
}
public String getDateTo()
{
return dateTo;
}
public void setDateTo(String dateTo)
{
this.dateTo = dateTo;
}
public String getOrderType()
{
return orderType;
}
public void setOrderType(String orderType)
{
this.orderType = orderType;
}
public String getPackingCode()
{
return packingCode;
}
public void setPackingCode(String packingCode)
{
this.packingCode = packingCode;
}
public String getDistCode()
{
return distCode;
}
public void setDistCode(String distCode)
{
this.distCode = distCode;
}
public String getPartNo()
{
return partNo;
}
public void setPartNo(String partNo)
{
this.partNo = partNo;
}
public String getRadioCond()
{
return radioCond;
}
public void setRadioCond(String radioCond)
{
this.radioCond = radioCond;
}
public String getDistOrderNo()
{
return distOrderNo;
}
public void setDistOrderNo(String distOrderNo)
{
this.distOrderNo = distOrderNo;
}
public String getSuppPartNo()
{
return suppPartNo;
}
public void setSuppPartNo(String suppPartNo)
{
this.suppPartNo = suppPartNo;
}
public String getSuppSrc()
{
return suppSrc;
}
public void setSuppSrc(String suppSrc)
{
this.suppSrc = suppSrc;
}
public String getCaseStatus()
{
return caseStatus;
}
public void setCaseStatus(String caseStatus)
{
this.caseStatus = caseStatus;
}
public String getCaseYear()
{
return caseYear;
}
public void setCaseYear(String caseYear)
{
this.caseYear = caseYear;
}
public String getCaseCustCd()
{
return caseCustCd;
}
public void setCaseCustCd(String caseCustCd)
{
this.caseCustCd = caseCustCd;
}
public String getCaseSm()
{
return caseSm;
}
public void setCaseSm(String caseSm)
{
this.caseSm = caseSm;
}
public String getCaseSeq()
{
return caseSeq;
}
public void setCaseSeq(String caseSeq)
{
this.caseSeq = caseSeq;
}
public String getChk()
{
return chk;
}
public void setChk(String chk)
{
this.chk = chk;
}
public String getMod()
{
return mod;
}
public void setMod(String mod)
{
this.mod = mod;
}
public String getGmPartNo()
{
return gmPartNo;
}
public void setGmPartNo(String gmPartNo)
{
this.gmPartNo = gmPartNo;
}
public String getSuzukiPartNo()
{
return suzukiPartNo;
}
public void setSuzukiPartNo(String suzukiPartNo)
{
this.suzukiPartNo = suzukiPartNo;
}
}
结果模型
package com.gm.app.apms.model;
public class WbbOrderStatusResult {
private String distOrderNo;
private String gmdatOrderNo;
private String cnfmDt;
private String packingCode;
private String orderedItem;
private String orderedPcs;
private String orderedAmt;
private String allocationItem;
private String allocationPcs;
private String allocationAmt;
private String allocationRate;
private String pickItem;
private String pickPcs;
private String pickAmt;
private String pickRate;
private String packItem;
private String packPcs;
private String packAmt;
private String packRate;
private String cargoReadyItem;
private String cargoReadyPcs;
private String cargoReadyAmt;
private String cargoReadyRate;
private String vanningItem;
private String vanningPcs;
private String vanningAmt;
private String vanningRate;
private String shippedItem;
private String shippedPcs;
private String shippedAmt;
private String shippedRate;
private String balanceItem;
private String balancePcs;
private String balanceAmt;
private String balanceRate;
private String cur;
public String getDistOrderNo() {
return distOrderNo;
}
public void setDistOrderNo(String distOrderNo) {
this.distOrderNo = distOrderNo;
}
public String getGmdatOrderNo() {
return gmdatOrderNo;
}
public void setGmdatOrderNo(String gmdatOrderNo) {
this.gmdatOrderNo = gmdatOrderNo;
}
public String getCnfmDt() {
return cnfmDt;
}
public void setCnfmDt(String cnfmDt) {
this.cnfmDt = cnfmDt;
}
public String getPackingCode() {
return packingCode;
}
public void setPackingCode(String packingCode) {
this.packingCode = packingCode;
}
public String getOrderedItem() {
return orderedItem;
}
public void setOrderedItem(String orderedItem) {
this.orderedItem = orderedItem;
}
public String getOrderedPcs() {
return orderedPcs;
}
public void setOrderedPcs(String orderedPcs) {
this.orderedPcs = orderedPcs;
}
public String getOrderedAmt() {
return orderedAmt;
}
public void setOrderedAmt(String orderedAmt) {
this.orderedAmt = orderedAmt;
}
public String getAllocationItem() {
return allocationItem;
}
public void setAllocationItem(String allocationItem) {
this.allocationItem = allocationItem;
}
public String getAllocationPcs() {
return allocationPcs;
}
public void setAllocationPcs(String allocationPcs) {
this.allocationPcs = allocationPcs;
}
public String getAllocationAmt() {
return allocationAmt;
}
public void setAllocationAmt(String allocationAmt) {
this.allocationAmt = allocationAmt;
}
public String getAllocationRate() {
return allocationRate;
}
public void setAllocationRate(String allocationRate) {
this.allocationRate = allocationRate;
}
public String getPickItem() {
return pickItem;
}
public void setPickItem(String pickItem) {
this.pickItem = pickItem;
}
public String getPickPcs() {
return pickPcs;
}
public void setPickPcs(String pickPcs) {
this.pickPcs = pickPcs;
}
public String getPickAmt() {
return pickAmt;
}
public void setPickAmt(String pickAmt) {
this.pickAmt = pickAmt;
}
public String getPickRate() {
return pickRate;
}
public void setPickRate(String pickRate) {
this.pickRate = pickRate;
}
public String getPackItem() {
return packItem;
}
public void setPackItem(String packItem) {
this.packItem = packItem;
}
public String getPackPcs() {
return packPcs;
}
public void setPackPcs(String packPcs) {
this.packPcs = packPcs;
}
public String getPackAmt() {
return packAmt;
}
public void setPackAmt(String packAmt) {
this.packAmt = packAmt;
}
public String getPackRate() {
return packRate;
}
public void setPackRate(String packRate) {
this.packRate = packRate;
}
public String getCargoReadyItem() {
return cargoReadyItem;
}
public void setCargoReadyItem(String cargoReadyItem) {
this.cargoReadyItem = cargoReadyItem;
}
public String getCargoReadyPcs() {
return cargoReadyPcs;
}
public void setCargoReadyPcs(String cargoReadyPcs) {
this.cargoReadyPcs = cargoReadyPcs;
}
public String getCargoReadyAmt() {
return cargoReadyAmt;
}
public void setCargoReadyAmt(String cargoReadyAmt) {
this.cargoReadyAmt = cargoReadyAmt;
}
public String getCargoReadyRate() {
return cargoReadyRate;
}
public void setCargoReadyRate(String cargoReadyRate) {
this.cargoReadyRate = cargoReadyRate;
}
public String getVanningItem() {
return vanningItem;
}
public void setVanningItem(String vanningItem) {
this.vanningItem = vanningItem;
}
public String getVanningPcs() {
return vanningPcs;
}
public void setVanningPcs(String vanningPcs) {
this.vanningPcs = vanningPcs;
}
public String getVanningAmt() {
return vanningAmt;
}
public void setVanningAmt(String vanningAmt) {
this.vanningAmt = vanningAmt;
}
public String getVanningRate() {
return vanningRate;
}
public void setVanningRate(String vanningRate) {
this.vanningRate = vanningRate;
}
public String getShippedItem() {
return shippedItem;
}
public void setShippedItem(String shippedItem) {
this.shippedItem = shippedItem;
}
public String getShippedPcs() {
return shippedPcs;
}
public void setShippedPcs(String shippedPcs) {
this.shippedPcs = shippedPcs;
}
public String getShippedAmt() {
return shippedAmt;
}
public void setShippedAmt(String shippedAmt) {
this.shippedAmt = shippedAmt;
}
public String getShippedRate() {
return shippedRate;
}
public void setShippedRate(String shippedRate) {
this.shippedRate = shippedRate;
}
public String getBalanceItem() {
return balanceItem;
}
public void setBalanceItem(String balanceItem) {
this.balanceItem = balanceItem;
}
public String getBalancePcs() {
return balancePcs;
}
public void setBalancePcs(String balancePcs) {
this.balancePcs = balancePcs;
}
public String getBalanceAmt() {
return balanceAmt;
}
public void setBalanceAmt(String balanceAmt) {
this.balanceAmt = balanceAmt;
}
public String getBalanceRate() {
return balanceRate;
}
public void setBalanceRate(String balanceRate) {
this.balanceRate = balanceRate;
}
public String getCur() {
return cur;
}
public void setCur(String cur) {
this.cur = cur;
}
}
服务接口
package com.gm.app.apms.service;
import java.util.List;
import com.gm.app.apms.model.WbbOrderStatusResult;
public interface IWbbCodeService
{
public List<WbbOrderStatusResult> getTableResult(String one, String two, String three, String four, String five);
}
服务实施
package com.gm.app.apms.service;
import java.util.HashMap;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gm.app.apms.mappers.StudentMapper;
import com.gm.app.apms.mappers.WbbCodeMapper;
import com.gm.app.apms.model.WbbOrderStatusResult;
@Service("IWbbCodeService")
public class WbbCodeService implements IWbbCodeService
{
@Autowired
private WbbCodeMapper wbbCodeMapper;
@Override
public List<WbbOrderStatusResult> getTableResult(String one, String two,
String three, String four, String five) {
return wbbCodeMapper.getResult(one, two, three, four, five);
}
}
解决方案是使用@Param 注释
public List <WbbOrderStatusResult> getResult(@Param("one")String one, @Param("two")String two, @Param("three")String three, @Param("four")String four, @Param("five")String five);
Kothari 自己的答案是可行的,但在您的 xml 映射中您可以这样做