From 702c1a3cf8112e610c5b3d62fc0b36b600b9f75c Mon Sep 17 00:00:00 2001
From: 13693261870 <252740454@qq.com>
Date: 星期五, 09 六月 2023 17:47:38 +0800
Subject: [PATCH] 添加查询su_yuan_700方法

---
 src/main/java/com/yssh/dao/SuYuanMapper.java               |    2 +-
 src/main/java/com/yssh/entity/SuYuan700.java               |   12 +++++++-----
 src/main/java/com/yssh/service/impl/SuYuanServiceImpl.java |    5 +++--
 src/main/resources/mapping/SuYuanMapper.xml                |    6 ++++++
 4 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/src/main/java/com/yssh/dao/SuYuanMapper.java b/src/main/java/com/yssh/dao/SuYuanMapper.java
index 6b2df8c..dd53845 100644
--- a/src/main/java/com/yssh/dao/SuYuanMapper.java
+++ b/src/main/java/com/yssh/dao/SuYuanMapper.java
@@ -40,5 +40,5 @@
 
 	int updateVocsName(String table, String id, String vocsName);
 
-	SuYuan700 selectSuYuan700ById(String id, String time);
+	SuYuan700 selectSuYuan700ById(@Param("id") String id, @Param("time") String time);
 }
diff --git a/src/main/java/com/yssh/entity/SuYuan700.java b/src/main/java/com/yssh/entity/SuYuan700.java
index 1ba1293..2b02223 100644
--- a/src/main/java/com/yssh/entity/SuYuan700.java
+++ b/src/main/java/com/yssh/entity/SuYuan700.java
@@ -1,5 +1,6 @@
 package com.yssh.entity;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
@@ -19,7 +20,7 @@
     private Long id;
 
     @ApiModelProperty(value = "婧簮ID")
-    private String su_yuan_id;
+    private String suYuanId;
 
     @ApiModelProperty(value = "鍦板潃1")
     private String addr1;
@@ -58,6 +59,7 @@
     private Double y3;
 
     @ApiModelProperty(value = "鏃堕棿")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date createTime;
 
     public SuYuan700() {
@@ -71,12 +73,12 @@
         this.id = id;
     }
 
-    public String getSu_yuan_id() {
-        return su_yuan_id;
+    public String getSuYuanId() {
+        return suYuanId;
     }
 
-    public void setSu_yuan_id(String su_yuan_id) {
-        this.su_yuan_id = su_yuan_id;
+    public void setSuYuanId(String suYuanId) {
+        this.suYuanId = suYuanId;
     }
 
     public String getAddr1() {
diff --git a/src/main/java/com/yssh/service/impl/SuYuanServiceImpl.java b/src/main/java/com/yssh/service/impl/SuYuanServiceImpl.java
index 27ca2f1..f50492a 100644
--- a/src/main/java/com/yssh/service/impl/SuYuanServiceImpl.java
+++ b/src/main/java/com/yssh/service/impl/SuYuanServiceImpl.java
@@ -296,8 +296,9 @@
 
 	@Override
 	public SuYuan700 selectSuYuan700ById(String id, Date date) {
-		String time = DateUtils.getYyyyMmDdHhMmSs(date);
+		id = id.substring(0, id.lastIndexOf("_") + 1) + "0";
+		String time = DateUtils.getYyyyMmDdHhMmSs(date).substring(0, 13) + ":00:00";
 
-		return null;
+		return suYuanMapper.selectSuYuan700ById(id, time);
 	}
 }
diff --git a/src/main/resources/mapping/SuYuanMapper.xml b/src/main/resources/mapping/SuYuanMapper.xml
index b85e601..1d0a5a8 100644
--- a/src/main/resources/mapping/SuYuanMapper.xml
+++ b/src/main/resources/mapping/SuYuanMapper.xml
@@ -163,6 +163,12 @@
     	ORDER BY value DESC
 		LIMIT 1
     </select>
+
+	<select id="selectSuYuan700ById" resultType="com.yssh.entity.SuYuan700">
+		select * from suyuan_700
+		where su_yuan_id = #{id} and create_time = #{time}
+		limit 1;
+	</select>
     
     <select id="getTemporary" resultMap="TemporaryResult">
     	SELECT  x, y, z, u, v, w, format(c, 2) "c"

--
Gitblit v1.9.3