Java实现,当然也可以数据库实现;
/**
* Created by shaozhiqi on 2019/7/31.
*/
public class TestUnion {
@Test
public void test1() {
List
结果:
{"high":["高风险","高风险5"],"low":["低风险1","低风险3"],"assort_no":"11111","name":"test","leve1":"high","id":"1","leve1Desc":"高风险"}
{"high":["高风险","高风险5"],"low":["低风险1","低风险3"],"assort_no":"11111","name":"test","leve1":"low","id":"2","leve1Desc":"低风险1"}
{"high":[],"low":["低风险2"],"assort_no":"11222","name":"test2","leve1":"low","id":"3","leve1Desc":"低风险2"}
{"high":["高风险","高风险5"],"low":["低风险1","低风险3"],"assort_no":"11111","name":"test","leve1":"low","id":"4","leve1Desc":"低风险3"}
{"high":["高风险","高风险5"],"low":["低风险1","低风险3"],"assort_no":"11111","name":"test","leve1":"high","id":"5","leve1Desc":"高风险5"}
======================去重后============================
{"high":["高风险","高风险5"],"low":["低风险1","低风险3"],"assort_no":"11111","name":"test","leve1":"high","id":"5","leve1Desc":"高风险5"}
{"high":[],"low":["低风险2"],"assort_no":"11222","name":"test2","leve1":"low",