package com.hx.common.service.impl;
|
|
import com.hx.common.dao.CommonDao;
|
import com.hx.common.service.CommonService;
|
import com.hx.mybatisTool.SqlSentence;
|
import org.springframework.stereotype.Service;
|
import org.springframework.transaction.annotation.Transactional;
|
|
import javax.annotation.Resource;
|
import java.io.Serializable;
|
import java.util.List;
|
import java.util.Map;
|
|
/**当前是有事务处理*/
|
@Transactional
|
@Service
|
public class CommonServiceImpl implements CommonService {
|
|
@Resource
|
private CommonDao commonDao;
|
|
/**插入*/
|
@Override
|
public <T extends Serializable> int insert(Class<?> mapperClass,T entity) {
|
return commonDao.insert(mapperClass,entity);
|
}
|
|
@Override
|
public <T extends Serializable> int insertById(Class<?> mapperClass, T entity) {
|
return commonDao.insertById(mapperClass,entity);
|
}
|
|
/**获取条数*/
|
@Override
|
public <T extends Serializable> int selectCount(Class<?> mapperClass,SqlSentence sqlSentence) {
|
return commonDao.selectCount(mapperClass,sqlSentence);
|
}
|
|
/**获取条数*/
|
@Override
|
public <T extends Serializable> int selectCountSql(Class<?> mapperClass,SqlSentence sqlSentence) {
|
return commonDao.selectCountSql(mapperClass,sqlSentence);
|
}
|
|
/**获取列表*/
|
@Override
|
public <T extends Serializable> List<T> selectList(Class<?> mapperClass, SqlSentence sqlSentence) {
|
return commonDao.selectList(mapperClass,sqlSentence);
|
}
|
|
/**获取列表*/
|
@Override
|
public <T extends Serializable> List<Map<String, Object>> selectListMap(Class<?> mapperClass, SqlSentence sqlSentence) {
|
return commonDao.selectListMap(mapperClass,sqlSentence);
|
}
|
|
/**获取单条数据*/
|
@Override
|
public <T extends Serializable> T selectOne(Class<?> mapperClass, SqlSentence sqlSentence) {
|
return commonDao.selectOne(mapperClass,sqlSentence);
|
}
|
|
/**获取单条数据*/
|
@Override
|
public <T extends Serializable> Map<String, Object> selectOneMap(Class<?> mapperClass, SqlSentence sqlSentence) {
|
return commonDao.selectOneMap(mapperClass,sqlSentence);
|
}
|
|
/**获取单条数据-不含longText的数据*/
|
@Override
|
public <T extends Serializable> T selectOneByKey(Class<?> mapperClass,Object object) {
|
return commonDao.selectOneByKey(mapperClass,object);
|
}
|
|
/**获取单条数据-含longText的数据*/
|
@Override
|
public <T extends Serializable> T selectOneByKeyBlob(Class<?> mapperClass,Object object) {
|
return commonDao.selectOneByKeyBlob(mapperClass,object);
|
}
|
|
/**更新*/
|
@Override
|
public <T extends Serializable> int updateWhere(Class<?> mapperClass,SqlSentence sqlSentence) {
|
return commonDao.updateWhere(mapperClass,sqlSentence);
|
}
|
|
/**全部字段更新*/
|
@Override
|
public <T extends Serializable> int updateAll(Class<?> mapperClass,T entity) {
|
return commonDao.updateAll(mapperClass,entity);
|
}
|
|
/**删除*/
|
@Override
|
public <T extends Serializable> int deleteWhere(Class<?> mapperClass,SqlSentence sqlSentence) {
|
return commonDao.deleteWhere(mapperClass,sqlSentence);
|
}
|
|
/**删除*/
|
@Override
|
public <T extends Serializable> int deleteById(Class<?> mapperClass,Object object) {
|
return commonDao.deleteById(mapperClass,object);
|
}
|
|
|
/**更新sql语句(全语句)*/
|
@Override
|
public <T extends Serializable> int updateSentence(SqlSentence sqlSentence) {
|
return commonDao.updateSentence(sqlSentence);
|
}
|
|
/**更新sql语句(全语句)*/
|
@Override
|
public <T extends Serializable> int selectCountSql(SqlSentence sqlSentence) {
|
return commonDao.selectCountSql(sqlSentence);
|
}
|
|
|
}
|