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