我想做一个销量排行的动态更新表,之前建立过一个商品表了,现在要做商品的排行,请问该怎么实现呢?用不用新建一个表,然后再做降序排列呢,求各位老师指导
解决方案 »
- struts2 批量提交问题
- 关于 select 框的onchange问题
- 为什么老是报错No ResultSet was produced?
- 一个关于jfreechart折线的问题.
- (struts问题) jsp提交之后的do页面一片空白,百思不得其解
- 求自定义标签
- 谁遇到过?TNS:could not resolve service name,不是配置问题。
- 怎么在JSP之间传递向量
- 执行ResultSet的 executeQuery 方法时出的错!
- 有关application变量,一定给分
- 多人访问同一个页面
- SB们喘口气呀!能不能关于hibernate的session.update()不更新数据的问题
a.NAME as name,
a.IMG_SURL as imgSUrl,
cast(g.ORIGINAL_PRICE/100 as decimal(8,2)) as orignalPrice,
cast(g.PRESENT_PRICE/100 as decimal(8,2))as presentPrice,
a.GOODS_TITLE as goodsTitel,
c.SALE_COUNT as saleCount,
c.IS_GOOD as isGood,
a.DOWN_TIME as endTime,
a.TITLE_PREFIX as titlePrefix,
a.PRESENT_PRICE/a.ORIGINAL_PRICE*10 as zhekou,
cast((a.ORIGINAL_PRICE/100 - a.PRESENT_PRICE/100) as decimal(8,2)) as save, from VGS_GP_GOODS a ,VGS_GP_GOODS_EXT c
where exists(select sn_proid from VGS_GP_GOODS_DISTRICT b
where 1=1
<#if cityId ? exists> and b.DISTRICT_LV1_ID=:cityId</#if>
<#if areaId ? exists> and b.DISTRICT_LV2_ID =:areaId</#if>
<#if businessId ? exists> and b.DISTRICT_LV3_ID=:businessId</#if>
and a.SN_PROID=b.SN_PROID) and a.SN_PROID=c.SN_PROID
<#if category ? exists> and a.CATALOG_LV1_ID=:category</#if>
<#if subCategory ? exists> and a.CATALOG_LV2_ID=:subCategory</#if>
<#if isGood ? exists> and c.IS_GOOD=:isGood</#if>
<#if ! sortType ? exists>order by c.SORT_KEY </#if>
<#if sortType ? exists && sortType=="1">order by c.SALE_COUNT desc </#if>
<#if sortType ? exists && sortType=="2">order by a.UP_TIME </#if>
<#if sortType ? exists && sortType=="3">order by a.UP_TIME DESC </#if>
<#if sortType ? exists && sortType=="4">order by a.PRESENT_PRICE </#if>
<#if sortType ? exists && sortType=="5">order by a.PRESENT_PRICE DESC </#if>不用心建表,直接查就可以了 这是我目前项目写的 你也可以直接建立一个job 让他定时跑
如果没有的话那就需要一张销量表了,每售出一件商品就更新销量表,销量排行就根据“销量排序了”,界面可采用ajax
2、售出商品,则更新该字段
3、用ajax来实现异步加载,更新销量信息