mybatis sql判断多个元素不为空
SELECT * FROM result co where <if test="projectId != null"> co.projectId=#{projectId} and </if> <if test="startTime!=null and endTime!=null"> modifyTime between #{startTime} and #{endTime} </if> <if test="startTime!=null and endTime==null ">
modifyTime>= #{startTime} </if> order by co.id desc;