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

import java.util.List;

/**
 * 生活助理巡视明细 Mapper
 */
@Mapper
public interface ElderlyLifeAssistantInspectionItemMapper extends BaseMapperX<ElderlyLifeAssistantInspectionItemDO> {

    default List<ElderlyLifeAssistantInspectionItemDO> selectListByInspectionId(Long inspectionId) {
        return selectList(new LambdaQueryWrapperX<ElderlyLifeAssistantInspectionItemDO>()
                .eq(ElderlyLifeAssistantInspectionItemDO::getLifeAssistantInspectionId, inspectionId)
                .orderByAsc(ElderlyLifeAssistantInspectionItemDO::getId));
    }

    default void deleteByInspectionId(Long inspectionId) {
        delete(new LambdaQueryWrapperX<ElderlyLifeAssistantInspectionItemDO>()
                .eq(ElderlyLifeAssistantInspectionItemDO::getLifeAssistantInspectionId, inspectionId));
    }
}

