package com.hx.phip.service.impl; import javax.annotation.Resource; import com.hx.phiappt.dao.mapper.EmployeeMapper; import com.hx.phiappt.model.EmployeeRole; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.hx.exception.TipsException; import com.hx.phiappt.model.Employee; import com.hx.phip.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 selectList(SqlSentence sqlSentence) { return employeeMapper.selectList(sqlSentence); } /**查询列表*/ @Override public List> selectListMap(SqlSentence sqlSentence) { return employeeMapper.selectListMap(sqlSentence); } /**查询单个*/ @Override public Employee selectOne(SqlSentence sqlSentence) { return employeeMapper.selectOne(sqlSentence); } /**查询单个*/ @Override public Map 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; } /** 查询角色信息 by id */ @Override public EmployeeRole selectRoleInfoById(String id) { return employeeMapper.selectRoleInfoById(id); } /** 查询员工 By id and role */ @Override public Employee selectOneByIdAndRole(String id, String roleUniqueStr) { return employeeMapper.selectOneByIdAndRole(id, roleUniqueStr); } }