ShopOrderDAO extends BaseIbatisDAO { public Long orderCount(final Map<String, Object> parameters) { return (Long) super.queryForObject("SHOP_ORDER.orderCount", parameters); }  Long insert(final ShopOrder shopOrder); @SuppressWarnings("unchecked") List<ShopOrder> queryShopOrder(final Map<String, Object> parameters); @SuppressWarnings("unchecked") List<ShopOrderVO> queryShopOrderVO(final Map<String, Object> parameters); ShopOrder queryShopOrderByKey(final Long orderId); int updata(final ShopOrder shopOrder); Long orderCount(final Map<String, Object> parameters);  }
@Test public void testOrderDeatilCount() throws SQLException { Map<String, Object> parameters = new HashMap<String, Object>(); long count = shopOrderDAO.orderCount(parameters); Statement stat = conn.createStatement(); String selectSQL = "SELECT COUNT(PO.ORDER_ID) FROM (SELECT T1.*, T2.USER_NAME FROM (SELECT SO1.* FROM SHOP_ORDER SO1 left join SHOP_PRODUCT SP ON SO1.PRODUCT_ID = SP.PRODUCT_ID) T1 inner join USER_USER T2 on T1.USER_ID = T2.USER_NO) PO"; ResultSet rs1 = stat.executeQuery(selectSQL); rs1.next(); Assert.assertEquals(count, rs1.getLong(1)); }