Browse Source

对接温度湿度漏水检测

logistics
ma 4 years ago
parent
commit
38e80445fd
  1. 22
      logistics/src/main/java/com/ccsens/logistics/Util/Constant.java
  2. 11
      logistics/src/main/java/com/ccsens/logistics/bean/po/LogisticsEnvironmentRecord.java
  3. 70
      logistics/src/main/java/com/ccsens/logistics/bean/po/LogisticsEnvironmentRecordExample.java
  4. 11
      logistics/src/main/java/com/ccsens/logistics/bean/po/LogisticsHeatImagingRecord.java
  5. 70
      logistics/src/main/java/com/ccsens/logistics/bean/po/LogisticsHeatImagingRecordExample.java
  6. 63
      logistics/src/main/java/com/ccsens/logistics/bean/vo/HttpVo.java
  7. 31
      logistics/src/main/java/com/ccsens/logistics/scheduled/ScheduledService.java
  8. 100
      logistics/src/main/java/com/ccsens/logistics/service/HttpService.java
  9. 31
      logistics/src/main/resources/mapper_raw/LogisticsEnvironmentRecordMapper.xml
  10. 27
      logistics/src/main/resources/mapper_raw/LogisticsHeatImagingRecordMapper.xml

22
logistics/src/main/java/com/ccsens/logistics/Util/Constant.java

