package com.yuchen.saas.park.service.mapper.property;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuchen.saas.park.api.entity.property.PropertyAdsPosition;
import com.yuchen.saas.park.api.vo.property.PropertyAdsPositionListVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface PropertyAdsPositionMapper extends BaseMapper<PropertyAdsPosition> {

    @Select("select p.park_name,b.building_name,ap.*" +
            " from property_ads_position ap" +
            " left join property_buildings b on ap.building_id = b.id" +
            " left join pmg_bat_park_info p on ap.park_id = p.id" +
            " ${ew.customSqlSegment} order by ap.create_time desc")
    Page<PropertyAdsPositionListVo> propertyAdsPositionPage(Page<PropertyAdsPositionListVo> page, @Param(Constants.WRAPPER) Wrapper<String> wrapper);

}
