package com.ylx.massage.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ylx.massage.domain.TCollect;
import com.ylx.massage.mapper.TCollectMapper;
import com.ylx.massage.service.TCollectService;
import org.springframework.stereotype.Service;

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

/**
 * 收藏表 服务实现类
 */
@Service
public class TCollectServiceImpl extends ServiceImpl<TCollectMapper, TCollect> implements TCollectService {
    @Resource
    private TCollectMapper collectMapper;

    public List<TCollect> getAll(TCollect param) {
        return collectMapper.getAll(param);
    }

    @Override
    public TCollect selectCollect(TCollect collect) {
        LambdaQueryWrapper<TCollect> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(TCollect::getcWxOpenId,collect.getcWxOpenId()).eq(TCollect::getcJsId,collect.getcJsId());
        return this.getOne(wrapper);
    }
}
