package com.steering.pss.sale.order;

import CoreFS.SA08.CoreXmlSqlParsersFactory;
import com.steering.comm.db.DBCommon;
import com.steering.comm.tools.EntityTool;
import com.steering.pss.sale.order.fmis.FmisOrderHeadEntity;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

public class FmisOrder  extends DBCommon {

    public FmisOrderHeadEntity getOrderInfo(Connection con,String orderPk,String syncFlag) throws Exception{
        String sql = CoreXmlSqlParsersFactory.getSql("FmisOrder.getFmisOrderHead");
        sql += " AND ORD_PK = '" + orderPk +"'";
        sql += " AND SYNC_FLAG = '" + syncFlag +"'";
       return EntityTool.getEntityBySqlNoClsCon(sql, con, FmisOrderHeadEntity.class);
    }

    public void  delOrderInfo(Connection con,String ordPk) throws SQLException {
        String sql = CoreXmlSqlParsersFactory.getSql("FmisOrder.delFmisOrder");
        PreparedStatement ps = con.prepareStatement(sql);
        ps.setObject(1, ordPk);
        ps.executeUpdate();
        ps.close();
    }
}
