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.IIdxBizJgProtectionDevicesService;
import com.yeejoin.amos.boot.module.ymt.api.dto.IdxBizJgProtectionDevicesDto;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgProtectionDevices;
import com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgProtectionDevicesMapper;
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 IdxBizJgProtectionDevicesServiceImpl extends BaseService<IdxBizJgProtectionDevicesDto,IdxBizJgProtectionDevices,IdxBizJgProtectionDevicesMapper> implements IIdxBizJgProtectionDevicesService {

    public boolean saveOrUpdateBatchData(List<IdxBizJgProtectionDevices> protectionDevicesList){
        return this.saveOrUpdateBatch(protectionDevicesList);
    }

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

}