package com.hx.phip.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.phip.dao.mapper.ProjectMapper;
|
import com.hx.phiappt.model.Project;
|
import com.hx.phip.service.ProjectService;
|
import com.hx.mybatisTool.SqlSentence;
|
import java.util.List;
|
import java.util.Map;
|
|
@Transactional
|
@Service
|
public class ProjectServiceImpl implements ProjectService {
|
|
@Resource
|
private ProjectMapper projectMapper;
|
|
/**查询列表*/
|
@Override
|
public List<Project> selectList(SqlSentence sqlSentence) {
|
return projectMapper.selectList(sqlSentence);
|
}
|
|
/**查询列表*/
|
@Override
|
public List<Map<String,Object>> selectListMap(SqlSentence sqlSentence) {
|
return projectMapper.selectListMap(sqlSentence);
|
}
|
|
/**查询单个*/
|
@Override
|
public Project selectOne(SqlSentence sqlSentence) {
|
return projectMapper.selectOne(sqlSentence);
|
}
|
|
/**查询单个*/
|
@Override
|
public Map<String,Object> selectOneMap(SqlSentence sqlSentence) {
|
return projectMapper.selectOneMap(sqlSentence);
|
}
|
|
/**查询单个,大数据不拿取*/
|
@Override
|
public Project selectOneByKey(Object object) {
|
return projectMapper.selectOneByKey(object);
|
}
|
|
/**查询单个,大数据拿取*/
|
@Override
|
public Project selectOneByKeyBlob(Object object) {
|
return projectMapper.selectOneByKeyBlob(object);
|
}
|
|
/**新增*/
|
@Override
|
public void insert(Project project) {
|
int count = projectMapper.insert(project);
|
if(count != 1) {
|
throw new TipsException("新增失败!");
|
}
|
}
|
|
/**修改*/
|
@Override
|
public void updateAll(Project project) {
|
int count = projectMapper.updateAll(project);
|
if(count!=1) {
|
throw new TipsException("保存失败!");
|
}
|
}
|
|
/**修改*/
|
@Override
|
public void updateWhere(SqlSentence sqlSentence) {
|
int count = projectMapper.updateWhere(sqlSentence);
|
if(count!=1) {
|
throw new TipsException("保存失败!");
|
}
|
}
|
|
/**删除一个*/
|
@Override
|
public void deleteOne(String delId) {
|
int count = projectMapper.deleteById(delId);
|
if(count!=1) {
|
throw new TipsException("删除失败!");
|
}
|
}
|
|
/**查询条数*/
|
@Override
|
public int selectCount(SqlSentence sqlSentence) {
|
int count = projectMapper.selectCount(sqlSentence);
|
return count;
|
}
|
}
|