下面是代码: 为什么会提示 _parameter 不存在 如果我还固定其他的参数 就查询不到数据 求大神们帮帮忙 在线 急!!
Service:
public List<ManageUserBean> getManageuserinfo(int pageT,int pagesizeT,String scbtn);
xml SQL 语句:
select a.id,a.agent_accountname,a.agent_date,b.role_name,b.role_nameEG
from agent_info_table a,agent_role b
where a.role_id=b.role_id and
CONCAT('',a.agent_accountname,b.role_name) LIKE CONCAT('%',#{_parameter},'%')
limit #{0},#{1}
controller:
@RequestMapping(value="/ManageUser",method={RequestMethod.POST,RequestMethod.GET},produces="application/json;charset=utf-8")
public String ManageUserRequest(HttpServletRequest req,HttpServletResponse res){
int pagesizeT=12; //显示行数
int pageT=1; //当前页数
int totalRecordT; //总记录数
int totalPageT; //总页数
String scbtn = req.getParameter("scbtn");
if(!Verify.isNullOrEmpty(req.getParameter("page"))){
pageT = Integer.parseInt(req.getParameter("page"));
}
totalRecordT = appService.getManageMax();
totalPageT = (int) Math.ceil((double)totalRecordT/pagesizeT);
if(pageT==0){pageT=1;}
if(pageT>totalPageT){pageT=totalPageT;}
req.setAttribute("page",pageT);
req.setAttribute("totalRecord",totalRecordT);
req.setAttribute("totalPage",totalPageT);
List<ManageUserBean> ManageOTran = appService.getManageuserinfo(pageT,pagesizeT, scbtn);
req.setAttribute("ManageInfo", ManageOTran);
if(!CharNull.isNullOrEmpty(req.getSession().getAttribute("Language"))){
return "ManageUserEG";
}else{
return "ManageUser";
}
}
问题已经解决了 原来是Mybatis多个参数传值问题
public List<XXXBean> getXXXBeanList(String xxId, String xxCode);
<select id="getXXXBeanList" resultType="XXBean">
select t.* from tableName where id = #{0} and name = #{1}
</select>
由于是多参数那么就不能使用parameterType, 改用#{index}是第几个就用第几个的索引,索引从0开始