Procházet zdrojové kódy

feat: 站点人员每日坐标

zhangying před 6 měsíci
rodič
revize
e8861f77c6

+ 6 - 0
src/main/java/com/hz/employmentsite/controller/LongitudeLatitudeController.java

@@ -28,4 +28,10 @@ public class LongitudeLatitudeController {
         return RespGenerstor.success(longitudeLatitudeService.list(userId, startDate, endDate));
     }
 
+    @GetMapping("newAllList")
+    public BaseResponse<List<PcLongitudeLatitudeVo>> newAllList(@RequestParam("userName") String userName, @RequestParam("startDate") Date startDate,
+                                                                @RequestParam("regionCode") String regionCode, @RequestParam("siteID") String siteID) {
+        return RespGenerstor.success(longitudeLatitudeService.newAllList(userName, startDate, regionCode, siteID));
+    }
+
 }

+ 13 - 0
src/main/java/com/hz/employmentsite/mapper/cquery/LongitudeLatitudeCQuery.java

@@ -10,4 +10,17 @@ public interface LongitudeLatitudeCQuery {
 
     List<PcLongitudeLatitudeVo> selectList(@Param("userName") String userName, @Param("userId") String userId, @Param("startDate") Date startDate, @Param("endDate") Date endDate);
 
+    /**
+     * 查询各驿站工作者每天最新的数据
+     *
+     * @param userName   驿站工作者姓名
+     * @param startDate  查询日期
+     * @param regionCode 所属县区
+     * @param siteID     所属驿站
+     * @return 实时经纬度
+     */
+    List<PcLongitudeLatitudeVo> selectNewAllList(@Param("userName") String userName,
+                                                 @Param("startDate") Date startDate,
+                                                 @Param("regionCode") String regionCode,
+                                                 @Param("siteID") String siteID);
 }

+ 5 - 0
src/main/java/com/hz/employmentsite/services/impl/LongitudeLatitudeServiceImpl.java

@@ -35,4 +35,9 @@ public class LongitudeLatitudeServiceImpl implements LongitudeLatitudeService {
     public List<PcLongitudeLatitudeVo> list(String userId, Date startDate, Date endDate) {
         return longitudeLatitudeCQuery.selectList(null, userId, startDate, endDate);
     }
+
+    @Override
+    public List<PcLongitudeLatitudeVo> newAllList(String userName, Date startDate, String regionCode, String siteID) {
+        return longitudeLatitudeCQuery.selectNewAllList(userName, startDate, regionCode, siteID);
+    }
 }

+ 3 - 1
src/main/java/com/hz/employmentsite/services/service/LongitudeLatitudeService.java

@@ -9,5 +9,7 @@ import java.util.List;
 public interface LongitudeLatitudeService {
     Integer save(PcLongitudeLatitude data);
 
-    List<PcLongitudeLatitudeVo> list(String userId, Date startDate,Date endDate);
+    List<PcLongitudeLatitudeVo> list(String userId, Date startDate, Date endDate);
+
+    List<PcLongitudeLatitudeVo> newAllList(String userName, Date startDate, String regionCode, String siteID);
 }

+ 6 - 0
src/main/java/com/hz/employmentsite/vo/taskAndLog/PcLongitudeLatitudeVo.java

@@ -6,4 +6,10 @@ import lombok.Data;
 @Data
 public class PcLongitudeLatitudeVo extends PcLongitudeLatitude {
     public String userName;
+
+    public String siteId;
+
+    public String regionCode;
+
+    public String siteName;
 }

+ 32 - 0
src/main/resources/mapping/cquery/LongitudeLatitudeCQuery.xml

@@ -20,4 +20,36 @@
         </if>
         order by l.Time
     </select>
+
+    <select id="selectNewAllList" resultType="com.hz.employmentsite.vo.taskAndLog.PcLongitudeLatitudeVo">
+        SELECT llt.UserId,
+        MAX(llt.Time) AS Time,
+        llt.Longitude,
+        llt.Latitude,
+        site_user.SiteUserName as userName,
+        site_user.SiteID,
+        site.RegionCode,
+        site.SiteName
+        FROM
+        `pc_longitude_latitude` llt
+        LEFT JOIN pc_site_user site_user
+        ON llt.UserId = site_user.UserID
+        LEFT JOIN pc_site site ON site_user.SiteID = site.SiteID
+        WHERE
+        1=1
+        <if test="userName!='' and userName!=null">
+            and site_user.SiteUserName like Concat('%',#{userName},'%')
+        </if>
+        <if test="startDate != null">
+            and llt.Time <![CDATA[ >= ]]> #{startDate}
+        </if>
+        <if test="regionCode!='' and regionCode!=null">
+            and site.RegionCode = #{regionCode}
+        </if>
+        <if test="siteID!='' and siteID!=null">
+            and site_user.SiteID = #{siteId}
+        </if>
+        GROUP BY
+        llt.UserId
+    </select>
 </mapper>