保存门诊号
parent
23dc187bf0
commit
539ccdbdd8
@ -0,0 +1,23 @@
|
||||
package com.docus.server.message.dao;
|
||||
|
||||
import com.docus.infrastructure.core.db.dao.IBaseDao;
|
||||
import com.docus.server.message.entity.TrInpatientOutpatient;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wyb
|
||||
*/
|
||||
public interface TrInpatientOutpatientDao extends IBaseDao<TrInpatientOutpatient> {
|
||||
/**
|
||||
* 插入住院和门诊关系
|
||||
* @param trInpatientOutpatientList 住院和门诊的关联信息
|
||||
*/
|
||||
void insertOrUpdateTrInpatientOutpatient(List<TrInpatientOutpatient> trInpatientOutpatientList);
|
||||
|
||||
/**
|
||||
* 根据住院病案主键删除和门诊关联
|
||||
* @param inpatientId 住院病案主键
|
||||
*/
|
||||
void deleteTrInpatientOutpatientByInpatientId(String inpatientId);
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package com.docus.server.message.dao.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.docus.infrastructure.core.db.dao.impl.BaseDaoImpl;
|
||||
import com.docus.infrastructure.redis.service.IdService;
|
||||
import com.docus.server.message.dao.TrInpatientOutpatientDao;
|
||||
import com.docus.server.message.entity.TrInpatientOutpatient;
|
||||
import com.docus.server.message.mapper.TrInpatientOutpatientMapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author wyb
|
||||
*/
|
||||
@Repository
|
||||
public class TrInpatientOutpatientDaoImpl extends BaseDaoImpl<TrInpatientOutpatientMapper, TrInpatientOutpatient> implements TrInpatientOutpatientDao {
|
||||
@Resource
|
||||
private IdService idService;
|
||||
|
||||
@Override
|
||||
public void insertOrUpdateTrInpatientOutpatient(List<TrInpatientOutpatient> trInpatientOutpatientList) {
|
||||
for (TrInpatientOutpatient tr : trInpatientOutpatientList) {
|
||||
if (Objects.isNull(tr.getId())) {
|
||||
tr.setId(idService.getDateSeq());
|
||||
}
|
||||
}
|
||||
saveOrUpdateBatch(trInpatientOutpatientList, 1000);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteTrInpatientOutpatientByInpatientId(String inpatientId) {
|
||||
LambdaQueryWrapper<TrInpatientOutpatient> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(TrInpatientOutpatient::getPatientId, inpatientId);
|
||||
baseMapper.delete(wrapper);
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package com.docus.server.message.entity;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author wyb
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "TrInpatientOutpatient对象", description = "住院和门诊关联关系表")
|
||||
public class TrInpatientOutpatient implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@ApiModelProperty("id")
|
||||
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
@ApiModelProperty("病案主键")
|
||||
private String patientId;
|
||||
@ApiModelProperty("门诊号")
|
||||
private String outpatientNo;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
package com.docus.server.message.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.docus.server.message.entity.TrInpatientOutpatient;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface TrInpatientOutpatientMapper extends BaseMapper<TrInpatientOutpatient> {
|
||||
}
|
Loading…
Reference in New Issue