package com.dcsoft.system.face.service.impl;

import java.util.List;
import com.dcsoft.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.dcsoft.system.face.mapper.FaceImageMapper;
import com.dcsoft.system.face.domain.FaceImage;
import com.dcsoft.system.face.service.IFaceImageService;

/**
 * 图片信息Service业务层处理
 *
 * @author nichun
 * @date 2023-03-30
 */
@Service
public class FaceImageServiceImpl implements IFaceImageService
{
    @Autowired
    private FaceImageMapper faceImageMapper;

    /**
     * 查询图片信息
     *
     * @param id 图片信息主键
     * @return 图片信息
     */
    @Override
    public FaceImage selectFaceImageById(Long id)
    {
        return faceImageMapper.selectFaceImageById(id);
    }

    /**
     * 查询图片信息列表
     *
     * @param faceImage 图片信息
     * @return 图片信息
     */
    @Override
    public List<FaceImage> selectFaceImageList(FaceImage faceImage)
    {
        return faceImageMapper.selectFaceImageList(faceImage);
    }

    /**
     * 新增图片信息
     *
     * @param faceImage 图片信息
     * @return 结果
     */
    @Override
    public int insertFaceImage(FaceImage faceImage)
    {
        faceImage.setCreateTime(DateUtils.getNowDate());
        return faceImageMapper.insertFaceImage(faceImage);
    }

    /**
     * 修改图片信息
     *
     * @param faceImage 图片信息
     * @return 结果
     */
    @Override
    public int updateFaceImage(FaceImage faceImage)
    {
        faceImage.setUpdateTime(DateUtils.getNowDate());
        return faceImageMapper.updateFaceImage(faceImage);
    }

    /**
     * 批量删除图片信息
     *
     * @param ids 需要删除的图片信息主键
     * @return 结果
     */
    @Override
    public int deleteFaceImageByIds(Long[] ids)
    {
        return faceImageMapper.deleteFaceImageByIds(ids);
    }

    /**
     * 删除图片信息信息
     *
     * @param id 图片信息主键
     * @return 结果
     */
    @Override
    public int deleteFaceImageById(Long id)
    {
        return faceImageMapper.deleteFaceImageById(id);
    }

    @Override
    public FaceImage selectFaceImageByStuId(String stuId)
    {
        return faceImageMapper.selectFaceImageByStuId(stuId);
    }

}
