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.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;

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 {

	//获取对象JdbcTemplate,便于使用JdbcTemplate提供的封装方法
	public JdbcTemplate getJdbcTemplate();
	//获取对象NamedParameterJdbcTemplate,便于使用getJNamedParameterJdbcTemplate提供的封装方法
	public NamedParameterJdbcTemplate getJNamedParameterJdbcTemplate();
	
	//与数据库表的信息对应,保存进入数据库,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 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);
	public  List findList(String sql,Class clazz);
	public List> findList(String sql, Object[] vals);
	public  List findList(Class clazz,String sql, Object... vals);
	public  T  findObj(String sql, Object[] vals, Class modelClass);
	public  T  findObj(Class clazz ,String sql, Object... vals) ;
	public  T  findObj(Class clazz ,String sql, NeParamList params) ;

	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);
	
	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