package com.cdzy.operations; import com.cdzy.operations.mapper.EbikeBikeInfoMapper; import com.cdzy.operations.model.entity.EbikeBikeInfo; import org.junit.jupiter.api.Test; import org.postgresql.geometric.PGpoint; import org.postgresql.geometric.PGpolygon; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import java.util.List; @SpringBootTest class EbikeOperationsApplicationTests { @Autowired private EbikeBikeInfoMapper bikeInfoMapper; @Test void contextLoads(){ PGpoint gpoint1 = new PGpoint(103.943116,30.6327); PGpoint gpoint2 = new PGpoint(104.205415,30.633586); PGpoint gpoint3 = new PGpoint(104.080789,30.496715); PGpoint gpoint4 = new PGpoint(103.943116,30.6327); PGpoint[] points = new PGpoint[]{gpoint1,gpoint2,gpoint3,gpoint4}; PGpolygon pgpolygon = new PGpolygon(points); List bikeInfos = bikeInfoMapper.selectPolygonGeometry(pgpolygon); for (EbikeBikeInfo bikeInfo : bikeInfos) { System.out.println(bikeInfo); } } }