错误示范: <if test="sort == '0'"> ORDER BY id desc </if> 正确写法: <if test='sort == "0"'> ORDER BY a.id desc </if>