package com.srs.staff.service.impl;

import java.util.List;

import com.srs.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import com.srs.staff.mapper.SrsStaffOneStopCommunityConstructionMapper;
import com.srs.staff.domain.SrsStaffOneStopCommunityConstruction;
import com.srs.staff.service.ISrsStaffOneStopCommunityConstructionService;

/**
 * 一站式社区模块：社区建设Service业务层处理
 *
 * @author chc
 * @date 2024-07-17
 */
@Service
public class SrsStaffOneStopCommunityConstructionServiceImpl extends ServiceImpl<SrsStaffOneStopCommunityConstructionMapper, SrsStaffOneStopCommunityConstruction> implements ISrsStaffOneStopCommunityConstructionService {
    @Autowired
    private SrsStaffOneStopCommunityConstructionMapper srsStaffOneStopCommunityConstructionMapper;

    /**
     * 查询一站式社区模块：社区建设
     *
     * @param constructId 一站式社区模块：社区建设主键
     * @return 一站式社区模块：社区建设
     */
    @Override
    public SrsStaffOneStopCommunityConstruction selectSrsStaffOneStopCommunityConstructionByConstructId(Long constructId) {
        return srsStaffOneStopCommunityConstructionMapper.selectSrsStaffOneStopCommunityConstructionByConstructId(constructId);
    }

    /**
     * 查询一站式社区模块：社区建设列表
     *
     * @param srsStaffOneStopCommunityConstruction 一站式社区模块：社区建设
     * @return 一站式社区模块：社区建设
     */
    @Override
    public List<SrsStaffOneStopCommunityConstruction> selectSrsStaffOneStopCommunityConstructionList(SrsStaffOneStopCommunityConstruction srsStaffOneStopCommunityConstruction) {
        return srsStaffOneStopCommunityConstructionMapper.selectSrsStaffOneStopCommunityConstructionList(srsStaffOneStopCommunityConstruction);
    }

    /**
     * 新增一站式社区模块：社区建设
     *
     * @param srsStaffOneStopCommunityConstruction 一站式社区模块：社区建设
     * @return 结果
     */
    @Override
    public int insertSrsStaffOneStopCommunityConstruction(SrsStaffOneStopCommunityConstruction srsStaffOneStopCommunityConstruction) {
        if (srsStaffOneStopCommunityConstruction.getEventPromoter() == null) {
            srsStaffOneStopCommunityConstruction.setEventPromoter(SecurityUtils.getLoginUser().getUser().getNickName());
        }
        srsStaffOneStopCommunityConstruction.setUserName(SecurityUtils.getUsername());
        return srsStaffOneStopCommunityConstructionMapper.insertSrsStaffOneStopCommunityConstruction(srsStaffOneStopCommunityConstruction);
    }

    /**
     * 修改一站式社区模块：社区建设
     *
     * @param srsStaffOneStopCommunityConstruction 一站式社区模块：社区建设
     * @return 结果
     */
    @Override
    public int updateSrsStaffOneStopCommunityConstruction(SrsStaffOneStopCommunityConstruction srsStaffOneStopCommunityConstruction) {
        return srsStaffOneStopCommunityConstructionMapper.updateSrsStaffOneStopCommunityConstruction(srsStaffOneStopCommunityConstruction);
    }

    /**
     * 批量删除一站式社区模块：社区建设
     *
     * @param constructIds 需要删除的一站式社区模块：社区建设主键
     * @return 结果
     */
    @Override
    public int deleteSrsStaffOneStopCommunityConstructionByConstructIds(Long[] constructIds) {
        return srsStaffOneStopCommunityConstructionMapper.deleteSrsStaffOneStopCommunityConstructionByConstructIds(constructIds);
    }

    /**
     * 删除一站式社区模块：社区建设信息
     *
     * @param constructId 一站式社区模块：社区建设主键
     * @return 结果
     */
    @Override
    public int deleteSrsStaffOneStopCommunityConstructionByConstructId(Long constructId) {
        return srsStaffOneStopCommunityConstructionMapper.deleteSrsStaffOneStopCommunityConstructionByConstructId(constructId);
    }
}