@ -3,7 +3,7 @@ package com.ccsens.logistics.Util;
/** /**
* @author * @author
*/ */
public class Constant { public class Constant {
/** /**
* 心跳信息 * 心跳信息
*/ */
@ -12,4 +12,24 @@ public class Constant {
* 热成像图片 * 热成像图片
*/ */
public static final String THERMAL_IMAGERY = "SN4Image"; public static final String THERMAL_IMAGERY = "SN4Image";
/**
* 温度检测
*/
public static final String TEMP = "温度(℃)";
/**
* 湿度检测
*/
public static final String HUMIDITY = "湿度(%RH)";
/**
* 水浸检测
*/
public static final String WATER_OUT = "水浸";
/**
* 有水
*/
public static final String HAVE_WATER = "有水";
/**
* 无水
*/
public static final String NO_WATER = "无水";
} }

11
logistics/src/main/java/com/ccsens/logistics/bean/po/LogisticsEnvironmentRecord.java

@ -15,6 +15,8 @@ public class LogisticsEnvironmentRecord implements Serializable {
private Long warehouseId; private Long warehouseId;
private String equipmentNum;
private Long recordTime; private Long recordTime;
private Byte isAlarm; private Byte isAlarm;
@ -67,6 +69,14 @@ public class LogisticsEnvironmentRecord implements Serializable {
this.warehouseId = warehouseId; this.warehouseId = warehouseId;
} }
public String getEquipmentNum() {
return equipmentNum;
}
public void setEquipmentNum(String equipmentNum) {
this.equipmentNum = equipmentNum == null ? null : equipmentNum.trim();
}
public Long getRecordTime() { public Long getRecordTime() {
return recordTime; return recordTime;
} }
@ -118,6 +128,7 @@ public class LogisticsEnvironmentRecord implements Serializable {
sb.append(", numType=").append(numType); sb.append(", numType=").append(numType);
sb.append(", equipmentId=").append(equipmentId); sb.append(", equipmentId=").append(equipmentId);
sb.append(", warehouseId=").append(warehouseId); sb.append(", warehouseId=").append(warehouseId);
sb.append(", equipmentNum=").append(equipmentNum);
sb.append(", recordTime=").append(recordTime); sb.append(", recordTime=").append(recordTime);
sb.append(", isAlarm=").append(isAlarm); sb.append(", isAlarm=").append(isAlarm);
sb.append(", createdAt=").append(createdAt); sb.append(", createdAt=").append(createdAt);

70
logistics/src/main/java/com/ccsens/logistics/bean/po/LogisticsEnvironmentRecordExample.java

@ -406,6 +406,76 @@ public class LogisticsEnvironmentRecordExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andEquipmentNumIsNull() {
addCriterion("equipment_num is null");
return (Criteria) this;
}
public Criteria andEquipmentNumIsNotNull() {
addCriterion("equipment_num is not null");
return (Criteria) this;
}
public Criteria andEquipmentNumEqualTo(String value) {
addCriterion("equipment_num =", value, "equipmentNum");
return (Criteria) this;
}
public Criteria andEquipmentNumNotEqualTo(String value) {
addCriterion("equipment_num <>", value, "equipmentNum");
return (Criteria) this;
}
public Criteria andEquipmentNumGreaterThan(String value) {
addCriterion("equipment_num >", value, "equipmentNum");
return (Criteria) this;
}
public Criteria andEquipmentNumGreaterThanOrEqualTo(String value) {
addCriterion("equipment_num >=", value, "equipmentNum");
return (Criteria) this;
}
public Criteria andEquipmentNumLessThan(String value) {
addCriterion("equipment_num <", value, "equipmentNum");
return (Criteria) this;
}
public Criteria andEquipmentNumLessThanOrEqualTo(String value) {
addCriterion("equipment_num <=", value, "equipmentNum");
return (Criteria) this;
}
public Criteria andEquipmentNumLike(String value) {
addCriterion("equipment_num like", value, "equipmentNum");
return (Criteria) this;
}
public Criteria andEquipmentNumNotLike(String value) {
addCriterion("equipment_num not like", value, "equipmentNum");
return (Criteria) this;
}
public Criteria andEquipmentNumIn(List<String> values) {
addCriterion("equipment_num in", values, "equipmentNum");
return (Criteria) this;
}
public Criteria andEquipmentNumNotIn(List<String> values) {
addCriterion("equipment_num not in", values, "equipmentNum");
return (Criteria) this;
}
public Criteria andEquipmentNumBetween(String value1, String value2) {
addCriterion("equipment_num between", value1, value2, "equipmentNum");
return (Criteria) this;
}
public Criteria andEquipmentNumNotBetween(String value1, String value2) {
addCriterion("equipment_num not between", value1, value2, "equipmentNum");
return (Criteria) this;
}
public Criteria andRecordTimeIsNull() { public Criteria andRecordTimeIsNull() {
addCriterion("record_time is null"); addCriterion("record_time is null");
return (Criteria) this; return (Criteria) this;

11
logistics/src/main/java/com/ccsens/logistics/bean/po/LogisticsHeatImagingRecord.java

@ -23,6 +23,8 @@ public class LogisticsHeatImagingRecord implements Serializable {
private Long warehouseId; private Long warehouseId;
private String equipmentNum;
private Date createdAt; private Date createdAt;
private Date updatedAt; private Date updatedAt;
@ -105,6 +107,14 @@ public class LogisticsHeatImagingRecord implements Serializable {
this.warehouseId = warehouseId; this.warehouseId = warehouseId;
} }
public String getEquipmentNum() {
return equipmentNum;
}
public void setEquipmentNum(String equipmentNum) {
this.equipmentNum = equipmentNum == null ? null : equipmentNum.trim();
}
public Date getCreatedAt() { public Date getCreatedAt() {
return createdAt; return createdAt;
} }
@ -152,6 +162,7 @@ public class LogisticsHeatImagingRecord implements Serializable {
sb.append(", recordTime=").append(recordTime); sb.append(", recordTime=").append(recordTime);
sb.append(", equipmentId=").append(equipmentId); sb.append(", equipmentId=").append(equipmentId);
sb.append(", warehouseId=").append(warehouseId); sb.append(", warehouseId=").append(warehouseId);
sb.append(", equipmentNum=").append(equipmentNum);
sb.append(", createdAt=").append(createdAt); sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt); sb.append(", updatedAt=").append(updatedAt);
sb.append(", recStatus=").append(recStatus); sb.append(", recStatus=").append(recStatus);

70
logistics/src/main/java/com/ccsens/logistics/bean/po/LogisticsHeatImagingRecordExample.java

@ -666,6 +666,76 @@ public class LogisticsHeatImagingRecordExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andEquipmentNumIsNull() {
addCriterion("equipment_num is null");
return (Criteria) this;
}
public Criteria andEquipmentNumIsNotNull() {
addCriterion("equipment_num is not null");
return (Criteria) this;
}
public Criteria andEquipmentNumEqualTo(String value) {
addCriterion("equipment_num =", value, "equipmentNum");
return (Criteria) this;
}
public Criteria andEquipmentNumNotEqualTo(String value) {
addCriterion("equipment_num <>", value, "equipmentNum");
return (Criteria) this;
}
public Criteria andEquipmentNumGreaterThan(String value) {
addCriterion("equipment_num >", value, "equipmentNum");
return (Criteria) this;
}
public Criteria andEquipmentNumGreaterThanOrEqualTo(String value) {
addCriterion("equipment_num >=", value, "equipmentNum");
return (Criteria) this;
}
public Criteria andEquipmentNumLessThan(String value) {
addCriterion("equipment_num <", value, "equipmentNum");
return (Criteria) this;
}
public Criteria andEquipmentNumLessThanOrEqualTo(String value) {
addCriterion("equipment_num <=", value, "equipmentNum");
return (Criteria) this;
}
public Criteria andEquipmentNumLike(String value) {
addCriterion("equipment_num like", value, "equipmentNum");
return (Criteria) this;
}
public Criteria andEquipmentNumNotLike(String value) {
addCriterion("equipment_num not like", value, "equipmentNum");
return (Criteria) this;
}
public Criteria andEquipmentNumIn(List<String> values) {
addCriterion("equipment_num in", values, "equipmentNum");
return (Criteria) this;
}
public Criteria andEquipmentNumNotIn(List<String> values) {
addCriterion("equipment_num not in", values, "equipmentNum");
return (Criteria) this;
}
public Criteria andEquipmentNumBetween(String value1, String value2) {
addCriterion("equipment_num between", value1, value2, "equipmentNum");
return (Criteria) this;
}
public Criteria andEquipmentNumNotBetween(String value1, String value2) {
addCriterion("equipment_num not between", value1, value2, "equipmentNum");
return (Criteria) this;
}
public Criteria andCreatedAtIsNull() { public Criteria andCreatedAtIsNull() {
addCriterion("created_at is null"); addCriterion("created_at is null");
return (Criteria) this; return (Criteria) this;

63
logistics/src/main/java/com/ccsens/logistics/bean/vo/HttpVo.java

@ -0,0 +1,63 @@
package com.ccsens.logistics.bean.vo;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author
*/
@Data
public class HttpVo {
@Data
@ApiModel("温湿度设备分组")
public static class Groups{
@ApiModelProperty("分组id")
private String groupId;
@ApiModelProperty("分组名称")
private String groupName;
}
@Data
@ApiModel("温湿度设备的数据")
public static class EnvironmentOfData{
@ApiModelProperty("分组id")
private String groupId;
@ApiModelProperty("设备编号")
private String deviceKey;
@ApiModelProperty("设备地址")
private Integer deviceAddr;
@ApiModelProperty("节点编号")
private Integer nodeID;
@ApiModelProperty("节点类型")
private Integer nodeType;
@ApiModelProperty("停用状态,true停用")
private Integer deviceDisabled;
@ApiModelProperty("设备名称")
private String deviceName;
@ApiModelProperty("设备状态0未运行,1离线,2在线")
private Integer deviceStatus;
@ApiModelProperty("实时数据")
private JSONArray relTimeData;
// @ApiModelProperty("实时数据")
// private List<RealData> relTimeData;
}
@Data
@ApiModel("实时数据")
public static class RealData{
@ApiModelProperty("模拟量名称")
private String dataName;
@ApiModelProperty("实时数据")
private String dataValue;
@ApiModelProperty("是否报警")
private Boolean isAlarm;
@ApiModelProperty("报警信息")
private String alarmMsg;
}
}

31
logistics/src/main/java/com/ccsens/logistics/scheduled/ScheduledService.java

@ -0,0 +1,31 @@
package com.ccsens.logistics.scheduled;
import com.ccsens.logistics.service.IHttpService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
/**
* @author
*/
@Slf4j
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
@Component
@EnableScheduling
public class ScheduledService {
@Resource
private IHttpService iHttpService;
@Scheduled(cron = "*/30 * * * * ?")
public void runfirst(){
iHttpService.getTemperatureAndHumidity();
}
}

100
logistics/src/main/java/com/ccsens/logistics/service/HttpService.java

@ -1,33 +1,34 @@
package com.ccsens.logistics.service; package com.ccsens.logistics.service;
import com.alibaba.fastjson.JSON; import cn.hutool.core.lang.Snowflake;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.ccsens.logistics.bean.dto.HttpDto; import com.ccsens.logistics.bean.dto.HttpDto;
import com.ccsens.util.CodeEnum; import com.ccsens.logistics.bean.po.LogisticsEnvironmentRecord;
import com.ccsens.logistics.bean.vo.HttpVo;
import com.ccsens.logistics.persist.dao.LogisticsEnvironmentRecordDao;
import com.ccsens.util.JsonResponse; import com.ccsens.util.JsonResponse;
import com.ccsens.util.PropUtil;
import com.ccsens.util.RestTemplateUtil; import com.ccsens.util.RestTemplateUtil;
import com.ccsens.util.exception.BaseException;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.http.Header; import org.apache.http.Header;
import org.apache.http.HttpResponse; import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient; import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients; import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils; import org.apache.http.util.EntityUtils;
import org.apache.http.HttpEntity; import org.apache.http.HttpEntity;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import com.ccsens.logistics.Util.Constant;
import javax.annotation.Resource;
import java.io.IOException; import java.io.IOException;
import java.net.URI; import java.math.BigDecimal;
import java.net.URISyntaxException; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Map; import java.util.List;
/** /**
* @author * @author
@ -37,15 +38,75 @@ import java.util.Map;
@Transactional(propagation = Propagation.REQUIRED,rollbackFor = Exception.class) @Transactional(propagation = Propagation.REQUIRED,rollbackFor = Exception.class)
public class HttpService implements IHttpService{ public class HttpService implements IHttpService{
@Resource
private LogisticsEnvironmentRecordDao environmentRecordDao;
@Resource
private Snowflake snowflake;
@Override @Override
public void getTemperatureAndHumidity() { public void getTemperatureAndHumidity() {
try { try {
List<HttpVo.Groups> groupsList = new ArrayList<>();
HttpDto.Login login = new HttpDto.Login(); HttpDto.Login login = new HttpDto.Login();
login.setLoginName("jnrstest"); login.setLoginName("t210510sxck");
login.setPassword("jnrstest321"); login.setPassword("ccsens123");
//调取登录接口 获取userId //调取登录接口 获取userId
String userId = getUserId(login); String userId = getUserId(login);
String body = getBody(userId); //获取设备分组列表
// String getGroupOfUrl = "http://iot.0531yun.cn/wsjc/app/GetUserDeviceGroups";
// String groupString = getBody(getGroupOfUrl,userId);
// JsonResponse<JSONArray> groups = JSONObject.parseObject(groupString,JsonResponse.class);
// JSONArray data = groups.getData();
// for (int i = 0; i < data.size(); i++) {
// HttpVo.Groups oneData = JSONObject.parseObject(data.get(i).toString(), HttpVo.Groups.class);
// groupsList.add(oneData);
// }
//循环查询分组id下的设备数据并存入数据库
String getDataAndSaveOfUrl = "http://iot.0531yun.cn/wsjc/app/GetDeviceData?groupId=";
String environmentOfData = getBody(getDataAndSaveOfUrl, userId);
JSONObject jsonObject = JSONObject.parseObject(environmentOfData);
JSONArray dataArray = jsonObject.getJSONArray("data");
for (int i = 0; i < dataArray.size(); i++) {
LogisticsEnvironmentRecord environmentRecord = new LogisticsEnvironmentRecord();
JSONObject oneObject = dataArray.getJSONObject(i);
environmentRecord.setEquipmentNum(oneObject.getString("deviceKey"));
environmentRecord.setRecordTime(System.currentTimeMillis());
JSONArray realTimeData = oneObject.getJSONArray("realTimeData");
for (int j = 0; j < realTimeData.size(); j++) {
JSONObject realData = realTimeData.getJSONObject(j);
switch (realData.getString("dataName")){
case Constant.TEMP :
environmentRecord.setId(snowflake.nextId());
environmentRecord.setNumType((byte)1);
environmentRecord.setNumValue(new BigDecimal(realData.getString("dataValue")));
environmentRecord.setIsAlarm(realData.getBoolean("isAlarm") ? (byte) 1 : (byte) 0);
break;
case Constant.HUMIDITY:
environmentRecord.setId(snowflake.nextId());
environmentRecord.setNumType((byte)0);
environmentRecord.setNumValue(new BigDecimal(realData.getString("dataValue")));
environmentRecord.setIsAlarm(realData.getBoolean("isAlarm") ? (byte) 1 : (byte) 0);
break;
case Constant.WATER_OUT:
environmentRecord.setId(snowflake.nextId());
environmentRecord.setNumType((byte)2);
if(Constant.HAVE_WATER.equals(realData.getString("dataValue"))){
environmentRecord.setNumValue(new BigDecimal(100));
environmentRecord.setIsAlarm((byte)1);
}else{
environmentRecord.setNumValue(new BigDecimal(0));
environmentRecord.setIsAlarm((byte)0);
}
break;
default:
break;
}
environmentRecordDao.insertSelective(environmentRecord);
}
}
}catch (Exception e){ }catch (Exception e){
e.printStackTrace(); e.printStackTrace();
@ -59,26 +120,22 @@ public class HttpService implements IHttpService{
* @return userId * @return userId
*/ */
public String getUserId(HttpDto.Login login){ public String getUserId(HttpDto.Login login){
String requestUrl = "http://www.0531yun.cn/wsjc/app/Login"; String requestUrl = "http://iot.0531yun.cn/app/Login";
String s = RestTemplateUtil.postBody(requestUrl, login); String s = RestTemplateUtil.postBody(requestUrl, login);
JsonResponse<JSONObject> a = JSONObject.parseObject(s, JsonResponse.class); JsonResponse<JSONObject> a = JSONObject.parseObject(s, JsonResponse.class);
JSONObject data = a.getData(); JSONObject data = a.getData();
String userId = data.getString("userId"); return data.getString("userId");
return userId;
} }
//get请求
public static String getBody(String userId) throws IOException { public static String getBody(String url,String userId){
try { try {
String url = "http://www.0531yun.cn/app/GetUserDeviceGroups";
HttpGet get = new HttpGet(url); HttpGet get = new HttpGet(url);
get.setHeader("userId",userId); get.setHeader("userId",userId);
HttpClient httpClient = HttpClients.createDefault(); HttpClient httpClient = HttpClients.createDefault();
HttpResponse response = httpClient.execute(get); HttpResponse response = httpClient.execute(get);
return getResult(response); return getResult(response);
} catch (ClientProtocolException e) {
e.printStackTrace();
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }
@ -103,4 +160,5 @@ public class HttpService implements IHttpService{
} }
} }

31
logistics/src/main/resources/mapper_raw/LogisticsEnvironmentRecordMapper.xml

@ -7,6 +7,7 @@
<result column="num_type" jdbcType="TINYINT" property="numType" /> <result column="num_type" jdbcType="TINYINT" property="numType" />
<result column="equipment_id" jdbcType="BIGINT" property="equipmentId" /> <result column="equipment_id" jdbcType="BIGINT" property="equipmentId" />
<result column="warehouse_id" jdbcType="BIGINT" property="warehouseId" /> <result column="warehouse_id" jdbcType="BIGINT" property="warehouseId" />
<result column="equipment_num" jdbcType="VARCHAR" property="equipmentNum" />
<result column="record_time" jdbcType="BIGINT" property="recordTime" /> <result column="record_time" jdbcType="BIGINT" property="recordTime" />
<result column="is_alarm" jdbcType="TINYINT" property="isAlarm" /> <result column="is_alarm" jdbcType="TINYINT" property="isAlarm" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" /> <result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
@ -72,8 +73,8 @@
</where> </where>
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, num_value, num_type, equipment_id, warehouse_id, record_time, is_alarm, created_at, id, num_value, num_type, equipment_id, warehouse_id, equipment_num, record_time,
updated_at, rec_status is_alarm, created_at, updated_at, rec_status
</sql> </sql>
<select id="selectByExample" parameterType="com.ccsens.logistics.bean.po.LogisticsEnvironmentRecordExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="com.ccsens.logistics.bean.po.LogisticsEnvironmentRecordExample" resultMap="BaseResultMap">
select select
@ -107,13 +108,13 @@
</delete> </delete>
<insert id="insert" parameterType="com.ccsens.logistics.bean.po.LogisticsEnvironmentRecord"> <insert id="insert" parameterType="com.ccsens.logistics.bean.po.LogisticsEnvironmentRecord">
insert into t_logistics_environment_record (id, num_value, num_type, insert into t_logistics_environment_record (id, num_value, num_type,
equipment_id, warehouse_id, record_time, equipment_id, warehouse_id, equipment_num,
is_alarm, created_at, updated_at, record_time, is_alarm, created_at,
rec_status) updated_at, rec_status)
values (#{id,jdbcType=BIGINT}, #{numValue,jdbcType=DECIMAL}, #{numType,jdbcType=TINYINT}, values (#{id,jdbcType=BIGINT}, #{numValue,jdbcType=DECIMAL}, #{numType,jdbcType=TINYINT},
#{equipmentId,jdbcType=BIGINT}, #{warehouseId,jdbcType=BIGINT}, #{recordTime,jdbcType=BIGINT}, #{equipmentId,jdbcType=BIGINT}, #{warehouseId,jdbcType=BIGINT}, #{equipmentNum,jdbcType=VARCHAR},
#{isAlarm,jdbcType=TINYINT}, #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recordTime,jdbcType=BIGINT}, #{isAlarm,jdbcType=TINYINT}, #{createdAt,jdbcType=TIMESTAMP},
#{recStatus,jdbcType=TINYINT}) #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT})
</insert> </insert>
<insert id="insertSelective" parameterType="com.ccsens.logistics.bean.po.LogisticsEnvironmentRecord"> <insert id="insertSelective" parameterType="com.ccsens.logistics.bean.po.LogisticsEnvironmentRecord">
insert into t_logistics_environment_record insert into t_logistics_environment_record
@ -133,6 +134,9 @@
<if test="warehouseId != null"> <if test="warehouseId != null">
warehouse_id, warehouse_id,
</if> </if>
<if test="equipmentNum != null">
equipment_num,
</if>
<if test="recordTime != null"> <if test="recordTime != null">
record_time, record_time,
</if> </if>
@ -165,6 +169,9 @@
<if test="warehouseId != null"> <if test="warehouseId != null">
#{warehouseId,jdbcType=BIGINT}, #{warehouseId,jdbcType=BIGINT},
</if> </if>
<if test="equipmentNum != null">
#{equipmentNum,jdbcType=VARCHAR},
</if>
<if test="recordTime != null"> <if test="recordTime != null">
#{recordTime,jdbcType=BIGINT}, #{recordTime,jdbcType=BIGINT},
</if> </if>
@ -206,6 +213,9 @@
<if test="record.warehouseId != null"> <if test="record.warehouseId != null">
warehouse_id = #{record.warehouseId,jdbcType=BIGINT}, warehouse_id = #{record.warehouseId,jdbcType=BIGINT},
</if> </if>
<if test="record.equipmentNum != null">
equipment_num = #{record.equipmentNum,jdbcType=VARCHAR},
</if>
<if test="record.recordTime != null"> <if test="record.recordTime != null">
record_time = #{record.recordTime,jdbcType=BIGINT}, record_time = #{record.recordTime,jdbcType=BIGINT},
</if> </if>
@ -233,6 +243,7 @@
num_type = #{record.numType,jdbcType=TINYINT}, num_type = #{record.numType,jdbcType=TINYINT},
equipment_id = #{record.equipmentId,jdbcType=BIGINT}, equipment_id = #{record.equipmentId,jdbcType=BIGINT},
warehouse_id = #{record.warehouseId,jdbcType=BIGINT}, warehouse_id = #{record.warehouseId,jdbcType=BIGINT},
equipment_num = #{record.equipmentNum,jdbcType=VARCHAR},
record_time = #{record.recordTime,jdbcType=BIGINT}, record_time = #{record.recordTime,jdbcType=BIGINT},
is_alarm = #{record.isAlarm,jdbcType=TINYINT}, is_alarm = #{record.isAlarm,jdbcType=TINYINT},
created_at = #{record.createdAt,jdbcType=TIMESTAMP}, created_at = #{record.createdAt,jdbcType=TIMESTAMP},
@ -257,6 +268,9 @@
<if test="warehouseId != null"> <if test="warehouseId != null">
warehouse_id = #{warehouseId,jdbcType=BIGINT}, warehouse_id = #{warehouseId,jdbcType=BIGINT},
</if> </if>
<if test="equipmentNum != null">
equipment_num = #{equipmentNum,jdbcType=VARCHAR},
</if>
<if test="recordTime != null"> <if test="recordTime != null">
record_time = #{recordTime,jdbcType=BIGINT}, record_time = #{recordTime,jdbcType=BIGINT},
</if> </if>
@ -281,6 +295,7 @@
num_type = #{numType,jdbcType=TINYINT}, num_type = #{numType,jdbcType=TINYINT},
equipment_id = #{equipmentId,jdbcType=BIGINT}, equipment_id = #{equipmentId,jdbcType=BIGINT},
warehouse_id = #{warehouseId,jdbcType=BIGINT}, warehouse_id = #{warehouseId,jdbcType=BIGINT},
equipment_num = #{equipmentNum,jdbcType=VARCHAR},
record_time = #{recordTime,jdbcType=BIGINT}, record_time = #{recordTime,jdbcType=BIGINT},
is_alarm = #{isAlarm,jdbcType=TINYINT}, is_alarm = #{isAlarm,jdbcType=TINYINT},
created_at = #{createdAt,jdbcType=TIMESTAMP}, created_at = #{createdAt,jdbcType=TIMESTAMP},

27
logistics/src/main/resources/mapper_raw/LogisticsHeatImagingRecordMapper.xml

@ -11,6 +11,7 @@
<result column="record_time" jdbcType="BIGINT" property="recordTime" /> <result column="record_time" jdbcType="BIGINT" property="recordTime" />
<result column="equipment_id" jdbcType="BIGINT" property="equipmentId" /> <result column="equipment_id" jdbcType="BIGINT" property="equipmentId" />
<result column="warehouse_id" jdbcType="BIGINT" property="warehouseId" /> <result column="warehouse_id" jdbcType="BIGINT" property="warehouseId" />
<result column="equipment_num" jdbcType="VARCHAR" property="equipmentNum" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" /> <result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" /> <result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" /> <result column="rec_status" jdbcType="TINYINT" property="recStatus" />
@ -78,7 +79,7 @@
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, num_value, num_type, max_t, max_tx, max_ty, record_time, equipment_id, warehouse_id, id, num_value, num_type, max_t, max_tx, max_ty, record_time, equipment_id, warehouse_id,
created_at, updated_at, rec_status equipment_num, created_at, updated_at, rec_status
</sql> </sql>
<sql id="Blob_Column_List"> <sql id="Blob_Column_List">
image_data image_data
@ -135,13 +136,13 @@
insert into t_logistics_heat_imaging_record (id, num_value, num_type, insert into t_logistics_heat_imaging_record (id, num_value, num_type,
max_t, max_tx, max_ty, max_t, max_tx, max_ty,
record_time, equipment_id, warehouse_id, record_time, equipment_id, warehouse_id,
created_at, updated_at, rec_status, equipment_num, created_at, updated_at,
image_data) rec_status, image_data)
values (#{id,jdbcType=BIGINT}, #{numValue,jdbcType=DECIMAL}, #{numType,jdbcType=TINYINT}, values (#{id,jdbcType=BIGINT}, #{numValue,jdbcType=DECIMAL}, #{numType,jdbcType=TINYINT},
#{maxT,jdbcType=DECIMAL}, #{maxTx,jdbcType=VARCHAR}, #{maxTy,jdbcType=VARCHAR}, #{maxT,jdbcType=DECIMAL}, #{maxTx,jdbcType=VARCHAR}, #{maxTy,jdbcType=VARCHAR},
#{recordTime,jdbcType=BIGINT}, #{equipmentId,jdbcType=BIGINT}, #{warehouseId,jdbcType=BIGINT}, #{recordTime,jdbcType=BIGINT}, #{equipmentId,jdbcType=BIGINT}, #{warehouseId,jdbcType=BIGINT},
#{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}, #{equipmentNum,jdbcType=VARCHAR}, #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP},
#{imageData,jdbcType=LONGVARCHAR}) #{recStatus,jdbcType=TINYINT}, #{imageData,jdbcType=LONGVARCHAR})
</insert> </insert>
<insert id="insertSelective" parameterType="com.ccsens.logistics.bean.po.LogisticsHeatImagingRecord"> <insert id="insertSelective" parameterType="com.ccsens.logistics.bean.po.LogisticsHeatImagingRecord">
insert into t_logistics_heat_imaging_record insert into t_logistics_heat_imaging_record
@ -173,6 +174,9 @@
<if test="warehouseId != null"> <if test="warehouseId != null">
warehouse_id, warehouse_id,
</if> </if>
<if test="equipmentNum != null">
equipment_num,
</if>
<if test="createdAt != null"> <if test="createdAt != null">
created_at, created_at,
</if> </if>
@ -214,6 +218,9 @@
<if test="warehouseId != null"> <if test="warehouseId != null">
#{warehouseId,jdbcType=BIGINT}, #{warehouseId,jdbcType=BIGINT},
</if> </if>
<if test="equipmentNum != null">
#{equipmentNum,jdbcType=VARCHAR},
</if>
<if test="createdAt != null"> <if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP}, #{createdAt,jdbcType=TIMESTAMP},
</if> </if>
@ -264,6 +271,9 @@
<if test="record.warehouseId != null"> <if test="record.warehouseId != null">
warehouse_id = #{record.warehouseId,jdbcType=BIGINT}, warehouse_id = #{record.warehouseId,jdbcType=BIGINT},
</if> </if>
<if test="record.equipmentNum != null">
equipment_num = #{record.equipmentNum,jdbcType=VARCHAR},
</if>
<if test="record.createdAt != null"> <if test="record.createdAt != null">
created_at = #{record.createdAt,jdbcType=TIMESTAMP}, created_at = #{record.createdAt,jdbcType=TIMESTAMP},
</if> </if>
@ -292,6 +302,7 @@
record_time = #{record.recordTime,jdbcType=BIGINT}, record_time = #{record.recordTime,jdbcType=BIGINT},
equipment_id = #{record.equipmentId,jdbcType=BIGINT}, equipment_id = #{record.equipmentId,jdbcType=BIGINT},
warehouse_id = #{record.warehouseId,jdbcType=BIGINT}, warehouse_id = #{record.warehouseId,jdbcType=BIGINT},
equipment_num = #{record.equipmentNum,jdbcType=VARCHAR},
created_at = #{record.createdAt,jdbcType=TIMESTAMP}, created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT}, rec_status = #{record.recStatus,jdbcType=TINYINT},
@ -311,6 +322,7 @@
record_time = #{record.recordTime,jdbcType=BIGINT}, record_time = #{record.recordTime,jdbcType=BIGINT},
equipment_id = #{record.equipmentId,jdbcType=BIGINT}, equipment_id = #{record.equipmentId,jdbcType=BIGINT},
warehouse_id = #{record.warehouseId,jdbcType=BIGINT}, warehouse_id = #{record.warehouseId,jdbcType=BIGINT},
equipment_num = #{record.equipmentNum,jdbcType=VARCHAR},
created_at = #{record.createdAt,jdbcType=TIMESTAMP}, created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}, updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT} rec_status = #{record.recStatus,jdbcType=TINYINT}
@ -345,6 +357,9 @@
<if test="warehouseId != null"> <if test="warehouseId != null">
warehouse_id = #{warehouseId,jdbcType=BIGINT}, warehouse_id = #{warehouseId,jdbcType=BIGINT},
</if> </if>
<if test="equipmentNum != null">
equipment_num = #{equipmentNum,jdbcType=VARCHAR},
</if>
<if test="createdAt != null"> <if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP}, created_at = #{createdAt,jdbcType=TIMESTAMP},
</if> </if>
@ -370,6 +385,7 @@
record_time = #{recordTime,jdbcType=BIGINT}, record_time = #{recordTime,jdbcType=BIGINT},
equipment_id = #{equipmentId,jdbcType=BIGINT}, equipment_id = #{equipmentId,jdbcType=BIGINT},
warehouse_id = #{warehouseId,jdbcType=BIGINT}, warehouse_id = #{warehouseId,jdbcType=BIGINT},
equipment_num = #{equipmentNum,jdbcType=VARCHAR},
created_at = #{createdAt,jdbcType=TIMESTAMP}, created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP}, updated_at = #{updatedAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT}, rec_status = #{recStatus,jdbcType=TINYINT},
@ -386,6 +402,7 @@
record_time = #{recordTime,jdbcType=BIGINT}, record_time = #{recordTime,jdbcType=BIGINT},
equipment_id = #{equipmentId,jdbcType=BIGINT}, equipment_id = #{equipmentId,jdbcType=BIGINT},
warehouse_id = #{warehouseId,jdbcType=BIGINT}, warehouse_id = #{warehouseId,jdbcType=BIGINT},
equipment_num = #{equipmentNum,jdbcType=VARCHAR},
created_at = #{createdAt,jdbcType=TIMESTAMP}, created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP}, updated_at = #{updatedAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT} rec_status = #{recStatus,jdbcType=TINYINT}

Loading…
Cancel
Save