package com.zhgd.xmgl.modules.basicdata.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhgd.xmgl.modules.basicdata.dto.TeamInfoDto;
import com.zhgd.xmgl.modules.basicdata.entity.TeamInfo;
import com.zhgd.xmgl.modules.basicdata.mapper.TeamInfoMapper;
import com.zhgd.xmgl.modules.basicdata.service.ITeamInfoService;
import org.springframework.stereotype.Service;

import java.util.UUID;

/**
 * @Description: 班组
 * @author： pengj
 * @date：   2023-03-13
 * @version： V1.0
 */
@Service
public class TeamInfoServiceImpl extends ServiceImpl<TeamInfoMapper, TeamInfo> implements ITeamInfoService {

    @Override
    public Page<TeamInfoDto> getPageList(Page page, Wrapper<TeamInfo> wrapper) {
        return baseMapper.getPageList(page, wrapper);
    }

    @Override
    public boolean saveInfo(TeamInfo teamInfo) {
        String uuid = UUID.randomUUID().toString().replace("-", "").toUpperCase();
        teamInfo.setTeamSn(uuid);
        return this.save(teamInfo);
    }
}
