Commit 759b8e2c authored by hezhen's avatar hezhen

123

parent 573d0cbe
......@@ -78,6 +78,8 @@ public class TourGoodDetailBiz extends BaseBiz<TourGoodMapper, TourGood> {
//获取出行时间
List<TourDepartTimeVo> timelist = priceMapper.getAllByGoodId(id);
detailVo.setTourDepartTimeVo(timelist);
Integer stock=priceMapper.getTotalStock(id);
detailVo.setStock(stock);
//获取出发地点
List<TourDepartVo> departList = siteMapper.getlistByGoodId(id);
detailVo.setTourDepartVo(departList);
......
......@@ -18,6 +18,9 @@ public interface TourGoodSpePriceMapper extends Mapper<TourGoodSpePrice> {
List<TourDepartTimeVo> getAllByGoodId(@Param("goodId") Integer goodId);
//获取总库存
Integer getTotalStock(@Param("goodId") Integer goodId);
//减库存
int updStockById(@Param("id") Integer id,@Param("number") Integer number,@Param("type") Integer type);
......
......@@ -41,6 +41,11 @@
FROM tour_good_spe_price WHERE good_id=#{goodId} and is_del=0 ORDER BY start_time
</select>
<!-- 获取出行时间 -->
<select id="getTotalStock" >
SELECT IFNULL(SUM(stock),0) as stock FROM tour_good_spe_price WHERE good_id=#{goodId} and is_del=0 and IFNULL(DATEDIFF(start_time,NOW()),0)>0
</select>
<!-- 减库存-->
<update id="updStockById">
update tour_good_spe_price set
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment