ssm使用全注解来实现增删改查案例之DeptServiceImpl
程序员文章站
2024-01-28 20:50:34
ssm使用全注解来实现增删改查案例之DeptServiceImpl
/**
* @Title: DeptServiceImpl.java
* @Package or...
ssm使用全注解来实现增删改查案例之DeptServiceImpl
/** * @Title: DeptServiceImpl.java * @Package org.service.impl * @Description: TODO该方法的主要作用: * @author A18ccms A18ccms_gmail_com * @date 2018-3-12 上午11:04:09 * @version V1.0 */ package org.service.impl; import java.util.List; import org.dao.IDeptMapper; import org.entity.Dept; import org.service.IDeptService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** * * 项目名称:test_springmvc_16qn2 * 类名称:DeptServiceImpl * 类描述: * 创建人:Mu Xiongxiong * 创建时间:2018-3-12 上午11:04:09 * 修改人:Mu Xiongxiong * 修改时间:2018-3-12 上午11:04:09 * 修改备注: * @version * */ //注入事务 @Component public class DeptServiceImpl implements IDeptService { //部门 @Autowired private IDeptMapper deptMapper; /**(非 Javadoc) * <p>Description(描述):删除 </p> * <p>Title: deleteByPrimaryKey</p> * @param id * @return * @see org.service.IDeptService#deleteByPrimaryKey(java.lang.Integer) */ @Override public int deleteByPrimaryKey(Integer id) { // TODO Auto-generated method stub return deptMapper.deleteByPrimaryKey(id); } /**(非 Javadoc) * <p>Description(描述):添加 </p> * <p>Title: insert</p> * @param record * @return * @see org.service.IDeptService#insert(org.entity.Dept) */ @Override public int insert(Dept record) { return deptMapper.insert(record); } /**(非 Javadoc) * <p>Description(描述):根据编号查询 </p> * <p>Title: selectByPrimaryKey</p> * @param id * @return * @see org.service.IDeptService#selectByPrimaryKey(java.lang.Integer) */ @Override public Dept selectByPrimaryKey(Integer id) { return deptMapper.selectByPrimaryKey(id); } /**(非 Javadoc) * <p>Description(描述):修改 </p> * <p>Title: updateByPrimaryKeySelective</p> * @param record * @return * @see org.service.IDeptService#updateByPrimaryKeySelective(org.entity.Dept) */ @Override public int updateByPrimaryKey(Dept record) { // TODO Auto-generated method stub return deptMapper.updateByPrimaryKey(record); } /**(非 Javadoc) * <p>Description(描述):查询全部 </p> * <p>Title: findDeptAll</p> * @return * @see org.service.IDeptService#findDeptAll() */ @Override public List<Dept> findDeptAll() { // TODO Auto-generated method stub return deptMapper.findDeptAll(); } }