我这样写可以吗
最后一行改一下:
<if test="newCar ==null or newCar == ''"> ORDER BY t.create_time DESC </if>
可以的,没看出什么问题,测试一下吧
and 改成 or
最后一个判断中的and错了吧,换成or应该就可以了