欣影管理平台装置通道表修改

jni
18616268358 2 years ago
parent 9d850b477f
commit 59e177d50d

@ -5,6 +5,7 @@ import com.shxy.xymanager_common.base.BaseController;
import com.shxy.xymanager_common.base.ResponseReult; import com.shxy.xymanager_common.base.ResponseReult;
import com.shxy.xymanager_common.bean.ServiceBody; import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.bean.ServiceStatus; import com.shxy.xymanager_common.bean.ServiceStatus;
import com.shxy.xymanager_common.entity.TerminalPhoto;
import com.shxy.xymanager_common.model.TerminalPhotoListModel; import com.shxy.xymanager_common.model.TerminalPhotoListModel;
import com.shxy.xymanager_common.vo.TerminalAndChannelIdAndTimeVo; import com.shxy.xymanager_common.vo.TerminalAndChannelIdAndTimeVo;
import com.shxy.xymanager_common.vo.TerminalPhotoVo; import com.shxy.xymanager_common.vo.TerminalPhotoVo;
@ -19,6 +20,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@ -71,4 +73,17 @@ public class TerminalPhotoController extends BaseController {
} }
} }
@ApiOperation(value = "最新图片查询", notes = "图片查询接口", httpMethod = "POST")
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
@RequestMapping("/getReturnedPhoto")
@Log(title = "最新图片查询", type = "查询")
public ResponseReult<TerminalPhoto> getReturnedPhoto(@RequestParam("termId")String termId) {
ServiceBody<TerminalPhoto> serviceBody = terminalPhotoService.getReturnedPhoto(termId);
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
return ResponseReult.success(serviceBody.getData());
} else {
return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg());
}
}
} }

@ -23,4 +23,6 @@ public interface TerminalPhotoDao {
int updateByPrimaryKeySelective(TerminalPhoto record); int updateByPrimaryKeySelective(TerminalPhoto record);
int updateByPrimaryKey(TerminalPhoto record); int updateByPrimaryKey(TerminalPhoto record);
TerminalPhoto getLatestPhoto(@Param("termId")String termId);
} }

@ -26,6 +26,14 @@
where term_id = #{terminalid} and channel_id = #{channelid} and photo_time between #{starttime} and #{endtime} where term_id = #{terminalid} and channel_id = #{channelid} and photo_time between #{starttime} and #{endtime}
</select> </select>
<select id="getLatestPhoto" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from terminal_photos
where term_id = #{termId}
order by create_time desc limit 1
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>

@ -89,4 +89,10 @@ public class TerminalPhotoServiceImpl implements TerminalPhotoService {
return Asserts.success(hasNew); return Asserts.success(hasNew);
} }
@Override
public ServiceBody<TerminalPhoto> getReturnedPhoto(String termId) {
TerminalPhoto photo = terminalPhotoDao.getLatestPhoto(termId);
return Asserts.success(photo);
}
} }

@ -3,7 +3,16 @@ package com.shxy.xymanager_service.interaction;
public class Cma { public class Cma {
static { static {
System.load(System.getProperty("user.dir")+"\\libs\\xympj.dll"); String osName = System.getProperties().getProperty("os.name");
if(osName.equals("Linux"))
{
System.load(System.getProperty("user.dir")+"\\libs\\xympj.so");
}
else
{
System.load(System.getProperty("user.dir")+"\\libs\\xympj.dll");
}
initCmaEnv(); initCmaEnv();
} }

@ -1,6 +1,7 @@
package com.shxy.xymanager_service.service; package com.shxy.xymanager_service.service;
import com.shxy.xymanager_common.bean.ServiceBody; import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.entity.TerminalPhoto;
import com.shxy.xymanager_common.model.TerminalPhotoListModel; import com.shxy.xymanager_common.model.TerminalPhotoListModel;
import com.shxy.xymanager_common.vo.TerminalAndChannelIdAndTimeVo; import com.shxy.xymanager_common.vo.TerminalAndChannelIdAndTimeVo;
import com.shxy.xymanager_common.vo.TerminalPhotoVo; import com.shxy.xymanager_common.vo.TerminalPhotoVo;
@ -25,4 +26,12 @@ public interface TerminalPhotoService {
*/ */
ServiceBody<Boolean> getLatestPhoto(TerminalPhotoVo vo); ServiceBody<Boolean> getLatestPhoto(TerminalPhotoVo vo);
/**
* id
*
* @return
*/
ServiceBody<TerminalPhoto> getReturnedPhoto(String termId);
} }

Loading…
Cancel
Save