lau572
2 weeks ago
14 changed files with 903 additions and 2 deletions
@ -0,0 +1,53 @@ |
|||||
|
import request from '@/utils/request' |
||||
|
|
||||
|
// 查询外部平台离线记录列表
|
||||
|
export function listExternalPlatformOffline(query) { |
||||
|
return request({ |
||||
|
url: '/externalPlatformOffline/list', |
||||
|
method: 'get', |
||||
|
params: query |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 查询外部平台离线记录详细
|
||||
|
export function getExternalPlatformOffline(id) { |
||||
|
return request({ |
||||
|
url: '/externalPlatformOffline/' + id, |
||||
|
method: 'get' |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 新增外部平台离线记录
|
||||
|
export function addExternalPlatformOffline(data) { |
||||
|
return request({ |
||||
|
url: '/externalPlatformOffline', |
||||
|
method: 'post', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 修改外部平台离线记录
|
||||
|
export function updateExternalPlatformOffline(data) { |
||||
|
return request({ |
||||
|
url: '/externalPlatformOffline', |
||||
|
method: 'put', |
||||
|
data: data |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 删除外部平台离线记录
|
||||
|
export function delExternalPlatformOffline(id) { |
||||
|
return request({ |
||||
|
url: '/externalPlatformOffline/' + id, |
||||
|
method: 'delete' |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
// 导出外部平台离线记录
|
||||
|
export function exportExternalPlatformOffline(query) { |
||||
|
return request({ |
||||
|
url: '/externalPlatformOffline/export', |
||||
|
method: 'get', |
||||
|
params: query |
||||
|
}) |
||||
|
} |
@ -0,0 +1,302 @@ |
|||||
|
<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" placeholder="请选择类型" clearable> |
||||
|
<el-option |
||||
|
v-for="type in typeList" |
||||
|
:key="type.value" |
||||
|
:label="type.label" |
||||
|
:value="type.value" |
||||
|
/> |
||||
|
</el-select> |
||||
|
</el-form-item> |
||||
|
|
||||
|
<el-form-item label="离线时间" prop="offlineTime"> |
||||
|
<el-date-picker clearable |
||||
|
v-model="queryParams.offlineTime" |
||||
|
type="date" |
||||
|
value-format="yyyy-MM-dd HH:mm:ss" |
||||
|
placeholder="请选择离线时间" |
||||
|
:picker-options="pickerOptions"> |
||||
|
</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="externalPlatformOfflineList" > |
||||
|
<!--<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="offlineTime"> |
||||
|
<template slot-scope="scope"> |
||||
|
<span>{{ parseTime(scope.row.offlineTime, '{y}-{m}-{d} {h}:{i}:{s}') }} </span> |
||||
|
<span v-if="scope.row.endTime">至 {{ parseTime(scope.row.endTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span> |
||||
|
<span v-else>至 当前</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<!--<el-table-column label="结束时间" align="center" prop="endTime" width="180"> |
||||
|
<template slot-scope="scope"> |
||||
|
<span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d}') }}</span> |
||||
|
</template> |
||||
|
</el-table-column>--> |
||||
|
<!--<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-item label="离线时间" prop="offlineTime"> |
||||
|
<el-date-picker clearable |
||||
|
v-model="form.offlineTime" |
||||
|
type="date" |
||||
|
value-format="yyyy-MM-dd" |
||||
|
placeholder="请选择离线时间"> |
||||
|
</el-date-picker> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="结束时间" prop="endTime"> |
||||
|
<el-date-picker clearable |
||||
|
v-model="form.endTime" |
||||
|
type="date" |
||||
|
value-format="yyyy-MM-dd" |
||||
|
placeholder="请选择结束时间"> |
||||
|
</el-date-picker> |
||||
|
</el-form-item> |
||||
|
</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 { listExternalPlatformOffline, getExternalPlatformOffline, delExternalPlatformOffline, addExternalPlatformOffline, updateExternalPlatformOffline } from "@/api/monitor/externalPlatformOffline"; |
||||
|
|
||||
|
export default { |
||||
|
name: "ExternalPlatformOffline", |
||||
|
data() { |
||||
|
return { |
||||
|
typeList:[ |
||||
|
{value:'1',label:'GIS+BIM'}, |
||||
|
{value:'2',label:'数字孪生'}, |
||||
|
{value:'3',label:'收费运营'}, |
||||
|
{value:'4',label:'桥梁监测'}, |
||||
|
{value:'5',label:'光纤'}, |
||||
|
], |
||||
|
// 遮罩层 |
||||
|
loading: true, |
||||
|
// 选中数组 |
||||
|
ids: [], |
||||
|
// 非单个禁用 |
||||
|
single: true, |
||||
|
// 非多个禁用 |
||||
|
multiple: true, |
||||
|
// 显示搜索条件 |
||||
|
showSearch: true, |
||||
|
// 总条数 |
||||
|
total: 0, |
||||
|
// 外部平台离线记录表格数据 |
||||
|
externalPlatformOfflineList: [], |
||||
|
// 弹出层标题 |
||||
|
title: "", |
||||
|
// 是否显示弹出层 |
||||
|
open: false, |
||||
|
// 查询参数 |
||||
|
queryParams: { |
||||
|
pageNum: 1, |
||||
|
pageSize: 10, |
||||
|
type: null, |
||||
|
offlineTime: null, |
||||
|
endTime: null |
||||
|
}, |
||||
|
// 表单参数 |
||||
|
form: {}, |
||||
|
// 表单校验 |
||||
|
rules: { |
||||
|
}, |
||||
|
pickerOptions: { |
||||
|
disabledDate(time) { |
||||
|
return time.getTime() > Date.now(); |
||||
|
} |
||||
|
}, |
||||
|
}; |
||||
|
}, |
||||
|
created() { |
||||
|
this.getList(); |
||||
|
}, |
||||
|
methods: { |
||||
|
|
||||
|
/** 查询外部平台离线记录列表 */ |
||||
|
getList() { |
||||
|
this.loading = true; |
||||
|
listExternalPlatformOffline(this.queryParams).then(response => { |
||||
|
this.externalPlatformOfflineList = response.rows; |
||||
|
this.total = response.total; |
||||
|
this.loading = false; |
||||
|
}); |
||||
|
}, |
||||
|
// 取消按钮 |
||||
|
cancel() { |
||||
|
this.open = false; |
||||
|
this.reset(); |
||||
|
}, |
||||
|
// 表单重置 |
||||
|
reset() { |
||||
|
this.form = { |
||||
|
id: null, |
||||
|
type: null, |
||||
|
offlineTime: null, |
||||
|
endTime: null |
||||
|
}; |
||||
|
this.resetForm("form"); |
||||
|
}, |
||||
|
/** 搜索按钮操作 */ |
||||
|
handleQuery() { |
||||
|
this.queryParams.pageNum = 1; |
||||
|
this.getList(); |
||||
|
}, |
||||
|
/** 重置按钮操作 */ |
||||
|
resetQuery() { |
||||
|
this.resetForm("queryForm"); |
||||
|
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 |
||||
|
getExternalPlatformOffline(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) { |
||||
|
updateExternalPlatformOffline(this.form).then(response => { |
||||
|
this.$modal.msgSuccess("修改成功"); |
||||
|
this.open = false; |
||||
|
this.getList(); |
||||
|
}); |
||||
|
} else { |
||||
|
addExternalPlatformOffline(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 delExternalPlatformOffline(ids); |
||||
|
}).then(() => { |
||||
|
this.getList(); |
||||
|
this.$modal.msgSuccess("删除成功"); |
||||
|
}).catch(() => {}); |
||||
|
}, |
||||
|
/** 导出按钮操作 */ |
||||
|
handleExport() { |
||||
|
this.download('externalPlatformOffline/export', { |
||||
|
...this.queryParams |
||||
|
}, `外部系统离线记录_${new Date().getTime()}.xlsx`) |
||||
|
} |
||||
|
} |
||||
|
}; |
||||
|
</script> |
@ -0,0 +1,94 @@ |
|||||
|
package com.zc.business.controller; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import javax.servlet.http.HttpServletResponse; |
||||
|
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.zc.business.domain.DcExternalPlatformOffline; |
||||
|
import com.zc.business.service.IDcExternalPlatformOfflineService; |
||||
|
import com.ruoyi.common.utils.poi.ExcelUtil; |
||||
|
import com.ruoyi.common.core.page.TableDataInfo; |
||||
|
|
||||
|
/** |
||||
|
* 外部平台离线记录Controller |
||||
|
* |
||||
|
* @author ruoyi |
||||
|
* @date 2024-11-14 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@RequestMapping("/externalPlatformOffline") |
||||
|
public class DcExternalPlatformOfflineController extends BaseController |
||||
|
{ |
||||
|
@Autowired |
||||
|
private IDcExternalPlatformOfflineService dcExternalPlatformOfflineService; |
||||
|
|
||||
|
/** |
||||
|
* 查询外部平台离线记录列表 |
||||
|
*/ |
||||
|
@GetMapping("/list") |
||||
|
public TableDataInfo list(DcExternalPlatformOffline dcExternalPlatformOffline) |
||||
|
{ |
||||
|
startPage(); |
||||
|
List<DcExternalPlatformOffline> list = dcExternalPlatformOfflineService.selectDcExternalPlatformOfflineList(dcExternalPlatformOffline); |
||||
|
return getDataTable(list); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 导出外部平台离线记录列表 |
||||
|
*/ |
||||
|
@PostMapping("/export") |
||||
|
public void export(HttpServletResponse response, DcExternalPlatformOffline dcExternalPlatformOffline) |
||||
|
{ |
||||
|
List<DcExternalPlatformOffline> list = dcExternalPlatformOfflineService.selectDcExternalPlatformOfflineList(dcExternalPlatformOffline); |
||||
|
ExcelUtil<DcExternalPlatformOffline> util = new ExcelUtil<>(DcExternalPlatformOffline.class); |
||||
|
util.exportExcel(response, list, "外部平台离线记录数据"); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 获取外部平台离线记录详细信息 |
||||
|
*/ |
||||
|
@GetMapping(value = "/{id}") |
||||
|
public AjaxResult getInfo(@PathVariable("id") Long id) |
||||
|
{ |
||||
|
return AjaxResult.success(dcExternalPlatformOfflineService.selectDcExternalPlatformOfflineById(id)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增外部平台离线记录 |
||||
|
*/ |
||||
|
@PostMapping |
||||
|
public AjaxResult add(@RequestBody DcExternalPlatformOffline dcExternalPlatformOffline) |
||||
|
{ |
||||
|
return toAjax(dcExternalPlatformOfflineService.insertDcExternalPlatformOffline(dcExternalPlatformOffline)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改外部平台离线记录 |
||||
|
*/ |
||||
|
@PutMapping |
||||
|
public AjaxResult edit(@RequestBody DcExternalPlatformOffline dcExternalPlatformOffline) |
||||
|
{ |
||||
|
return toAjax(dcExternalPlatformOfflineService.updateDcExternalPlatformOffline(dcExternalPlatformOffline)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除外部平台离线记录 |
||||
|
*/ |
||||
|
@DeleteMapping("/{ids}") |
||||
|
public AjaxResult remove(@PathVariable Long[] ids) |
||||
|
{ |
||||
|
return toAjax(dcExternalPlatformOfflineService.deleteDcExternalPlatformOfflineByIds(ids)); |
||||
|
} |
||||
|
} |
@ -0,0 +1,83 @@ |
|||||
|
package com.zc.business.domain; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
|
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; |
||||
|
|
||||
|
/** |
||||
|
* 外部平台离线记录对象 dc_external_platform_offline |
||||
|
* |
||||
|
* @author ruoyi |
||||
|
* @date 2024-11-14 |
||||
|
*/ |
||||
|
public class DcExternalPlatformOffline extends BaseEntity |
||||
|
{ |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** id */ |
||||
|
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") |
||||
|
private Date offlineTime; |
||||
|
|
||||
|
/** 结束时间 */ |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") |
||||
|
@Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") |
||||
|
private Date endTime; |
||||
|
|
||||
|
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 void setOfflineTime(Date offlineTime) |
||||
|
{ |
||||
|
this.offlineTime = offlineTime; |
||||
|
} |
||||
|
|
||||
|
public Date getOfflineTime() |
||||
|
{ |
||||
|
return offlineTime; |
||||
|
} |
||||
|
public void setEndTime(Date endTime) |
||||
|
{ |
||||
|
this.endTime = endTime; |
||||
|
} |
||||
|
|
||||
|
public Date getEndTime() |
||||
|
{ |
||||
|
return endTime; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public String toString() { |
||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
||||
|
.append("id", getId()) |
||||
|
.append("type", getType()) |
||||
|
.append("offlineTime", getOfflineTime()) |
||||
|
.append("endTime", getEndTime()) |
||||
|
.toString(); |
||||
|
} |
||||
|
} |
@ -0,0 +1,63 @@ |
|||||
|
package com.zc.business.mapper; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import com.zc.business.domain.DcExternalPlatformOffline; |
||||
|
|
||||
|
/** |
||||
|
* 外部平台离线记录Mapper接口 |
||||
|
* |
||||
|
* @author ruoyi |
||||
|
* @date 2024-11-14 |
||||
|
*/ |
||||
|
public interface DcExternalPlatformOfflineMapper |
||||
|
{ |
||||
|
/** |
||||
|
* 查询外部平台离线记录 |
||||
|
* |
||||
|
* @param id 外部平台离线记录主键 |
||||
|
* @return 外部平台离线记录 |
||||
|
*/ |
||||
|
public DcExternalPlatformOffline selectDcExternalPlatformOfflineById(Long id); |
||||
|
|
||||
|
/** |
||||
|
* 查询外部平台离线记录列表 |
||||
|
* |
||||
|
* @param dcExternalPlatformOffline 外部平台离线记录 |
||||
|
* @return 外部平台离线记录集合 |
||||
|
*/ |
||||
|
List<DcExternalPlatformOffline> selectDcExternalPlatformOfflineList(DcExternalPlatformOffline dcExternalPlatformOffline); |
||||
|
|
||||
|
/** |
||||
|
* 新增外部平台离线记录 |
||||
|
* |
||||
|
* @param dcExternalPlatformOffline 外部平台离线记录 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
int insertDcExternalPlatformOffline(DcExternalPlatformOffline dcExternalPlatformOffline); |
||||
|
|
||||
|
/** |
||||
|
* 修改外部平台离线记录 |
||||
|
* |
||||
|
* @param dcExternalPlatformOffline 外部平台离线记录 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
int updateDcExternalPlatformOffline(DcExternalPlatformOffline dcExternalPlatformOffline); |
||||
|
|
||||
|
/** |
||||
|
* 删除外部平台离线记录 |
||||
|
* |
||||
|
* @param id 外部平台离线记录主键 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
int deleteDcExternalPlatformOfflineById(Long id); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除外部平台离线记录 |
||||
|
* |
||||
|
* @param ids 需要删除的数据主键集合 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
int deleteDcExternalPlatformOfflineByIds(Long[] ids); |
||||
|
|
||||
|
int updateEndTimeByType(String type); |
||||
|
} |
@ -0,0 +1,61 @@ |
|||||
|
package com.zc.business.service; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import com.zc.business.domain.DcExternalPlatformOffline; |
||||
|
|
||||
|
/** |
||||
|
* 外部平台离线记录Service接口 |
||||
|
* |
||||
|
* @author ruoyi |
||||
|
* @date 2024-11-14 |
||||
|
*/ |
||||
|
public interface IDcExternalPlatformOfflineService |
||||
|
{ |
||||
|
/** |
||||
|
* 查询外部平台离线记录 |
||||
|
* |
||||
|
* @param id 外部平台离线记录主键 |
||||
|
* @return 外部平台离线记录 |
||||
|
*/ |
||||
|
public DcExternalPlatformOffline selectDcExternalPlatformOfflineById(Long id); |
||||
|
|
||||
|
/** |
||||
|
* 查询外部平台离线记录列表 |
||||
|
* |
||||
|
* @param dcExternalPlatformOffline 外部平台离线记录 |
||||
|
* @return 外部平台离线记录集合 |
||||
|
*/ |
||||
|
List<DcExternalPlatformOffline> selectDcExternalPlatformOfflineList(DcExternalPlatformOffline dcExternalPlatformOffline); |
||||
|
|
||||
|
/** |
||||
|
* 新增外部平台离线记录 |
||||
|
* |
||||
|
* @param dcExternalPlatformOffline 外部平台离线记录 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
int insertDcExternalPlatformOffline(DcExternalPlatformOffline dcExternalPlatformOffline); |
||||
|
|
||||
|
/** |
||||
|
* 修改外部平台离线记录 |
||||
|
* |
||||
|
* @param dcExternalPlatformOffline 外部平台离线记录 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
int updateDcExternalPlatformOffline(DcExternalPlatformOffline dcExternalPlatformOffline); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除外部平台离线记录 |
||||
|
* |
||||
|
* @param ids 需要删除的外部平台离线记录主键集合 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
int deleteDcExternalPlatformOfflineByIds(Long[] ids); |
||||
|
|
||||
|
/** |
||||
|
* 删除外部平台离线记录信息 |
||||
|
* |
||||
|
* @param id 外部平台离线记录主键 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
int deleteDcExternalPlatformOfflineById(Long id); |
||||
|
} |
@ -0,0 +1,93 @@ |
|||||
|
package com.zc.business.service.impl; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import com.zc.business.mapper.DcExternalPlatformOfflineMapper; |
||||
|
import com.zc.business.domain.DcExternalPlatformOffline; |
||||
|
import com.zc.business.service.IDcExternalPlatformOfflineService; |
||||
|
|
||||
|
/** |
||||
|
* 外部平台离线记录Service业务层处理 |
||||
|
* |
||||
|
* @author ruoyi |
||||
|
* @date 2024-11-14 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class DcExternalPlatformOfflineServiceImpl implements IDcExternalPlatformOfflineService |
||||
|
{ |
||||
|
@Autowired |
||||
|
private DcExternalPlatformOfflineMapper dcExternalPlatformOfflineMapper; |
||||
|
|
||||
|
/** |
||||
|
* 查询外部平台离线记录 |
||||
|
* |
||||
|
* @param id 外部平台离线记录主键 |
||||
|
* @return 外部平台离线记录 |
||||
|
*/ |
||||
|
@Override |
||||
|
public DcExternalPlatformOffline selectDcExternalPlatformOfflineById(Long id) |
||||
|
{ |
||||
|
return dcExternalPlatformOfflineMapper.selectDcExternalPlatformOfflineById(id); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 查询外部平台离线记录列表 |
||||
|
* |
||||
|
* @param dcExternalPlatformOffline 外部平台离线记录 |
||||
|
* @return 外部平台离线记录 |
||||
|
*/ |
||||
|
@Override |
||||
|
public List<DcExternalPlatformOffline> selectDcExternalPlatformOfflineList(DcExternalPlatformOffline dcExternalPlatformOffline) |
||||
|
{ |
||||
|
return dcExternalPlatformOfflineMapper.selectDcExternalPlatformOfflineList(dcExternalPlatformOffline); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增外部平台离线记录 |
||||
|
* |
||||
|
* @param dcExternalPlatformOffline 外部平台离线记录 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public int insertDcExternalPlatformOffline(DcExternalPlatformOffline dcExternalPlatformOffline) |
||||
|
{ |
||||
|
return dcExternalPlatformOfflineMapper.insertDcExternalPlatformOffline(dcExternalPlatformOffline); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改外部平台离线记录 |
||||
|
* |
||||
|
* @param dcExternalPlatformOffline 外部平台离线记录 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public int updateDcExternalPlatformOffline(DcExternalPlatformOffline dcExternalPlatformOffline) |
||||
|
{ |
||||
|
return dcExternalPlatformOfflineMapper.updateDcExternalPlatformOffline(dcExternalPlatformOffline); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 批量删除外部平台离线记录 |
||||
|
* |
||||
|
* @param ids 需要删除的外部平台离线记录主键 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public int deleteDcExternalPlatformOfflineByIds(Long[] ids) |
||||
|
{ |
||||
|
return dcExternalPlatformOfflineMapper.deleteDcExternalPlatformOfflineByIds(ids); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除外部平台离线记录信息 |
||||
|
* |
||||
|
* @param id 外部平台离线记录主键 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public int deleteDcExternalPlatformOfflineById(Long id) |
||||
|
{ |
||||
|
return dcExternalPlatformOfflineMapper.deleteDcExternalPlatformOfflineById(id); |
||||
|
} |
||||
|
} |
@ -0,0 +1,73 @@ |
|||||
|
<?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.DcExternalPlatformOfflineMapper"> |
||||
|
|
||||
|
<resultMap type="DcExternalPlatformOffline" id="DcExternalPlatformOfflineResult"> |
||||
|
<result property="id" column="id" /> |
||||
|
<result property="type" column="type" /> |
||||
|
<result property="offlineTime" column="offline_time" /> |
||||
|
<result property="endTime" column="end_time" /> |
||||
|
</resultMap> |
||||
|
|
||||
|
<sql id="selectDcExternalPlatformOfflineVo"> |
||||
|
select id, type, offline_time, end_time from dc_external_platform_offline |
||||
|
</sql> |
||||
|
|
||||
|
<select id="selectDcExternalPlatformOfflineList" parameterType="DcExternalPlatformOffline" resultMap="DcExternalPlatformOfflineResult"> |
||||
|
<include refid="selectDcExternalPlatformOfflineVo"/> |
||||
|
<where> |
||||
|
<if test="type != null and type != ''"> and type = #{type}</if> |
||||
|
<if test="offlineTime != null "> |
||||
|
and date_format(offline_time,'%Y-%m-%d') <= date_format(#{offlineTime},'%Y-%m-%d') |
||||
|
and (date_format(end_time,'%Y-%m-%d') >= date_format(#{offlineTime},'%Y-%m-%d') or isnull(end_time)) |
||||
|
</if> |
||||
|
</where> |
||||
|
order by id desc |
||||
|
</select> |
||||
|
|
||||
|
<select id="selectDcExternalPlatformOfflineById" parameterType="Long" resultMap="DcExternalPlatformOfflineResult"> |
||||
|
<include refid="selectDcExternalPlatformOfflineVo"/> |
||||
|
where id = #{id} |
||||
|
</select> |
||||
|
|
||||
|
<insert id="insertDcExternalPlatformOffline" parameterType="DcExternalPlatformOffline" useGeneratedKeys="true" keyProperty="id"> |
||||
|
insert into dc_external_platform_offline |
||||
|
<trim prefix="(" suffix=")" suffixOverrides=","> |
||||
|
<if test="type != null">type,</if> |
||||
|
<if test="offlineTime != null">offline_time,</if> |
||||
|
<if test="endTime != null">end_time,</if> |
||||
|
</trim> |
||||
|
<trim prefix="values (" suffix=")" suffixOverrides=","> |
||||
|
<if test="type != null">#{type},</if> |
||||
|
<if test="offlineTime != null">#{offlineTime},</if> |
||||
|
<if test="endTime != null">#{endTime},</if> |
||||
|
</trim> |
||||
|
</insert> |
||||
|
|
||||
|
<update id="updateDcExternalPlatformOffline" parameterType="DcExternalPlatformOffline"> |
||||
|
update dc_external_platform_offline |
||||
|
<trim prefix="SET" suffixOverrides=","> |
||||
|
<if test="type != null">type = #{type},</if> |
||||
|
<if test="offlineTime != null">offline_time = #{offlineTime},</if> |
||||
|
<if test="endTime != null">end_time = #{endTime},</if> |
||||
|
</trim> |
||||
|
where id = #{id} |
||||
|
</update> |
||||
|
<update id="updateEndTimeByType"> |
||||
|
update dc_external_platform_offline set end_time = now() |
||||
|
where isnull(end_time) and type = #{type} |
||||
|
</update> |
||||
|
|
||||
|
<delete id="deleteDcExternalPlatformOfflineById" parameterType="Long"> |
||||
|
delete from dc_external_platform_offline where id = #{id} |
||||
|
</delete> |
||||
|
|
||||
|
<delete id="deleteDcExternalPlatformOfflineByIds" parameterType="String"> |
||||
|
delete from dc_external_platform_offline where id in |
||||
|
<foreach item="id" collection="array" open="(" separator="," close=")"> |
||||
|
#{id} |
||||
|
</foreach> |
||||
|
</delete> |
||||
|
</mapper> |
Loading…
Reference in new issue