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();
    }

}
posted @ 2018-03-19 08:00  穆雄雄  阅读(139)  评论(0编辑  收藏  举报