| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- package com.coffee.bus.service;
- import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
- import com.coffee.bus.entity.BusClinicEntity;
- import com.coffee.bus.mapper.BusClinicMapper;
- import com.coffee.common.crud.BaseService;
- import lombok.extern.slf4j.Slf4j;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.context.annotation.Lazy;
- import org.springframework.stereotype.Service;
- /**
- * @author lifang
- * @version 1.0.0
- * @ClassName LocalBusHospitalService.java
- * @Description TODO
- * @createTime 2022年03月19日 09:27:00
- */
- @Service
- @Slf4j
- public class LocalBusClinicService extends BaseService<BusClinicMapper, BusClinicEntity,String> {
- @Autowired
- @Lazy
- private LocalBusDeviceUsingService netPumpService;
- @Override
- public void validateBeforeSave(BusClinicEntity entity) {
- }
- @Override
- public void validateBeforeUpdate(BusClinicEntity entity) {
- }
- @Override
- public void validateBeforeDelete(String id) {
- }
- /**
- * 判断当前病人是否存在临床信息
- * @param hospitalId 医院id
- * @param patientCode 病号
- * @return
- */
- public boolean existClinic(String hospitalId,String patientCode){
- return this.getOne(new QueryWrapper<BusClinicEntity>().lambda()
- .eq(BusClinicEntity::getPatientCode, patientCode)
- .eq(BusClinicEntity::getTenantId,hospitalId)
- .eq(BusClinicEntity::getFinished, 0)) == null;
- }
- /**
- * 获取当前病号的临床信息
- * @param hospitalId
- * @param patientCode
- * @return
- */
- public BusClinicEntity getCurrentClinic(String hospitalId,String patientCode){
- return this.baseMapper.getCurrentClinic(hospitalId,patientCode);
- }
- @Override
- public boolean save(BusClinicEntity entity) {
- return super.save(entity);
- }
- }
|