package com.ai.da.service.impl;

import com.ai.da.mapper.primary.TDesignPythonOutfitMapper;
import com.ai.da.mapper.primary.entity.TDesignPythonOutfit;
import com.ai.da.model.vo.TDesignPythonOutfitVO;
import com.ai.da.service.ITDesignPythonOutfitService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;

/**
 * design item表 存对应design的8张图片 服务实现类
 *
 * @author SHAHAIBO
 * @since 2023-09-04
 */
@Service
public class TDesignPythonOutfitServiceImpl extends ServiceImpl<TDesignPythonOutfitMapper, TDesignPythonOutfit> implements ITDesignPythonOutfitService {

    @Override
    public IPage<TDesignPythonOutfitVO> selectTDesignPythonOutfitPage(IPage<TDesignPythonOutfitVO> page, TDesignPythonOutfitVO tDesignPythonOutfit) {
        return page.setRecords(baseMapper.selectTDesignPythonOutfitPage(page, tDesignPythonOutfit));
    }

    @Override
    public TDesignPythonOutfit getByDesignItemId(Long designItemId) {
        QueryWrapper<TDesignPythonOutfit> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("design_item_id", designItemId);

        return getOne(queryWrapper);
    }

}
