package com.bofeng.service; import com.baomidou.mybatisplus.mapper.EntityWrapper; import com.bofeng.dao.QzTaskDao; import com.bofeng.dao.RbMapper; import com.bofeng.entity.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; @Service public class RbService { @Autowired private RbMapper rbMapper; public List selectAll (Long userId) { List sysUptownUnits = rbMapper.selectDY(userId); return sysUptownUnits; } public List selectXq (Long str) { // userId = 1224706869998772226L; // List sysUptownHouses = rbMapper.selectList(new EntityWrapper().eq("ridgepole",ridgepole).eq("unit",unit)); Date date = new Date(); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); String dateStr = simpleDateFormat.format(date); List sysUptownHousesss = rbMapper.selectMp(str,dateStr); return sysUptownHousesss; } public List selectYcXq (Long houseId) { Date date = new Date(); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); String dateStr = simpleDateFormat.format(date); List sysUptownHouses = rbMapper.selectYcXq(houseId, dateStr); String bingqingDesc = ""; if(sysUptownHouses.size() != 0 ){ for (int i = 0; i < sysUptownHouses.size(); i++) { Integer cough = sysUptownHouses.get(i).getCough(); if(cough != null && cough ==1){ bingqingDesc += "偶尔短暂咳嗽、"; }else if(cough != null && cough ==2){ bingqingDesc += "咳嗽轻度影响生活、"; }else if(cough != null && cough ==3){ bingqingDesc += "咳嗽严重影响生活、"; } Integer muscle = sysUptownHouses.get(i).getMuscle(); if(muscle != null && muscle ==1){ bingqingDesc += "肌肉按压有酸痛、"; }else if(muscle != null && muscle ==2){ bingqingDesc += "偶尔肌肉按压酸痛、"; }else if(muscle != null && muscle ==3){ bingqingDesc += "肌肉按压持续酸痛、"; } Integer dyspnea = sysUptownHouses.get(i).getDyspnea(); if(dyspnea != null && dyspnea ==1){ bingqingDesc += "呼吸急走或上坡气短、"; }else if(dyspnea != null && dyspnea ==2){ bingqingDesc += "呼吸气短而走路变慢、"; }else if(dyspnea != null && dyspnea ==3){ bingqingDesc += "呼吸走路数分钟后气短、"; }else if(dyspnea != null && dyspnea ==4){ bingqingDesc += "呼吸气短无法离开房间、"; } Integer fatigue = sysUptownHouses.get(i).getFatigue(); if(fatigue !=null && fatigue == 1){ bingqingDesc += "可体力劳动但觉得累、"; }else if(fatigue !=null && fatigue == 2){ bingqingDesc += "轻体力劳动后长时间不能恢复、"; }else if(fatigue !=null && fatigue == 3){ bingqingDesc += "不能正常生活、"; } Integer diarrhea = sysUptownHouses.get(i).getDiarrhea(); if(diarrhea !=null && diarrhea == 1){ bingqingDesc += "轻度腹泻少于于3次、"; }else if(diarrhea !=null && diarrhea == 2){ bingqingDesc += "中度腹泻4-6次、"; }else if(diarrhea !=null && diarrhea == 3){ bingqingDesc += "重度腹泻超过6次、"; } Integer singleRoom = sysUptownHouses.get(i).getSingleRoom(); if(singleRoom != null && singleRoom == 1){ bingqingDesc += "单间隔离"; } sysUptownHouses.get(i).setZhengzhuang(bingqingDesc); } } return sysUptownHouses; } }