Pārlūkot izejas kodu

增加实体MsReportLog

peiguo 4 gadi atpakaļ
vecāks
revīzija
7b5a6a1a9c

+ 19 - 0
whepi-web/src/main/java/com/bofeng/dao/MsReportLogMapper.java

@@ -0,0 +1,19 @@
+package com.bofeng.dao;
+
+import com.baomidou.mybatisplus.mapper.BaseMapper;
+import com.bofeng.entity.MsReportLog;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Mapper
+@Repository
+public interface MsReportLogMapper extends BaseMapper<MsReportLog> {
+
+    // 当天的打卡轨迹
+    @Select("select user_id,report_date,city from ms_report_log where user_id = 1 and report_date = DATE_FORMAT(now(), '%Y-%m-%d') group by user_id,report_date,city")
+    List<MsReportLog> logAddr(@Param("userId") Long userId);
+}

+ 53 - 0
whepi-web/src/main/java/com/bofeng/entity/MsReportLog.java

@@ -0,0 +1,53 @@
+package com.bofeng.entity;
+
+
+import com.baomidou.mybatisplus.annotations.TableField;
+import com.baomidou.mybatisplus.annotations.TableId;
+import com.baomidou.mybatisplus.annotations.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+import org.joda.time.DateTime;
+
+import java.util.Date;
+
+@Getter
+@Setter
+@TableName("ms_report_log")
+public class MsReportLog {
+
+    @TableId("log_id")
+    private Long logId;
+
+    @TableField("report_id")
+    private Long reportId;
+
+    @ApiModelProperty("上报人")
+    @TableField("user_id")
+    private Long userId;
+
+    @ApiModelProperty("上报日期")
+    @TableField("report_date")
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    private Date reportDate;
+
+    @ApiModelProperty("经度")
+    @TableField("longitude")
+    private String longitude;
+
+    @ApiModelProperty("纬度")
+    @TableField("latitude")
+    private String latitude;
+
+    @ApiModelProperty("当前城市")
+    @TableField("city")
+    private String city;
+
+    @ApiModelProperty("当前地址")
+    @TableField("addr")
+    private String addr;
+
+    @TableField("time_create")
+    private DateTime timeCreate;
+}