密度任意时间报表
This commit is contained in:
@ -242,4 +242,43 @@ public class DB_Ajax_DashBoard_Density_48102 {
|
||||
}
|
||||
return hashMapList;
|
||||
}
|
||||
|
||||
public static List<HashMap<String,String>> getDensityDataRange(String fDateStart, String fDateEnd) {
|
||||
List<HashMap<String,String>> hashMapList = new ArrayList<>();
|
||||
try {
|
||||
Connection conn = getSQLConnection();
|
||||
String sql = "SELECT\n" +
|
||||
"\tProductDate AS TIME,\n" +
|
||||
"\tAVG ( Density ) AS density \n" +
|
||||
"FROM\n" +
|
||||
"\t[dbo].[MouldingRealTimeDensity] \n" +
|
||||
"WHERE\n" +
|
||||
"\tCreatedOn >= '"+fDateStart+"' and CreatedOn <= '"+fDateEnd+"'" +
|
||||
"GROUP BY\n" +
|
||||
"\tProductDate \n" +
|
||||
"ORDER BY\n" +
|
||||
"\tMAX ( CreatedOn );";
|
||||
Statement stmt = conn.createStatement();//
|
||||
System.out.println(sql);
|
||||
|
||||
ResultSet rs = stmt.executeQuery(sql);
|
||||
while (rs.next()) {
|
||||
// 截面积(mm2)
|
||||
HashMap<String,String> map = new HashMap<>();
|
||||
map.put("density",rs.getString("density"));
|
||||
map.put("time",rs.getString("time"));
|
||||
hashMapList.add(map);
|
||||
|
||||
}
|
||||
rs.close();
|
||||
stmt.close();
|
||||
conn.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
}
|
||||
return hashMapList;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,15 +1,17 @@
|
||||
package com.ruoyi.project.fx_density.controller;
|
||||
|
||||
import com.ruoyi.db.mssql.DB_Ajax_DashBoard_Density_48102;
|
||||
import com.ruoyi.db.mssql.DB_Ajax_DashBoard_Technologist_48102;
|
||||
import com.ruoyi.framework.web.controller.BaseController;
|
||||
import com.ruoyi.framework.web.domain.AjaxResult;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 服务器监控
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@RestController
|
||||
@ -36,4 +38,12 @@ public class DensityController extends BaseController
|
||||
{
|
||||
return AjaxResult.success(DB_Ajax_DashBoard_Density_48102.DoGetGroupDensityListMap());
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/getDensityDataRange/{fDateStart}/{fDateEnd}")
|
||||
public AjaxResult getDateRange(@PathVariable String fDateStart, @PathVariable String fDateEnd) throws Exception
|
||||
{
|
||||
return AjaxResult.success(DB_Ajax_DashBoard_Density_48102.getDensityDataRange(fDateStart,fDateEnd));
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user