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

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

import java.util.List;

/**
 * 卫生服务质量评价明细 Mapper
 */
@Mapper
public interface EvaluationServiceQualityItemMapper extends BaseMapperX<EvaluationServiceQualityItemDO> {

    default List<EvaluationServiceQualityItemDO> selectListByEvaluationId(Long evaluationId) {
        return selectList(new LambdaQueryWrapperX<EvaluationServiceQualityItemDO>()
                .eq(EvaluationServiceQualityItemDO::getEvaluationId, evaluationId)
                .orderByAsc(EvaluationServiceQualityItemDO::getId));
    }

    default void deleteByEvaluationId(Long evaluationId) {
        delete(new LambdaQueryWrapperX<EvaluationServiceQualityItemDO>()
                .eq(EvaluationServiceQualityItemDO::getEvaluationId, evaluationId));
    }
}

