获取事件记录接口修改

This commit is contained in:
yu 2024-11-01 15:52:46 +08:00
parent 422704d5dd
commit cf8fd0bb1b
4 changed files with 46 additions and 18 deletions

View File

@ -10,7 +10,7 @@ public class EventLogDto {
private String endTime;
private String attributeCode;
private String windTurbinesCode;
private String userName;

View File

@ -56,6 +56,10 @@ public class SysOperationLogVo {
* 操作描述
*/
private String optDesc;
/**
* 设备名称
*/
private String name;

View File

@ -12,25 +12,47 @@
<result property="attributeCode" column="attribute_code" jdbcType="VARCHAR"/>
<result property="attributeName" column="attribute_name" jdbcType="VARCHAR"/>
<result property="optDesc" column="opt_desc" jdbcType="VARCHAR"/>
<result property="name" column="name" jdbcType="VARCHAR"/>
</resultMap>
<select id="getEventLogList" resultMap="EnumValuesMap">
select e.* from sys_operation_log e
select
sol.*,
se."name"
from sys_operation_log sol
left join
sys_equipment se on sol.device_id = se.id
<where>
<if test="info.startTime != null and info.endTime != null">
and e.opt_time &gt;= to_timestamp(#{info.startTime}, 'YYYY-MM-DD HH24:MI:SS')
and e.opt_time &lt;= to_timestamp(#{info.endTime}, 'YYYY-MM-DD HH24:MI:SS')
and sol.opt_time &gt;= to_timestamp(#{info.startTime}, 'YYYY-MM-DD HH24:MI:SS')
and sol.opt_time &lt;= to_timestamp(#{info.endTime}, 'YYYY-MM-DD HH24:MI:SS')
</if>
<if test="info.attributeCode != null and info.attributeCode != ''">
and e.attribute_code =#{info.attributeCode}
<if test="info.windTurbinesCode != null and info.windTurbinesCode != ''">
and se.code =#{info.windTurbinesCode}
</if>
<if test="info.userName != null and info.userName != ''">
and e.user_name like concat('%',#{info.userName},'%')
and sol.user_name like concat('%',#{info.userName},'%')
</if>
</where>
order by e.opt_time desc
order by sol.opt_time desc
</select>
<!-- <select id="getEventLogList" resultMap="EnumValuesMap">-->
<!-- select e.* from sys_operation_log e-->
<!-- <where>-->
<!-- <if test="info.startTime != null and info.endTime != null">-->
<!-- and e.opt_time &gt;= to_timestamp(#{info.startTime}, 'YYYY-MM-DD HH24:MI:SS')-->
<!-- and e.opt_time &lt;= to_timestamp(#{info.endTime}, 'YYYY-MM-DD HH24:MI:SS')-->
<!-- </if>-->
<!-- <if test="info.attributeCode != null and info.attributeCode != ''">-->
<!-- and e.attribute_code =#{info.attributeCode}-->
<!-- </if>-->
<!-- <if test="info.userName != null and info.userName != ''">-->
<!-- and e.user_name like concat('%',#{info.userName},'%')-->
<!-- </if>-->
<!-- </where>-->
<!-- order by e.opt_time desc-->
<!-- </select>-->
</mapper>

View File

@ -24,7 +24,7 @@ POST 请求接口
{
"startTime": "2024-10-21 23:00:00:00",
"endTime": "2024-10-31 23:00:00:00",YES
"attributeCode": "SC-01",
"windTurbinesCode": "SC-01",
"userName": "张三",
"pageNum": 1,
"pageSize": 10
@ -36,7 +36,7 @@ POST 请求接口
| ------------ |---------|-----|--------|
| startTime | String | YES | 开始时间 |
| endTime | String | YES | 结束时间 |
| attributeCode | String | YES | 风机编号 |
| windTurbinesCode | String | YES | 风机编号 |
| userName | String | YES | 操作人员 |
| pageNum | Integer | NO | 当前页 |
| pageSize | Integer | NO | 每页显示大小 |
@ -57,7 +57,8 @@ POST 请求接口
"deviceId": 863256444266222,
"attributeCode": "testCode",
"attributeName": "测试遥控2",
"optDesc": "手动调试2"
"optDesc": "手动调试2",
"name": "A-001"
}
],
"code": 200,
@ -69,7 +70,7 @@ POST 请求接口
返参描述
| 参数名 | 参数类型 | 可选 | 描述 |
| ------------- |--------| ---- |--------|
|---------------|--------| ---- |--------|
| id | Long | 否 | id |
| optTime | String | 否 | 时间 |
| attributeCode | String | 否 | 风机编号 |
@ -77,6 +78,7 @@ POST 请求接口
| optDesc | String | 否 | 操作详情 |
| userName | String | 否 | 操作员 |
| deviceId | Long | 否 | 操作设备id |
| name | String | 否 | 设备名称 |
### 2.2 手动操作相关接口