增加温度查最后一条方法
parent
19b16844a3
commit
87b4645da0
|
|
@ -13,7 +13,7 @@ public class SqlUtil
|
||||||
/**
|
/**
|
||||||
* 定义常用的 sql关键字
|
* 定义常用的 sql关键字
|
||||||
*/
|
*/
|
||||||
public static String SQL_REGEX = "\u000B|and |extractvalue|updatexml|sleep|information_schema|exec |insert |select |delete |update |drop |count |chr |mid |master |truncate |char |declare |or |union |like |+|/*|user()";
|
public static String SQL_REGEX = "\u000B|and |extractvalue|updatexml|sleep|information_schema|exec |insert |select |delete |drop |count |chr |mid |master |truncate |char |declare |or |union |like |+|/*|user()";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 仅支持字母、数字、下划线、空格、逗号、小数点(支持多个字段排序)
|
* 仅支持字母、数字、下划线、空格、逗号、小数点(支持多个字段排序)
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,17 @@ public class SysDtuDataController extends BaseController
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询DTU温湿度上报数据列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/findDtuDataByInfo")
|
||||||
|
public AjaxResult findDtuDataByInfo(SysDtuData sysDtuData)
|
||||||
|
{
|
||||||
|
SysDtuData dtuData = sysDtuDataService.findDtuDataByInfo(sysDtuData);
|
||||||
|
return AjaxResult.success(dtuData);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出DTU温湿度上报数据列表
|
* 导出DTU温湿度上报数据列表
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ public class SysDtuData extends BaseEntity
|
||||||
private Long ts;
|
private Long ts;
|
||||||
|
|
||||||
/** ts转换后的正常时间(由服务端转换入库) */
|
/** ts转换后的正常时间(由服务端转换入库) */
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
@Excel(name = "ts转换后的正常时间(由服务端转换入库)", width = 30, dateFormat = "yyyy-MM-dd")
|
@Excel(name = "ts转换后的正常时间(由服务端转换入库)", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
private Date time;
|
private Date time;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,8 @@ public interface SysDtuDataMapper
|
||||||
*/
|
*/
|
||||||
public List<SysDtuData> selectSysDtuDataList(SysDtuData sysDtuData);
|
public List<SysDtuData> selectSysDtuDataList(SysDtuData sysDtuData);
|
||||||
|
|
||||||
|
SysDtuData findDtuDataByInfo(SysDtuData sysDtuData);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增DTU温湿度上报数据
|
* 新增DTU温湿度上报数据
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,13 @@ public interface ISysDtuDataService
|
||||||
*/
|
*/
|
||||||
public List<SysDtuData> selectSysDtuDataList(SysDtuData sysDtuData);
|
public List<SysDtuData> selectSysDtuDataList(SysDtuData sysDtuData);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据某个信息查询对应数据
|
||||||
|
* @param sysDtuData
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
SysDtuData findDtuDataByInfo(SysDtuData sysDtuData);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增DTU温湿度上报数据
|
* 新增DTU温湿度上报数据
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,13 @@ public class SysDtuDataServiceImpl implements ISysDtuDataService
|
||||||
return sysDtuDataMapper.selectSysDtuDataList(sysDtuData);
|
return sysDtuDataMapper.selectSysDtuDataList(sysDtuData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SysDtuData findDtuDataByInfo(SysDtuData sysDtuData)
|
||||||
|
{
|
||||||
|
return sysDtuDataMapper.findDtuDataByInfo(sysDtuData);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增DTU温湿度上报数据
|
* 新增DTU温湿度上报数据
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -116,4 +116,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="findDtuDataByInfo" parameterType="SysDtuData" resultMap="SysDtuDataResult">
|
||||||
|
<include refid="selectSysDtuDataVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="imei != null and imei != ''"> and imei = #{imei}</if>
|
||||||
|
<if test="ts != null "> and ts = #{ts}</if>
|
||||||
|
<if test="time != null "> and time = #{time}</if>
|
||||||
|
<if test="temp1 != null "> and temp1 = #{temp1}</if>
|
||||||
|
<if test="humi1 != null "> and humi1 = #{humi1}</if>
|
||||||
|
<if test="temp2 != null "> and temp2 = #{temp2}</if>
|
||||||
|
<if test="humi2 != null "> and humi2 = #{humi2}</if>
|
||||||
|
<if test="temp3 != null "> and temp3 = #{temp3}</if>
|
||||||
|
<if test="humi3 != null "> and humi3 = #{humi3}</if>
|
||||||
|
<if test="temp4 != null "> and temp4 = #{temp4}</if>
|
||||||
|
<if test="humi4 != null "> and humi4 = #{humi4}</if>
|
||||||
|
<if test="raw != null and raw != ''"> and raw = #{raw}</if>
|
||||||
|
</where>
|
||||||
|
order by `time` desc limit 1
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
Loading…
Reference in New Issue