package com.sysu.admin.controller.crop;

import com.xiesx.fastboot.core.jpa.JpaPlusRepository;
import org.locationtech.jts.geom.Geometry;
import org.springframework.data.jpa.repository.Query;


public interface CropLandRepository extends JpaPlusRepository<CropLand, Long> {


    @Query(value = "SELECT * FROM p_crop where St_within(st_geomfromtext(?1,4326), geom) limit 1", nativeQuery = true)
    CropLand findByPoint(String pointWKT);

    @Query(value = "select st_astext(st_centroid(?1))",nativeQuery = true)
    String getCenterPoint(Geometry geom);





}
