package com.sptg.estate.biz.mapper;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.sptg.estate.api.entity.InstallationReview;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * title: ContractMapper
 * package: com.sptg.estate.biz.security
 * description: 安装环境评审-DAO接口
 *
 *               
 *                     
 */
public interface InstallationReviewMapper extends BaseMapper<InstallationReview> {

    /**
     * 功能描述:根据定位id查询关联安装环境评审信息
     * @param id
     * @return List<InstallationReview>
     *                
     *                      
     */
    @Select("SELECT iir.i_is_lock_cable AS isLockCable,iir.i_is_device_cable AS isDeviceCable,iir.i_is_door_cable AS isDoorCable,iir.i_is_rectify " +
            "AS isRectify,iir.i_is_signal AS isSignal,iir.i_is_lock_status AS isLockStatus,iir.s_detail_img_uri AS detailImgUri,iir.s_panorama_img_uri AS panoramaImgUri," +
            "ipr.s_install_path AS positionName FROM implement_position ip,implement_position_record ipr,implement_installation_review iir where " +
            " ip.l_id=ipr.l_position_id AND iir.l_position_record_id=ipr.l_id AND  ip.l_id=#{id} ")
    public List<InstallationReview> getListByPositionId(@Param(value ="id") long id);
    /**
     * 功能描述:根据环境评审id获安装环境评审记录
     * @param wrapper
     * @return List<InstallationReview>
     *               
     *                      
     */
    List<InstallationReview> findByEnvironmentalReviewId(@Param(value = "ew") Wrapper<InstallationReview> wrapper);
}
