zoukankan      html  css  js  c++  java
  • Mapper method 'com.autoyol.mapper.trans.AccountLogMapper.getTotalIncomByMemNoLastest attempted to return null from a method with a primitive return type (int).解决方法

    1.打开日志输出,降低日志级别。

    <AppenderRef ref="console" level="trace"></AppenderRef>  否则看不到报错。。

    2.调整mysql语句,不能使用order by limit之类的

    <!-- SELECT IFNULL(amt,1) FROM account_log WHERE mem_no=#{value} AND income_type != 4 ORDER BY id DESC LIMIT 1 -->
        <select id="getTotalIncomByMemNoLastest" parameterType="int" resultType="Integer">
            
            SELECT IFNULL(MAX(amt),1) FROM account_log WHERE id = (SELECT MAX(id) FROM account_log WHERE mem_no=#{value} AND income_type != 4)
        </select>
    
    
    <!-- 
        处理非空的情况,同时处理MAX(order_no)订单号的情况。
        SELECT order_no AS orderNo FROM trans WHERE invite_group = #{groupOrderNo} AND is_group=1 AND order_no != #{orderNo} AND STATUS = 21 ORDER BY id ASC LIMIT 1 
        -->
        <select id="getTransGroupOrderRestToIsGroup" resultType="java.lang.Long">
            SELECT IFNULL(MAX(order_no),0) AS orderNo FROM trans WHERE id = (
                SELECT IFNULL(MIN(id),0) AS orderNo FROM trans WHERE invite_group=#{groupOrderNo} AND is_group=1 AND order_no != #{orderNo} AND STATUS = 21 
            )
        </select>
  • 相关阅读:
    Java输入输出流详解2
    Java输入输出流详解(转)
    java泛型
    E-R图学习笔记
    MongoDB工具
    MongoDB安装
    mongodb-参考其他
    mongodb学习笔记
    WebService学习笔记
    nutch笔记
  • 原文地址:https://www.cnblogs.com/simpledev/p/5466635.html
Copyright © 2011-2022 走看看