一、输入映射:

通过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 }
View Code

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-22
  • 2021-10-10
  • 2021-09-09
  • 2021-06-11
  • 2021-05-07
猜你喜欢
  • 2022-12-23
  • 2021-06-19
  • 2019-02-09
  • 2021-08-05
  • 2021-12-12
  • 2022-03-04
  • 2022-12-23
相关资源
相似解决方案