list<map<string object>>怎么遍历看是否存在某一项,不存在则添加 20
mybatis查出的数据是这样的:{"entity":[{"channelRatio":20,"channelnum":"01","documentsum":1},{"c...
mybatis查出的数据是这样的:
{
"entity": [
{
"channelRatio": 20,
"channelnum": "01",
"documentsum": 1
},
{
"channelRatio": 40,
"channelnum": "02",
"documentsum": 2
},
{
"channelRatio": 20,
"channelnum": "04",
"documentsum": 1
},
{
"channelRatio": 20,
"channelnum": "05",
"documentsum": 1
}
],
"errorCode": "0"
}
用的是list<map<string object>>接的,如果渠道channelnum=03没有 怎么在service层加到这个list<map<string object>>里,加上 "channelRatio":0, "channelnum": "03", "documentsum": 0 展开
{
"entity": [
{
"channelRatio": 20,
"channelnum": "01",
"documentsum": 1
},
{
"channelRatio": 40,
"channelnum": "02",
"documentsum": 2
},
{
"channelRatio": 20,
"channelnum": "04",
"documentsum": 1
},
{
"channelRatio": 20,
"channelnum": "05",
"documentsum": 1
}
],
"errorCode": "0"
}
用的是list<map<string object>>接的,如果渠道channelnum=03没有 怎么在service层加到这个list<map<string object>>里,加上 "channelRatio":0, "channelnum": "03", "documentsum": 0 展开
2017-08-30
展开全部
既然是mybatis,为何不在SQL查询中过滤呢
如果一定要枚举,先定义判断变量,逐个枚举、发现就改变判断变量的值 。。。。。
~
~
~
如果一定要枚举,先定义判断变量,逐个枚举、发现就改变判断变量的值 。。。。。
~
~
~
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询