Map中存放数组

       Map<String,Object> map = new HashMap<String, Object>();
        Map<String,String> agentMap = new HashMap<String, String>();
        String agentAmt = "123";
        agentMap.put("agentAmt",agentAmt);
        agentMap.put("agentId", "35110230000000393");
        Map [] agentInfo = {agentMap};//[{agentAmt=210.00, agentId=35110230000000393}]
        String b = JsonUtil.toJson(agentInfo);

        map.put("agentInfo", b);//agentInfo=[Ljava.lang.String;@429f81f1

 map中放入数组,查询对应的条件

Map<String, Object> conditionMap = new HashMap<String, Object>();
        List<Integer> statusList = Arrays.asList(Borrow.STATUS_FULL,
                Borrow.STATUS_FULL_YES, Borrow.STATUS_REPLYING,
                Borrow.STATUS_REPLY_SUCCESS, Borrow.STATUS_OVERDUE);
        conditionMap.put("statusList", statusList);
        conditionMap.put("userId", userId);
        List borrowList = borrowQueryService.getborrowAccount(conditionMap);

 

   <!-- 查询借款资金情况 -->
  <select id="getborrowAccount" parameterType="map" resultType="map">
     SELECT IFNULL(SUM(b.borrow_sum),0) borrowSum,IFNULL(count(b.id),0) as borrowCount ,ua.wait_repay_capital waitRepayCapital, ua.wait_repay_interest waitRepayInterest 
     FROM borrow b LEFT JOIN user_account ua ON b.user_id=ua.user_id 
     WHERE b.user_id=#{userId} AND b.borrow_status IN
     <foreach collection="statusList" item="item" open="(" separator="," close=")">
        #{item}         
     </foreach>
  </select>

 

转载于:https://www.cnblogs.com/taiguyiba/p/7090327.html

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值