lau572
1 month ago
9 changed files with 818 additions and 0 deletions
@ -0,0 +1,53 @@ |
|||||
|
import request from '@/utils/request' |
||||
|
|
||||
|
// 查询外部平台心跳日志列表
|
||||
|
export function listHeartbeat(query) { |
||||
|
return request({ |
||||
|
url: '/externalPlatform/heartbeat/list', |
||||
|
method: 'get', |
||||
|
params: query |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 查询外部平台心跳日志详细
|
||||
|
export function getHeartbeat(id) { |
||||
|
return request({ |
||||
|
url: '/externalPlatform/heartbeat/' + id, |
||||
|
method: 'get' |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 新增外部平台心跳日志
|
||||
|
export function addHeartbeat(data) { |
||||
|
return request({ |
||||
|
url: '/externalPlatform/heartbeat', |
||||
|
method: 'post', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 修改外部平台心跳日志
|
||||
|
export function updateHeartbeat(data) { |
||||
|
return request({ |
||||
|
url: '/externalPlatform/heartbeat', |
||||
|
method: 'put', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 删除外部平台心跳日志
|
||||
|
export function delHeartbeat(id) { |
||||
|
return request({ |
||||
|
url: '/externalPlatform/heartbeat/' + id, |
||||
|
method: 'delete' |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 导出外部平台心跳日志
|
||||
|
export function exportHeartbeat(query) { |
||||
|
return request({ |
||||
|
url: '/externalPlatform/heartbeat/export', |
||||
|
method: 'get', |
||||
|
params: query |
||||
|
}) |
||||
|
} |
@ -0,0 +1,280 @@ |
|||||
|
<template> |
||||
|
<div class="app-container"> |
||||
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |
||||
|
<el-form-item label="类型" prop="type"> |
||||
|
<el-select v-model="queryParams.type" clearable placeholder="请选择类型" class="select-width"> |
||||
|
<el-option |
||||
|
v-for="item in typeList" |
||||
|
:key="item.value" |
||||
|
:label="item.label" |
||||
|
:value="item.value" |
||||
|
></el-option> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="时间范围" prop="dateTime"> |
||||
|
<el-date-picker |
||||
|
v-model="queryParams.dateTime" |
||||
|
type="datetimerange" |
||||
|
format="yyyy-MM-dd HH:mm:ss" |
||||
|
value-format="yyyy-MM-dd HH:mm:ss" |
||||
|
range-separator="-" |
||||
|
@change="handleProcessingTime " |
||||
|
start-placeholder="开始日期" |
||||
|
end-placeholder="结束日期"> |
||||
|
</el-date-picker> |
||||
|
</el-form-item> |
||||
|
|
||||
|
<el-form-item> |
||||
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> |
||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
|
||||
|
<el-row :gutter="10" class="mb8"> |
||||
|
<!--<el-col :span="1.5"> |
||||
|
<el-button |
||||
|
type="primary" |
||||
|
plain |
||||
|
icon="el-icon-plus" |
||||
|
size="mini" |
||||
|
@click="handleAdd" |
||||
|
>新增</el-button> |
||||
|
</el-col> |
||||
|
<el-col :span="1.5"> |
||||
|
<el-button |
||||
|
type="success" |
||||
|
plain |
||||
|
icon="el-icon-edit" |
||||
|
size="mini" |
||||
|
:disabled="single" |
||||
|
@click="handleUpdate" |
||||
|
>修改</el-button> |
||||
|
</el-col> |
||||
|
<el-col :span="1.5"> |
||||
|
<el-button |
||||
|
type="danger" |
||||
|
plain |
||||
|
icon="el-icon-delete" |
||||
|
size="mini" |
||||
|
:disabled="multiple" |
||||
|
@click="handleDelete" |
||||
|
>删除</el-button> |
||||
|
</el-col>--> |
||||
|
<el-col :span="1.5"> |
||||
|
<el-button |
||||
|
type="warning" |
||||
|
plain |
||||
|
icon="el-icon-download" |
||||
|
size="mini" |
||||
|
@click="handleExport" |
||||
|
>导出</el-button> |
||||
|
</el-col> |
||||
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
||||
|
</el-row> |
||||
|
|
||||
|
<el-table v-loading="loading" :data="heartbeatList" @selection-change="handleSelectionChange"> |
||||
|
<el-table-column type="selection" width="55" align="center" /> |
||||
|
<!-- <el-table-column label="id" align="center" prop="id" />--> |
||||
|
<el-table-column label="平台类型" align="center" prop="type" > |
||||
|
<template slot-scope="scope"> |
||||
|
<span v-if="scope.row.type == '1'">GIS+BIM</span> |
||||
|
<span v-if="scope.row.type == '2'">数字孪生</span> |
||||
|
<span v-if="scope.row.type == '3'">收费运营</span> |
||||
|
<span v-if="scope.row.type == '4'">桥梁监测</span> |
||||
|
<span v-if="scope.row.type == '5'">光纤监测</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column label="心跳时间" align="center" prop="createTime" /> |
||||
|
<!--<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
||||
|
<template slot-scope="scope"> |
||||
|
<el-button |
||||
|
size="mini" |
||||
|
type="text" |
||||
|
icon="el-icon-edit" |
||||
|
@click="handleUpdate(scope.row)" |
||||
|
>修改</el-button> |
||||
|
<el-button |
||||
|
size="mini" |
||||
|
type="text" |
||||
|
icon="el-icon-delete" |
||||
|
@click="handleDelete(scope.row)" |
||||
|
>删除</el-button> |
||||
|
</template> |
||||
|
</el-table-column>--> |
||||
|
</el-table> |
||||
|
|
||||
|
<pagination |
||||
|
v-show="total>0" |
||||
|
:total="total" |
||||
|
:page.sync="queryParams.pageNum" |
||||
|
:limit.sync="queryParams.pageSize" |
||||
|
@pagination="getList" |
||||
|
/> |
||||
|
|
||||
|
<!-- 添加或修改外部平台心跳日志对话框 --> |
||||
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> |
||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> |
||||
|
</el-form> |
||||
|
<div slot="footer" class="dialog-footer"> |
||||
|
<el-button type="primary" @click="submitForm">确 定</el-button> |
||||
|
<el-button @click="cancel">取 消</el-button> |
||||
|
</div> |
||||
|
</el-dialog> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { listHeartbeat, getHeartbeat, delHeartbeat, addHeartbeat, updateHeartbeat } from "@/api/monitor/heartbeat"; |
||||
|
|
||||
|
export default { |
||||
|
name: "Heartbeat", |
||||
|
data() { |
||||
|
return { |
||||
|
// 遮罩层 |
||||
|
loading: true, |
||||
|
// 选中数组 |
||||
|
ids: [], |
||||
|
// 非单个禁用 |
||||
|
single: true, |
||||
|
// 非多个禁用 |
||||
|
multiple: true, |
||||
|
// 显示搜索条件 |
||||
|
showSearch: true, |
||||
|
// 总条数 |
||||
|
total: 0, |
||||
|
// 外部平台心跳日志表格数据 |
||||
|
heartbeatList: [], |
||||
|
// 弹出层标题 |
||||
|
title: "", |
||||
|
// 是否显示弹出层 |
||||
|
open: false, |
||||
|
// 查询参数 |
||||
|
queryParams: { |
||||
|
dateTime: undefined, |
||||
|
startTime:null, |
||||
|
endTime:null, |
||||
|
pageNum: 1, |
||||
|
pageSize: 10, |
||||
|
type: null, |
||||
|
}, |
||||
|
typeList:[ |
||||
|
{value:1,label:'GIS+BIM'}, |
||||
|
{value:2,label:'数字孪生'}, |
||||
|
{value:3,label:'收费运营'}, |
||||
|
{value:4,label:'桥梁监测'}, |
||||
|
{value:5,label:'光纤监测'} |
||||
|
], |
||||
|
// 表单参数 |
||||
|
form: {}, |
||||
|
// 表单校验 |
||||
|
rules: { |
||||
|
} |
||||
|
}; |
||||
|
}, |
||||
|
created() { |
||||
|
this.getList(); |
||||
|
}, |
||||
|
methods: { |
||||
|
/** 查询外部平台心跳日志列表 */ |
||||
|
getList() { |
||||
|
this.loading = true; |
||||
|
listHeartbeat(this.queryParams).then(response => { |
||||
|
this.heartbeatList = response.rows; |
||||
|
this.total = response.total; |
||||
|
this.loading = false; |
||||
|
}); |
||||
|
}, |
||||
|
/** 处理时间选择器组件 */ |
||||
|
handleProcessingTime() { |
||||
|
if (this.queryParams.dateTime.length > 0) { |
||||
|
this.queryParams.startTime = this.queryParams.dateTime[0] |
||||
|
this.queryParams.endTime = this.queryParams.dateTime[1] |
||||
|
} |
||||
|
}, |
||||
|
// 取消按钮 |
||||
|
cancel() { |
||||
|
this.open = false; |
||||
|
this.reset(); |
||||
|
}, |
||||
|
// 表单重置 |
||||
|
reset() { |
||||
|
this.form = { |
||||
|
id: null, |
||||
|
type: null, |
||||
|
createTime: null |
||||
|
}; |
||||
|
this.resetForm("form"); |
||||
|
}, |
||||
|
/** 搜索按钮操作 */ |
||||
|
handleQuery() { |
||||
|
this.queryParams.pageNum = 1; |
||||
|
this.getList(); |
||||
|
}, |
||||
|
/** 重置按钮操作 */ |
||||
|
resetQuery() { |
||||
|
this.resetForm("queryForm"); |
||||
|
this.queryParams.startTime = null; |
||||
|
this.queryParams.endTime = null; |
||||
|
this.handleQuery(); |
||||
|
}, |
||||
|
// 多选框选中数据 |
||||
|
handleSelectionChange(selection) { |
||||
|
this.ids = selection.map(item => item.id) |
||||
|
this.single = selection.length!==1 |
||||
|
this.multiple = !selection.length |
||||
|
}, |
||||
|
/** 新增按钮操作 */ |
||||
|
handleAdd() { |
||||
|
this.reset(); |
||||
|
this.open = true; |
||||
|
this.title = "添加外部平台心跳日志"; |
||||
|
}, |
||||
|
/** 修改按钮操作 */ |
||||
|
handleUpdate(row) { |
||||
|
this.reset(); |
||||
|
const id = row.id || this.ids |
||||
|
getHeartbeat(id).then(response => { |
||||
|
this.form = response.data; |
||||
|
this.open = true; |
||||
|
this.title = "修改外部平台心跳日志"; |
||||
|
}); |
||||
|
}, |
||||
|
/** 提交按钮 */ |
||||
|
submitForm() { |
||||
|
this.$refs["form"].validate(valid => { |
||||
|
if (valid) { |
||||
|
if (this.form.id != null) { |
||||
|
updateHeartbeat(this.form).then(response => { |
||||
|
this.$modal.msgSuccess("修改成功"); |
||||
|
this.open = false; |
||||
|
this.getList(); |
||||
|
}); |
||||
|
} else { |
||||
|
addHeartbeat(this.form).then(response => { |
||||
|
this.$modal.msgSuccess("新增成功"); |
||||
|
this.open = false; |
||||
|
this.getList(); |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
/** 删除按钮操作 */ |
||||
|
handleDelete(row) { |
||||
|
const ids = row.id || this.ids; |
||||
|
this.$modal.confirm('是否确认删除外部平台心跳日志编号为"' + ids + '"的数据项?').then(function() { |
||||
|
return delHeartbeat(ids); |
||||
|
}).then(() => { |
||||
|
this.getList(); |
||||
|
this.$modal.msgSuccess("删除成功"); |
||||
|
}).catch(() => {}); |
||||
|
}, |
||||
|
/** 导出按钮操作 */ |
||||
|
handleExport() { |
||||
|
this.download('externalPlatform/heartbeat/export', { |
||||
|
...this.queryParams |
||||
|
}, `heartbeat_${new Date().getTime()}.xlsx`) |
||||
|
} |
||||
|
} |
||||
|
}; |
||||
|
</script> |
@ -0,0 +1,98 @@ |
|||||
|
package com.zc.business.controller; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import javax.servlet.http.HttpServletResponse; |
||||
|
|
||||
|
import com.ruoyi.common.utils.ServletUtils; |
||||
|
import com.ruoyi.common.utils.ip.IpUtils; |
||||
|
import com.zc.business.domain.DcExternalPlatformHeartbeat; |
||||
|
import com.zc.business.service.IDcExternalPlatformHeartbeatService; |
||||
|
import org.springframework.security.access.prepost.PreAuthorize; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.PutMapping; |
||||
|
import org.springframework.web.bind.annotation.DeleteMapping; |
||||
|
import org.springframework.web.bind.annotation.PathVariable; |
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
import com.ruoyi.common.annotation.Log; |
||||
|
import com.ruoyi.common.core.controller.BaseController; |
||||
|
import com.ruoyi.common.core.domain.AjaxResult; |
||||
|
import com.ruoyi.common.enums.BusinessType; |
||||
|
import com.ruoyi.common.utils.poi.ExcelUtil; |
||||
|
import com.ruoyi.common.core.page.TableDataInfo; |
||||
|
|
||||
|
/** |
||||
|
* 外部平台心跳日志Controller |
||||
|
* |
||||
|
* @author ruoyi |
||||
|
* @date 2024-10-24 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("/externalPlatform/heartbeat") |
||||
|
public class DcExternalPlatformHeartbeatController extends BaseController |
||||
|
{ |
||||
|
@Autowired |
||||
|
private IDcExternalPlatformHeartbeatService dcExternalPlatformHeartbeatService; |
||||
|
|
||||
|
/** |
||||
|
* 查询外部平台心跳日志列表 |
||||
|
*/ |
||||
|
@GetMapping("/list") |
||||
|
public TableDataInfo list(DcExternalPlatformHeartbeat dcExternalPlatformHeartbeat) |
||||
|
{ |
||||
|
startPage(); |
||||
|
List<DcExternalPlatformHeartbeat> list = dcExternalPlatformHeartbeatService.selectDcExternalPlatformHeartbeatList(dcExternalPlatformHeartbeat); |
||||
|
return getDataTable(list); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 导出外部平台心跳日志列表 |
||||
|
*/ |
||||
|
@PostMapping("/export") |
||||
|
public void export(HttpServletResponse response, DcExternalPlatformHeartbeat dcExternalPlatformHeartbeat) |
||||
|
{ |
||||
|
List<DcExternalPlatformHeartbeat> list = dcExternalPlatformHeartbeatService.selectDcExternalPlatformHeartbeatList(dcExternalPlatformHeartbeat); |
||||
|
ExcelUtil<DcExternalPlatformHeartbeat> util = new ExcelUtil<>(DcExternalPlatformHeartbeat.class); |
||||
|
util.exportExcel(response, list, "外部平台心跳日志数据"); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 获取外部平台心跳日志详细信息 |
||||
|
*/ |
||||
|
@GetMapping(value = "/{id}") |
||||
|
public AjaxResult getInfo(@PathVariable("id") Long id) |
||||
|
{ |
||||
|
return AjaxResult.success(dcExternalPlatformHeartbeatService.selectDcExternalPlatformHeartbeatById(id)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增外部平台心跳日志 |
||||
|
*/ |
||||
|
@PostMapping |
||||
|
public AjaxResult add(@RequestBody DcExternalPlatformHeartbeat dcExternalPlatformHeartbeat) |
||||
|
{ |
||||
|
dcExternalPlatformHeartbeat.setIp(IpUtils.getIpAddr(ServletUtils.getRequest()));; |
||||
|
return toAjax(dcExternalPlatformHeartbeatService.insertDcExternalPlatformHeartbeat(dcExternalPlatformHeartbeat)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改外部平台心跳日志 |
||||
|
*/ |
||||
|
@PutMapping |
||||
|
public AjaxResult edit(@RequestBody DcExternalPlatformHeartbeat dcExternalPlatformHeartbeat) |
||||
|
{ |
||||
|
return toAjax(dcExternalPlatformHeartbeatService.updateDcExternalPlatformHeartbeat(dcExternalPlatformHeartbeat)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除外部平台心跳日志 |
||||
|
*/ |
||||
|
@DeleteMapping("/{ids}") |
||||
|
public AjaxResult remove(@PathVariable Long[] ids) |
||||
|
{ |
||||
|
return toAjax(dcExternalPlatformHeartbeatService.deleteDcExternalPlatformHeartbeatByIds(ids)); |
||||
|
} |
||||
|
} |
@ -0,0 +1,101 @@ |
|||||
|
package com.zc.business.domain; |
||||
|
|
||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import org.apache.commons.lang3.builder.ToStringBuilder; |
||||
|
import org.apache.commons.lang3.builder.ToStringStyle; |
||||
|
import com.ruoyi.common.annotation.Excel; |
||||
|
import com.ruoyi.common.core.domain.BaseEntity; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* 外部平台心跳日志对象 dc_external_platform_heartbeat |
||||
|
* |
||||
|
* @author ruoyi |
||||
|
* @date 2024-10-24 |
||||
|
*/ |
||||
|
public class DcExternalPlatformHeartbeat |
||||
|
{ |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** $column.columnComment */ |
||||
|
private Long id; |
||||
|
|
||||
|
/** 平台类型(1gis+bim 2数字孪生 3收费运营 4桥梁监测 5光纤) */ |
||||
|
@Excel(name = "平台类型",readConverterExp = "1=GIS+BIM,2=数字孪生,3=收费运营,4=桥梁监测,5=光纤监测") |
||||
|
private String type; |
||||
|
|
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") |
||||
|
@Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Excel.Type.EXPORT) |
||||
|
private Date createTime; |
||||
|
|
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
|
private Date startTime; |
||||
|
|
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
||||
|
private Date endTime; |
||||
|
|
||||
|
/** 心跳ip*/ |
||||
|
private String ip; |
||||
|
|
||||
|
public void setId(Long id) |
||||
|
{ |
||||
|
this.id = id; |
||||
|
} |
||||
|
|
||||
|
public Long getId() |
||||
|
{ |
||||
|
return id; |
||||
|
} |
||||
|
public void setType(String type) |
||||
|
{ |
||||
|
this.type = type; |
||||
|
} |
||||
|
|
||||
|
public String getType() |
||||
|
{ |
||||
|
return type; |
||||
|
} |
||||
|
|
||||
|
public Date getCreateTime() { |
||||
|
return createTime; |
||||
|
} |
||||
|
|
||||
|
public void setCreateTime(Date createTime) { |
||||
|
this.createTime = createTime; |
||||
|
} |
||||
|
|
||||
|
public Date getStartTime() { |
||||
|
return startTime; |
||||
|
} |
||||
|
|
||||
|
public void setStartTime(Date startTime) { |
||||
|
this.startTime = startTime; |
||||
|
} |
||||
|
|
||||
|
public Date getEndTime() { |
||||
|
return endTime; |
||||
|
} |
||||
|
|
||||
|
public void setEndTime(Date endTime) { |
||||
|
this.endTime = endTime; |
||||
|
} |
||||
|
|
||||
|
public String getIp() { |
||||
|
return ip; |
||||
|
} |
||||
|
|
||||
|
public void setIp(String ip) { |
||||
|
this.ip = ip; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public String toString() { |
||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
||||
|
.append("id", getId()) |
||||
|
.append("type", getType()) |
||||
|
.append("createTime", getCreateTime()) |
||||
|
.toString(); |
||||
|
} |
||||
|
} |
@ -0,0 +1,62 @@ |
|||||
|
package com.zc.business.mapper; |
||||
|
|
||||
|
import com.zc.business.domain.DcExternalPlatformHeartbeat; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 外部平台心跳日志Mapper接口 |
||||
|
* |
||||
|
* @author ruoyi |
||||
|
* @date 2024-10-24 |
||||
|
*/ |
||||
|
public interface DcExternalPlatformHeartbeatMapper |
||||
|
{ |
||||
|
/** |
||||
|
* 查询外部平台心跳日志 |
||||
|
* |
||||
|
* @param id 外部平台心跳日志主键 |
||||
|
* @return 外部平台心跳日志 |
||||
|
*/ |
||||
|
public DcExternalPlatformHeartbeat selectDcExternalPlatformHeartbeatById(Long id); |
||||
|
|
||||
|
/** |
||||
|
* 查询外部平台心跳日志列表 |
||||
|
* |
||||
|
* @param dcExternalPlatformHeartbeat 外部平台心跳日志 |
||||
|
* @return 外部平台心跳日志集合 |
||||
|
*/ |
||||
|
List<DcExternalPlatformHeartbeat> selectDcExternalPlatformHeartbeatList(DcExternalPlatformHeartbeat dcExternalPlatformHeartbeat); |
||||
|
|
||||
|
/** |
||||
|
* 新增外部平台心跳日志 |
||||
|
* |
||||
|
* @param dcExternalPlatformHeartbeat 外部平台心跳日志 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
int insertDcExternalPlatformHeartbeat(DcExternalPlatformHeartbeat dcExternalPlatformHeartbeat); |
||||
|
|
||||
|
/** |
||||
|
* 修改外部平台心跳日志 |
||||
|
* |
||||
|
* @param dcExternalPlatformHeartbeat 外部平台心跳日志 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
int updateDcExternalPlatformHeartbeat(DcExternalPlatformHeartbeat dcExternalPlatformHeartbeat); |
||||
|
|
||||
|
/** |
||||
|
* 删除外部平台心跳日志 |
||||
|
* |
||||
|
* @param id 外部平台心跳日志主键 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
int deleteDcExternalPlatformHeartbeatById(Long id); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除外部平台心跳日志 |
||||
|
* |
||||
|
* @param ids 需要删除的数据主键集合 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
int deleteDcExternalPlatformHeartbeatByIds(Long[] ids); |
||||
|
} |
@ -0,0 +1,62 @@ |
|||||
|
package com.zc.business.service; |
||||
|
|
||||
|
import com.zc.business.domain.DcExternalPlatformHeartbeat; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 外部平台心跳日志Service接口 |
||||
|
* |
||||
|
* @author ruoyi |
||||
|
* @date 2024-10-24 |
||||
|
*/ |
||||
|
public interface IDcExternalPlatformHeartbeatService |
||||
|
{ |
||||
|
/** |
||||
|
* 查询外部平台心跳日志 |
||||
|
* |
||||
|
* @param id 外部平台心跳日志主键 |
||||
|
* @return 外部平台心跳日志 |
||||
|
*/ |
||||
|
public DcExternalPlatformHeartbeat selectDcExternalPlatformHeartbeatById(Long id); |
||||
|
|
||||
|
/** |
||||
|
* 查询外部平台心跳日志列表 |
||||
|
* |
||||
|
* @param dcExternalPlatformHeartbeat 外部平台心跳日志 |
||||
|
* @return 外部平台心跳日志集合 |
||||
|
*/ |
||||
|
List<DcExternalPlatformHeartbeat> selectDcExternalPlatformHeartbeatList(DcExternalPlatformHeartbeat dcExternalPlatformHeartbeat); |
||||
|
|
||||
|
/** |
||||
|
* 新增外部平台心跳日志 |
||||
|
* |
||||
|
* @param dcExternalPlatformHeartbeat 外部平台心跳日志 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
int insertDcExternalPlatformHeartbeat(DcExternalPlatformHeartbeat dcExternalPlatformHeartbeat); |
||||
|
|
||||
|
/** |
||||
|
* 修改外部平台心跳日志 |
||||
|
* |
||||
|
* @param dcExternalPlatformHeartbeat 外部平台心跳日志 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
int updateDcExternalPlatformHeartbeat(DcExternalPlatformHeartbeat dcExternalPlatformHeartbeat); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除外部平台心跳日志 |
||||
|
* |
||||
|
* @param ids 需要删除的外部平台心跳日志主键集合 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
int deleteDcExternalPlatformHeartbeatByIds(Long[] ids); |
||||
|
|
||||
|
/** |
||||
|
* 删除外部平台心跳日志信息 |
||||
|
* |
||||
|
* @param id 外部平台心跳日志主键 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
int deleteDcExternalPlatformHeartbeatById(Long id); |
||||
|
} |
@ -0,0 +1,95 @@ |
|||||
|
package com.zc.business.service.impl; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import com.ruoyi.common.utils.DateUtils; |
||||
|
import com.zc.business.domain.DcExternalPlatformHeartbeat; |
||||
|
import com.zc.business.mapper.DcExternalPlatformHeartbeatMapper; |
||||
|
import com.zc.business.service.IDcExternalPlatformHeartbeatService; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
/** |
||||
|
* 外部平台心跳日志Service业务层处理 |
||||
|
* |
||||
|
* @author ruoyi |
||||
|
* @date 2024-10-24 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class DcExternalPlatformHeartbeatServiceImpl implements IDcExternalPlatformHeartbeatService |
||||
|
{ |
||||
|
@Autowired |
||||
|
private DcExternalPlatformHeartbeatMapper dcExternalPlatformHeartbeatMapper; |
||||
|
|
||||
|
/** |
||||
|
* 查询外部平台心跳日志 |
||||
|
* |
||||
|
* @param id 外部平台心跳日志主键 |
||||
|
* @return 外部平台心跳日志 |
||||
|
*/ |
||||
|
@Override |
||||
|
public DcExternalPlatformHeartbeat selectDcExternalPlatformHeartbeatById(Long id) |
||||
|
{ |
||||
|
return dcExternalPlatformHeartbeatMapper.selectDcExternalPlatformHeartbeatById(id); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 查询外部平台心跳日志列表 |
||||
|
* |
||||
|
* @param dcExternalPlatformHeartbeat 外部平台心跳日志 |
||||
|
* @return 外部平台心跳日志 |
||||
|
*/ |
||||
|
@Override |
||||
|
public List<DcExternalPlatformHeartbeat> selectDcExternalPlatformHeartbeatList(DcExternalPlatformHeartbeat dcExternalPlatformHeartbeat) |
||||
|
{ |
||||
|
return dcExternalPlatformHeartbeatMapper.selectDcExternalPlatformHeartbeatList(dcExternalPlatformHeartbeat); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增外部平台心跳日志 |
||||
|
* |
||||
|
* @param dcExternalPlatformHeartbeat 外部平台心跳日志 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public int insertDcExternalPlatformHeartbeat(DcExternalPlatformHeartbeat dcExternalPlatformHeartbeat) |
||||
|
{ |
||||
|
dcExternalPlatformHeartbeat.setCreateTime(DateUtils.getNowDate()); |
||||
|
return dcExternalPlatformHeartbeatMapper.insertDcExternalPlatformHeartbeat(dcExternalPlatformHeartbeat); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改外部平台心跳日志 |
||||
|
* |
||||
|
* @param dcExternalPlatformHeartbeat 外部平台心跳日志 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public int updateDcExternalPlatformHeartbeat(DcExternalPlatformHeartbeat dcExternalPlatformHeartbeat) |
||||
|
{ |
||||
|
return dcExternalPlatformHeartbeatMapper.updateDcExternalPlatformHeartbeat(dcExternalPlatformHeartbeat); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 批量删除外部平台心跳日志 |
||||
|
* |
||||
|
* @param ids 需要删除的外部平台心跳日志主键 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public int deleteDcExternalPlatformHeartbeatByIds(Long[] ids) |
||||
|
{ |
||||
|
return dcExternalPlatformHeartbeatMapper.deleteDcExternalPlatformHeartbeatByIds(ids); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除外部平台心跳日志信息 |
||||
|
* |
||||
|
* @param id 外部平台心跳日志主键 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public int deleteDcExternalPlatformHeartbeatById(Long id) |
||||
|
{ |
||||
|
return dcExternalPlatformHeartbeatMapper.deleteDcExternalPlatformHeartbeatById(id); |
||||
|
} |
||||
|
} |
@ -0,0 +1,65 @@ |
|||||
|
<?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.zc.business.mapper.DcExternalPlatformHeartbeatMapper"> |
||||
|
|
||||
|
<resultMap type="DcExternalPlatformHeartbeat" id="DcExternalPlatformHeartbeatResult"> |
||||
|
<result property="id" column="id" /> |
||||
|
<result property="type" column="type" /> |
||||
|
<result property="createTime" column="create_time" /> |
||||
|
</resultMap> |
||||
|
|
||||
|
<sql id="selectDcExternalPlatformHeartbeatVo"> |
||||
|
select id, type, create_time from dc_external_platform_heartbeat |
||||
|
</sql> |
||||
|
|
||||
|
<select id="selectDcExternalPlatformHeartbeatList" parameterType="DcExternalPlatformHeartbeat" resultMap="DcExternalPlatformHeartbeatResult"> |
||||
|
<include refid="selectDcExternalPlatformHeartbeatVo"/> |
||||
|
<where> |
||||
|
<if test="type != null and type != ''"> and type = #{type}</if> |
||||
|
<if test="startTime != null"> and date_format(create_time,'%Y-%m-%d %H:%i:%s') >= date_format(#{startTime},'%Y-%m-%d %H:%i:%s')</if> |
||||
|
<if test="endTime != null"> and date_format(create_time,'%Y-%m-%d %H:%i:%s') <= date_format(#{endTime},'%Y-%m-%d %H:%i:%s')</if> |
||||
|
</where> |
||||
|
order by id desc |
||||
|
</select> |
||||
|
|
||||
|
<select id="selectDcExternalPlatformHeartbeatById" parameterType="Long" resultMap="DcExternalPlatformHeartbeatResult"> |
||||
|
<include refid="selectDcExternalPlatformHeartbeatVo"/> |
||||
|
where id = #{id} |
||||
|
</select> |
||||
|
|
||||
|
<insert id="insertDcExternalPlatformHeartbeat" parameterType="DcExternalPlatformHeartbeat" useGeneratedKeys="true" keyProperty="id"> |
||||
|
insert into dc_external_platform_heartbeat |
||||
|
<trim prefix="(" suffix=")" suffixOverrides=","> |
||||
|
<if test="type != null">type,</if> |
||||
|
<if test="createTime != null">create_time,</if> |
||||
|
<if test="ip != null">ip,</if> |
||||
|
</trim> |
||||
|
<trim prefix="values (" suffix=")" suffixOverrides=","> |
||||
|
<if test="type != null">#{type},</if> |
||||
|
<if test="createTime != null">#{createTime},</if> |
||||
|
<if test="ip != null">#{ip},</if> |
||||
|
</trim> |
||||
|
</insert> |
||||
|
|
||||
|
<update id="updateDcExternalPlatformHeartbeat" parameterType="DcExternalPlatformHeartbeat"> |
||||
|
update dc_external_platform_heartbeat |
||||
|
<trim prefix="SET" suffixOverrides=","> |
||||
|
<if test="type != null">type = #{type},</if> |
||||
|
<if test="createTime != null">create_time = #{createTime},</if> |
||||
|
</trim> |
||||
|
where id = #{id} |
||||
|
</update> |
||||
|
|
||||
|
<delete id="deleteDcExternalPlatformHeartbeatById" parameterType="Long"> |
||||
|
delete from dc_external_platform_heartbeat where id = #{id} |
||||
|
</delete> |
||||
|
|
||||
|
<delete id="deleteDcExternalPlatformHeartbeatByIds" parameterType="String"> |
||||
|
delete from dc_external_platform_heartbeat where id in |
||||
|
<foreach item="id" collection="array" open="(" separator="," close=")"> |
||||
|
#{id} |
||||
|
</foreach> |
||||
|
</delete> |
||||
|
</mapper> |
Loading…
Reference in new issue