package com.ics.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ics.admin.domain.ApplyRoom;
import com.ics.admin.mapper.ApplyRoomMapper;
import com.ics.service.IApplyRoomService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;



/**
 * 申请房间关联Service业务层处理
 *
 * @author zzm
 * @date 2021-03-31
 */
@Service("applyRoomAppService")
public class ApplyRoomServiceImpl extends ServiceImpl<ApplyRoomMapper, ApplyRoom> implements IApplyRoomService {

    @Autowired
    private ApplyRoomMapper applyRoomMapper;


    /**
     * 根据房间id查询
     *
     * @return
     */
    public ApplyRoom selectApplyRoomId(Long roomId,Long userId) {
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq("room_id", roomId);
        queryWrapper.eq("user_id", userId);
        return applyRoomMapper.selectOne(queryWrapper);
    }
}
