package org.jeecg.modules.clockInproject.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.clockInproject.entity.ClockInProject;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

/**
 * @Description: clock_in_project
 * @Author: jeecg-boot
 * @Date:   2024-11-05
 * @Version: V1.0
 */
public interface ClockInProjectMapper extends BaseMapper<ClockInProject> {

    /**
     * 经纬度距离计算
     * @param lon
     * @param lat
     * @return
     */
    @Select("SELECT ROUND(ST_Distance_Sphere(POINT(#{lon}, #{lat}),POINT(lon, lat)),0) AS distance FROM clock_in_project WHERE del_flag = 0 AND id = #{id}")
    Integer getDistance(@Param("lon") String lon,@Param("lat") String lat,@Param("id") String id);




}
