package com.ruoyi.sales.service.impl;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.ruoyi.sales.mapper.SalesLedgerProductMapper;
|
import com.ruoyi.sales.pojo.SalesLedgerProduct;
|
import com.ruoyi.sales.service.ISalesLedgerProductService;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Service;
|
|
import java.util.Arrays;
|
import java.util.List;
|
|
/**
|
* 产品信息Service业务层处理
|
*
|
* @author ruoyi
|
* @date 2025-05-08
|
*/
|
@Service
|
public class SalesLedgerProductServiceImpl extends ServiceImpl<SalesLedgerProductMapper, SalesLedgerProduct> implements ISalesLedgerProductService {
|
@Autowired
|
private SalesLedgerProductMapper salesLedgerProductMapper;
|
|
@Override
|
public SalesLedgerProduct selectSalesLedgerProductById(Long id) {
|
return salesLedgerProductMapper.selectById(id);
|
}
|
|
@Override
|
public List<SalesLedgerProduct> selectSalesLedgerProductList(SalesLedgerProduct salesLedgerProduct) {
|
LambdaQueryWrapper<SalesLedgerProduct> queryWrapper = new LambdaQueryWrapper<>();
|
queryWrapper.eq(SalesLedgerProduct::getSalesLedgerId,salesLedgerProduct.getSalesLedgerId());
|
return salesLedgerProductMapper.selectList(queryWrapper);
|
}
|
|
@Override
|
public int deleteSalesLedgerProductByIds(Long[] ids) {
|
return salesLedgerProductMapper.deleteBatchIds(Arrays.asList(ids));
|
}
|
|
@Override
|
public int addOrUpdateSalesLedgerProduct(SalesLedgerProduct salesLedgerProduct) {
|
if (salesLedgerProduct.getId() == null){
|
return salesLedgerProductMapper.insert(salesLedgerProduct);
|
}else {
|
return salesLedgerProductMapper.updateById(salesLedgerProduct);
|
}
|
}
|
}
|