zoukankan      html  css  js  c++  java
  • mysql 批量查询

    //        for (Map m : rangeList) {
    // String str = m.get("value").toString();
    // String value;
    // if (str.contains(",")) {
    // List<String> list = Arrays.asList(str.split(","));
    // value = getValue(list);
    // m.put("value", value);
    // }
    // }


    Impl ----->>

    private String getValue(List<String> list) {
    Map map = tbHospitalMapper.selectByIds(list);
    return map.get("name").toString();
    }

    Mapper-------->>
    Map selectByIds(List<String> list);


    Xml--------->>

    <select id="selectByIds" parameterType="list" resultType="java.util.Map">
    SELECT
    IFNULL(GROUP_CONCAT(name) ,'') name
    from tb_hospital
    where id in
    <foreach collection="list" index="index" item="item" open="("
    separator="," close=")">
    #{item}
    </foreach>
    </select>





  • 相关阅读:
    WinCE 与通讯模块
    6174问题
    阶乘因式分解(一)
    三个数从小到大排序
    公约数和公倍数
    水仙花数
    韩信点兵
    5个数求最值
    求转置矩阵问题
    孪生素数问题
  • 原文地址:https://www.cnblogs.com/guagua-join-1/p/10936011.html
Copyright © 2011-2022 走看看