MISBoot快速开发平台

Service业务层实现

一、 概述

1.作用

统一业务逻辑实现,方便接口调用

2.位置

cn.ewsd.xxxx.service.impl

3.命名方式

命名方式:XxxxServiceImpl.java

4.继承

cn.ewsd.frame.service.impl.BaseServiceImpl

5.公用方法

实现cn.ewsd.frame.service.XxxxBaseServiceImpl中的方法

二、示例代码

1.自定义方法示例
保存save
@Override
    public int save(SysUser sysUser){
        return sysUserMapper.save(sysUser);
    }
更新update
@Override
    public int update(SysUser sysUser){
        return sysUserMapper.update(sysUser);
    }
删除delete
@Override
    public int deleteBatch(String[] uuids){
        return sysUserMapper.deleteBatch(uuids);
    }
2.用户serviceImpl示例
用户serviceImpl
@Service("sysUserServiceImpl")
    public class SysUserServiceImpl extends SystemBaseServiceImplimplements SysUserService {
        @Autowired
        private SysUserMapper sysUserMapper;

        @Override
        public PageSetgetPageSet(PageParam pageParam, String filterSort) {
            PageHelper.startPage(pageParam.getPage(), pageParam.getRows());
            Listlist = sysUserMapper.getPageSet(filterSort);
            PageInfopageInfo = new PageInfo<>(list);
            return PageUtils.getPageSet(pageInfo);
        }

        @Override
        public SysUser queryObject(String uuid){
            return sysUserMapper.queryObject(uuid);
        }

        @Override
        public ListqueryList(Mapmap){
            return sysUserMapper.queryList(map);
        }

        @Override
        public int queryTotal(Mapmap){
            return sysUserMapper.queryTotal(map);
        }

        @Override
        public int executeSave(SysUser sysUser){
            return sysUserMapper.executeSave(sysUser);
        }

        @Override
        public int executeUpdate(SysUser sysUser){
            return sysUserMapper.executeUpdate(sysUser);
        }

        @Override
        public int executeDelete(String uuid){
            return sysUserMapper.executeDelete(uuid);
        }

        @Override
        public int executeDeleteBatch(String[] uuids){
            return sysUserMapper.executeDeleteBatch(uuids);
        }
    }
QQ在线咨询
客服 QQ
251122361
微信/手机
18973127736
办公电话
0731-89565588