<if test="''!=user_id">
and o.user_id=#{user_id}
</if>
o.user_id='ggg'
-----------------
o.user_id=ggg
<if test="''!=user_id">
and o.user_id=${user_id}
</if>
and o.user_id=#{user_id}
</if>
o.user_id='ggg'
-----------------
o.user_id=ggg
<if test="''!=user_id">
and o.user_id=${user_id}
</if>