zoukankan      html  css  js  c++  java
  • 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>
  • 相关阅读:
    PHP入门03 -- 数组与数据结构
    PHP入门02 -- 函数
    PHP入门01 -- 基本语法
    node文章
    Mongodb08
    Mongodb07
    ISO处理jq事件
    map
    Django自定义模板
    JS this指向
  • 原文地址:https://www.cnblogs.com/taiguyiba/p/7090327.html
Copyright © 2011-2022 走看看