mybatis返回值爲map怎麼處理

mybatis返回值爲map怎麼處理


sql

<select id="selectCount" parameterType="map" resultType="map">
    <![CDATA[
        select sum(total - pay) as "total",
        count(1) as "unpaid",
        max(total - pay) as "max"
        from t_order
        ]]>
  </select>
  

method

Map<String,Object> selectCount(Map<String,Object> map);

result
{“max”:7,“unpaid”:2,“total”:9}
或者
sql

<select id="selectCount" parameterType="map" resultType="map">
    select sum(total - pay) as "tota",
    count(1) as "unpaid",
    max(total - pay) as "max"
    from t_order
  </select>

result
{“max”:7,“unpaid”:2,“tota”:9}

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章