From b8ed4828e4d798111d36fc58ebb718ebe62359b9 Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期四, 21 十一月 2024 10:31:15 +0800
Subject: [PATCH] HIS工号
---
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/devmanage/DeviceMapper.java | 37 ++++++++++++++++++++++++++++++++-----
1 files changed, 32 insertions(+), 5 deletions(-)
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/devmanage/DeviceMapper.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/devmanage/DeviceMapper.java
index b7434bd..125c9f9 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/devmanage/DeviceMapper.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/devmanage/DeviceMapper.java
@@ -1,15 +1,17 @@
package cn.lihu.jh.module.ecg.dal.mysql.devmanage;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
import java.util.*;
import cn.lihu.jh.framework.common.pojo.PageResult;
import cn.lihu.jh.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.lihu.jh.framework.mybatis.core.mapper.BaseMapperX;
import cn.lihu.jh.module.ecg.dal.dataobject.devmanage.DeviceDO;
-import org.apache.ibatis.annotations.Mapper;
+import cn.lihu.jh.module.ecg.dal.dataobject.devmanage.DeviceStatisticDO;
+import cn.lihu.jh.module.ecg.dal.dataobject.jobrecord.JobRecordStatisticDO;
+import org.apache.ibatis.annotations.*;
import cn.lihu.jh.module.ecg.controller.admin.devmanage.vo.*;
-import org.apache.ibatis.annotations.Param;
-import org.apache.ibatis.annotations.Select;
/**
* 璁惧 Mapper
@@ -22,15 +24,40 @@
default PageResult<DeviceDO> selectPage(DevicePageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<DeviceDO>()
.eqIfPresent(DeviceDO::getDevId, reqVO.getDevId())
+ .inIfPresent(DeviceDO::getState, reqVO.getState())
.eqIfPresent(DeviceDO::getCategory, reqVO.getCategory())
.eqIfPresent(DeviceDO::getBrand, reqVO.getBrand())
.eqIfPresent(DeviceDO::getModel, reqVO.getModel())
.betweenIfPresent(DeviceDO::getPurchaseDate, reqVO.getPurchaseDate())
.betweenIfPresent(DeviceDO::getCreateTime, reqVO.getCreateTime())
- .orderByDesc(DeviceDO::getId));
+ .orderByAsc(DeviceDO::getStateDate));
}
@Select("select * from lihu.device where dev_id=#{devId}")
+ @Results({
+ @Result(property = "patDetails", column = "pat_details", typeHandler=com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler.class)
+ })
DeviceDO getDeviceByDevId(@Param("devId") String devId);
-}
\ No newline at end of file
+ @Update("update lihu.device set state=#{state}, state_date=#{stateDate} where dev_id=#{devId}")
+ Integer updateDevState(@Param("devId") String devId, @Param("state") Integer state, @Param("stateDate") LocalDate stateDate);
+
+ @Select("<script>" +
+ "select category, state, count(1) as dev_count from lihu.device " +
+ " <where> deleted = 0 " +
+ " <if test=\"category != null and category != ''\"> " +
+ " and category = #{category} " +
+ " </if> " +
+ " <if test=\"brand != null and brand != ''\"> " +
+ " and brand = #{brand} " +
+ " </if> " +
+ " <if test=\"model != null and model != ''\"> " +
+ " and model = #{model} " +
+ " </if> " +
+ " </where> " +
+ " group by category, state " +
+ " order by category " +
+ "</script>")
+ List<DeviceStatisticDO> getDevStatistic(DevicePageReqVO pageReqVO);
+
+}
--
Gitblit v1.9.3