package com.ruoyi.dz.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.dz.mapper.DzSchoolMapper;
import com.ruoyi.dz.domain.DzSchool;
import com.ruoyi.dz.service.IDzSchoolService;

/**
 * 机构校区Service业务层处理
 *
 * @author ruoyi
 * @date 2025-09-12
 */
@Service
public class DzSchoolServiceImpl implements IDzSchoolService
{
    @Autowired
    private DzSchoolMapper dzSchoolMapper;

    /**
     * 查询机构校区
     *
     * @param id 机构校区主键
     * @return 机构校区
     */
    @Override
    public DzSchool selectDzSchoolById(Long id)
    {
        return dzSchoolMapper.selectDzSchoolById(id);
    }

    /**
     * 查询机构校区列表
     *
     * @param dzSchool 机构校区
     * @return 机构校区
     */
    @Override
    public List<DzSchool> selectDzSchoolList(DzSchool dzSchool)
    {
        return dzSchoolMapper.selectDzSchoolList(dzSchool);
    }

    @Override
    public List<DzSchool> selectDzSchoolListByIds(List<Long> schoolIds)
    {
        return dzSchoolMapper.selectDzSchoolListByIds(schoolIds);
    }

    /**
     * 新增机构校区
     *
     * @param dzSchool 机构校区
     * @return 结果
     */
    @Override
    public int insertDzSchool(DzSchool dzSchool)
    {
        dzSchool.setCreateTime(DateUtils.getNowDate());
        dzSchoolMapper.insertDzSchool(dzSchool);
        return dzSchool.getId().intValue();
    }

    /**
     * 修改机构校区
     *
     * @param dzSchool 机构校区
     * @return 结果
     */
    @Override
    public int updateDzSchool(DzSchool dzSchool)
    {
        dzSchool.setUpdateTime(DateUtils.getNowDate());
        return dzSchoolMapper.updateDzSchool(dzSchool);
    }

    /**
     * 批量删除机构校区
     *
     * @param ids 需要删除的机构校区主键
     * @return 结果
     */
    @Override
    public int deleteDzSchoolByIds(Long[] ids)
    {
        return dzSchoolMapper.deleteDzSchoolByIds(ids);
    }

    /**
     * 删除机构校区信息
     *
     * @param id 机构校区主键
     * @return 结果
     */
    @Override
    public int deleteDzSchoolById(Long id)
    {
        return dzSchoolMapper.deleteDzSchoolById(id);
    }
}
