package com.ylx.massage.mapper;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ylx.massage.domain.MaProject;
import com.ylx.massage.domain.MaTeProject;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 商户服务项目关联Mapper接口
 */
@Mapper
public interface MaTeProjectMapper extends BaseMapper<MaTeProject> {

    /**
     * 批量新增商户服务项目关联
     *
     * @param entities 关联集合
     * @return 影响行数
     */
    int insertBatch(@Param("entities") List<MaTeProject> entities);

    /**
     * 根据商户ID删除服务项目关联。
     *
     * @param technicianId 商户ID
     * @return 影响行数
     */
    default int deleteByTechnicianId(Integer technicianId) {
        return delete(new LambdaQueryWrapper<MaTeProject>().eq(MaTeProject::getTeId, technicianId));
    }
}
