跟代码没问题 百度一下看一下配置文件包路径这类
StudentMapper不变, 只修改StudentMapper.xml文件,注意,将name改成arg0,age1改成arg1,age2改成arg2
<select id="getUserByNameAndAge" resultType="com.csu.software.model.Student">
select * from student
<where>
<if test="arg0 != null">
and name like CONCAT('%',#{arg0},'%')
</if>
<if test="arg1 != null">
and age > #{arg1,jdbcType=INTEGER}
</if>
<if test="arg2 != null">
and age < #{arg2,jdbcType=INTEGER}
</if>
</where>
</select>