0
点赞
收藏
分享

微信扫一扫

Mybatis xml文件中获取不到传入的对象中各属性的值

Hyggelook 2022-01-09 阅读 151
xmlmybatis

传入了俩对象,一个是分页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>
举报

相关推荐

0 条评论