eight
2024-09-19 a940b56e9781e2b4e56dbe05a896dba33a6905c6
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
42
43
44
package cn.lihu.jh.module.ecg.dal.mysql.call;
 
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.call.CallDO;
import org.apache.ibatis.annotations.Mapper;
import cn.lihu.jh.module.ecg.controller.admin.call.vo.*;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
 
/**
 * 叫号 Mapper
 *
 * @author 马剑波
 */
@Mapper
public interface CallMapper extends BaseMapperX<CallDO> {
 
    default PageResult<CallDO> selectPage(CallPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<CallDO>()
                .eqIfPresent(CallDO::getPatId, reqVO.getPatId())
                .likeIfPresent(CallDO::getPatName, reqVO.getPatName())
                .eqIfPresent(CallDO::getPatGender, reqVO.getPatGender())
                .eqIfPresent(CallDO::getSeqNum, reqVO.getSeqNum())
                .eqIfPresent(CallDO::getPassed, reqVO.getPassed())
                .eqIfPresent(CallDO::getExpired, reqVO.getExpired())
                .eqIfPresent(CallDO::getCalled, reqVO.getCalled())
                .eqIfPresent(CallDO::getJumpFlag, reqVO.getJumpFlag())
                .eqIfPresent(CallDO::getRoomId, reqVO.getRoomId())
                .likeIfPresent(CallDO::getRoomName, reqVO.getRoomName())
                .eqIfPresent(CallDO::getBedNo, reqVO.getBedNo())
                .betweenIfPresent(CallDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(CallDO::getId));
    }
 
    @Select("select * from lihu.call_patient where pat_id = #{patId} order by id desc limit 1")
    CallDO getLatestPatientCall(@Param("patId") String patId);
 
    @Select("select * from lihu.call_patient where called = 0 order by id limit 1")
    CallDO getNextCall();
}