增加温度查最后一条方法

feasure
lld 2025-12-28 21:41:49 +08:00
parent 19b16844a3
commit 87b4645da0
7 changed files with 49 additions and 2 deletions

View File

@ -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()";
/** /**
* 线 * 线

View File

@ -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湿
*/ */

View File

@ -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;

View File

@ -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湿
* *

View File

@ -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湿
* *

View File

@ -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湿
* *

View File

@ -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>