比如想查询这个sql,当参数不为空的时候加上条件
select a.number,a.time,a.status," +
"b.course_id,b.quantnum,b.price,b.orig," +
"c.name from order a " +
"left join course_order b on a.id = b.order_id " +
"left join course c on b.course_id = c. id" +
"where a.user_id=@userId
应该用哪种方法把sql和cnd结合起来