mybatis用法記錄

1:條件語句 
<if test="couponType != null and couponType !='' and couponType == '1'.toString()">ui

AND coupon.coupon_amount>0 AND coupon.coupon_amount_return = 1
</if>
 
2: 循環語句
<foreach item="item" index="index" collection="uuids" open="(" separator="," close=")">
#{item}
</foreach>

3:大於與小於不能直接使用
<![CDATA[
SELECT isnull(sum(main.fee),0) as fee FROM [counter].[dbo].[T_COUNTER_TRANS_COUPON] coupon
left join [counter].[dbo].[T_COUNTER_TRANS_MAIN] main on coupon.trade_id=main.trade_id
where main.state_now IN ('0000','2100') AND coupon.coupon_id in
]]>   it

相關文章
相關標籤/搜索