package com.ruoyi.sim.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.sim.mapper.SeatMapper;
import com.ruoyi.sim.domain.Seat;

/**
 * 座Service业务层处理
 *
 * @author tom
 * @date 2024-12-13
 */
@Service
public class SeatService {
    @Autowired
    private SeatMapper seatMapper;

    /**
     * 查询座
     *
     * @param seatId 座主键
     * @return 座
     */
    public Seat selectSeatBySeatId(Long seatId) {
        return seatMapper.selectSeatBySeatId(seatId);
    }

    /**
     * 查询座列表
     *
     * @param seat 座
     * @return 座
     */
    public List<Seat> selectSeatList(Seat seat) {
        return seatMapper.selectSeatList(seat);
    }

    /**
     * 新增座
     *
     * @param seat 座
     * @return 结果
     */
    public int insertSeat(Seat seat) {
        seat.setCreateTime(DateUtils.getNowDate());
        return seatMapper.insertSeat(seat);
    }

    /**
     * 修改座
     *
     * @param seat 座
     * @return 结果
     */
    public int updateSeat(Seat seat) {
        seat.setUpdateTime(DateUtils.getNowDate());
        return seatMapper.updateSeat(seat);
    }

    /**
     * 批量删除座
     *
     * @param seatIds 需要删除的座主键
     * @return 结果
     */
    public int deleteSeatBySeatIds(Long[] seatIds) {
        return seatMapper.deleteSeatBySeatIds(seatIds);
    }

    /**
     * 删除座信息
     *
     * @param seatId 座主键
     * @return 结果
     */
    public int deleteSeatBySeatId(Long seatId) {
        return seatMapper.deleteSeatBySeatId(seatId);
    }
}
