統計大於某個時間段的交易異常

Mybatis的幾種用法

 

1.  在mapper.xml中添加參數。如在以下的應用中

 

例如:統計大於某個時間段的交易異常

 

代碼如下:

在mapper.xml文件中,可以這樣使用常量中的參數

 

 

 

代碼如下:

    select

              o.id,

              o.price,

              o.pStatus

           from tblOrders as o

           where o.wdate > '${@com.bns.sp.Constants@ABNORMAL_ORDER_TIME}'

              and (o.pStatus = 1 or (o.Status = 1 and datediff(n,o.wdate,getdate()) > 15))

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章