package cn.com.ty.lift.business.emergency.service;

import cn.com.ty.lift.business.emergency.entity.ErRecordImg;
import cn.com.ty.lift.business.emergency.mapper.ErRecordImgMapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 临修图片 服务实现类
 * </p>
 *
 * @author wcz
 * @since 2019-12-04
 */
@Service
public class ErRecordImgService extends ServiceImpl<ErRecordImgMapper, ErRecordImg> {

    /**
     * 根据急修id查询急修图片
     *
     * @param erRecordId 急修id
     * @return List<ErRecordCost>
     */
    public List<ErRecordImg> listByErRecordId(Long erRecordId) {
        LambdaQueryWrapper<ErRecordImg> lambdaQueryWrapper = Wrappers.lambdaQuery();
        lambdaQueryWrapper.eq(ErRecordImg::getErRecordId, erRecordId);
        return list(lambdaQueryWrapper);
    }

    /**
     * 根据急修ids列表查询急修图片
     *
     * @param ids List<Long>
     * @return List<ErRecordImg>
     */
    public List<ErRecordImg> listByErRecordIds(List<Long> ids) {
        LambdaQueryWrapper<ErRecordImg> lambdaQueryWrapper = Wrappers.lambdaQuery();
        lambdaQueryWrapper.in(ErRecordImg::getErRecordId, ids);
        return list(lambdaQueryWrapper);
    }
}
