package com.steering.pss.pncost.base;

import CoreFS.SA06.CoreReturnObject;
import CoreFS.SA08.CoreXmlSqlParsersFactory;
import com.steering.comm.db.DBCommon;
import com.steering.comm.tools.EntityTool;
import com.steering.comm.tools.SqlBuilder;
import com.steering.pss.pncost.entity.CostBasePlineRebackEntity;
public class ComBasePlineReback extends DBCommon{
    public CoreReturnObject query(){
        String sql = CoreXmlSqlParsersFactory.getSql("ComBasePlineReback.query");
        
        return this.getData(sql);
    }
    public CoreReturnObject queryPliao(String gang){
        SqlBuilder b = new SqlBuilder("ComBasePlineReback.queryPliao");
        b.Fill(new String[]{gang});
        return this.getData(b.toString());
    }
    public CoreReturnObject queryNum(String gang,String hejin){
        String sql = CoreXmlSqlParsersFactory.getSql("ComBasePlineReback.queryNum");
        if(!gang.equals("")){
            sql += " AND PLINE_CODE = '" + gang + "'";
        }
        if(!hejin.equals("")){
            sql += " AND ITEM_CODE = '" + hejin + "'";
        }
        return this.getData(sql);
    }
    public CoreReturnObject isave(String strJSON){
        CostBasePlineRebackEntity batching = EntityTool.getEntityByJSONStr(strJSON, CostBasePlineRebackEntity.class);
        String sql = CoreXmlSqlParsersFactory.getSql("ComBasePlineReback.isave");
        sql = EntityTool.fillSqlByEntity(sql, batching);
        return this.setData(sql);
    }
    public CoreReturnObject usave(String strJSON){
        CostBasePlineRebackEntity batching = EntityTool.getEntityByJSONStr(strJSON, CostBasePlineRebackEntity.class);
        String sql = CoreXmlSqlParsersFactory.getSql("ComBasePlineReback.usave");
        sql = EntityTool.fillSqlByEntity(sql, batching);
        return this.setData(sql);
    }
}
