xiaoyi
9 天以前 05ab6e3f69a5e73624b2573db043f5923e8f7d8b
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/dal/mysql/dv/machinery/MesDvMachineryMapper.java
@@ -8,10 +8,12 @@
import cn.iocoder.yudao.module.mes.dal.dataobject.dv.machinery.MesDvMachineryDO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
 * MES 设备台账 Mapper
 *
 * @author 芋道源码
 * @author 超级管理员
 */
@Mapper
public interface MesDvMachineryMapper extends BaseMapperX<MesDvMachineryDO> {
@@ -24,6 +26,9 @@
                .eqIfPresent(MesDvMachineryDO::getMachineryTypeId, reqVO.getMachineryTypeId())
                .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));
    }
@@ -32,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);
    }