The query result does not exist in mybatis, but it can be queried directly in 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 = -sharp{shelfNo}  and sp.sp_time >=-sharp{startDate}
  and sp.sp_time < -sharp{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= -sharp{status}  and sp.sp_time >=bi.bill_startDate
AND us.user_id = -sharp{userId}
group by sp.sp_shelf_no

< / select >
the upper one of these two select can be returned normally, but the lower one has not been queried. But it can be queried in the database tool. There are two more connections in the last one.
never found the cause of the problem. I also hope to give you some advice.

Mar.22,2021

you can print the executed sql on the console and take a look at

Menu