<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="合同信息">

	<query id="FmisOrder.getFmisOrderHead" desc="合同头">
		<![CDATA[
			SELECT * FROM FMIS_ORDER_HEAD WHERE VALIDFLAG = '1'
		]]>
	</query>

	<query id="FmisOrder.delFmisOrder" desc="合同头">
		<![CDATA[
		DECLARE
		    BEGIN
				FOR MYROW IN
                    (SELECT T.ORD_PK FROM FMIS_ORDER_HEAD T WHERE T.ORD_PK = ? AND T.SYNC_FLAG = '0') LOOP
                 DELETE FROM FMIS_ORDER_HEAD H
                 WHERE H.ORD_PK = MYROW.ORD_PK;
                 DELETE FROM FMIS_ORDER_LINE L
                 WHERE L.ORD_PK = MYROW.ORD_PK;
                 DELETE FROM FMIS_ORDER_DELIVERY D
                 WHERE D.ORD_PK = MYROW.ORD_PK;
            END LOOP;
        END;
		]]>
	</query>
</queryMap>


