package org.jeecg.modules.adweb.site.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;

import jakarta.annotation.Resource;

import org.jeecg.modules.adweb.site.entity.Sohoeb2bOrder;
import org.jeecg.modules.adweb.site.mapper.Sohoeb2bOrderMapper;
import org.springframework.stereotype.Service;

/**
 * @author Chen
 */
@Service
public class Sohoeb2bOrderService {

    @Resource private Sohoeb2bOrderMapper sohoeb2bOrderMapper;

    /**
     * @param sohoeb2bOrder
     */
    public void update(Sohoeb2bOrder sohoeb2bOrder) {
        sohoeb2bOrderMapper.updateById(sohoeb2bOrder);
    }

    /**
     * @param sohoeb2bOrder
     */
    public void insert(Sohoeb2bOrder sohoeb2bOrder) {
        sohoeb2bOrderMapper.insert(sohoeb2bOrder);
    }

    public Sohoeb2bOrder getBySiteCode(String siteCode) {
        LambdaQueryWrapper<Sohoeb2bOrder> query = new LambdaQueryWrapper<>();

        query.eq(Sohoeb2bOrder::getSiteCode, siteCode);

        return sohoeb2bOrderMapper.selectOne(query);
    }
}
