package com.ruoyi.system.mapper;

import java.math.BigDecimal;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.system.domain.PosOrder;
import com.ruoyi.system.domain.TaxiOrder;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * TaxiOrderMapper接口
 * 
 * @author ruoyi
 * @date 2024-01-26
 */
public interface TaxiOrderMapper  extends BaseMapper<TaxiOrder>
{

    //按照距离获取附近订单
    @Select("SELECT *,(st_distance(point(into_longitude,into_latitude),point(#{longitude},#{latitude}))*111195/1000 ) as juli FROM taxi_order WHERE state = '0' HAVING juli<#{juli} ORDER BY juli ASC limit #{page},20")  //查询语句
    List<TaxiOrder> getfjorder(@Param("longitude") BigDecimal longitude, @Param("latitude")BigDecimal latitude, @Param("page")Integer page, @Param("juli")Integer juli);  //反回结果
    /**
     * 查询TaxiOrder
     * 
     * @param id TaxiOrder主键
     * @return TaxiOrder
     */
    public TaxiOrder selectTaxiOrderById(Long id);

    /**
     * 查询TaxiOrder列表
     * 
     * @param taxiOrder TaxiOrder
     * @return TaxiOrder集合
     */
    public List<TaxiOrder> selectTaxiOrderList(TaxiOrder taxiOrder);

    /**
     * 新增TaxiOrder
     * 
     * @param taxiOrder TaxiOrder
     * @return 结果
     */
    public int insertTaxiOrder(TaxiOrder taxiOrder);

    /**
     * 修改TaxiOrder
     * 
     * @param taxiOrder TaxiOrder
     * @return 结果
     */
    public int updateTaxiOrder(TaxiOrder taxiOrder);

    /**
     * 删除TaxiOrder
     * 
     * @param id TaxiOrder主键
     * @return 结果
     */
    public int deleteTaxiOrderById(Long id);

    /**
     * 批量删除TaxiOrder
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteTaxiOrderByIds(Long[] ids);
}
