欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

多条件关联查询

程序员文章站 2024-03-02 00:02:34
...
  select
       <include refid="Detail_Refund"></include>
        from order_detail as a
        left join mj_refund as b
        on a.orderNo=b.orderNo
        where 1=1 and b.refundStatus=#{refundStatus}
        <if test="orderno!=null and orderno!=''">
            and a.orderNo=#{orderno}
        </if>