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

import java.util.List;

/**
 * 约束观察记录-明细 Mapper
 */
@Mapper
public interface ElderlyRestraintItemMapper extends BaseMapperX<ElderlyRestraintItemDO> {

    default List<ElderlyRestraintItemDO> selectListByRestraintId(Long restraintId) {
        return selectList(new LambdaQueryWrapperX<ElderlyRestraintItemDO>()
                .eq(ElderlyRestraintItemDO::getRestraintId, restraintId)
                .orderByAsc(ElderlyRestraintItemDO::getId));
    }

    default void deleteByRestraintId(Long restraintId) {
        delete(new LambdaQueryWrapperX<ElderlyRestraintItemDO>()
                .eq(ElderlyRestraintItemDO::getRestraintId, restraintId));
    }
}

