package cn.iocoder.yudao.module.member.api.diningplates;

import cn.hutool.core.bean.BeanUtil;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.member.api.diningplates.dto.DiningPlatesRespDTO;
import cn.iocoder.yudao.module.member.dal.dataobject.diningplates.DiningPlatesDO;
import cn.iocoder.yudao.module.member.dal.mysql.diningplates.DiningPlatesMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @Author:qjq
 * @Date:2024/4/10 下午2:42
 */
@Service
public class DiningplatesApiImpl implements DiningplatesApi{
    @Resource
    private DiningPlatesMapper diningPlatesMapper;
    /**
     * @param diningPlatesNum
     * @return
     * @Description: 根据餐盘查询
     * @Author: qjq
     * @Date: 2024/4/10 下午2:41
     */
    @Override
    public DiningPlatesRespDTO getQueryByDiningPlatesNum(String diningPlatesNum) {
        DiningPlatesDO diningPlatesDO = diningPlatesMapper.selectOne(new LambdaQueryWrapperX<DiningPlatesDO>()
                .eq(DiningPlatesDO::getDiningPlatesNum, diningPlatesNum)
        );
        return BeanUtil.toBean(diningPlatesDO, DiningPlatesRespDTO.class);
    }
}
