Browse Source

修改mybatis相关业务实体类,完成基础信息初始化加载类内容

shilin 4 years ago
parent
commit
9bf28d7c79

+ 3 - 3
src/main/java/com/gyee/frame/service/WindpowerinfodayService.java

@@ -63,14 +63,14 @@ public class WindpowerinfodayService extends SocketToolService implements BaseSe
 	 * @return
 	 * @throws ParseException
 	 */
-	public Windpowerinfoday findListByDate(String wpid,String recorddate) throws ParseException {
+	public Windpowerinfoday findListByDate(String wpid,Date recorddate) throws ParseException {
 
 		Windpowerinfoday wpi=null;
 
 		if(recorddate!=null&&!"".equals(recorddate) && wpid!=null&&!"".equals(wpid)){
 
-			SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
-			Date recodedatebegin =sdf.parse(recorddate);
+
+			Date recodedatebegin =recorddate;
 			Date recodedateend = DateUtils.addDays(recodedatebegin,1);
 			WindpowerinfodayExample testExample=new WindpowerinfodayExample();
 			testExample.setOrderByClause("id ASC");

+ 3 - 4
src/main/java/com/gyee/frame/service/WindturbineinfodayService.java

@@ -30,7 +30,6 @@ public class WindturbineinfodayService extends SocketToolService implements Base
 	@Resource
 	private WindturbineinfodayMapper windturbineinfodayMapper;
 
-
 	/**
 	 * 分页查询
 	 * @param windpowerstationid
@@ -63,14 +62,14 @@ public class WindturbineinfodayService extends SocketToolService implements Base
 	 * @return
 	 * @throws ParseException
 	 */
-	public Windturbineinfoday findListByDate(String wtid,String recorddate) throws ParseException {
+	public Windturbineinfoday findListByDate(String wtid,Date recorddate) throws ParseException {
 
 		Windturbineinfoday wpi=null;
 
 		if(wtid!=null&&!"".equals(wtid) && recorddate!=null&&!"".equals(recorddate)){
 
-			SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
-			Date recodedatebegin =sdf.parse(recorddate);
+
+			Date recodedatebegin =recorddate;
 			Date recodedateend = DateUtils.addDays(recodedatebegin,1);
 			WindturbineinfodayExample testExample=new WindturbineinfodayExample();
 			testExample.setOrderByClause("id ASC");

+ 12 - 3
src/test/java/test/RelationalDataBaseTest.java

@@ -9,6 +9,8 @@ import com.gyee.frame.service.WindturbineinfodayService;
 import lombok.SneakyThrows;
 import org.springframework.boot.SpringApplication;
 
+import java.util.Calendar;
+
 public class RelationalDataBaseTest {
 
     @SneakyThrows
@@ -23,11 +25,18 @@ public class RelationalDataBaseTest {
 //
 //        List<Line> ls=lineService.selectByExample(lineExample);
 
-        Windturbineinfoday wt=windturbineinfodayService.findListByDate("CL01_001","2020-05-14");
-        Windpowerinfoday wp=windpowerinfodayService.findListByDate("CL_FDC","2020-05-14");
+        Calendar c = Calendar.getInstance();
+
+        c.set(Calendar.HOUR_OF_DAY, 0);
+        c.set(Calendar.MINUTE, 0);
+        c.set(Calendar.SECOND, 0);
+
+        Windturbineinfoday wt=windturbineinfodayService.findListByDate("CL01_001",c.getTime());
+        Windpowerinfoday wp=windpowerinfodayService.findListByDate("CL_FDC",c.getTime());
 
         System.out.println(wt.getRecorddate()+ "___" +wt.getGeneratingcapacity2());
-        System.out.println(wp.getRecorddate()+ "___" +wp.getGeneratingcapacity2());
+        System.out.println(wp.getRecorddate()+ "___" +wp.getDaylyxs());
+
 
     }