提交 ae60af2d authored 作者: Phyday's avatar Phyday

接入部分实时监控

上级 d3c70ef5
package com.elephant.framework.galaxy.aroad.module.szgl.controller;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.elephant.framework.galaxy.aroad.response.R;
import com.elephant.framework.galaxy.aroad.module.common.annotation.SysLog;
import com.elephant.framework.galaxy.aroad.module.szgl.entity.SpdwVideo;
import com.elephant.framework.galaxy.aroad.module.szgl.service.SpdwVideoService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
import com.elephant.framework.galaxy.aroad.module.common.controller.BaseController;
import java.net.URLDecoder;
import java.net.URLEncoder;
/**
* 实时监控_日照
*
* @author Xingyuyang
* @date 2019-06-03 18:15:02
*/
@RestController
@AllArgsConstructor
@RequestMapping("/szgl/spdwvideo")
public class SpdwVideoController extends BaseController {
private final SpdwVideoService spdwVideoService;
/**
* 分页查询
* @param page 分页对象
* @param spdwVideo 实时监控_日照
* @return
*/
@GetMapping("/page")
public R getSpdwVideoPage(Page page, SpdwVideo spdwVideo) {
return new R<>(spdwVideoService.page(page,Wrappers.query(spdwVideo)));
}
/**
* 通过监控名称查询实时监控_日照
* @param spname string
* @return R
*/
@GetMapping("/rzbyname")
public R RZByName(@RequestParam("spname") String spname){
return new R<> (spdwVideoService.RZByName(spname));
}
}
package com.elephant.framework.galaxy.aroad.module.szgl.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* 实时监控_日照
*
* @author Xingyuyang
* @date 2019-06-03 18:15:02
*/
@Data
@TableName("spdw_video")
@EqualsAndHashCode(callSuper = true)
public class SpdwVideo extends Model<SpdwVideo> {
private static final long serialVersionUID = 1L;
/**
*
*/
@TableId
private String city;
/**
*
*/
private String area;
/**
*
*/
private String spName;
/**
*
*/
private String spAddress;
}
package com.elephant.framework.galaxy.aroad.module.szgl.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.elephant.framework.galaxy.aroad.module.szgl.entity.SpdwVideo;
import org.apache.ibatis.annotations.Param;
/**
* 实时监控_日照
*
* @author Xingyuyang
* @date 2019-06-03 18:15:02
*/
public interface SpdwVideoMapper extends BaseMapper<SpdwVideo> {
String RZByName(@Param("spname") String spname);
}
package com.elephant.framework.galaxy.aroad.module.szgl.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.elephant.framework.galaxy.aroad.module.szgl.entity.SpdwVideo;
/**
* 实时监控_日照
*
* @author Xingyuyang
* @date 2019-06-03 18:15:02
*/
public interface SpdwVideoService extends IService<SpdwVideo> {
String RZByName(String spname);
}
package com.elephant.framework.galaxy.aroad.module.szgl.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.elephant.framework.galaxy.aroad.module.szgl.entity.SpdwVideo;
import com.elephant.framework.galaxy.aroad.module.szgl.mapper.SpdwVideoMapper;
import com.elephant.framework.galaxy.aroad.module.szgl.service.SpdwVideoService;
import org.springframework.stereotype.Service;
/**
* 实时监控_日照
*
* @author Xingyuyang
* @date 2019-06-03 18:15:02
*/
@Service
public class SpdwVideoServiceImpl extends ServiceImpl<SpdwVideoMapper, SpdwVideo> implements SpdwVideoService {
public String RZByName(String spname) {
return baseMapper.RZByName(spname);
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.elephant.framework.galaxy.aroad.module.szgl.mapper.SpdwVideoMapper">
<resultMap id="spdwVideoMap" type="com.elephant.framework.galaxy.aroad.module.szgl.entity.SpdwVideo">
<id property="city" column="city"/>
<result property="area" column="area"/>
<result property="spName" column="sp_name"/>
<result property="spAddress" column="sp_address"/>
</resultMap>
<select id="RZByName" resultType="String">
select sp_address from spdw_video where sp_name=#{spname}
</select>
</mapper>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论