mybatis使用sum

作者: jwentest | 来源:发表于2017-06-07 12:54 被阅读150次

mapper.xml配置

<select id="getSum" resultType="java.lang.Integer" >
    select 
    SUM(columnName3)
    from tablesName
    where columnName1= #{0} and columnName2= #{1}
  </select>

mapper.java修改

  int getSum(String id,int age);

重点就是resultType的修改

相关文章

网友评论

    本文标题:mybatis使用sum

    本文链接:https://www.haomeiwen.com/subject/rkwofxtx.html