package com.miaxis.app.school.service.impl;

import java.util.List;
import java.util.Map;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.miaxis.app.school.dto.SchoolInfoDTO;
import com.miaxis.app.school.dto.SchoolInfoEvalDTO;
import com.miaxis.app.school.dto.SchoolInfoEvalVO;
import com.miaxis.app.school.dto.SchoolInfoVO;
import com.miaxis.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.miaxis.app.school.mapper.SchoolInfoMapper;
import com.miaxis.app.school.domain.SchoolInfo;
import com.miaxis.app.school.service.ISchoolInfoService;

/**
 * 驾校Service业务层处理
 *
 * @author miaxis
 * @date 2020-12-24
 */
@Service
public class SchoolInfoServiceImpl extends ServiceImpl<SchoolInfoMapper, SchoolInfo> implements ISchoolInfoService {
    @Autowired
    private SchoolInfoMapper schoolInfoMapper;

    /**
     * 查询驾校
     *
     * @param inscode 驾校ID
     * @return 驾校
     */
    @Override
    public SchoolInfo selectSchoolInfoById(String inscode){
        return schoolInfoMapper.selectSchoolInfoById(inscode);
    }

    /**
     * 查询驾校列表
     *
     * @param schoolInfo 驾校
     * @return 驾校
     */
    @Override
    public List<SchoolInfo> selectSchoolInfoList(SchoolInfo schoolInfo){
        return schoolInfoMapper.selectSchoolInfoList(schoolInfo);
    }


    /**
     * 查询驾校列表
     *
     * @param schoolInfoDTO 驾校
     * @return 驾校
     */
    @Override
    public List<SchoolInfoVO> selectSchoolInfoUrlList(SchoolInfoDTO schoolInfoDTO){
        return schoolInfoMapper.selectSchoolInfoUrlList(schoolInfoDTO);
    }

    /**
     * 查询驾校列表
     *
     * @param schoolInfoEvalDTO 驾校
     * @return 驾校
     */
    @Override
    public List<SchoolInfoEvalVO> selectSchoolInfoEvalList(SchoolInfoEvalDTO schoolInfoEvalDTO) {
        return schoolInfoMapper.selectSchoolInfoEvalList(schoolInfoEvalDTO);
    }


    /**
     * 新增驾校
     *
     * @param schoolInfo 驾校
     * @return 结果
     */
    @Override
    public int insertSchoolInfo(SchoolInfo schoolInfo){
        schoolInfo.setCreateTime(DateUtils.getNowDate());
        return schoolInfoMapper.insertSchoolInfo(schoolInfo);
    }

    /**
     * 修改驾校
     *
     * @param schoolInfo 驾校
     * @return 结果
     */
    @Override
    public int updateSchoolInfo(SchoolInfo schoolInfo){
        schoolInfo.setUpdateTime(DateUtils.getNowDate());
        return schoolInfoMapper.updateSchoolInfo(schoolInfo);
    }

    /**
     * 批量删除驾校
     *
     * @param inscodes 需要删除的驾校ID
     * @return 结果
     */
    @Override
    public int deleteSchoolInfoByIds(String[] inscodes){
        return schoolInfoMapper.deleteSchoolInfoByIds(inscodes);
    }

    /**
     * 删除驾校信息
     *
     * @param inscode 驾校ID
     * @return 结果
     */
    @Override
    public int deleteSchoolInfoById(String inscode){
        return schoolInfoMapper.deleteSchoolInfoById(inscode);
    }
}
