云
2026-10-20 4eb9a3a99e21522ede60dcb8bee5b5856b515dc7
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/dal/mysql/dv/machinery/MesDvMachineryMapper.java
@@ -8,6 +8,8 @@
import cn.iocoder.yudao.module.mes.dal.dataobject.dv.machinery.MesDvMachineryDO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
 * MES 设备台账 Mapper
 *
@@ -25,6 +27,8 @@
                .inIfPresent(MesDvMachineryDO::getMachineryTypeId, reqVO.getMachineryTypeIds())
                .eqIfPresent(MesDvMachineryDO::getWorkshopId, reqVO.getWorkshopId())
                .eqIfPresent(MesDvMachineryDO::getWorkstationId, reqVO.getWorkstationId())
                .eqIfPresent(MesDvMachineryDO::getCollectDeviceCode, reqVO.getCollectDeviceCode())
                .eqIfPresent(MesDvMachineryDO::getCollectEnabled, reqVO.getCollectEnabled())
                .eqIfPresent(MesDvMachineryDO::getStatus, reqVO.getStatus())
                .orderByDesc(MesDvMachineryDO::getId));
    }
@@ -33,6 +37,16 @@
        return selectOne(MesDvMachineryDO::getCode, code);
    }
    default MesDvMachineryDO selectByCollectDeviceCode(String collectDeviceCode) {
        return selectOne(MesDvMachineryDO::getCollectDeviceCode, collectDeviceCode);
    }
    default List<MesDvMachineryDO> selectListWithCollectDeviceCode() {
        return selectList(new LambdaQueryWrapperX<MesDvMachineryDO>()
                .isNotNull(MesDvMachineryDO::getCollectDeviceCode)
                .orderByAsc(MesDvMachineryDO::getId));
    }
    default Long selectCountByMachineryTypeId(Long machineryTypeId) {
        return selectCount(MesDvMachineryDO::getMachineryTypeId, machineryTypeId);
    }