package cn.iocoder.yudao.module.system.dal.mysql.elderly;

import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.system.dal.dataobject.elderly.ElderlyNasalFeedingItemDO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * 鼻饲记录明细 Mapper
 */
@Mapper
public interface ElderlyNasalFeedingItemMapper extends BaseMapperX<ElderlyNasalFeedingItemDO> {

    default List<ElderlyNasalFeedingItemDO> selectListByNasalId(Long nasalId) {
        return selectList(new LambdaQueryWrapperX<ElderlyNasalFeedingItemDO>()
                .eq(ElderlyNasalFeedingItemDO::getNasalId, nasalId)
                .orderByAsc(ElderlyNasalFeedingItemDO::getId));
    }

    default void deleteByNasalId(Long nasalId) {
        delete(new LambdaQueryWrapperX<ElderlyNasalFeedingItemDO>()
                .eq(ElderlyNasalFeedingItemDO::getNasalId, nasalId));
    }
}

