传入了俩对象,一个是分页pagination,一个是查询条件query。
取值时应写成 对象.属性 的形式。
像这样:
<select id="getAllClassVO" parameterType="ClassQuery" resultType="vo.ClassVO">
SELECT c.id id, t.id tid, t.name tname, c.name name, c.total, c.gmt_create gmt_create, c.gmt_modified gmt_modified
FROM cl_info c, ac_teacher t
WHERE c.tid = t.id
<if test="query.name != null and query.name != ''">
AND c.name LIKE CONCAT('%', #{query.name}, '%')
</if>
<if test="query.begin != null and query.begin != ''">
AND c.gmt_create >= #{query.begin}
</if>
ORDER BY c.gmt_create
</select>