package cn.iocoder.yudao.module.asset.dal.mysql.inspection;

import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.asset.dal.dataobject.inspection.InspectionRecordItemDO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * 验车记录检查项 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface InspectionRecordItemMapper extends BaseMapperX<InspectionRecordItemDO> {

    default List<InspectionRecordItemDO> selectByRecordId(Long recordId) {
        return selectList(new LambdaQueryWrapperX<InspectionRecordItemDO>()
                .eq(InspectionRecordItemDO::getRecordId, recordId)
                .orderByAsc(InspectionRecordItemDO::getId));
    }

    default int deleteByRecordId(Long recordId) {
        return delete(new LambdaQueryWrapperX<InspectionRecordItemDO>()
                .eq(InspectionRecordItemDO::getRecordId, recordId));
    }

}
