// 可以接受一个或者多个 List<Map<String, Object>> prodList = prodetailService.findAllByType( osPartnerId, type);
public List<Map<String, Object>> findAllByType(String partnerId, String type) { List<Map<String, Object>> resultList = new ArrayList<Map<String, Object>>(); String sql = "select b.*,a.ID as detailId,a.page_price as detailPrice,a.is_special from os_product_detail a inner join os_product b on a.pro_id=b.ID where a.is_publish='1' and b.is_publish='1' and a.is_del='0' and b.is_del='0' and a.partner_id=? and b.pro_type=? order by a.utime desc "; List<Map<String, Object>> list = prodetailDao.findByConditionMix(sql, partnerId, type); // 如果代理商不为空,则抽取该代理商所能展示的产品信息 if (list != null && list.size() > 0) { resultList = list; } return resultList; }
public List<Map<String,Object>> findByConditionMix(String sql, Object... params) { // TODO Auto-generated method stub return dao.getJdbcTemplate().queryForList(sql,params); }