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.NinePreventiveMeasuresItemDO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * 九防措施单明细 Mapper
 */
@Mapper
public interface NinePreventiveMeasuresItemMapper extends BaseMapperX<NinePreventiveMeasuresItemDO> {

    default List<NinePreventiveMeasuresItemDO> selectListByPreventiveId(Long preventiveId) {
        return selectList(new LambdaQueryWrapperX<NinePreventiveMeasuresItemDO>()
                .eq(NinePreventiveMeasuresItemDO::getPreventiveId, preventiveId)
                .orderByAsc(NinePreventiveMeasuresItemDO::getId));
    }

    default void deleteByPreventiveId(Long preventiveId) {
        delete(new LambdaQueryWrapperX<NinePreventiveMeasuresItemDO>()
                .eq(NinePreventiveMeasuresItemDO::getPreventiveId, preventiveId));
    }
}

