功能新增
parent
bae537fe0a
commit
c888501afd
|
|
@ -0,0 +1,47 @@
|
|||
######################################################################
|
||||
# Build Tools
|
||||
|
||||
.gradle
|
||||
/build/
|
||||
!gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
target/
|
||||
!.mvn/wrapper/maven-wrapper.jar
|
||||
|
||||
######################################################################
|
||||
# IDE
|
||||
|
||||
### STS ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
### JRebel ###
|
||||
rebel.xml
|
||||
|
||||
### NetBeans ###
|
||||
nbproject/private/
|
||||
build/*
|
||||
nbbuild/
|
||||
dist/
|
||||
nbdist/
|
||||
.nb-gradle/
|
||||
|
||||
######################################################################
|
||||
# Others
|
||||
*.log
|
||||
*.xml.versionsBackup
|
||||
*.swp
|
||||
|
||||
!*/build/*.java
|
||||
!*/build/*.html
|
||||
!*/build/*.xml
|
||||
|
|
@ -0,0 +1,104 @@
|
|||
package com.agri.system.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.agri.common.annotation.Log;
|
||||
import com.agri.common.core.controller.BaseController;
|
||||
import com.agri.common.core.domain.AjaxResult;
|
||||
import com.agri.common.enums.BusinessType;
|
||||
import com.agri.system.domain.SysDtuData;
|
||||
import com.agri.system.service.ISysDtuDataService;
|
||||
import com.agri.common.utils.poi.ExcelUtil;
|
||||
import com.agri.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* DTU温湿度上报数据Controller
|
||||
*
|
||||
* @author agri
|
||||
* @date 2025-12-23
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/data")
|
||||
public class SysDtuDataController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ISysDtuDataService sysDtuDataService;
|
||||
|
||||
/**
|
||||
* 查询DTU温湿度上报数据列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:data:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysDtuData sysDtuData)
|
||||
{
|
||||
startPage();
|
||||
List<SysDtuData> list = sysDtuDataService.selectSysDtuDataList(sysDtuData);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出DTU温湿度上报数据列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:data:export')")
|
||||
@Log(title = "DTU温湿度上报数据", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysDtuData sysDtuData)
|
||||
{
|
||||
List<SysDtuData> list = sysDtuDataService.selectSysDtuDataList(sysDtuData);
|
||||
ExcelUtil<SysDtuData> util = new ExcelUtil<SysDtuData>(SysDtuData.class);
|
||||
util.exportExcel(response, list, "DTU温湿度上报数据数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取DTU温湿度上报数据详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:data:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(sysDtuDataService.selectSysDtuDataById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增DTU温湿度上报数据
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:data:add')")
|
||||
@Log(title = "DTU温湿度上报数据", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SysDtuData sysDtuData)
|
||||
{
|
||||
return toAjax(sysDtuDataService.insertSysDtuData(sysDtuData));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改DTU温湿度上报数据
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:data:edit')")
|
||||
@Log(title = "DTU温湿度上报数据", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody SysDtuData sysDtuData)
|
||||
{
|
||||
return toAjax(sysDtuDataService.updateSysDtuData(sysDtuData));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除DTU温湿度上报数据
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:data:remove')")
|
||||
@Log(title = "DTU温湿度上报数据", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(sysDtuDataService.deleteSysDtuDataByIds(ids));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,223 @@
|
|||
package com.agri.system.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.agri.common.annotation.Excel;
|
||||
import com.agri.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* DTU温湿度上报数据对象 sys_dtu_data
|
||||
*
|
||||
* @author agri
|
||||
* @date 2025-12-23
|
||||
*/
|
||||
public class SysDtuData extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
private Long id;
|
||||
|
||||
/** 设备唯一标识(IMEI/DeviceId) */
|
||||
@Excel(name = "设备唯一标识(IMEI/DeviceId)")
|
||||
private String imei;
|
||||
|
||||
/** 设备上报时间戳(ms或s,建议统一ms) */
|
||||
@Excel(name = "设备上报时间戳(ms或s,建议统一ms)")
|
||||
private Long ts;
|
||||
|
||||
/** ts转换后的正常时间(由服务端转换入库) */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "ts转换后的正常时间(由服务端转换入库)", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date time;
|
||||
|
||||
/** 温度1(℃) */
|
||||
@Excel(name = "温度1(℃)")
|
||||
private BigDecimal temp1;
|
||||
|
||||
/** 湿度1(%RH) */
|
||||
@Excel(name = "湿度1(%RH)")
|
||||
private BigDecimal humi1;
|
||||
|
||||
/** 温度2(℃) */
|
||||
@Excel(name = "温度2(℃)")
|
||||
private BigDecimal temp2;
|
||||
|
||||
/** 湿度2(%RH) */
|
||||
@Excel(name = "湿度2(%RH)")
|
||||
private BigDecimal humi2;
|
||||
|
||||
/** 温度3(℃) */
|
||||
@Excel(name = "温度3(℃)")
|
||||
private BigDecimal temp3;
|
||||
|
||||
/** 湿度3(%RH) */
|
||||
@Excel(name = "湿度3(%RH)")
|
||||
private BigDecimal humi3;
|
||||
|
||||
/** 温度4(℃) */
|
||||
@Excel(name = "温度4(℃)")
|
||||
private BigDecimal temp4;
|
||||
|
||||
/** 湿度4(%RH) */
|
||||
@Excel(name = "湿度4(%RH)")
|
||||
private BigDecimal humi4;
|
||||
|
||||
/** 原始JSON元信息(原始上报码/额外字段) */
|
||||
@Excel(name = "原始JSON元信息(原始上报码/额外字段)")
|
||||
private String raw;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setImei(String imei)
|
||||
{
|
||||
this.imei = imei;
|
||||
}
|
||||
|
||||
public String getImei()
|
||||
{
|
||||
return imei;
|
||||
}
|
||||
|
||||
public void setTs(Long ts)
|
||||
{
|
||||
this.ts = ts;
|
||||
}
|
||||
|
||||
public Long getTs()
|
||||
{
|
||||
return ts;
|
||||
}
|
||||
|
||||
public void setTime(Date time)
|
||||
{
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
public Date getTime()
|
||||
{
|
||||
return time;
|
||||
}
|
||||
|
||||
public void setTemp1(BigDecimal temp1)
|
||||
{
|
||||
this.temp1 = temp1;
|
||||
}
|
||||
|
||||
public BigDecimal getTemp1()
|
||||
{
|
||||
return temp1;
|
||||
}
|
||||
|
||||
public void setHumi1(BigDecimal humi1)
|
||||
{
|
||||
this.humi1 = humi1;
|
||||
}
|
||||
|
||||
public BigDecimal getHumi1()
|
||||
{
|
||||
return humi1;
|
||||
}
|
||||
|
||||
public void setTemp2(BigDecimal temp2)
|
||||
{
|
||||
this.temp2 = temp2;
|
||||
}
|
||||
|
||||
public BigDecimal getTemp2()
|
||||
{
|
||||
return temp2;
|
||||
}
|
||||
|
||||
public void setHumi2(BigDecimal humi2)
|
||||
{
|
||||
this.humi2 = humi2;
|
||||
}
|
||||
|
||||
public BigDecimal getHumi2()
|
||||
{
|
||||
return humi2;
|
||||
}
|
||||
|
||||
public void setTemp3(BigDecimal temp3)
|
||||
{
|
||||
this.temp3 = temp3;
|
||||
}
|
||||
|
||||
public BigDecimal getTemp3()
|
||||
{
|
||||
return temp3;
|
||||
}
|
||||
|
||||
public void setHumi3(BigDecimal humi3)
|
||||
{
|
||||
this.humi3 = humi3;
|
||||
}
|
||||
|
||||
public BigDecimal getHumi3()
|
||||
{
|
||||
return humi3;
|
||||
}
|
||||
|
||||
public void setTemp4(BigDecimal temp4)
|
||||
{
|
||||
this.temp4 = temp4;
|
||||
}
|
||||
|
||||
public BigDecimal getTemp4()
|
||||
{
|
||||
return temp4;
|
||||
}
|
||||
|
||||
public void setHumi4(BigDecimal humi4)
|
||||
{
|
||||
this.humi4 = humi4;
|
||||
}
|
||||
|
||||
public BigDecimal getHumi4()
|
||||
{
|
||||
return humi4;
|
||||
}
|
||||
|
||||
public void setRaw(String raw)
|
||||
{
|
||||
this.raw = raw;
|
||||
}
|
||||
|
||||
public String getRaw()
|
||||
{
|
||||
return raw;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("imei", getImei())
|
||||
.append("ts", getTs())
|
||||
.append("time", getTime())
|
||||
.append("temp1", getTemp1())
|
||||
.append("humi1", getHumi1())
|
||||
.append("temp2", getTemp2())
|
||||
.append("humi2", getHumi2())
|
||||
.append("temp3", getTemp3())
|
||||
.append("humi3", getHumi3())
|
||||
.append("temp4", getTemp4())
|
||||
.append("humi4", getHumi4())
|
||||
.append("raw", getRaw())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package com.agri.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.agri.system.domain.SysDtuData;
|
||||
|
||||
/**
|
||||
* DTU温湿度上报数据Mapper接口
|
||||
*
|
||||
* @author agri
|
||||
* @date 2025-12-23
|
||||
*/
|
||||
public interface SysDtuDataMapper
|
||||
{
|
||||
/**
|
||||
* 查询DTU温湿度上报数据
|
||||
*
|
||||
* @param id DTU温湿度上报数据主键
|
||||
* @return DTU温湿度上报数据
|
||||
*/
|
||||
public SysDtuData selectSysDtuDataById(Long id);
|
||||
|
||||
/**
|
||||
* 查询DTU温湿度上报数据列表
|
||||
*
|
||||
* @param sysDtuData DTU温湿度上报数据
|
||||
* @return DTU温湿度上报数据集合
|
||||
*/
|
||||
public List<SysDtuData> selectSysDtuDataList(SysDtuData sysDtuData);
|
||||
|
||||
/**
|
||||
* 新增DTU温湿度上报数据
|
||||
*
|
||||
* @param sysDtuData DTU温湿度上报数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSysDtuData(SysDtuData sysDtuData);
|
||||
|
||||
/**
|
||||
* 修改DTU温湿度上报数据
|
||||
*
|
||||
* @param sysDtuData DTU温湿度上报数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSysDtuData(SysDtuData sysDtuData);
|
||||
|
||||
/**
|
||||
* 删除DTU温湿度上报数据
|
||||
*
|
||||
* @param id DTU温湿度上报数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysDtuDataById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除DTU温湿度上报数据
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysDtuDataByIds(Long[] ids);
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package com.agri.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.agri.system.domain.SysDtuData;
|
||||
|
||||
/**
|
||||
* DTU温湿度上报数据Service接口
|
||||
*
|
||||
* @author agri
|
||||
* @date 2025-12-23
|
||||
*/
|
||||
public interface ISysDtuDataService
|
||||
{
|
||||
/**
|
||||
* 查询DTU温湿度上报数据
|
||||
*
|
||||
* @param id DTU温湿度上报数据主键
|
||||
* @return DTU温湿度上报数据
|
||||
*/
|
||||
public SysDtuData selectSysDtuDataById(Long id);
|
||||
|
||||
/**
|
||||
* 查询DTU温湿度上报数据列表
|
||||
*
|
||||
* @param sysDtuData DTU温湿度上报数据
|
||||
* @return DTU温湿度上报数据集合
|
||||
*/
|
||||
public List<SysDtuData> selectSysDtuDataList(SysDtuData sysDtuData);
|
||||
|
||||
/**
|
||||
* 新增DTU温湿度上报数据
|
||||
*
|
||||
* @param sysDtuData DTU温湿度上报数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertSysDtuData(SysDtuData sysDtuData);
|
||||
|
||||
/**
|
||||
* 修改DTU温湿度上报数据
|
||||
*
|
||||
* @param sysDtuData DTU温湿度上报数据
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateSysDtuData(SysDtuData sysDtuData);
|
||||
|
||||
/**
|
||||
* 批量删除DTU温湿度上报数据
|
||||
*
|
||||
* @param ids 需要删除的DTU温湿度上报数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysDtuDataByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除DTU温湿度上报数据信息
|
||||
*
|
||||
* @param id DTU温湿度上报数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteSysDtuDataById(Long id);
|
||||
}
|
||||
|
|
@ -0,0 +1,95 @@
|
|||
package com.agri.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.agri.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.agri.system.mapper.SysDtuDataMapper;
|
||||
import com.agri.system.domain.SysDtuData;
|
||||
import com.agri.system.service.ISysDtuDataService;
|
||||
|
||||
/**
|
||||
* DTU温湿度上报数据Service业务层处理
|
||||
*
|
||||
* @author agri
|
||||
* @date 2025-12-23
|
||||
*/
|
||||
@Service
|
||||
public class SysDtuDataServiceImpl implements ISysDtuDataService
|
||||
{
|
||||
@Autowired
|
||||
private SysDtuDataMapper sysDtuDataMapper;
|
||||
|
||||
/**
|
||||
* 查询DTU温湿度上报数据
|
||||
*
|
||||
* @param id DTU温湿度上报数据主键
|
||||
* @return DTU温湿度上报数据
|
||||
*/
|
||||
@Override
|
||||
public SysDtuData selectSysDtuDataById(Long id)
|
||||
{
|
||||
return sysDtuDataMapper.selectSysDtuDataById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询DTU温湿度上报数据列表
|
||||
*
|
||||
* @param sysDtuData DTU温湿度上报数据
|
||||
* @return DTU温湿度上报数据
|
||||
*/
|
||||
@Override
|
||||
public List<SysDtuData> selectSysDtuDataList(SysDtuData sysDtuData)
|
||||
{
|
||||
return sysDtuDataMapper.selectSysDtuDataList(sysDtuData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增DTU温湿度上报数据
|
||||
*
|
||||
* @param sysDtuData DTU温湿度上报数据
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertSysDtuData(SysDtuData sysDtuData)
|
||||
{
|
||||
sysDtuData.setCreateTime(DateUtils.getNowDate());
|
||||
return sysDtuDataMapper.insertSysDtuData(sysDtuData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改DTU温湿度上报数据
|
||||
*
|
||||
* @param sysDtuData DTU温湿度上报数据
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateSysDtuData(SysDtuData sysDtuData)
|
||||
{
|
||||
return sysDtuDataMapper.updateSysDtuData(sysDtuData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除DTU温湿度上报数据
|
||||
*
|
||||
* @param ids 需要删除的DTU温湿度上报数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSysDtuDataByIds(Long[] ids)
|
||||
{
|
||||
return sysDtuDataMapper.deleteSysDtuDataByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除DTU温湿度上报数据信息
|
||||
*
|
||||
* @param id DTU温湿度上报数据主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteSysDtuDataById(Long id)
|
||||
{
|
||||
return sysDtuDataMapper.deleteSysDtuDataById(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,119 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.agri.system.mapper.SysDtuDataMapper">
|
||||
|
||||
<resultMap type="SysDtuData" id="SysDtuDataResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="imei" column="imei" />
|
||||
<result property="ts" column="ts" />
|
||||
<result property="time" column="time" />
|
||||
<result property="temp1" column="temp1" />
|
||||
<result property="humi1" column="humi1" />
|
||||
<result property="temp2" column="temp2" />
|
||||
<result property="humi2" column="humi2" />
|
||||
<result property="temp3" column="temp3" />
|
||||
<result property="humi3" column="humi3" />
|
||||
<result property="temp4" column="temp4" />
|
||||
<result property="humi4" column="humi4" />
|
||||
<result property="raw" column="raw" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysDtuDataVo">
|
||||
select id, imei, ts, time, temp1, humi1, temp2, humi2, temp3, humi3, temp4, humi4, raw, create_by, create_time from sys_dtu_data
|
||||
</sql>
|
||||
|
||||
<select id="selectSysDtuDataList" 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>
|
||||
</select>
|
||||
|
||||
<select id="selectSysDtuDataById" parameterType="Long" resultMap="SysDtuDataResult">
|
||||
<include refid="selectSysDtuDataVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertSysDtuData" parameterType="SysDtuData" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sys_dtu_data
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="imei != null and imei != ''">imei,</if>
|
||||
<if test="ts != null">ts,</if>
|
||||
<if test="time != null">time,</if>
|
||||
<if test="temp1 != null">temp1,</if>
|
||||
<if test="humi1 != null">humi1,</if>
|
||||
<if test="temp2 != null">temp2,</if>
|
||||
<if test="humi2 != null">humi2,</if>
|
||||
<if test="temp3 != null">temp3,</if>
|
||||
<if test="humi3 != null">humi3,</if>
|
||||
<if test="temp4 != null">temp4,</if>
|
||||
<if test="humi4 != null">humi4,</if>
|
||||
<if test="raw != null">raw,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="imei != null and imei != ''">#{imei},</if>
|
||||
<if test="ts != null">#{ts},</if>
|
||||
<if test="time != null">#{time},</if>
|
||||
<if test="temp1 != null">#{temp1},</if>
|
||||
<if test="humi1 != null">#{humi1},</if>
|
||||
<if test="temp2 != null">#{temp2},</if>
|
||||
<if test="humi2 != null">#{humi2},</if>
|
||||
<if test="temp3 != null">#{temp3},</if>
|
||||
<if test="humi3 != null">#{humi3},</if>
|
||||
<if test="temp4 != null">#{temp4},</if>
|
||||
<if test="humi4 != null">#{humi4},</if>
|
||||
<if test="raw != null">#{raw},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateSysDtuData" parameterType="SysDtuData">
|
||||
update sys_dtu_data
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="imei != null and imei != ''">imei = #{imei},</if>
|
||||
<if test="ts != null">ts = #{ts},</if>
|
||||
<if test="time != null">time = #{time},</if>
|
||||
<if test="temp1 != null">temp1 = #{temp1},</if>
|
||||
<if test="humi1 != null">humi1 = #{humi1},</if>
|
||||
<if test="temp2 != null">temp2 = #{temp2},</if>
|
||||
<if test="humi2 != null">humi2 = #{humi2},</if>
|
||||
<if test="temp3 != null">temp3 = #{temp3},</if>
|
||||
<if test="humi3 != null">humi3 = #{humi3},</if>
|
||||
<if test="temp4 != null">temp4 = #{temp4},</if>
|
||||
<if test="humi4 != null">humi4 = #{humi4},</if>
|
||||
<if test="raw != null">raw = #{raw},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteSysDtuDataById" parameterType="Long">
|
||||
delete from sys_dtu_data where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteSysDtuDataByIds" parameterType="String">
|
||||
delete from sys_dtu_data where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue