All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.tmsps.ne4spring.base.IBaseService Maven / Gradle / Ivy

There is a newer version: 999.0.0.0
Show newest version
package com.tmsps.ne4spring.base;

import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.jdbc.core.JdbcTemplate;

import com.tmsps.ne4spring.orm.model.DataModel;
import com.tmsps.ne4spring.orm.param.NeParamList;
import com.tmsps.ne4spring.page.Page;

/**
 * 
 *======================================================
 * @author zhangwei [email protected] 
 *------------------------------------------------------
 * IBaseService base service interface
 *======================================================
 */
public interface IBaseService {
	public Logger log = LoggerFactory.getLogger("Ne4Spring");

	//获取对象JdbcTemplate,便于使用JdbcTemplate提供的封装方法
	public JdbcTemplate getJdbcTemplate();
	
	//与数据库表的信息对应,保存进入数据库,sync 为是否需要同步一次Model,用于数据库中默认属性的回填
	public int saveObj(DataModel model);
	public DataModel saveObj(DataModel model, boolean sync);
	public int saveTemplateObj(DataModel model);
	public DataModel saveTemplateObj(DataModel model, boolean sync);
	
	public void saveObjs(List objs);

	public  T findObjById(Object idVal, final Class clazz);
	public  T findById(Object idVal, final Class clazz);
	public Map findById(String tableName, String pkName, String pkVal);
	public Map findById(String tableName, String pkVal);
	
	public Map findObj(String sql);
	public Map findObj(String sql, Object[] vals);
	public  T findObj(String sql, Class clazz);
	public  T findForObj(String sql, Class clazz);
	public List> findList(String sql);
	//1.6.5新增
	public  List findList(String sql,Class clazz);
	public List> findList(String sql, Object[] vals);
	//1.6.5新增
	public  List findList(Class clazz,String sql, Object... vals);
	//查询结果集封装成BEAN
	public  T  findObj(String sql, Object[] vals, Class modelClass);
	//1.6.5新增
	public  T  findObj(Class clazz ,String sql, Object... vals) ;

	/**
	 * 修改Id类型为Object
	 */
	public int deleteObjById(Object id, Class clazz);
	public int deleteByID(String pkColumn, Object id, String tableName);

	public int updateObj(DataModel obj) ;
	public int updateObjT(DataModel obj) ;
	public int updateChangeObj(DataModel obj);
	public int updateTemplateObj(DataModel obj);
	
	public List> findList(String sql, String sql_cnt, Object[] vals, Page page);
	public List> findList(String sql, Object[] vals, Map sort_params, Page page);
	public List> findList(String sql, Object[] vals, Page page);
	public List> findList(String sql, Page page);
	//1.6.5新增
	public  List findList(Class clazz, Page page, String sql, String sql_cnt, Object... vals);
	public  List findList(Class clazz, Page page, String sql, Map sort_params, Object... vals);
	public  List findList(Class clazz, Page page, String sql, Object... vals);
	public  List findList(Class clazz, Page page, String sql);
	
	
	public int updObj(final Class clazz, Map parm, Map whereparm) ;

	public Map getMap(String key, Object val);
	public Map> getSearchMap();
	public Map getMap(String[] key, Object[] val) ;

	public Page pageinate(int pageNumber, int pageSize, String select, String sqlExceptSelect, Object... paras);
	public Page pageinate(int pageNumber, int pageSize, String select, String sqlExceptSelect) ;
	//新增page参数,少一个形参
	public Page pageinate(Page page, String select, String sqlExceptSelect, NeParamList params);
	public Page pageinate(Page page, String select, String sqlExceptSelect, Object... paras);
	public Page pageinate(Page page, String select, String sqlExceptSelect) ;
	
	//新版本的查询,节约查询参数
	public List> findList(String sql, NeParamList params, Map sort_params, Page page);
	public List> findList(String sql, NeParamList params);
	//1.6.5新增
	public  List findList(Class clazz, String sql, NeParamList params, Map sort_params, Page page);
	public  List findList(Class clazz, String sql, NeParamList params);
	//1.6.7新增
	public  T queryForObject(String sql, Class requiredType);
	public  T queryForObject(String sql, NeParamList params, Class requiredType);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy