| | |
| | | |
| | | @Override |
| | | public OutPark count4(Integer bId) { |
| | | // OutPark outPark = null; |
| | | // try { |
| | | // String s = redisTemplate.opsForValue().get("outPark-"+bId); |
| | | // if(!StringUtil.isNullOrEmpty(s)){ |
| | | // outPark = JSON.parseObject(s, OutPark.class); |
| | | // return outPark; |
| | | // }else { |
| | | OutPark outPark = null; |
| | | try { |
| | | String s = redisTemplate.opsForValue().get("outPark-"+bId); |
| | | if(!StringUtil.isNullOrEmpty(s)){ |
| | | outPark = JSON.parseObject(s, OutPark.class); |
| | | return outPark; |
| | | }else { |
| | | return null; |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return null; |
| | | // |
| | | // QueryWrapper<OutPark> wrapper = new QueryWrapper<>(); |
| | | // wrapper.lambda() |
| | | // .eq(OutPark::getBarrierId,bId) |
| | |
| | | // .orderByDesc(OutPark::getCreateTime); |
| | | // List<OutPark> outParks = outParkMapper.selectList(wrapper); |
| | | // if(outParks.size()>0){ |
| | | // String jsonValue = JSON.toJSONString(outParks.get(0)); |
| | | // redisTemplate.opsForValue().set("outPark-"+bId, jsonValue); |
| | | // return outParks.get(0); |
| | | // }else{ |
| | | // return null; |
| | | // } |
| | | // } |
| | | // } catch (Exception e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // return null; |
| | | |
| | | QueryWrapper<OutPark> wrapper = new QueryWrapper<>(); |
| | | wrapper.lambda() |
| | | .eq(OutPark::getBarrierId,bId) |
| | | .eq(OutPark::getStatus,1) |
| | | .eq(OutPark::getStatus2,0) |
| | | .orderByDesc(OutPark::getCreateTime); |
| | | List<OutPark> outParks = outParkMapper.selectList(wrapper); |
| | | if(outParks.size()>0){ |
| | | return outParks.get(0); |
| | | }else{ |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | @Override |