#20230510 欣影管理平台装置信息查询代码

master
18616268358 2 years ago
parent 4a5ac4b600
commit d0e22f05da

@ -175,7 +175,7 @@
(
SELECT path,term_id,channel_id
from terminal_photos
where id in (select max(id) from terminal_photos GROUP BY term_id,channel_id)
where id in (select max(id) from terminal_photos where media_type =1 GROUP BY term_id,channel_id)
) tp on tp.channel_id = e.id and tp.term_id = a.id )
WHERE a.status = 1
order by a.create_time desc

@ -26,6 +26,7 @@ import com.shxy.xymanager_service.service.TerminalService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -62,6 +63,10 @@ public class TerminalServiceImpl implements TerminalService {
@Autowired
DyLevelDao dyLevelDao;
@Value("${photo.address}")
private String photoaddress;
/**
*
*
@ -78,6 +83,11 @@ public class TerminalServiceImpl implements TerminalService {
if (empty) {
model.setList(new ArrayList<>());
} else {
list.forEach(var->{
var.getList().stream().forEach(line->{
line.setPath(photoaddress+line.getPath());
});
});
List<TerminalListModel.TerminalBean> beans = BeanUtil.copyToList(list, TerminalListModel.TerminalBean.class, CopyOptions.create().ignoreCase());
model.setList(beans);
}

Loading…
Cancel
Save