码迷,mamicode.com
首页 > 移动开发 > 详细

Mapper method 'com.autoyol.mapper.trans.AccountLogMapper.getTotalIncomByMemNoLastest attempted to return null from a method with a primitive return type (int).解决方法

时间:2016-05-06 19:06:09      阅读:297      评论:0      收藏:0      [点我收藏+]

标签:

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>

 

Mapper method 'com.autoyol.mapper.trans.AccountLogMapper.getTotalIncomByMemNoLastest attempted to return null from a method with a primitive return type (int).解决方法

标签:

原文地址:http://www.cnblogs.com/simpledev/p/5466635.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!