ShopProductDAO extends BaseIbatisDAO { @SuppressWarnings("unchecked") public List<ShopProduct> query(final Map<String, Object> parameters) { return super.queryForList("SHOP_PRODUCT.query", parameters); }  @SuppressWarnings("unchecked") List<ShopProduct> query(final Map<String, Object> parameters); Long count(final Map<String, Object> parameters); ShopProduct queryByPk(final Long id); ShopProduct queryDetailByPk(final Long id); Long insert(final ShopProduct product); Long insert(final ShopProductCoupon couponProduct); Long update(final ShopProduct product); Long update(final ShopProductCoupon couponProduct); void reduceStocks(final Map<String, Object> parameters); @SuppressWarnings("unchecked") List<ShopProductCondition> getShopProductConditionByShopProductId(Long productId); ShopProductCondition insertShopProductCondition(ShopProductCondition entity); void deleteShopProductConditionByProductId(Long productId);  }
@Test public void testQueryAll(){ Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("productType", Constant.SHOP_PRODUCT_TYPE.COUPON.name()); parameters.put("_startRow", "1"); parameters.put("_endRow", "2"); List<ShopProduct> list1 = shopProductDAO.query(parameters); Assert.assertEquals(2, list1.size()); Assert.assertEquals(Constant.SHOP_PRODUCT_TYPE.COUPON.name(), list1.get(0).getProductType()); parameters.put("productName", "P"); List<ShopProduct> list_2 = shopProductDAO.query(parameters); Assert.assertEquals(0, list_2.size()); }