@@ -217,20 +217,12 @@ public class BusPumpController{
}
@ApiOperation("获取注液信息和病人信息")
- @PostMapping("/getPumpInfoNew")
- public CommonResult getPumpInfoNew(@RequestBody PumpNewParam pumpParam) throws Exception{
+ @PostMapping("/getPumpInfoListNew")
+ public CommonResult getPumpInfoListNew(@RequestBody PumpNewParam pumpParam) throws Exception{
try{
- QueryWrapper<BusPatientEntity> pie = new QueryWrapper<BusPatientEntity>();
- if(StrUtil.isNotBlank(pumpParam.getPatientId())){
- pie.eq(StrUtil.isNotBlank(pumpParam.getPatientId()),"patient_id",pumpParam.getPatientId());
- } else {
- return CommonResult.failed("请输入患者ID");
- }
- BusPatientEntity patientInfoEntity = iBusPatientService.getOne(pie);
- pumpParam.setPatientCode(patientInfoEntity.getPatientCode());
- List<PumpVo> pumpVo = iBusPumpEntityService.queryPumpInfoNew(pumpParam);
- if(!pumpVo.isEmpty()){
- return CommonResult.success(pumpVo.get(0));
+ IPage<PumpVo> iPage = iBusPumpEntityService.queryPumpInfoNew(pumpParam);;
+ if( iPage.getRecords().size() > 0 ){
+ return CommonResult.success(iPage);
return CommonResult.noData();
} catch (Exception e) {
@@ -61,7 +61,7 @@ public interface IBusPumpService extends IService<BusPumpEntity> {
* 获取注液信息和病人信息对应NB新开发
* @return
*/
- List<PumpVo> queryPumpInfoNew(PumpNewParam pumpParam);
+ IPage<PumpVo> queryPumpInfoNew(PumpNewParam pumpParam);
void removePump(List<String> ids);
@@ -192,7 +192,7 @@ public class BusPumpServiceImpl extends ServiceImpl<BusPumpMapper, BusPumpEntity
@Override
- public List<PumpVo> queryPumpInfoNew(PumpNewParam pumpParam) {
+ public IPage<PumpVo> queryPumpInfoNew(PumpNewParam pumpParam) {
//特殊处理报警
// 输液结束 未装药盒 堵塞 极限 电量耗尽 气泡 输注总量 电机失控 机械故障
String[] alarmList = {"输液结束","未装药盒", "堵塞", "极限", "电量耗尽", "气泡", "输注总量", "电机失控", "机械故障"};
@@ -209,8 +209,10 @@ public class BusPumpServiceImpl extends ServiceImpl<BusPumpMapper, BusPumpEntity
}else if(Boolean.FALSE.equals(pumpParam.getTip())){
pumpParam.setTipList(Arrays.asList(tipList));
-
- return this.getBaseMapper().queryPumpInfoNew(pumpParam);
+ IPage<PumpVo> iPage = new Page<>(pumpParam.getPageNo(), pumpParam.getPageSize());
+ List<PumpVo> pumpVos = this.getBaseMapper().queryPumpInfoNew(pumpParam);
+ iPage.setRecords(pumpVos);
+ return iPage;
@@ -22,10 +22,16 @@ import java.util.List;
@ApiModel(value = "PumpNewParam")
public class PumpNewParam {
+ @ApiModelProperty(value = "几页")
+ private Integer pageNo=1;
+
+ @ApiModelProperty(value = "条数")
+ private Integer pageSize=10;
@ApiModelProperty(value = "患者ID")
private String patientId;
- @ApiModelProperty(value = "住院号")
+ @ApiModelProperty(value = "住院号",required = true)
private String patientCode;
@ApiModelProperty(value = "医院编码")
@@ -312,8 +312,12 @@
AND p.patient_code = pi.patient_code
AND p.hospital_code = pi.hospital_code
<where>
- AND p.hospital_code = #{pumpParam.hospitalCode}
- AND pi.patient_code IS NOT NULL
+ <if test="pumpParam.hospitalCode != null and pumpParam.hospitalCode != ''">
+ AND p.hospital_code = #{pumpParam.hospitalCode}
+ </if>
+ <if test="pumpParam.patientCode != null and pumpParam.patientCode != ''">
+ AND p.patient_code = #{pumpParam.patientCode}
<if test="pumpParam.pumpCode != null and pumpParam.pumpCode != ''">
AND p.pump_code = #{pumpParam.pumpCode}
</if>