eight
2024-09-29 fb1c355f7b38d493816b4cf94a20060887c524a0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package cn.lihu.jh.module.ecg.dal.mysql.devmanage;
 
import java.time.LocalDate;
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.controller.admin.devmanage.vo.*;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
 
/**
 * 设备 Mapper
 *
 * @author majianbo
 */
@Mapper
public interface DeviceMapper extends BaseMapperX<DeviceDO> {
 
    default PageResult<DeviceDO> selectPage(DevicePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DeviceDO>()
                .eqIfPresent(DeviceDO::getDevId, reqVO.getDevId())
                .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));
    }
 
    @Select("select * from lihu.device where dev_id=#{devId}")
    DeviceDO getDeviceByDevId(@Param("devId") String devId);
 
    @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);
 
}