zoukankan      html  css  js  c++  java
  • ibatis返回map列表

    ibatis返回map列表

    1. resultClass="java.util.HashMap"
     
    <select id="queryCustmerCarNoByCustId" resultClass="java.util.HashMap" parameterClass="string">
    select t.vehicle_no from NETS2_T_PC_VEHICLE t
    where t.nets_cust_id=#custId#
    order by t.updated_date desc
    </select>
    2. dao: 使用_queryForList得到map列表,map存放的字段值都是大写
    public String queryCustmerCarNoByCustId(String custId)
    throws DAOException {
    List<Map> list = (List<Map>)_queryForList("mobileMoneyUserinfo.queryCustmerCarNoByCustId", custId);

    log.info("CustomerContactInfoDaoImpl.queryCustmerCarNoByCustId() list="+list);

    if(list==null || list.isEmpty()){
    return null;
    }
    Map map = list.get(0);
    return (String)map.get("VEHICLE_NO");
    }

  • 相关阅读:
    mysql常用技能分享
    php生成器使用总结
    MySQL索引使用方法和性能优化
    servlet相关
    UML图
    How Tomcat Works
    字符串编码
    高效工作
    php 设计模式总结
    python之装饰器
  • 原文地址:https://www.cnblogs.com/qqzy168/p/4724639.html
Copyright © 2011-2022 走看看