This commit is contained in:
likehai 2023-12-04 19:30:50 +08:00
parent bf91daafd8
commit 46e2bc23ae
7 changed files with 213 additions and 47 deletions

View File

@ -37,6 +37,14 @@ public class MaintainUpkeepInfoController extends BaseController {
return getDataTable(list);
}
/**
* 查询维保次数
*/
@GetMapping("/listCount")
public AjaxResult listCount(MaintainUpkeepInfo maintainUpkeepInfo) {
return AjaxResult.success(maintainUpkeepInfoService.listCount(maintainUpkeepInfo));
}
/**
* 导出维修保养记录列表
*/

View File

@ -1,6 +1,7 @@
package com.god.maintenance.mapper;
import java.util.List;
import java.util.Map;
import com.god.maintenance.domain.MaintainUpkeepInfo;
@ -27,6 +28,22 @@ public interface MaintainUpkeepInfoMapper {
*/
List<MaintainUpkeepInfo> selectMaintainUpkeepInfoList(MaintainUpkeepInfo maintainUpkeepInfo);
/**
* 查询维修保养次数列表
*
* @param maintainUpkeepInfo 维修保养记录
* @return 维修保养记录集合
*/
Map<String, Long> listCount(MaintainUpkeepInfo maintainUpkeepInfo);
/**
* 查询维修保养次数列表
*
* @param maintainUpkeepInfo 维修保养记录
* @return 维修保养记录集合
*/
Map<String, Long> listCountAll(MaintainUpkeepInfo maintainUpkeepInfo);
/**
* 新增维修保养记录
*

View File

@ -1,6 +1,7 @@
package com.god.maintenance.service;
import java.util.List;
import java.util.Map;
import com.god.maintenance.domain.MaintainUpkeepInfo;
@ -27,6 +28,14 @@ public interface IMaintainUpkeepInfoService {
*/
List<MaintainUpkeepInfo> selectMaintainUpkeepInfoList(MaintainUpkeepInfo maintainUpkeepInfo);
/**
* 查询维修保养次数列表
*
* @param maintainUpkeepInfo 维修保养记录
* @return 维修保养记录集合
*/
Map<String, Long> listCount(MaintainUpkeepInfo maintainUpkeepInfo);
/**
* 新增维修保养记录
*

View File

@ -1,6 +1,8 @@
package com.god.maintenance.service.impl;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.god.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -42,6 +44,19 @@ public class MaintainUpkeepInfoServiceImpl implements IMaintainUpkeepInfoService
return maintainUpkeepInfoMapper.selectMaintainUpkeepInfoList(maintainUpkeepInfo);
}
/**
* 查询维修保养次数列表
*
* @param maintainUpkeepInfo 维修保养记录
* @return 维修保养记录集合
*/
public Map<String, Long> listCount(MaintainUpkeepInfo maintainUpkeepInfo) {
Map<String, Long> stringLongMap = maintainUpkeepInfoMapper.listCount(maintainUpkeepInfo);
Map<String, Long> stringLongMap1 = maintainUpkeepInfoMapper.listCountAll(maintainUpkeepInfo);
stringLongMap.put("0", stringLongMap1.get("0"));
return stringLongMap;
}
/**
* 新增维修保养记录
*

View File

@ -17,6 +17,8 @@
<result property="remark" column="remark"/>
<result property="reserveOne" column="reserve_one"/>
<result property="facilityId" column="facility_id"/>
<result property="startTimeA" column="startTimeA"/>
<result property="endTimeA" column="endTimeA"/>
</resultMap>
<sql id="selectMaintainUpkeepInfoVo">
@ -40,7 +42,8 @@
resultMap="MaintainUpkeepInfoResult">
<include refid="selectMaintainUpkeepInfoVo"/>
<where>
<if test="facilityName != null and facilityName != ''">and i.facility_name like concat('%', #{facilityName},
<if test="facilityName != null and facilityName != ''">and i.facility_name like concat('%',
#{facilityName},
'%')
</if>
<if test="facilityType != null and facilityType != ''">and i.facility_type = #{facilityType}</if>
@ -49,16 +52,71 @@
<if test="maintainUpkeepType != null and maintainUpkeepType != ''">and i.maintain_upkeep_type =
#{maintainUpkeepType}
</if>
<if test="distinctionPort != null and distinctionPort != ''">and i.distinction_port = #{distinctionPort}</if>
<if test="nowTime != null ">and i.now_time = #{nowTime}</if>
<if test="distinctionPort != null and distinctionPort != ''">and i.distinction_port = #{distinctionPort}
</if>
<if test="startTimeA != null ">and i.now_time >= #{startTimeA}</if>
<if test="endTimeA != null ">and #{endTimeA} >= i.now_time</if>
<if test="maintenanceUser != null and maintenanceUser != ''">and i.maintenance_user like concat('%',
#{maintenanceUser}, '%')
</if>
<if test="maintenanceInfo != null and maintenanceInfo != ''">and i.maintenance_info = #{maintenanceInfo}</if>
<if test="maintenanceInfo != null and maintenanceInfo != ''">and i.maintenance_info = #{maintenanceInfo}
</if>
<if test="reserveOne != null and reserveOne != ''">and i.reserve_one = #{reserveOne}</if>
</where>
</select>
<select id="listCount" parameterType="com.god.maintenance.domain.MaintainUpkeepInfo" resultType="map">
select count(1) as shuLiang,
case when maintain_upkeep_type = '1' then '1' ELSE '2' END AS maintainUpkeepType
from maintain_upkeep_info
<where>
<if test="facilityId != null and facilityId != ''">and facility_id = #{facilityId}</if>
<if test="facilityBrand != null and facilityBrand != ''">and facility_brand = #{facilityBrand}</if>
<if test="maintainUpkeepType != null and maintainUpkeepType != ''">and maintain_upkeep_type =
#{maintainUpkeepType}
</if>
<if test="distinctionPort != null and distinctionPort != ''">and distinction_port = #{distinctionPort}
</if>
<if test="startTimeA != null ">and now_time >= #{startTimeA}</if>
<if test="endTimeA != null ">and #{endTimeA} >= now_time</if>
<if test="maintenanceUser != null and maintenanceUser != ''">and maintenance_user like concat('%',
#{maintenanceUser}, '%')
</if>
<if test="maintenanceInfo != null and maintenanceInfo != ''">and maintenance_info = #{maintenanceInfo}
</if>
<if test="reserveOne != null and reserveOne != ''">and reserve_one = #{reserveOne}</if>
</where>
GROUP BY maintain_upkeep_type
</select>
<select id="listCountAll" parameterType="com.god.maintenance.domain.MaintainUpkeepInfo" resultType="map">
select count(1) as shuLiang,
"0" AS maintainUpkeepType
from maintain_upkeep_info
<where>
<if test="facilityName != null and facilityName != ''">and facility_name like concat('%',
#{facilityName},
'%')
</if>
<if test="facilityType != null and facilityType != ''">and facility_type = #{facilityType}</if>
<if test="facilityId != null and facilityId != ''">and facility_id = #{facilityId}</if>
<if test="facilityBrand != null and facilityBrand != ''">and facility_brand = #{facilityBrand}</if>
<if test="maintainUpkeepType != null and maintainUpkeepType != ''">and maintain_upkeep_type =
#{maintainUpkeepType}
</if>
<if test="distinctionPort != null and distinctionPort != ''">and distinction_port = #{distinctionPort}
</if>
<if test="startTimeA != null ">and now_time >= #{startTimeA}</if>
<if test="endTimeA != null ">and #{endTimeA} >= now_time</if>
<if test="maintenanceUser != null and maintenanceUser != ''">and maintenance_user like concat('%',
#{maintenanceUser}, '%')
</if>
<if test="maintenanceInfo != null and maintenanceInfo != ''">and maintenance_info = #{maintenanceInfo}
</if>
<if test="reserveOne != null and reserveOne != ''">and reserve_one = #{reserveOne}</if>
</where>
</select>
<select id="selectMaintainUpkeepInfoById" parameterType="String" resultMap="MaintainUpkeepInfoResult">
<include refid="selectMaintainUpkeepInfoVo"/>
where i.id = #{id}

View File

@ -8,6 +8,14 @@ export function listMaintainUpkeepInfo(query) {
params: query
})
}
// 查询维修保养记录列表
export function listCount(query) {
return request({
url: '/maintenance/maintainUpkeepInfo/listCount',
method: 'get',
params: query
})
}
// 查询维修保养记录详细
export function getMaintainUpkeepInfo(id) {

View File

@ -19,8 +19,8 @@
</el-select>
</el-form-item>
<el-form-item label="维类型1维修2保养" prop="maintainUpkeepType">
<el-select v-model="queryParams.maintainUpkeepType" placeholder="请选择维类型1维修2保养" clearable>
<el-form-item label="维保类型" prop="maintainUpkeepType">
<el-select v-model="queryParams.maintainUpkeepType" placeholder="请选择维保类型" clearable>
<el-option
v-for="dict in dict.type.maintain_upkeep_type"
:key="dict.value"
@ -29,14 +29,25 @@
/>
</el-select>
</el-form-item>
<!-- <el-form-item label="维保时间" prop="nowTime">-->
<el-form-item label="维保时间" prop="nowTime">
<!-- <el-date-picker clearable-->
<!-- v-model="queryParams.nowTime"-->
<!-- type="date"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- placeholder="请选择维保时间">-->
<!-- placeholder="请选择维保时间"-->
<!-- >-->
<!-- </el-date-picker>-->
<!-- </el-form-item>-->
<el-date-picker
v-model="value1"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
@change="selectDataPickerA"
value-format="yyyy-MM-dd"
>
</el-date-picker>
</el-form-item>
<el-form-item label="维保人" prop="maintenanceUser">
<el-input
v-model="queryParams.maintenanceUser"
@ -52,16 +63,16 @@
</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="primary"-->
<!-- plain-->
<!-- icon="el-icon-plus"-->
<!-- size="mini"-->
<!-- @click="handleAdd"-->
<!-- >新增-->
<!-- </el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="success"-->
@ -97,6 +108,14 @@
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-row style="width: 45rem;">
<el-col :span="8" class="extra-col">维保总数{{ zongShu }}</el-col>
<el-col :span="8" class="extra-col">维修次数{{ weiXiu }}</el-col>
<el-col :span="8" class="extra-col">保养次数{{ baoYang }}</el-col>
</el-row>
<el-row :gutter="10" class="mb8">
<!-- 详情列表-->
</el-row>
<el-table v-loading="loading" :data="maintainUpkeepInfoList" @selection-change="handleSelectionChange">
<!-- <el-table-column type="selection" width="55" align="center" />-->
<!-- <el-table-column label="主键ID" align="center" prop="id" />-->
@ -122,24 +141,24 @@
<el-table-column label="维保内容" align="center" prop="maintenanceInfo" :show-overflow-tooltip="true"/>
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true"/>
<!-- <el-table-column label="备用字段" align="center" prop="reserveOne" />-->
<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-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
@ -216,7 +235,7 @@ import {
getMaintainUpkeepInfo,
delMaintainUpkeepInfo,
addMaintainUpkeepInfo,
updateMaintainUpkeepInfo
updateMaintainUpkeepInfo, listCount
} from '@/api/maintenance/maintainUpkeepInfo'
import { listDeviceManage } from '@/api/deviceInfo/deviceManage'
@ -252,15 +271,23 @@ export default {
facilityName: null,
facilityType: null,
facilityBrand: null,
maintainUpkeepType: '1',
maintainUpkeepType: null,
distinctionPort: '9210',
nowTime: null,
maintenanceUser: null,
maintenanceInfo: null,
reserveOne: null
reserveOne: null,
starTimeA: null,
endTimeA: null
},
//
form: {},
//
zongShu: '0',
weiXiu: '0',
baoYang: '0',
//
value1: null,
//
rules: {
facilityName: [
@ -288,6 +315,9 @@ export default {
listDeviceManage(queryParamsA).then(response => {
this.deviceManageList = response.rows
})
// listCount(this.queryParams).then(res =>{
// console.log(res.data)
// })
},
//
cancel() {
@ -302,15 +332,20 @@ export default {
facilityId: null,
facilityType: null,
facilityBrand: null,
maintainUpkeepType: '1',
maintainUpkeepType: null,
distinctionPort: '9210',
nowTime: null,
maintenanceUser: null,
maintenanceInfo: null,
remark: null,
reserveOne: null
reserveOne: null,
starTimeA: null,
endTimeA: null
}
this.resetForm('form')
this.value1 = null
this.queryParams.starTimeA = null
this.queryParams.endTimeA = null
},
/** 搜索按钮操作 */
handleQuery() {
@ -319,6 +354,9 @@ export default {
},
/** 重置按钮操作 */
resetQuery() {
this.value1 = null
this.queryParams.starTimeA = null
this.queryParams.endTimeA = null
this.resetForm('queryForm')
this.handleQuery()
},
@ -380,7 +418,20 @@ export default {
this.download('maintenance/maintainUpkeepInfo/export', {
...this.queryParams
}, `maintainUpkeepInfo_${new Date().getTime()}.xlsx`)
},
//
selectDataPickerA(res) {
console.log(res)
this.queryParams.startTimeA = res[0]
this.queryParams.endTimeA = res[1]
}
}
}
</script>
<style scoped>
.extra-col {
box-shadow: 2px 2px 3px #25252525, -2px -2px 2px #23232312;
padding: 10px;
border-radius: 4px;
}
</style>