json取值

数据库格式:
[{"jjxId":13,"jjxName":"测试三","jjxDate":"1111"},{"jjxId":15,"jjxName":"测试五","jjxDate":"2222"}]
	public R getNew(@PathVariable("fpId") Integer fpId,@PathVariable("deptId") Integer deptId){

		AAA djbPo = new AAA();
		djbPo = AAAService.getById(fpId);


		List<String> lst = new ArrayList<>();

		JSONArray pmNameArr = JSON.parseArray(djbPo.getJjxXq());;
		for (Object x : pmNameArr) {
			JSONObject info = JSON.parseObject(x.toString());
			lst.add(info.get("jjxId").toString());
		}

		BBB jiangjinFpJjlydjb = new BBB();
		jiangjinFpJjlydjb.setDataState(1);
		jiangjinFpJjlydjb.setJjDeptId(deptId);

		QueryWrapper<BBB> queryWrapper = Wrappers.query(jiangjinFpJjlydjb);
		queryWrapper.gt("shengy_je", 0);
		//默认可用的显示
		queryWrapper.ge("yxqz", LocalDateTime.now());
		queryWrapper.notIn("jjx_id",lst);

		return R.ok(BBBService.list(queryWrapper));
	}

json取值

上一篇:mac osx 系统 brew install hadoop 安装指南


下一篇:Spring实现MySQL事务操作