在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/Java/ mybatis中查詢結(jié)果不存在,但直接在sql中就可以查詢出來。

mybatis中查詢結(jié)果不存在,但直接在sql中就可以查詢出來。

<select id="selectSpAmtBetweenDate" resultMap="SumAmtResultMap">

select
<include refid="Base_Column_List" />,
SUM(sp_amt) as sp_sum_amt
from shelf_pay sp
where  sp.sp_shelf_no = #{shelfNo}  and sp.sp_time >=#{startDate}
  and sp.sp_time &lt; #{endDate}
group by sp.sp_shelf_no

</select>

<select id="selectAllSpAmtFromStartDate" resultMap="SumAmtResultMap">

select
<include refid="Base_Column_List" />,
SUM(sp_amt) as sp_sum_amt
from shelf_pay sp
left join billinfo bi on sp.sp_shelf_no = bi.device_id
left join user_shelf us  on us.shelf_id = sp.sp_shelf_no
where  bi.bill_status= #{status}  and sp.sp_time >=bi.bill_startDate
AND us.user_id = #{userId}
group by sp.sp_shelf_no

</select>
這兩個(gè)select上面那個(gè)是能夠正常返回的 下面那個(gè)的確是沒有查詢出來。但在數(shù)據(jù)庫工具中是能查詢出來的。后面一個(gè)多了兩個(gè)連接 。
始終找不到問題原因。還望賜教。

回答
編輯回答
扯機(jī)薄

你可以把執(zhí)行的sql打印在控制臺(tái),觀察一下

2017年7月22日 02:10