Commit 9a8a367e authored by zhuangzhuang's avatar zhuangzhuang

5.8---修改监听checkIn的bug

parent 4584cd21
...@@ -15,7 +15,9 @@ import org.eclipse.paho.client.mqttv3.*; ...@@ -15,7 +15,9 @@ import org.eclipse.paho.client.mqttv3.*;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.concurrent.Callable; import java.util.concurrent.Callable;
...@@ -33,31 +35,39 @@ public class GWConfigWorker implements Callable<String>, MqttCallback { ...@@ -33,31 +35,39 @@ public class GWConfigWorker implements Callable<String>, MqttCallback {
private Logger logger = LoggerFactory.getLogger(this.getClass()); private Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired
private ConfigService configService;
private static final int INIT_DELAY_DEFAULT = 1000; // unit:ms private static final int INIT_DELAY_DEFAULT = 1000; // unit:ms
private static final int SCH_PERIOD_DEFAULT = 10 * INIT_DELAY_DEFAULT; // unit:ms private static final int SCH_PERIOD_DEFAULT = 10 * INIT_DELAY_DEFAULT; // unit:ms
private static final String PUB_TOPIC = "/Config"; private static final String PUB_TOPIC = "/Config";
private static final String SUB_TOPIC = "/Config/Resp"; private static final String SUB_TOPIC = "/Config/Resp";
private String SN; private String SN;
private String Type; private String Type;
private Boolean NeedResp = false; private Boolean NeedResp = false;
private String Device; private String Device;
private String ConfigCMD;//发送的数据 private String ConfigCMD;//发送的数据
private ConfigService configService;
private String ConfigTopic;//发送的主题 private String ConfigTopic;//发送的主题
private String RespTopic;//返回的主题 private String RespTopic;//返回的主题
private String ret_data=null; private String ret_data=null;
private MqttTemlateAsync mqttAsyncClient; private MqttTemlateAsync mqttAsyncClient;
private Gson gson = new Gson();
private ScheduledExecutorService mReconnectScheduler; private ScheduledExecutorService mReconnectScheduler;
private Gson gson = new Gson();
private long mInitDelay = INIT_DELAY_DEFAULT; private long mInitDelay = INIT_DELAY_DEFAULT;
private long mSchedulePeriod = SCH_PERIOD_DEFAULT; private long mSchedulePeriod = SCH_PERIOD_DEFAULT;
...@@ -84,11 +94,12 @@ public class GWConfigWorker implements Callable<String>, MqttCallback { ...@@ -84,11 +94,12 @@ public class GWConfigWorker implements Callable<String>, MqttCallback {
this.clientpwd = mclientpwd; this.clientpwd = mclientpwd;
} }
public GWConfigWorker(String type,String SN, String CMD,Boolean flag) throws Exception{ public GWConfigWorker(String type,String SN, String CMD,ConfigService configService,Boolean flag) throws Exception{
this.SN = SN; this.SN = SN;
this.Type = type; this.Type = type;
this.Device = Type + "_" + SN; this.Device = Type + "_" + SN;
this.ConfigCMD = CMD; this.ConfigCMD = CMD;
this.configService = configService;
this.NeedResp = flag; this.NeedResp = flag;
this.ConfigTopic = "TDL/" + Type + "/" + SN + PUB_TOPIC; this.ConfigTopic = "TDL/" + Type + "/" + SN + PUB_TOPIC;
this.RespTopic = "TDL/" + Type + "/" + SN + SUB_TOPIC; this.RespTopic = "TDL/" + Type + "/" + SN + SUB_TOPIC;
...@@ -183,11 +194,11 @@ public class GWConfigWorker implements Callable<String>, MqttCallback { ...@@ -183,11 +194,11 @@ public class GWConfigWorker implements Callable<String>, MqttCallback {
RespVo respVo = new Gson().fromJson(Message,RespVo.class); RespVo respVo = new Gson().fromJson(Message,RespVo.class);
if(respVo.getResponse().equals("config")){ if(respVo.getResponse().equals("config")){
//配置回复 //配置回复
configService.bindiSuccess(SN,Type,respVo.getStatus()); int i= configService.bindSuccess(SN,Type,respVo.getStatus());
}else if(respVo.getResponse().equals("end")){ }else if(respVo.getResponse().equals("end")){
//解绑回复 //解绑回复
if(respVo.getStatus() ==0 || respVo.getStatus() == 1){ if(respVo.getStatus() ==0 || respVo.getStatus() == 1){
configService.delConfig(SN,Type); int i = configService.delConfig(SN,Type);
} }
} }
if(NeedResp){ if(NeedResp){
......
...@@ -129,7 +129,7 @@ public class MqttTemlateAsync extends MqttAsyncClient { ...@@ -129,7 +129,7 @@ public class MqttTemlateAsync extends MqttAsyncClient {
String str = "witium"; String str = "witium";
char[] bm; char[] bm;
MqttConnectOptions mqttConnectOptions = new MqttConnectOptions(); MqttConnectOptions mqttConnectOptions = new MqttConnectOptions();
mqttConnectOptions.setCleanSession(true); mqttConnectOptions.setCleanSession(false);
mqttConnectOptions.setUserName("test"); mqttConnectOptions.setUserName("test");
bm = str.toCharArray(); bm = str.toCharArray();
mqttConnectOptions.setPassword(bm); mqttConnectOptions.setPassword(bm);
...@@ -140,7 +140,7 @@ public class MqttTemlateAsync extends MqttAsyncClient { ...@@ -140,7 +140,7 @@ public class MqttTemlateAsync extends MqttAsyncClient {
/* For raw tcp only */ /* For raw tcp only */
public static MqttConnectOptions setOptions(String username, String pwd){ public static MqttConnectOptions setOptions(String username, String pwd){
MqttConnectOptions mqttConnectOptions = new MqttConnectOptions(); MqttConnectOptions mqttConnectOptions = new MqttConnectOptions();
mqttConnectOptions.setCleanSession(true); mqttConnectOptions.setCleanSession(false);
mqttConnectOptions.setUserName(username); mqttConnectOptions.setUserName(username);
mqttConnectOptions.setPassword(pwd.toCharArray()); mqttConnectOptions.setPassword(pwd.toCharArray());
mqttConnectOptions.setAutomaticReconnect(true); // enable auto reconnect. mqttConnectOptions.setAutomaticReconnect(true); // enable auto reconnect.
...@@ -160,7 +160,7 @@ public class MqttTemlateAsync extends MqttAsyncClient { ...@@ -160,7 +160,7 @@ public class MqttTemlateAsync extends MqttAsyncClient {
} }
mqttConnectOptions.setSocketFactory(sslFactory); mqttConnectOptions.setSocketFactory(sslFactory);
mqttConnectOptions.setCleanSession(true); mqttConnectOptions.setCleanSession(false);
mqttConnectOptions.setUserName(username); mqttConnectOptions.setUserName(username);
mqttConnectOptions.setPassword(pwd.toCharArray()); mqttConnectOptions.setPassword(pwd.toCharArray());
mqttConnectOptions.setAutomaticReconnect(true); // enable auto reconnect. mqttConnectOptions.setAutomaticReconnect(true); // enable auto reconnect.
......
...@@ -29,12 +29,12 @@ public class CircuitMessageVo { ...@@ -29,12 +29,12 @@ public class CircuitMessageVo {
public static class TDL { public static class TDL {
private String tdlsn; private String tdlsn;
private Double batteryVoltage; private String batteryVoltage;
public TDL() { public TDL() {
} }
public TDL(String tdlsn, Double batteryVoltage) { public TDL(String tdlsn, String batteryVoltage) {
this.tdlsn = tdlsn; this.tdlsn = tdlsn;
this.batteryVoltage = batteryVoltage; this.batteryVoltage = batteryVoltage;
} }
...@@ -47,11 +47,11 @@ public class CircuitMessageVo { ...@@ -47,11 +47,11 @@ public class CircuitMessageVo {
this.tdlsn = tdlsn; this.tdlsn = tdlsn;
} }
public Double getBatteryVoltage() { public String getBatteryVoltage() {
return batteryVoltage; return batteryVoltage;
} }
public void setBatteryVoltage(Double batteryVoltage) { public void setBatteryVoltage(String batteryVoltage) {
this.batteryVoltage = batteryVoltage; this.batteryVoltage = batteryVoltage;
} }
} }
......
...@@ -17,8 +17,9 @@ public interface ConfigMapper { ...@@ -17,8 +17,9 @@ public interface ConfigMapper {
int delConfig(@Param("gSN") String gSN,@Param("gType") String gType); int delConfig(@Param("gSN") String gSN,@Param("gType") String gType);
int bindiSuccess(@Param("gSN") String gSN,@Param("gType") String gType,@Param("resp") Integer resp); int bindSuccess(@Param("gSN") String gSN,@Param("gType") String gType,@Param("resp") Integer resp);
//int updateConfig(@Param("gSN") String gSN,@Param("gType") String gType,@Param("untie") Boolean untie); //int updateConfig(@Param("gSN") String gSN,@Param("gType") String gType,@Param("untie") Boolean untie);
int updateConfig(Map<Object,Object> map); int updateConfig(Map<Object,Object> map);
} }
...@@ -143,10 +143,10 @@ public class MqttListener implements MqttCallback { ...@@ -143,10 +143,10 @@ public class MqttListener implements MqttCallback {
public void messageArrived(String topic, MqttMessage mqttMessage) throws Exception { public void messageArrived(String topic, MqttMessage mqttMessage) throws Exception {
String Message = mqttMessage.toString(); String Message = mqttMessage.toString();
Long timestamp = System.currentTimeMillis(); Long timestamp = System.currentTimeMillis();
clearOvertimeConfig(timestamp);
String[] tmparray = topic.split("/"); String[] tmparray = topic.split("/");
String Type = tmparray[1]; String Type = tmparray[1];
String SN = tmparray[2]; String SN = tmparray[2];
clearOvertimeConfig(timestamp);
if(SN.matches("^[0-9]*$")){ if(SN.matches("^[0-9]*$")){
try { try {
Integer flag = parseData(Message,SN,Type); Integer flag = parseData(Message,SN,Type);
...@@ -159,16 +159,16 @@ public class MqttListener implements MqttCallback { ...@@ -159,16 +159,16 @@ public class MqttListener implements MqttCallback {
configCMDVo.setAction("sleep"); configCMDVo.setAction("sleep");
configCMDVo.setT(System.currentTimeMillis()/1000l); configCMDVo.setT(System.currentTimeMillis()/1000l);
ConfigData = new Gson().toJson(configCMDVo); ConfigData = new Gson().toJson(configCMDVo);
gcconfig = new GWConfigWorker(Type,SN,ConfigData, false); gcconfig = new GWConfigWorker(Type,SN,ConfigData, configService,false);
}else if(flag == 2){ }else if(flag == 2){
ConfigCMDVo configCMDVo = new ConfigCMDVo(); ConfigCMDVo configCMDVo = new ConfigCMDVo();
configCMDVo.setAction("end"); configCMDVo.setAction("end");
configCMDVo.setT(System.currentTimeMillis()/1000l); configCMDVo.setT(System.currentTimeMillis()/1000l);
ConfigData = new Gson().toJson(configCMDVo); ConfigData = new Gson().toJson(configCMDVo);
gcconfig = new GWConfigWorker(Type,SN,ConfigData, true); gcconfig = new GWConfigWorker(Type,SN,ConfigData,configService, true);
}else if(flag == 1){ }else if(flag == 1){
ConfigData = configService.getConfig(SN,Type).getMessage(); ConfigData = configService.getConfig(SN,Type).getMessage();
gcconfig = new GWConfigWorker(Type,SN,ConfigData,true); gcconfig = new GWConfigWorker(Type,SN,ConfigData,configService,true);
} }
gcconfig.SetMqttConfig(mqttconfig.getUrl(),mqttconfig.getPort(), gcconfig.SetMqttConfig(mqttconfig.getUrl(),mqttconfig.getPort(),
mqttconfig.getUsername(), mqttconfig.getPassword(),mqttconfig.getQos(), mqttconfig.getUsername(), mqttconfig.getPassword(),mqttconfig.getQos(),
...@@ -198,21 +198,22 @@ public class MqttListener implements MqttCallback { ...@@ -198,21 +198,22 @@ public class MqttListener implements MqttCallback {
} }
//checkIn数据解析,true即发送休眠信息;false发送config信息 //checkIn数据解析
public Integer parseData(String message,String SN,String Type){ public Integer parseData(String message,String SN,String Type){
ConfigVo configVo = configService.getConfig(SN,Type);
//网关不存在
if(configVo == null){
return 0;//休眠
}
if(StringUtils.isEmpty(configVo.getMessage())) {//未绑定tdl
return 0;//休眠
}
CheckInVo checkInVo = new Gson().fromJson(message,CheckInVo.class); CheckInVo checkInVo = new Gson().fromJson(message,CheckInVo.class);
if(StringUtils.isEmpty(checkInVo.getDevList()==null ? "" :checkInVo.getDevList().toString())){ if(checkInVo.getDevList().size()==0){
return 1;//重发 return 1;//重发
} }
// 有设备信息 if(configVo.getUntie() && StringUtils.isEmpty(configVo.getMessage()) ){
ConfigVo configVo = configService.getConfig(SN,Type); return 2;//解绑
if(configVo != null){
if(StringUtils.isEmpty(configVo.getMessage())){
//解绑状态
return 2;//解绑
}
}else{
return 0;
} }
ConfigCMDVo configCMDVo = new Gson().fromJson(configVo.getMessage(),ConfigCMDVo.class); ConfigCMDVo configCMDVo = new Gson().fromJson(configVo.getMessage(),ConfigCMDVo.class);
//判断两者的devList是否一致 //判断两者的devList是否一致
...@@ -222,7 +223,7 @@ public class MqttListener implements MqttCallback { ...@@ -222,7 +223,7 @@ public class MqttListener implements MqttCallback {
&& checkInVo.getGpsPeriod().equals(configCMDVo.getGpsPeriod()) && checkInVo.getGpsPeriod().equals(configCMDVo.getGpsPeriod())
&& checkInVo.getMode().equals(configCMDVo.getMode())) { && checkInVo.getMode().equals(configCMDVo.getMode())) {
//一致 //一致
return 0;//发送休眠信息 return 0;//休眠
} else { } else {
//不一致 //不一致
return 1;//重发 return 1;//重发
......
...@@ -29,8 +29,8 @@ public class ConfigService { ...@@ -29,8 +29,8 @@ public class ConfigService {
} }
//绑定成功 //绑定成功
public int bindiSuccess(String gSN,String gType,Integer resp){ public int bindSuccess(String gSN,String gType,Integer resp){
return configMapper.bindiSuccess(gSN,gType,resp); return configMapper.bindSuccess(gSN,gType,resp);
} }
//解绑getWay和tdl //解绑getWay和tdl
......
...@@ -14,7 +14,6 @@ import io.swagger.annotations.ApiImplicitParam; ...@@ -14,7 +14,6 @@ import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.jdbc.Null;
import org.influxdb.dto.Query; import org.influxdb.dto.Query;
import org.influxdb.dto.QueryResult; import org.influxdb.dto.QueryResult;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -28,7 +27,6 @@ import javax.servlet.http.HttpServletRequest; ...@@ -28,7 +27,6 @@ import javax.servlet.http.HttpServletRequest;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.concurrent.Callable;
@RestController @RestController
@RequestMapping("/circuit") @RequestMapping("/circuit")
...@@ -343,7 +341,7 @@ public class CircuitController { ...@@ -343,7 +341,7 @@ public class CircuitController {
fb.setMessage("途径地不能超过3个"); fb.setMessage("途径地不能超过3个");
return gson.toJson(fb); return gson.toJson(fb);
} }
for(int i =0;i<addCircuitVo.getAddressVoList().size();i++){ for(int i =0,length=addCircuitVo.getAddressVoList().size();i<length;i++){
if(StringUtils.isEmpty(addCircuitVo.getAddressVoList().get(i).getCountry())){ if(StringUtils.isEmpty(addCircuitVo.getAddressVoList().get(i).getCountry())){
fb.setCode(0); fb.setCode(0);
fb.setMessage("途径地国家不能为空"); fb.setMessage("途径地国家不能为空");
...@@ -491,8 +489,14 @@ public class CircuitController { ...@@ -491,8 +489,14 @@ public class CircuitController {
fb.setMessage("该网关序不存在"); fb.setMessage("该网关序不存在");
return gson.toJson(fb); return gson.toJson(fb);
} }
ResultGatewayVo resultGatewayVo = gatewayService.getBySNAndType(addCircuitVo.getSN(),type);
if(!resultGatewayVo.getState()){
fb.setCode(0);
fb.setMessage("该网关为挂载");
return gson.toJson(fb);
}
//获取gateway的场景 //获取gateway的场景
if(gatewayService.getBySNAndType(addCircuitVo.getSN(),type).getUseScene()== 2){ if(resultGatewayVo.getUseScene()== 2){
fb.setCode(0); fb.setCode(0);
fb.setMessage("该网关的使用场景与当前不符"); fb.setMessage("该网关的使用场景与当前不符");
return gson.toJson(fb); return gson.toJson(fb);
...@@ -500,7 +504,7 @@ public class CircuitController { ...@@ -500,7 +504,7 @@ public class CircuitController {
String alarmTypeVar=""; String alarmTypeVar="";
String TDLSNVar=""; String TDLSNVar="";
List<String> devList = tdlDeviceService.getByGatewaySN(addCircuitVo.getSN(),type); List<String> devList = tdlDeviceService.getByGatewaySN(addCircuitVo.getSN(),type);
for(int j = 0;j<addCircuitVo.getTdlAlarmList().size();j++){ for(int j = 0,length =addCircuitVo.getTdlAlarmList().size();j<length;j++){
if(StringUtils.isEmpty(addCircuitVo.getTdlAlarmList().get(j).getTDLSN())){ if(StringUtils.isEmpty(addCircuitVo.getTdlAlarmList().get(j).getTDLSN())){
fb.setCode(0); fb.setCode(0);
fb.setMessage("tag序列号不能为空"); fb.setMessage("tag序列号不能为空");
...@@ -1188,33 +1192,36 @@ public class CircuitController { ...@@ -1188,33 +1192,36 @@ public class CircuitController {
List<CircuitMessageVo.TDL> tdlList = new ArrayList<>(); List<CircuitMessageVo.TDL> tdlList = new ArrayList<>();
for(int i=0;i<TDL.size();i++){ for(int i=0;i<TDL.size();i++){
CircuitMessageVo.TDL tdl = new CircuitMessageVo.TDL(); CircuitMessageVo.TDL tdl = new CircuitMessageVo.TDL();
String sql =""; tdl.setTdlsn(TDL.get(i).replace("TDL-", "").trim());
if(circuitVo.getEndTime() !=null && circuitVo.getEndTime()!=0){ if(circuitVo.getStartTime() == null || circuitVo.getStartTime() == 0){
sql = "SELECT \"b\" FROM \"tdl_policy\".\""+gatewayVo.getgType()+"_"+gatewayVo.getgSN()+"\" where \"tdl\"='"+TDL.get(i)+"' and time >="+circuitVo.getStartTime() + " and time<="+circuitVo.getEndTime() *1000000l+" ORDER BY time desc limit 1" ; tdl.setBatteryVoltage("");
}else{ }else {
sql = "SELECT \"b\" FROM \"tdl_policy\".\""+gatewayVo.getgType()+"_"+gatewayVo.getgSN()+"\" where \"tdl\"='"+TDL.get(i)+"' and time >="+circuitVo.getStartTime() +" ORDER BY time desc limit 1"; String sql ="";
} if (circuitVo.getEndTime() != null && circuitVo.getEndTime() != 0) {
QueryResult queryResult = influxDBTemplate.query(new Query(sql,database)); sql = "SELECT \"b\" FROM \"tdl_policy\".\"" + gatewayVo.getgType() + "_" + gatewayVo.getgSN() + "\" where \"tdl\"='" + TDL.get(i) + "' and time >=" + circuitVo.getStartTime() + " and time<=" + circuitVo.getEndTime() * 1000000l + " ORDER BY time desc limit 1";
if(queryResult == null){ } else {
fb.setCode(0); sql = "SELECT \"b\" FROM \"tdl_policy\".\"" + gatewayVo.getgType() + "_" + gatewayVo.getgSN() + "\" where \"tdl\"='" + TDL.get(i) + "' and time >=" + circuitVo.getStartTime() + " ORDER BY time desc limit 1";
fb.setMessage("该线路不存在"); }
return gson.toJson(fb); QueryResult queryResult = influxDBTemplate.query(new Query(sql, database));
if (queryResult.getResults().get(0).getSeries() == null) {
tdl.setBatteryVoltage("");
}else{
DecimalFormat df = new DecimalFormat("######0.0");
String value = queryResult.getResults().get(0).getSeries().get(0).getValues().get(0).get(1) == null ? "" : queryResult.getResults().get(0).getSeries().get(0).getValues().get(0).get(1).toString();
tdl.setBatteryVoltage(df.format(Double.valueOf(value)));
}
} }
tdl.setTdlsn(TDL.get(i).replace("TDL-","").trim());
DecimalFormat df = new DecimalFormat("######0.0");
String value = queryResult.getResults().get(0).getSeries().get(0).getValues().get(0).get(1) ==null ? "" :queryResult.getResults().get(0).getSeries().get(0).getValues().get(0).get(1).toString();
tdl.setBatteryVoltage(Double.valueOf(df.format(Double.valueOf(value))));
tdlList.add(tdl); tdlList.add(tdl);
} }
messageVo.setTdlList(tdlList); messageVo.setTdlList(tdlList);
//获取线路情况 //获取线路情况
List<CircuitTransferVo> list =circuitTransferService.getCity(transportationNo); List<CircuitTransferVo> list =circuitTransferService.getCity(transportationNo);
List<ResultCityVo> cityVoList = new ArrayList<>();
if(list == null){ if(list == null){
fb.setCode(0); fb.setCode(0);
fb.setMessage("该线路不存在"); fb.setMessage("该线路不存在");
return gson.toJson(fb); return gson.toJson(fb);
} }
List<ResultCityVo> cityVoList = new ArrayList<>();
for (int i = 0; i < list.size(); i++) { for (int i = 0; i < list.size(); i++) {
if (list.get(i).getSequence() == 1) { if (list.get(i).getSequence() == 1) {
ResultCityVo cityVo = new ResultCityVo(); ResultCityVo cityVo = new ResultCityVo();
...@@ -1356,7 +1363,7 @@ public class CircuitController { ...@@ -1356,7 +1363,7 @@ public class CircuitController {
msg.put("msg",map.get("msg")); msg.put("msg",map.get("msg"));
if (msg.get("msg").equals("修改成功")){ if (msg.get("msg").equals("修改成功")){
fb.setCode(1); fb.setCode(1);
fb.setMessage("添加线路成功"); fb.setMessage("线路开始运输");
}else { }else {
fb.setCode(0); fb.setCode(0);
fb.setMessage(msg.get("msg").toString()); fb.setMessage(msg.get("msg").toString());
......
...@@ -86,7 +86,7 @@ public class GatewayController { ...@@ -86,7 +86,7 @@ public class GatewayController {
fb.setMessage("gateway编号不能为空"); fb.setMessage("gateway编号不能为空");
return gson.toJson(fb); return gson.toJson(fb);
} }
if(addGatewayVo.getSN().matches("^[0-9]{8}$")){ if(!addGatewayVo.getSN().matches("^[0-9]{8}$")){
fb.setCode(0); fb.setCode(0);
fb.setMessage("gateway编号必须是数字"); fb.setMessage("gateway编号必须是数字");
return gson.toJson(fb); return gson.toJson(fb);
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
</select> </select>
<!--绑定回复--> <!--绑定回复-->
<update id="bindiSuccess"> <update id="bindSuccess">
update config set resp=#{resp,jdbcType=INTEGER} update config set resp=#{resp,jdbcType=INTEGER}
where gSN= #{gSN,jdbcType=VARCHAR} where gSN= #{gSN,jdbcType=VARCHAR}
and gType=#{gType,jdbcType=VARCHAR} and gType=#{gType,jdbcType=VARCHAR}
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
<!--解绑成功--> <!--解绑成功-->
<update id="delConfig" parameterType="String"> <update id="delConfig" parameterType="String">
update config set state = 0 update config set untie = 0
where gSN= #{gSN,jdbcType=VARCHAR} where gSN= #{gSN,jdbcType=VARCHAR}
and gType=#{gType,jdbcType=VARCHAR} and gType=#{gType,jdbcType=VARCHAR}
and state = 1; and state = 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment