package com.bonus.material.lease.service.impl;

import java.util.List;
import com.bonus.common.core.exception.ServiceException;
import com.bonus.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.bonus.material.lease.mapper.LeaseTeamInfoMapper;
import com.bonus.material.lease.domain.LeaseTeamInfo;
import com.bonus.material.lease.service.ILeaseTeamInfoService;

/**
 * 项目部班组管理Service业务层处理
 * 
 * @author xsheng
 * @date 2024-10-16
 */
@Service
public class LeaseTeamInfoServiceImpl implements ILeaseTeamInfoService {
    @Autowired
    private LeaseTeamInfoMapper leaseTeamInfoMapper;

    /**
     * 查询项目部班组管理
     * 
     * @param id 项目部班组管理主键
     * @return 项目部班组管理
     */
    @Override
    public LeaseTeamInfo selectLeaseTeamInfoById(Long id) {
        return leaseTeamInfoMapper.selectLeaseTeamInfoById(id);
    }

    /**
     * 查询项目部班组管理列表
     * 
     * @param leaseTeamInfo 项目部班组管理
     * @return 项目部班组管理
     */
    @Override
    public List<LeaseTeamInfo> selectLeaseTeamInfoList(LeaseTeamInfo leaseTeamInfo) {
        return leaseTeamInfoMapper.selectLeaseTeamInfoList(leaseTeamInfo);
    }

    /**
     * 新增项目部班组管理
     * 
     * @param leaseTeamInfo 项目部班组管理
     * @return 结果
     */
    @Override
    public int insertLeaseTeamInfo(LeaseTeamInfo leaseTeamInfo) {
        leaseTeamInfo.setCreateTime(DateUtils.getNowDate());
        try {
            return leaseTeamInfoMapper.insertLeaseTeamInfo(leaseTeamInfo);
        } catch (Exception e) {
            throw new ServiceException("错误信息描述");
        }
    }

    /**
     * 修改项目部班组管理
     * 
     * @param leaseTeamInfo 项目部班组管理
     * @return 结果
     */
    @Override
    public int updateLeaseTeamInfo(LeaseTeamInfo leaseTeamInfo) {
        leaseTeamInfo.setUpdateTime(DateUtils.getNowDate());
        try {
            return leaseTeamInfoMapper.updateLeaseTeamInfo(leaseTeamInfo);
        } catch (Exception e) {
            throw new ServiceException("错误信息描述");
        }
    }

    /**
     * 批量删除项目部班组管理
     * 
     * @param ids 需要删除的项目部班组管理主键
     * @return 结果
     */
    @Override
    public int deleteLeaseTeamInfoByIds(Long[] ids) {
        return leaseTeamInfoMapper.deleteLeaseTeamInfoByIds(ids);
    }

    /**
     * 删除项目部班组管理信息
     * 
     * @param id 项目部班组管理主键
     * @return 结果
     */
    @Override
    public int deleteLeaseTeamInfoById(Long id) {
        return leaseTeamInfoMapper.deleteLeaseTeamInfoById(id);
    }
}
