package com.yeejoin.amos.boot.module.jg.biz.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgMainPartsService;
import com.yeejoin.amos.boot.module.ymt.api.dto.IdxBizJgMainPartsDto;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgMainParts;
import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgMainPartsMapper;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;

import java.util.List;

/**
 * 安全追溯-主要零部件服务实现类
 *
 * @author system_generator
 * @date 2023-08-17
 */
@Service
public class IdxBizJgMainPartsServiceImpl extends BaseService<IdxBizJgMainPartsDto,IdxBizJgMainParts,IdxBizJgMainPartsMapper> implements IIdxBizJgMainPartsService {

    public boolean saveOrUpdateBatchData(List<IdxBizJgMainParts> mainPartsList){
        return this.saveOrUpdateBatch(mainPartsList);
    }

    public List<IdxBizJgMainParts> queryListByRecord(String record) {
        QueryWrapper<IdxBizJgMainParts> queryWrapper = new QueryWrapper<>();
        queryWrapper.lambda().eq(IdxBizJgMainParts::getRecord,record).orderByDesc(IdxBizJgMainParts::getRecDate);
        return list(queryWrapper);
    }

}