我在做一个查询的功能,现在把前台的查询条件放到一个CriteriaForm 普通java bean中.
然后在OrderMapper.xml
增加下面的一段.
<search id="searchOrdersByCriteria" resultMap="orderResultMap"
parameterType= "com.cl.shop.bean.CriteriaForm">
select * from clshop.cl_order where 1=1
<if test="custName != null and custName != '' ">
and cust_code = #{custCode}
</if>
<if test="status != null and status != '' ">
and status = #{status}
</if>
</search>
但是在项目启动的时候就起不来,想问一下,是这种方式不支持吗?
spring?mvc parameterType MyBatis
------解决方案--------------------
是可以的,Myibatis是支持自定义Bean的,但是不是parameterType;而是parameterClass