• 返回List<Map<String, String>>键值对格式


    只要设定resultType而不设定resultMap就可以了。

    Java接口:

    List<Map<String, String>> getMtypeList();

    XML:

    <select id="getMtypeList" parameterType="java.util.Map" resultType="java.util.HashMap">
        select code,`name` from jk_control_measure rs
        where rs.TYPE_ID != 1
            <if test="qKeyWord != null">
                and rs.stock_code = #{qKeyWord}
            </if>
            <if test="rsTitle != null">
                and rs.title like #{rsTitle}
            </if>
            order by rs.crt_time desc limit #{pageIndex}, #{pageSize}
    </select>

    输出结果:

    [
        {"NAME":"地面冲洗","name":"地面冲洗","code":"one","CODE":"one"},
        {"NAME":"边界围挡","name":"边界围挡","code":"two","CODE":"two"},
        {"NAME":"垃圾覆盖","name":"垃圾覆盖","code":"three","CODE":"three"},
        {"NAME":"裸地覆盖","name":"裸地覆盖","code":"four","CODE":"four"},
        {"NAME":"洒水降尘","name":"洒水降尘","code":"five","CODE":"five"}
    ]

  • 相关阅读:
    012.Nginx负载均衡
    011.Nginx防盗链
    010.Nginx正反代理
    009.Nginx缓存配置
    附007.Docker全系列大总结
    附024.Kubernetes全系列大总结
    008.Nginx静态资源
    007.Nginx虚拟主机
    006.Nginx访问控制
    005.Nginx配置下载站点
  • 原文地址:https://www.cnblogs.com/yifanSJ/p/9094061.html
Copyright © 2020-2023  润新知