package com.ruoyi.mall.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.mall.domain.Vo.SchoolPositionVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mall.mapper.MallSchoolPositionMapper;
import com.ruoyi.mall.domain.MallSchoolPosition;
import com.ruoyi.mall.service.IMallSchoolPositionService;

import javax.annotation.Resource;

/**
 * 学校定位Service业务层处理
 *
 * @author ruoyi
 * @date 2023-10-28
 */
@Service
public class MallSchoolPositionServiceImpl implements IMallSchoolPositionService
{
    @Resource
    private MallSchoolPositionMapper mallSchoolPositionMapper;

    /**
     * 查询学校定位
     *
     * @param positionId 学校定位主键
     * @return 学校定位
     */
    @Override
    public MallSchoolPosition selectMallSchoolPositionByPositionId(Long positionId)
    {
        return mallSchoolPositionMapper.selectMallSchoolPositionByPositionId(positionId);
    }

    /**
     * 查询学校定位列表
     *
     * @param mallSchoolPosition 学校定位
     * @return 学校定位
     */
    @Override
    public List<MallSchoolPosition> selectMallSchoolPositionList(MallSchoolPosition mallSchoolPosition)
    {
        return mallSchoolPositionMapper.selectMallSchoolPositionList(mallSchoolPosition);
    }

    /**
     * 新增学校定位
     *
     * @param mallSchoolPosition 学校定位
     * @return 结果
     */
    @Override
    public int insertMallSchoolPosition(MallSchoolPosition mallSchoolPosition)
    {
        mallSchoolPosition.setCreateAt(DateUtils.getTime());
        mallSchoolPosition.setDelFlag("0");
        return mallSchoolPositionMapper.insertMallSchoolPosition(mallSchoolPosition);
    }

    /**
     * 修改学校定位
     *
     * @param mallSchoolPosition 学校定位
     * @return 结果
     */
    @Override
    public int updateMallSchoolPosition(MallSchoolPosition mallSchoolPosition)
    {
        return mallSchoolPositionMapper.updateMallSchoolPosition(mallSchoolPosition);
    }

    /**
     * 批量删除学校定位
     *
     * @param positionIds 需要删除的学校定位主键
     * @return 结果
     */
    @Override
    public int deleteMallSchoolPositionByPositionIds(Long[] positionIds)
    {
        return mallSchoolPositionMapper.deleteMallSchoolPositionByPositionIds(positionIds);
    }

    /**
     * 删除学校定位信息
     *
     * @param positionId 学校定位主键
     * @return 结果
     */
    @Override
    public int deleteMallSchoolPositionByPositionId(Long positionId)
    {
        return mallSchoolPositionMapper.deleteMallSchoolPositionByPositionId(positionId);
    }

    /**
     * 学校定位列表
     * @return 结果
     */
    @Override
    public List<SchoolPositionVO> selectPositionList() {
        return mallSchoolPositionMapper.selectPositionList();
    }
}
