123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193 |
- package com.huimv.busi.xt.model;
- import java.sql.SQLException;
- import java.util.Date;
- import java.util.List;
- import java.util.Map;
- /**
- * 基础业务接口定义
- * @author hongjun.hu
- * @version 1.0
- */
- public interface BaseService {
- /**
- * 单表操作:根据动态条件记数记录集
- * @param nameSpace
- * @param example
- * @return
- * @throws SQLException
- */
- int countByExample(String nameSpace, Object example) throws SQLException;
- /**
- * 数据删除
- * @param sqlMapId sqlMapId
- * @param parameterObject parameterObject
- * @return 删除返回
- * @throws SQLException
- */
- public int delete(String sqlMapId, Object parameterObject)
- throws SQLException;
- /**
- * 单表操作:根据动态条件删除记录集
- * @param nameSpace nameSpace
- * @param example example
- * @return 删除返回
- * @throws SQLException
- */
- public int deleteByExample(String nameSpace, Object example)
- throws SQLException;
- /**
- * 单表操作:根据主键删除记录集
- * @param nameSpace
- * @param id
- * @return
- * @throws SQLException
- */
- public int deleteByPrimaryKey(String nameSpace, Long id)
- throws SQLException;
- public Date getCurrentDate() throws Exception;
- /** ************************手动sql操作******************************** */
- /**
- * 数据插入
- * @param sqlMapId
- * @param parameterObject
- * @return
- * @throws SQLException
- */
- public Object insert(String sqlMapId, Object parameterObject)
- throws SQLException;
- /** ************************ibator 单表sql操作******************************** */
- /**
- * 单表操作:插入记录集
- * @param nameSpace
- * @param record
- * @throws SQLException
- */
- void insertRecord(String nameSpace, Object record) throws SQLException;
- /**
- * 数据查询并返回全部列表
- * @param sqlMapId
- * @param parameterObject
- * @param resultObject
- * @return
- * @throws SQLException
- */
- @SuppressWarnings("rawtypes")
- public List queryForList(String sqlMapId, Object parameterObject)
- throws SQLException;
- /**
- * 数据查询并返回指定记录集大小的一个列表
- * @param sqlMapId
- * @param parameterObject
- * @param skipResults - 记录位移量
- * @param maxResults - 记录集大小
- * @return
- * @throws SQLException
- */
- @SuppressWarnings("rawtypes")
- public List queryForList(String sqlMapId, Object parameterObject,
- int skipResults, int maxResults) throws SQLException;
- /**
- * 数据查询并返回指定指keyProperty的一个Map对象
- * @param sqlMapId
- * @param parameterObject
- * @param keyProperty - Map key
- * @return
- * @throws SQLException
- */
- public Map<Object, Object> queryForMap(String sqlMapId, Object parameterObject,
- String keyProperty) throws SQLException;
- /**
- * 数据查询并返回指定keyProperty和valueProperty的一个Map对象
- * @param sqlMapId
- * @param parameterObject
- * @param keyProperty
- * @param valueProperty
- * @return
- * @throws SQLException
- */
- public Map<Object, Object> queryForMap(String sqlMapId, Object parameterObject,
- String keyProperty, String valueProperty) throws SQLException;
- /**
- * 数据查询并返回一个对象
- * @param sqlMapId
- * @param parameterObject
- * @return
- * @throws SQLException
- */
- public Object queryForObject(String sqlMapId, Object parameterObject)
- throws SQLException;
- /**
- * 数据查询并返回指定的对象
- * @param sqlMapId
- * @param parameterObject
- * @param resultObject
- * @return
- * @throws SQLException
- */
- public Object queryForObject(String sqlMapId, Object parameterObject,
- Object resultObject) throws SQLException;
- /**
- * 单表操作:根据条件动态查询记录集
- * @param nameSpace
- * @param example
- * @return
- * @throws SQLException
- */
- public List<Object> selectByExample(String nameSpace, Object example)
- throws SQLException;
- /**
- * 单表操作:根据主键查询记录集
- * @param nameSpace nameSpace
- * @param id id
- * @return Object
- * @throws SQLException
- */
- public Object selectByPrimaryKey(String nameSpace, Long id)
- throws SQLException;
- /**
- * 数据更新
- * @param sqlMapId sqlMapId
- * @param parameterObject parameterObject
- * @return int
- * @throws SQLException
- */
- public int update(String sqlMapId, Object parameterObject)
- throws SQLException;
- /**
- * 单表操作:根据主键更新记录集
- * @param nameSpace nameSpace
- * @param record record
- * @return int int
- * @throws SQLException
- */
- public int updateByPrimaryKey(String nameSpace, Object record)
- throws SQLException;
- /**
- * 单表操作:根据主键更新记录集
- * @param nameSpace nameSpace
- * @param record record
- * @return int int
- * @throws SQLException
- */
- public int updateByPrimaryKeySelective(String nameSpace, Object record)
- throws SQLException;
- }
|