一、输入映射:
通过parameterType指定输入参数的类型,类型可以是简单类型、hashmap、pojo的包装类型
1) 传递pojo的包装对象
需求是:完成用户信息的综合查询,传入的查询条件复杂;(包括用户信息、其他信息等);
定义包装类型:
用户扩展类:
package com.cy.po; /** *用户的扩展类 * @author chengyu * */ public class UserCustom extends User{ }
视图层面的用户包装类型:
1 package com.cy.po; 2 3 /** 4 * 用户的包装类型 5 * @author chengyu 6 * 7 */ 8 public class UserQueryVo { 9 //在这里包装所需要的查询条件 10 11 //用户查询条件 12 private UserCustom userCustom; 13 14 //可以包装其它的查询条件,订单、商品 15 //.... 16 17 public UserCustom getUserCustom() { 18 return userCustom; 19 } 20 21 public void setUserCustom(UserCustom userCustom) { 22 this.userCustom = userCustom; 23 } 24 }