MyBatis
Tbuser record = new Tbuser(); TbuserWithBLOBs bloBs = tbuserMapper.selectByPrimaryKey((long) 34); bloBs.setCardid("00000"); tbuserMapper.updateByPrimaryKeyWithBLOBs(bloBs); TbuserExample tbuserExample = new TbuserExample(); db.TbuserExample.Criteria criteria = tbuserExample.createCriteria(); criteria.andIdGreaterThan((long) 34); List<Tbuser> listtbuser = tbuserMapper.selectByExample(tbuserExample); for(Tbuser tbuser : listtbuser) { System.out.println(tbuser.getPwd()); } return bloBs.getPwd();
@RequestMapping(value = "/GetHeadImg",method = RequestMethod.GET) @ResponseBody public ResponseEntity<byte[]> GetHeadImg() { TbuserWithBLOBs bloBs = tbuserMapper.selectByPrimaryKey((long) 34); HttpHeaders headers = new HttpHeaders(); headers.set("Content-Type", "image/jpg"); return new ResponseEntity<byte[]>(bloBs.getUserimg(), headers, HttpStatus.OK); }