package com.xhkjedu.sapi.service.system;

import com.xhkjedu.sapi.mapper.system.PictureMapper;
import com.xhkjedu.sapi.model.system.TPicture;
import com.xhkjedu.utils.N_Utils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @author ywx
 * @classname PictureService
 * @description
 * @date 2022/04/27 10:09
 **/
@Service
public class PictureService {
    @Resource
    private PictureMapper pictureMapper;

    /**
      * 管理列表
      * @param [picture]
      * @author ywx
      * @date 2022/4/27 10:21
      * @return java.util.List<java.util.Map>
      */
    public List<Map> listAll(TPicture picture) {
        return pictureMapper.listAll(picture);
    }

    /**
      * 选择列表
      * @param [pictype]
      * @author ywx
      * @date 2022/4/27 10:25
      * @return java.util.List<java.util.Map>
      */
    public List<Map> listForSel(Integer pictype) {
        return pictureMapper.listForSel(pictype);
    }

    /**
      * 添加
      * @param [picture]
      * @author ywx
      * @date 2022/4/27 10:27
      * @return void
      */
    public void add(TPicture picture) {
        picture.setCreatetime(N_Utils.getSecondTimestamp());
        pictureMapper.insertSelective(picture);
    }

    /**
      * 删除
      * @param [picid]
      * @author ywx
      * @date 2022/4/27 10:29
      * @return void
      */
    public void del(Integer picid) {
        pictureMapper.deleteByPrimaryKey(picid);
    }
}
