package com.steering.pss.plnsaleord.report;

import CoreFS.SA06.CoreReturnObject;
import CoreFS.SA08.CoreXmlSqlParsersFactory;
import com.steering.comm.db.DBCommon;
import org.hsqldb.lib.StringUtil;

import java.util.HashMap;

/**
 * @Author xiay
 * @Date 2021/1/8 15:27
 * @Version 1.0
 */
public class FrmYieldInOutputQuery extends DBCommon {

    public CoreReturnObject doQuery(HashMap<String,Object> para) {

        String sql = CoreXmlSqlParsersFactory
                .getSql("FrmYieldInOutputQuery.doQuery");

        if(para.containsKey("time") && para.get("time")!=null && !StringUtil.isEmpty(para.get("time").toString()) ){
            sql+= " AND T.BAL_YEAR_MONTH= '"  + para.get("time").toString() + "'";
        }

        if(para.containsKey("judgeStoveNo") && para.get("judgeStoveNo")!=null && !StringUtil.isEmpty(para.get("judgeStoveNo").toString()) ){
            sql += " AND T.JUDGE_STOVE_NO = '"  + para.get("judgeStoveNo").toString() + "'";
        }

        sql += "  GROUP BY T.JUDGE_STOVE_NO,T.BATCH_NO,T.BATCH_GROUD_NO,T.MATERIAL_NAME,T.PRODUCNAME,T.JUGDE_APPLY_CODE,T.JUGDE_APPLY_SEQUENO," +
                " T.STEELNAME,T.GRADENAME,T.SPEC_NAME,T.MODEL_DESC,T.STD_NAME,T.STD_STYLE_DESC,T.LOT_NO,T.PLINE_NAME,T.PRO_ORDER_NO," +
                " T.ACT_DIMATER,T.ACT_HEIGHT,T.SUPPLY_UNIT_DESC,T.ACT_COUNT,T.ACT_WEIGHT,T2.JUDGE_STOVE_NO,T3.DIMATER,T3.GRADENAME,T.TARGET,T7. T7.CUSTOMER_NM,T7.FST_DRAWEE_UNIT";

        return this.getData(sql);
    }
}
