package com.sy.coinage.workshop.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.sy.coinage.core.constants.Constants;
import com.sy.coinage.core.vo.OptVO;
import org.springframework.stereotype.Service;

import com.sy.coinage.workshop.dao.ProductDao;
import com.sy.coinage.workshop.model.*;
import com.sy.coinage.workshop.service.IProductService;

import java.util.List;

/**
 * -产品表ServiceImpl
 */
@Service
public class ProductServiceImpl extends ServiceImpl<ProductDao, Product> implements IProductService {
    @Override
    public List<OptVO> opt() {
        LambdaQueryWrapper<Product> queryWrapper = new LambdaQueryWrapper<>();

        queryWrapper.eq(Product::getStatus, Constants.STATUS_USABLE);

        List<OptVO> resp = this.baseMapper.queryOptList(queryWrapper);
        return resp;
    }

    // @Override
    // public IPage<ProductVO> queryPageList(ProductListReq req) {
    // QueryWrapper<ProductVO> queryWrapper = new QueryWrapper<>();
    // if (null != req.getUserId() && req.getUserId() > 0) {
    // queryWrapper.eq("user_id", userId);
    // }
    // if (StringUtils.isNotBlank(req.getRealName())) {
    // queryWrapper.like("sys_user.real_name", req.getRealName());
    // }
    // Page<ProductVO> page = new Page<>(req.getPage(), req.getRows());
    // IPage<ProductVO> resp = this.baseMapper.queryPageList(page, queryWrapper);
    // return resp;
    // }

}
