标签:排序 条件 tor mybatis order by ddl pre select open
SELECT A.WBXSDDH,A.XSDDLX,B.XSFDH,B.XSZZDM,C.SKUID
FROM GMXSDD A,GMXSDDFD B,GMXSDDSP C
WHERE A.XSDDH=B.XSDDH
AND B.XSFDH=C.XSFDH
AND B.XSFDLX=0
AND B.STATUS!=-10
AND A.XQFDM=‘PDD‘
AND A.WBXSDDH IN
<foreach collection="outerOrders" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
UNION
SELECT B.WBXSDDH,A.XSDDLX,B.XSFDH,B.XSZZDM,C.SKUID
FROM GMXSDD A,GMXSDDFD B,GMXSDDSP C
WHERE A.XSDDH=B.XSDDH
AND B.XSFDH=C.XSFDH
AND B.XSFDLX=0
AND B.STATUS!=-10
AND A.XQFDM !=‘PDD‘
AND B.WBXSDDH IN
<foreach collection="outerOrders" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
ORDER BY field (WBXSDDH,
<foreach collection="outerOrders" item="item" separator=",">
#{item}
</foreach>
);
标签:排序 条件 tor mybatis order by ddl pre select open
原文地址:https://www.cnblogs.com/stubborn-dude/p/14931408.html