|
|
@@ -2257,7 +2257,11 @@ public class MESHelperServiceImpl implements MESHelperService {
|
|
|
List<String> sqls = new ArrayList<>();
|
|
|
List<MainSeatDeviceState> states = device.getDataList();
|
|
|
for(MainSeatDeviceState state : states){
|
|
|
- sqls.add(state.toSqlString());
|
|
|
+ //如果对应的ID数据已经存在则不插入
|
|
|
+ Integer cn = baseDao.getJdbcTemplate().queryForObject("select count(1) from MainSeatDeviceState where id=?",Integer.class,state.getId());
|
|
|
+ if(null ==cn || cn ==0) {
|
|
|
+ sqls.add(state.toSqlString());
|
|
|
+ }
|
|
|
}
|
|
|
baseDao.execute(sqls);
|
|
|
rmap.put("success",true);
|
|
|
@@ -2307,7 +2311,11 @@ public class MESHelperServiceImpl implements MESHelperService {
|
|
|
List<String> sqls = new ArrayList<>();
|
|
|
List<MainMachineDeviceState> states = device.getDataList();
|
|
|
for(MainMachineDeviceState state : states){
|
|
|
- sqls.add(state.toSqlString());
|
|
|
+ //如果对应的ID数据已经存在则不插入
|
|
|
+ Integer cn = baseDao.getJdbcTemplate().queryForObject("select count(1) from MainMachineDeviceState where id=?",Integer.class,state.getId());
|
|
|
+ if(null ==cn || cn ==0) {
|
|
|
+ sqls.add(state.toSqlString());
|
|
|
+ }
|
|
|
}
|
|
|
baseDao.execute(sqls);
|
|
|
rmap.put("success",true);
|
|
|
@@ -2357,7 +2365,11 @@ public class MESHelperServiceImpl implements MESHelperService {
|
|
|
List<String> sqls = new ArrayList<>();
|
|
|
List<MainCushionDeviceState> states = device.getDataList();
|
|
|
for(MainCushionDeviceState state : states){
|
|
|
- sqls.add(state.toSqlString());
|
|
|
+ //如果对应的ID数据已经存在则不插入
|
|
|
+ Integer cn = baseDao.getJdbcTemplate().queryForObject("select count(1) from MainCushionDeviceState where id=?",Integer.class,state.getId());
|
|
|
+ if(null ==cn || cn ==0) {
|
|
|
+ sqls.add(state.toSqlString());
|
|
|
+ }
|
|
|
}
|
|
|
baseDao.execute(sqls);
|
|
|
rmap.put("success",true);
|