ShopOrderDAO extends BaseIbatisDAO { @SuppressWarnings("unchecked") public List<ShopOrder> queryShopOrder(final Map<String, Object> parameters) { return super.queryForList("SHOP_ORDER.queryShopOrder", 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 testQueryShopOrder() throws SQLException { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("productType", "PRODUCT"); List<ShopOrder> orders = shopOrderDAO.queryShopOrder(parameters); 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 WHERE SO1.PRODUCT_TYPE='PRODUCT') T1 inner join USER_USER T2 on T1.USER_ID = T2.USER_NO) PO"; ResultSet rs1 = this.executeSQL(selectSQL); rs1.next(); Assert.assertEquals(orders.size(), rs1.getLong(1)); }