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

import java.util.List;

/**
 * 专护服务记录明细 Mapper
 */
@Mapper
public interface ElderlySpecialServiceItemMapper extends BaseMapperX<ElderlySpecialServiceItemDO> {

    default List<ElderlySpecialServiceItemDO> selectListBySpecialServiceId(Long specialServiceId) {
        return selectList(new LambdaQueryWrapperX<ElderlySpecialServiceItemDO>()
                .eq(ElderlySpecialServiceItemDO::getSpecialServiceId, specialServiceId)
                .orderByAsc(ElderlySpecialServiceItemDO::getId));
    }

    default void deleteBySpecialServiceId(Long specialServiceId) {
        delete(new LambdaQueryWrapperX<ElderlySpecialServiceItemDO>()
                .eq(ElderlySpecialServiceItemDO::getSpecialServiceId, specialServiceId));
    }
}

