skjcmanager/skjcmanager-service/skjcmanager-by/src/main/java/cn/gistack/by/picUpload/mapper/BaiyiPicMapper.xml
@@ -42,7 +42,7 @@ </insert> <select id="selectMnnoBySn" resultType="XfBySnRelation"> <select id="selectMnnoBySn" resultType="cn.gistack.by.picUpload.entity.XfBySnRelation"> select "id" AS "id", "sn" AS "sn", skjcmanager/skjcmanager-service/skjcmanager-by/src/main/java/cn/gistack/by/waterdata/controller/DistanceRecordController.java
New file @@ -0,0 +1,100 @@ /* * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the dreamlu.net developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: Chill 庄骞 (smallchill@163.com) */ package cn.gistack.by.waterdata.controller; import cn.gistack.by.waterdata.pojo.entity.DistanceRecord; import cn.gistack.by.waterdata.pojo.vo.DistanceRecordVO; import cn.gistack.by.waterdata.pojo.wrapper.DistanceRecordWrapper; import cn.gistack.by.waterdata.service.api.IDistanceRecordService; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import lombok.AllArgsConstructor; import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.Func; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; /** * E0功能码数据controller. * * @author Kai.Shan * @since 2024-12-11 */ @RestController @AllArgsConstructor @RequestMapping("/distance") @Api(value = "距离", tags = "距离数据记录接口") public class DistanceRecordController extends BladeController { private final IDistanceRecordService distanceRecordService; @GetMapping("/selectonebyid") public R<DistanceRecordVO> selectOneById(@RequestParam int id) { DistanceRecord distanceRecord = distanceRecordService.selectOneById(id); return R.data(DistanceRecordWrapper.build().entityVO(distanceRecord)); } /** * DistanceRecord 详情 */ @GetMapping("/detail") @ApiOperationSupport(order = 1) @ApiOperation(value = "详情", notes = "传入DistanceRecord") public R<DistanceRecordVO> detail(DistanceRecord disntanceRecord) { DistanceRecord detail = distanceRecordService.getOne(Condition.getQueryWrapper(disntanceRecord)); return R.data(DistanceRecordWrapper.build().entityVO(detail)); } /** * DistanceRecord 分页 */ @GetMapping("/list") @ApiOperation(value = "分页", notes = "传入DistanceRecord实体对象") public R<IPage<DistanceRecordVO>> list(DistanceRecord distanceRecord, Query query) { QueryWrapper<DistanceRecord> queryWrapper = Condition.getQueryWrapper(distanceRecord); IPage<DistanceRecord> pages = distanceRecordService.page(Condition.getPage(query), queryWrapper); return R.data(DistanceRecordWrapper.build().pageVO(pages)); } /** * DistanceRecord 自定义分页 */ @GetMapping("/page") @ApiOperation(value = "分页", notes = "传入DistanceRecord VO对象") public R<IPage<DistanceRecordVO>> page(DistanceRecordVO news, Query query) { IPage<DistanceRecordVO> pages = distanceRecordService.selectDistanceRecordPage(Condition.getPage(query), news); return R.data(pages); } /** * DistanceRecord 删除 */ @PostMapping("/remove") @ApiOperation(value = "真正的删除", notes = "传入ids") public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { return R.status(distanceRecordService.removeByIds(Func.toLongList(ids))); } } skjcmanager/skjcmanager-service/skjcmanager-by/src/main/java/cn/gistack/by/waterdata/mapper/DistanceRecordMapper.java
New file @@ -0,0 +1,45 @@ /* * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the dreamlu.net developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: Chill 庄骞 (smallchill@163.com) */ package cn.gistack.by.waterdata.mapper; import cn.gistack.by.waterdata.pojo.entity.DistanceRecord; import cn.gistack.by.waterdata.pojo.vo.DistanceRecordVO; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import org.apache.ibatis.annotations.Param; import java.util.List; /** * 水库全景图 Mapper 接口 * * @author BladeX * @since 2024-03-29 */ public interface DistanceRecordMapper extends BaseMapper<DistanceRecord> { /** * 自定义分页 * * @param page * @param distanceRecordVO * @return */ List<DistanceRecordVO> selectDistanceRecordPage(IPage page, DistanceRecordVO distanceRecordVO); DistanceRecord selectOneById(@Param("id") int id); } skjcmanager/skjcmanager-service/skjcmanager-by/src/main/java/cn/gistack/by/waterdata/mapper/DistanceRecordMapper.xml
New file @@ -0,0 +1,34 @@ <?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="cn.gistack.by.waterdata.mapper.DistanceRecordMapper"> <!-- 通用查询映射结果 --> <resultMap id="distanceRecordResultMap" type="cn.gistack.by.waterdata.pojo.entity.DistanceRecord"> <result column="id" property="id"/> <result column="station_id" property="stationId"/> <result column="station_name" property="stationName"/> <result column="device_id" property="deviceId"/> <result column="device_name" property="deviceName"/> <result column="device_no" property="deviceNo"/> <result column="receive_type" property="receiveType"/> <result column="create_at" property="createAt"/> <result column="ob_time" property="obTime"/> <result column="ob_date" property="obDate"/> <result column="order" property="order"/> <result column="distance" property="distance"/> <result column="channel1_signal_strength" property="channel1SignalStrength"/> <result column="power_voltage" property="powerVoltage"/> </resultMap> <sql id="mainSql"> select * from SJZT_ODS."water_data_distance" </sql> <select id="selectDistanceRecordPage" resultMap="distanceRecordResultMap"> select * from SJZT_ODS."water_data_distance" </select> <select id="selectOneById" resultType="cn.gistack.by.waterdata.pojo.entity.DistanceRecord"> select * from SJZT_ODS."water_data_distance" where "id" = #{id} </select> </mapper> skjcmanager/skjcmanager-service/skjcmanager-by/src/main/java/cn/gistack/by/waterdata/pojo/entity/DistanceRecord.java
New file @@ -0,0 +1,78 @@ package cn.gistack.by.waterdata.pojo.entity; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import lombok.EqualsAndHashCode; import org.springblade.core.mp.base.BaseEntity; import java.util.Date; /** * 数据库表实例对象 */ @TableName("water_data_distance") @Data @EqualsAndHashCode(callSuper = false) public class DistanceRecord extends BaseEntity { /** * 外键,station_id */ @TableField(value = "station_id") private int stationId; /** * station名称 */ @TableField(value = "station_name") private String stationName; /** * 外键,device_id */ @TableField(value = "device_id") private int deviceId; /** * 设备名称 */ @TableField(value = "device_name") private String deviceName; /** * 设备编号。 报文中的遥测站地址 */ @TableField(value = "device_no") private String deviceNo; /** * 接收类型, 4G或者北斗 */ @TableField(value = "receive_type") private int receiveType; /** * 记录入库时间 */ @TableField(value = "create_at") private Date createAt; /** * 观测时间 */ @TableField(value = "ob_time") private String obTime; @TableField(value = "ob_date") private Date obDate; /** * 点位顺序 */ private String order; /** * 点位距离. 为了防止精度问题,入库的时候直接按照字符串的类型入库 */ private double distance; /** * 通道1信号强度 */ @TableField(value = "channel1_signal_strength") private String channel1SignalStrength; /** * 电源电压。为了防止精度问题,入库的时候直接按照字符串的类型入库 */ @TableField(value = "power_voltage") private double powerVoltage; } skjcmanager/skjcmanager-service/skjcmanager-by/src/main/java/cn/gistack/by/waterdata/pojo/vo/DistanceRecordVO.java
New file @@ -0,0 +1,34 @@ /* * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the dreamlu.net developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: Chill 庄骞 (smallchill@163.com) */ package cn.gistack.by.waterdata.pojo.vo; import cn.gistack.by.waterdata.pojo.entity.DistanceRecord; import lombok.Data; import lombok.EqualsAndHashCode; /** * DistanceRecordVO * * @author BladeX * @since 2023-12-06 */ @Data @EqualsAndHashCode(callSuper = true) public class DistanceRecordVO extends DistanceRecord { private static final long serialVersionUID = 1L; } skjcmanager/skjcmanager-service/skjcmanager-by/src/main/java/cn/gistack/by/waterdata/pojo/wrapper/DistanceRecordWrapper.java
New file @@ -0,0 +1,46 @@ /* * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the dreamlu.net developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: Chill 庄骞 (smallchill@163.com) */ package cn.gistack.by.waterdata.pojo.wrapper; import cn.gistack.by.waterdata.pojo.entity.DistanceRecord; import cn.gistack.by.waterdata.pojo.vo.DistanceRecordVO; import org.springblade.core.mp.support.BaseEntityWrapper; import org.springblade.core.tool.utils.BeanUtil; import java.util.Objects; /** * 包装类, 进行VO对象和实体类对象的转换 * * @author Kai.Shan * @since 2024-12-06 */ public class DistanceRecordWrapper extends BaseEntityWrapper<DistanceRecord, DistanceRecordVO> { public static DistanceRecordWrapper build() { return new DistanceRecordWrapper(); } @Override public DistanceRecordVO entityVO(DistanceRecord distanceRecord) { DistanceRecordVO distanceRecordVO = Objects.requireNonNull(BeanUtil.copy(distanceRecord, DistanceRecordVO.class)); return distanceRecordVO; } } skjcmanager/skjcmanager-service/skjcmanager-by/src/main/java/cn/gistack/by/waterdata/service/api/IDistanceRecordService.java
New file @@ -0,0 +1,42 @@ /* * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the dreamlu.net developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: Chill 庄骞 (smallchill@163.com) */ package cn.gistack.by.waterdata.service.api; import cn.gistack.by.waterdata.pojo.entity.DistanceRecord; import cn.gistack.by.waterdata.pojo.vo.DistanceRecordVO; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.IService; import org.apache.ibatis.annotations.Param; /** * E0 distance service. * * @author Kai.Shan * @since 2023-12-06 */ public interface IDistanceRecordService extends IService<DistanceRecord> { /** * 自定义分页 * * @param page * @param news * @return */ IPage<DistanceRecordVO> selectDistanceRecordPage(IPage<DistanceRecordVO> page, DistanceRecordVO news); DistanceRecord selectOneById(@Param("id") int id); } skjcmanager/skjcmanager-service/skjcmanager-by/src/main/java/cn/gistack/by/waterdata/service/impl/DistanceRecordServiceImpl.java
New file @@ -0,0 +1,45 @@ /* * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the dreamlu.net developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: Chill 庄骞 (smallchill@163.com) */ package cn.gistack.by.waterdata.service.impl; import cn.gistack.by.waterdata.mapper.DistanceRecordMapper; import cn.gistack.by.waterdata.pojo.entity.DistanceRecord; import cn.gistack.by.waterdata.pojo.vo.DistanceRecordVO; import cn.gistack.by.waterdata.service.api.IDistanceRecordService; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; /** * 新闻 服务实现类 * * @author BladeX * @since 2023-12-06 */ @Service public class DistanceRecordServiceImpl extends ServiceImpl<DistanceRecordMapper, DistanceRecord> implements IDistanceRecordService { @Override public IPage<DistanceRecordVO> selectDistanceRecordPage(IPage<DistanceRecordVO> page, DistanceRecordVO distanceRecordVO) { return page.setRecords(baseMapper.selectDistanceRecordPage(page, distanceRecordVO)); } @Override public DistanceRecord selectOneById(int id) { return baseMapper.selectOneById(id); } }