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.pss.pncost.entity.ComBaseGradeEntity;
public class ComBaseGrade extends DBCommon{
    public CoreReturnObject query(String strChan){
        String sql = CoreXmlSqlParsersFactory.getSql("ComBaseGrade.query");
        if(!strChan.equals("")){
            sql += " AND GRADENAME LIKE '%" + strChan + "%'";
        }
        sql += " ORDER BY T.GRADECODE";
        return this.getData(sql);
    }
    public CoreReturnObject queryPliao(){
        String sql = CoreXmlSqlParsersFactory.getSql("ComBaseGrade.queryPliao");
        return this.getData(sql);
    }
    public CoreReturnObject save(String strJSON){
        ComBaseGradeEntity batching = EntityTool.getEntityByJSONStr(strJSON, ComBaseGradeEntity.class);
        String sql = CoreXmlSqlParsersFactory.getSql("ComBaseGrade.save");
        sql = EntityTool.fillSqlByEntity(sql, batching);
        return this.setData(sql);
    }
}
