package cn.iocoder.yudao.module.mes.dal.mysql.record;

import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.mes.dal.dataobject.record.RecordSuijiangDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 碎浆记录 Mapper
 *
 * @author 内蒙必硕
 */
@Mapper
public interface RecordSuijiangMapper extends BaseMapperX<RecordSuijiangDO> {

    default PageResult<RecordSuijiangDO> selectPage(PageParam reqVO, Long recordId) {
        return selectPage(reqVO, new LambdaQueryWrapperX<RecordSuijiangDO>()
                .eq(RecordSuijiangDO::getRecordId, recordId)
                .orderByDesc(RecordSuijiangDO::getId));
    }

    default int deleteByRecordId(Long recordId) {
        return delete(RecordSuijiangDO::getRecordId, recordId);
    }

}