package com.jd.lightapplication.mapper;

import com.jd.lightapplication.model.InspectionResult;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jd.lightapplication.model.vo.InspectionResultVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface InspectionResultMapper extends BaseMapper<InspectionResult>  {

    @Select("SELECT ir.*,ip.name as inspectionProjectName FROM inspection_result ir" +
            " LEFT JOIN inspection_project ip" +
            " ON ir.inspection_project_id = ip.id" +
            " WHERE ir.inspection_record_id = #{inspectionRecordId}")
    List<InspectionResultVo> queryVoByRecordId(@Param("inspectionRecordId") Long inspectionRecordId);
}
