1.正式检测-检测树
This commit is contained in:
@@ -19,7 +19,8 @@ public interface AdHarmonicService extends IService<AdHarmonicResult> {
|
||||
* @param index 序号列表
|
||||
* @param deviceId 设备ID
|
||||
* @param chnNum 通道号,从1开始
|
||||
* @param code 计划code
|
||||
* @return 谐波结果
|
||||
*/
|
||||
List<AdBaseResult> get(String scriptId, List<Integer> index, String deviceId, String chnNum);
|
||||
List<AdBaseResult> get(String scriptId, List<Integer> index, String deviceId, String chnNum,Integer code);
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ public interface AdNonHarmonicService extends IService<AdNonHarmonicResult> {
|
||||
* @param chnNum 通道号,从1开始
|
||||
* @return 非谐波结果
|
||||
*/
|
||||
List<AdBaseResult> get(String scriptId, List<Integer> index, String deviceId, String chnNum);
|
||||
List<AdBaseResult> get(String scriptId, List<Integer> index, String deviceId, String chnNum,Integer code);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package com.njcn.gather.storage.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.njcn.db.mybatisplus.handler.DynamicTableNameHandler;
|
||||
import com.njcn.gather.storage.mapper.AdHarmonicMappper;
|
||||
import com.njcn.gather.storage.pojo.po.AdBaseResult;
|
||||
import com.njcn.gather.storage.pojo.po.AdHarmonicResult;
|
||||
@@ -19,7 +21,9 @@ import java.util.List;
|
||||
@Service
|
||||
public class AdHarmonicServiceImpl extends ServiceImpl<AdHarmonicMappper, AdHarmonicResult> implements AdHarmonicService {
|
||||
@Override
|
||||
public List<AdBaseResult> get(String scriptId, List<Integer> index, String deviceId, String chnNum) {
|
||||
public List<AdBaseResult> get(String scriptId, List<Integer> index, String deviceId, String chnNum,Integer code ) {
|
||||
String prefix = "ad_harmonic_result_";
|
||||
DynamicTableNameHandler.setTableName(prefix +code);
|
||||
MPJLambdaWrapper<AdHarmonicResult> wrapper = new MPJLambdaWrapper<>();
|
||||
String monitorId = deviceId + "_" + chnNum;
|
||||
if ("-1".equals(chnNum)) {
|
||||
@@ -27,8 +31,9 @@ public class AdHarmonicServiceImpl extends ServiceImpl<AdHarmonicMappper, AdHarm
|
||||
}
|
||||
wrapper.like(AdHarmonicResult::getMonitorId, monitorId)
|
||||
.eq(ObjectUtil.isNotNull(scriptId), AdHarmonicResult::getScriptId, scriptId)
|
||||
.in(ObjectUtil.isNotEmpty(index), AdHarmonicResult::getIndex, index);
|
||||
.in(CollUtil.isNotEmpty(index), AdHarmonicResult::getIndex, index);
|
||||
List<AdHarmonicResult> list = this.getBaseMapper().selectJoinList(AdHarmonicResult.class, wrapper);
|
||||
DynamicTableNameHandler.remove();
|
||||
return BeanUtil.copyToList(list, AdBaseResult.class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package com.njcn.gather.storage.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.njcn.db.mybatisplus.handler.DynamicTableNameHandler;
|
||||
import com.njcn.gather.storage.mapper.AdNonHarmonicMapper;
|
||||
import com.njcn.gather.storage.pojo.po.AdBaseResult;
|
||||
import com.njcn.gather.storage.pojo.po.AdNonHarmonicResult;
|
||||
@@ -19,7 +21,10 @@ import java.util.List;
|
||||
public class AdNonHarmonicServiceImpl extends ServiceImpl<AdNonHarmonicMapper, AdNonHarmonicResult> implements AdNonHarmonicService {
|
||||
|
||||
@Override
|
||||
public List<AdBaseResult> get(String scriptId, List<Integer> index, String deviceId, String chnNum) {
|
||||
public List<AdBaseResult> get(String scriptId, List<Integer> index, String deviceId, String chnNum, Integer code) {
|
||||
String prefix = "ad_non_harmonic_result_";
|
||||
DynamicTableNameHandler.setTableName(prefix + code);
|
||||
|
||||
MPJLambdaWrapper<AdNonHarmonicResult> wrapper = new MPJLambdaWrapper<>();
|
||||
String monitorId = deviceId + "_" + chnNum;
|
||||
if ("-1".equals(chnNum)) {
|
||||
@@ -27,8 +32,9 @@ public class AdNonHarmonicServiceImpl extends ServiceImpl<AdNonHarmonicMapper, A
|
||||
}
|
||||
wrapper.like(AdNonHarmonicResult::getMonitorId, monitorId)
|
||||
.eq(ObjectUtil.isNotNull(scriptId), AdNonHarmonicResult::getScriptId, scriptId)
|
||||
.in(ObjectUtil.isNotEmpty(index), AdNonHarmonicResult::getIndex, index);
|
||||
.in(CollUtil.isNotEmpty(index), AdNonHarmonicResult::getIndex, index);
|
||||
List<AdNonHarmonicResult> list = this.getBaseMapper().selectJoinList(AdNonHarmonicResult.class, wrapper);
|
||||
DynamicTableNameHandler.remove();
|
||||
return BeanUtil.copyToList(list, AdBaseResult.class);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user