package com.steering.pss.ydm.pipeleavefactory;

import CoreFS.SA06.CoreReturnObject;
import CoreFS.SA08.CoreXmlSqlParsersFactory;
import CoreFS.Util.StringUtils;
import com.steering.comm.db.DBCommon;
import com.steering.comm.tools.EntityTool;
import com.steering.pss.ydm.entity.PreTrackNotice;

import java.util.ArrayList;

public class PreTrackNoticeService extends DBCommon {
    //private final static String DAONAME = "LimsDao";


    /*public CoreReturnObject query(String json){
        return query(json,null,null);
    }注释天管计量 2024/4/24*/

    /*public CoreReturnObject query(String json,String startTime, String endTime){
        PreTrackNotice entity = EntityTool.getEntityByJSONStr(json,PreTrackNotice.class);
        String sql = CoreXmlSqlParsersFactory
                .getSql("PreTrackNotice.query");
        if(!StringUtils.isEmpty(startTime) && !StringUtils.isEmpty(endTime)){
            sql += " AND T.CREATE_TIME >= TO_DATE('"+startTime+" 00:00:00','YYYY-MM-DD HH24:MI:SS')";
            sql += " AND T.CREATE_TIME <= TO_DATE('"+endTime+" 23:59:59','YYYY-MM-DD HH24:MI:SS')";
        }
        if(!StringUtils.isEmpty(entity.getCustomerSupplierName())){
            sql += " AND T.CUSTOMER_SUPPLIER_NAME LIKE '" + entity.getCustomerSupplierName() + "%'";
        }
        if(!StringUtils.isEmpty(entity.getMatterName())){
            sql += " AND T.MATTER_NAME LIKE '" + entity.getMatterName() + "%'";
        }
        if(!StringUtils.isEmpty(entity.getContractNo())){
            sql += " AND T.CONTRACT_NO LIKE '" + entity.getContractNo() + "%'";
        }
        if(!StringUtils.isEmpty(entity.getNoticeNo())){
            sql += " AND T.NOTICE_NO LIKE '" + entity.getNoticeNo() + "%'";
        }
        return this.getData(DAONAME,sql);
    }注释天管计量 2024/4/24*/


    /*public CoreReturnObject insert(ArrayList<String> jsons){
        ArrayList<String> arrayList = new ArrayList<String>();
        String sql = CoreXmlSqlParsersFactory
                .getSql("PreTrackNotice.insert");
        for (String json : jsons) {
            PreTrackNotice entity = EntityTool.getEntityByJSONStr(json,PreTrackNotice.class);
            sql = EntityTool.fillSqlByEntity(sql, entity);
            arrayList.add(sql);
        }
        return this.setData(DAONAME,arrayList,null);
    }注释天管计量 2024/4/24*/

    /*public CoreReturnObject delete(ArrayList<String> jsons){
        ArrayList<String> arrayList = new ArrayList<String>();
        String sql = CoreXmlSqlParsersFactory
                .getSql("PreTrackNotice.delete");
        for (String json : jsons) {
            PreTrackNotice entity = EntityTool.getEntityByJSONStr(json,PreTrackNotice.class);
            sql = EntityTool.fillSqlByEntity(sql, entity);
            arrayList.add(sql);
        }
        return this.setData(DAONAME,arrayList,null);
    }*/
}
