src/main/java/com/moral/entity/PollutionSourcePoint.java | ●●●●● patch | view | raw | blame | history | |
src/main/java/com/moral/mapper/PollutionSourcPointMapper.java | ●●●●● patch | view | raw | blame | history | |
src/main/java/com/moral/service/PollutioSourcePointService.java | ●●●●● patch | view | raw | blame | history | |
src/main/java/com/moral/service/impl/PollutioSourcePointServiceImpl.java | ●●●●● patch | view | raw | blame | history | |
src/main/resources/mapper/PollutionSourcePointMapper.xml | ●●●●● patch | view | raw | blame | history |
src/main/java/com/moral/entity/PollutionSourcePoint.java
New file @@ -0,0 +1,17 @@ package com.moral.entity; import lombok.Data; import javax.persistence.Id; @Data public class PollutionSourcePoint { @Id Integer id; Integer monitorPointId; Double longitude; Double latitude; } src/main/java/com/moral/mapper/PollutionSourcPointMapper.java
New file @@ -0,0 +1,13 @@ package com.moral.mapper; import com.moral.entity.DeviceAdjustValueTiming; import com.moral.entity.PollutionSourcePoint; import org.apache.ibatis.annotations.Param; import java.util.List; import java.util.Map; public interface PollutionSourcPointMapper { PollutionSourcePoint selectByMonitorPointId(@Param("monitorPointId") Integer monitorPointId); } src/main/java/com/moral/service/PollutioSourcePointService.java
New file @@ -0,0 +1,7 @@ package com.moral.service; import com.moral.entity.PollutionSourcePoint; public interface PollutioSourcePointService { PollutionSourcePoint selectByMonitorPointId(Integer monitorPointId); } src/main/java/com/moral/service/impl/PollutioSourcePointServiceImpl.java
New file @@ -0,0 +1,21 @@ package com.moral.service.impl; import com.moral.entity.PollutionSourcePoint; import com.moral.mapper.PollutionSourcPointMapper; import com.moral.service.PollutioSourcePointService; import org.springframework.stereotype.Service; import javax.annotation.Resource; @Service public class PollutioSourcePointServiceImpl implements PollutioSourcePointService { @Resource private PollutionSourcPointMapper pollutionSourcPointMapper; @Override public PollutionSourcePoint selectByMonitorPointId(Integer monitorPointId) { PollutionSourcePoint result = pollutionSourcPointMapper.selectByMonitorPointId(monitorPointId); return result; } } src/main/resources/mapper/PollutionSourcePointMapper.xml
New file @@ -0,0 +1,16 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.moral.mapper.PollutionSourcPointMapper"> <resultMap id="BaseResultMap" type="com.moral.entity.PollutionSourcePoint" > <id column="id" property="id" jdbcType="INTEGER" /> <result column="monitor_point_id" property="monitorPointId" jdbcType="INTEGER" /> <result column="longitude" property="longitude" jdbcType="NUMERIC" /> <result column="latitude" property="latitude" jdbcType="NUMERIC" /> </resultMap> <select id="selectByMonitorPointId" resultType="com.moral.entity.PollutionSourcePoint" resultMap="BaseResultMap"> select * from pollution_source_point where monitor_point_id = #{monitorPointId} </select> </mapper>