package org.jeecg.modules.itdmTestPlan.mapper;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.itdmDevice.entity.ItdmDevice;
import org.jeecg.modules.itdmTestPlan.vo.ItdmJCXMAndSYJHVO;
import org.jeecg.modules.itdmTestPlan.vo.ItdmJHYQueryListVO;

import java.util.List;

public interface ItdmJCXMSHJHMapper {

    @Select("select a.weituo_id, a.yangpin_id, a.test_items, a.id as testItemsId, " +
            "b.id as testPlanId, b.shebei_id, b.pm, b.jihua_start_date, b.jihua_end_date, b.status, b.report_no, b.chuanganqi " +
            "from itdm_weituo_yangpin_extend a " +
            "left join itdm_test_plan b on a.id = b.test_items_id " +
            "where a.weituo_id = #{weituoId}")
    List<ItdmJCXMAndSYJHVO> getAll(@Param("weituoId") String weituoId);


//    @Select("select a.weituo_id, a.yangpin_id, a.id as testItemsId, a.test_items, " +
//            "b.id as testPlanId, b.shebei_id, b.pm, b.jihua_start_date, b.jihua_end_date, b.status, b.report_no, b.chuanganqi, " +
//            "c.weituo_no, d.sample_name, e.device_name " +
//            "from itdm_weituo_yangpin_extend a " +
//            "left join itdm_test_plan b on a.id = b.test_items_id " +
//            "left join itdm_weituo_info c on a.weituo_id = c.id " +
//            "left join itdm_weituo_yangpin d on a.yangpin_id = d.id " +
//            "left join itdm_device e on b.shebei_id = e.id " +
//            "where a.weituo_id = #{weituoId}")
//    List<ItdmJHYQueryListVO> getAll2(@Param("weituoId") String weituoId);


    @Select("select a.weituo_id, a.yangpin_id, a.id as testItemsId, a.test_items, " +
            "b.id as testPlanId, b.shebei_id, b.pm, b.jihua_start_date, b.jihua_end_date, b.status, b.report_no, b.chuanganqi, " +
            "d.sample_name, e.device_name " +
            "from itdm_weituo_yangpin_extend a " +
            "left join itdm_test_plan b on a.id = b.test_items_id " +
            "left join itdm_weituo_yangpin d on a.yangpin_id = d.id " +
            "left join itdm_device e on b.shebei_id = e.id " +
            "where a.weituo_id = #{weituoId}")
    List<ItdmJHYQueryListVO> getAll3(@Param("weituoId") String weituoId);

}
