SELECT
o.*
FROM
u_order o
LEFT JOIN u_order_goods og ON o.id = og.order_id
<where>
o.is_virtual = 0
<if test="uOrderGoodsVO.ccode != null and uOrderGoodsVO.ccode != ''">
AND o.ccode = #{uOrderGoodsVO.ccode}
</if>
<if test="uOrderGoodsVO.cinvdefine3 != null and uOrderGoodsVO.cinvdefine3 != ''">
AND og.cinvdefine3 = #{uOrderGoodsVO.cinvdefine3}
</if>
<if test="uOrderGoodsVO.cinvdefine5List != null and uOrderGoodsVO.cinvdefine5List.size > 0">
AND og.cinvdefine5 in
<foreach collection="uOrderGoodsVO.cinvdefine5List" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</where>