select oad.*, bo.picture as image, bo.no as orderNo,bo.user_id, bo.goods_amount, bo.real_amount, bo.`status`, bo.crt_time as orderTime from order_active_detail oad
LEFT JOIN base_order bo on bo.id = oad.order_id
<where>
<iftest="no != null and no != ''">
and bo.no = #{no}
</if>
<iftest="userId != null and userId > 0">
and bo.user_id = #{userId}
</if>
<iftest="type != null and type > 0">
and oad.type = #{type}
</if>
<iftest="startTime != null and endTime != null">
and bo.crt_time between #{startTime} and #{endTime}