package com.hx.other.service.service.impl;
|
|
import javax.annotation.Resource;
|
|
import org.springframework.stereotype.Service;
|
import org.springframework.transaction.annotation.Transactional;
|
|
import com.hx.exception.TipsException;
|
import com.hx.other.service.dao.mapper.QueryRecordMapper;
|
import com.hx.other.service.model.QueryRecord;
|
import com.hx.other.service.service.QueryRecordService;
|
import com.hx.mybatisTool.SqlSentence;
|
import java.util.List;
|
import java.util.Map;
|
|
@Transactional
|
@Service
|
public class QueryRecordServiceImpl implements QueryRecordService {
|
|
@Resource
|
private QueryRecordMapper queryRecordMapper;
|
|
/**查询列表*/
|
@Override
|
public List<QueryRecord> selectList(SqlSentence sqlSentence) {
|
return queryRecordMapper.selectList(sqlSentence);
|
}
|
|
/**查询列表*/
|
@Override
|
public List<Map<String,Object>> selectListMap(SqlSentence sqlSentence) {
|
return queryRecordMapper.selectListMap(sqlSentence);
|
}
|
|
/**查询单个*/
|
@Override
|
public QueryRecord selectOne(SqlSentence sqlSentence) {
|
return queryRecordMapper.selectOne(sqlSentence);
|
}
|
|
/**查询单个*/
|
@Override
|
public Map<String,Object> selectOneMap(SqlSentence sqlSentence) {
|
return queryRecordMapper.selectOneMap(sqlSentence);
|
}
|
|
/**查询单个,大数据不拿取*/
|
@Override
|
public QueryRecord selectOneByKey(Object object) {
|
return queryRecordMapper.selectOneByKey(object);
|
}
|
|
/**查询单个,大数据拿取*/
|
@Override
|
public QueryRecord selectOneByKeyBlob(Object object) {
|
return queryRecordMapper.selectOneByKeyBlob(object);
|
}
|
|
/**新增*/
|
@Override
|
public void insert(QueryRecord queryRecord) {
|
int count = queryRecordMapper.insert(queryRecord);
|
if(count != 1) {
|
throw new TipsException("新增失败!");
|
}
|
}
|
|
/**修改*/
|
@Override
|
public void updateAll(QueryRecord queryRecord) {
|
int count = queryRecordMapper.updateAll(queryRecord);
|
if(count!=1) {
|
throw new TipsException("保存失败!");
|
}
|
}
|
|
/**修改*/
|
@Override
|
public void updateWhere(SqlSentence sqlSentence) {
|
int count = queryRecordMapper.updateWhere(sqlSentence);
|
if(count!=1) {
|
throw new TipsException("保存失败!");
|
}
|
}
|
|
/**删除一个*/
|
@Override
|
public void deleteOne(String delId) {
|
int count = queryRecordMapper.deleteById(delId);
|
if(count!=1) {
|
throw new TipsException("删除失败!");
|
}
|
}
|
|
/**查询条数*/
|
@Override
|
public int selectCount(SqlSentence sqlSentence) {
|
int count = queryRecordMapper.selectCount(sqlSentence);
|
return count;
|
}
|
}
|