package cn.ibizlab.core.lite.extensions.service;

import cn.ibizlab.core.lite.extensions.domain.EntityModel;
import cn.ibizlab.core.lite.extensions.domain.EntityObj;
import cn.ibizlab.core.lite.extensions.model.DataModel;
import cn.ibizlab.util.filter.QueryFilter;

import java.sql.Timestamp;
import java.util.List;

public interface CommonEntityService {

    List<EntityObj> selectBase(String dsName, EntityModel entityModel, QueryFilter filter);
    List<EntityObj> selectCore(String dsName, EntityModel entityModel, QueryFilter filter);
    Integer selectCount(String dsName, EntityModel entityModel, QueryFilter filter);

    List<EntityObj> search(String dsName, String dataSet, EntityModel entityModel, QueryFilter filter);

    List<EntityObj> search(String dsName, String sql, QueryFilter filter);

    void cursorRead(String dsName, EntityModel entityModel, String sql, QueryFilter filter, LiteDataCallback callback);


    boolean saveBatch(String dsName, EntityModel entityModel, List<EntityObj> list);
    boolean save(String dsName, EntityModel entityModel, EntityObj entityObj);
    EntityObj get(String dsName, EntityModel entityModel, EntityObj entityObj);


    void processList(DataModel dataModel, Timestamp lastModify, LiteDataCallback callback);
    void processList(DataModel dataModel, String extCond, Timestamp lastModify, LiteDataCallback callback);


}
