|  | @@ -20,10 +20,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 | 
	
		
			
				|  |  |          <result property="stock"    column="stock"    />
 | 
	
		
			
				|  |  |          <result property="sort"    column="sort"    />
 | 
	
		
			
				|  |  |          <result property="isShow"    column="is_show"    />
 | 
	
		
			
				|  |  | +        <result property="sales"    column="sales"    />
 | 
	
		
			
				|  |  |      </resultMap>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      <sql id="selectLiveGoodsVo">
 | 
	
		
			
				|  |  | -        select goods_id, live_id, company_id, company_user_id, store_id, product_id, create_time, create_by, update_by, update_time, remark, status, stock, sort,case when is_show = 1 then true else false end as is_show from live_goods
 | 
	
		
			
				|  |  | +        select goods_id, live_id, company_id, company_user_id,sales, store_id, product_id, create_time, create_by, update_by, update_time, remark, status, stock, sort,case when is_show = 1 then true else false end as is_show from live_goods
 | 
	
		
			
				|  |  |      </sql>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      <select id="selectLiveGoodsList" parameterType="LiveGoods" resultMap="LiveGoodsResult">
 | 
	
	
		
			
				|  | @@ -38,6 +39,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 | 
	
		
			
				|  |  |              <if test="stock != null "> and stock = #{stock}</if>
 | 
	
		
			
				|  |  |              <if test="sort != null "> and sort = #{sort}</if>
 | 
	
		
			
				|  |  |              <if test="isShow != null "> and is_show = #{isShow}</if>
 | 
	
		
			
				|  |  | +            <if test="sales != null "> and sales = #{sales}</if>
 | 
	
		
			
				|  |  |          </where>
 | 
	
		
			
				|  |  |      </select>
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -63,6 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 | 
	
		
			
				|  |  |              <if test="stock != null">stock,</if>
 | 
	
		
			
				|  |  |              <if test="sort != null">sort,</if>
 | 
	
		
			
				|  |  |              <if test="isShow != null">is_show,</if>
 | 
	
		
			
				|  |  | +            <if test="sales != null">sales,</if>
 | 
	
		
			
				|  |  |           </trim>
 | 
	
		
			
				|  |  |          <trim prefix="values (" suffix=")" suffixOverrides=",">
 | 
	
		
			
				|  |  |              <if test="liveId != null">#{liveId},</if>
 | 
	
	
		
			
				|  | @@ -79,6 +82,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 | 
	
		
			
				|  |  |              <if test="stock != null">#{stock},</if>
 | 
	
		
			
				|  |  |              <if test="sort != null">#{sort},</if>
 | 
	
		
			
				|  |  |              <if test="isShow != null">#{isShow},</if>
 | 
	
		
			
				|  |  | +            <if test="sales != null">#{sales},</if>
 | 
	
		
			
				|  |  |           </trim>
 | 
	
		
			
				|  |  |      </insert>
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -99,6 +103,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 | 
	
		
			
				|  |  |              <if test="stock != null">stock = #{stock},</if>
 | 
	
		
			
				|  |  |              <if test="sort != null">sort = #{sort},</if>
 | 
	
		
			
				|  |  |              <if test="isShow != null">is_show = #{isShow},</if>
 | 
	
		
			
				|  |  | +            <if test="sales != null">sales = #{sales},</if>
 | 
	
		
			
				|  |  |          </trim>
 | 
	
		
			
				|  |  |          where goods_id = #{goodsId}
 | 
	
		
			
				|  |  |      </update>
 | 
	
	
		
			
				|  | @@ -121,7 +126,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 | 
	
		
			
				|  |  |          INSERT INTO live_goods (
 | 
	
		
			
				|  |  |          live_id, company_id, company_user_id, store_id,
 | 
	
		
			
				|  |  |          product_id, create_time, create_by, update_by,
 | 
	
		
			
				|  |  | -        update_time, remark, status, stock, sort, is_show
 | 
	
		
			
				|  |  | +        update_time, remark, status, stock, sort, is_show,sales
 | 
	
		
			
				|  |  |          ) VALUES
 | 
	
		
			
				|  |  |          <foreach collection="liveGoodsList" item="item" separator=",">
 | 
	
		
			
				|  |  |              (
 | 
	
	
		
			
				|  | @@ -152,7 +157,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 | 
	
		
			
				|  |  |              #{item.status},
 | 
	
		
			
				|  |  |              #{item.stock},
 | 
	
		
			
				|  |  |              #{item.sort},
 | 
	
		
			
				|  |  | -            #{item.isShow}
 | 
	
		
			
				|  |  | +            #{item.isShow},
 | 
	
		
			
				|  |  | +            #{item.sales}
 | 
	
		
			
				|  |  |              )
 | 
	
		
			
				|  |  |          </foreach>
 | 
	
		
			
				|  |  |      </insert>
 | 
	
	
		
			
				|  | @@ -165,7 +171,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      <select id="selectProductListByLiveId" parameterType="LiveGoods" resultType="com.fs.live.vo.LiveGoodsVo">
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -        select lg.goods_id,sp.img_url,sp.product_name,sp.price,sp.stock,sp.sales,lg.status,sp.product_id,sp.ot_price,sp.store_id,case when lg.is_show = 1 then true else false end as is_show
 | 
	
		
			
				|  |  | +        select lg.goods_id,sp.img_url,sp.product_name,sp.price,sp.stock,lg.sales,lg.status,sp.product_id,sp.ot_price,sp.store_id,case when lg.is_show = 1 then true else false end as is_show
 | 
	
		
			
				|  |  |          from live_goods lg
 | 
	
		
			
				|  |  |          left join fs_store_product sp
 | 
	
		
			
				|  |  |          ON lg.store_id = sp.store_id AND lg.product_id = sp.product_id
 | 
	
	
		
			
				|  | @@ -180,6 +186,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 | 
	
		
			
				|  |  |              <if test="stock != null "> and stock = #{stock}</if>
 | 
	
		
			
				|  |  |              <if test="sort != null "> and sort = #{sort}</if>
 | 
	
		
			
				|  |  |              <if test="isShow != null "> and is_show = #{isShow}</if>
 | 
	
		
			
				|  |  | +            <if test="sales != null "> and sales = #{sales}</if>
 | 
	
		
			
				|  |  |              <if test="keywords != null and keywords != ''">
 | 
	
		
			
				|  |  |                  and sp.product_name like concat('%',#{keywords},'%')
 | 
	
		
			
				|  |  |              </if>
 | 
	
	
		
			
				|  | @@ -188,7 +195,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      <select id="selectProductListByLiveIdAll" parameterType="LiveGoods" resultType="com.fs.live.vo.LiveGoodsVo">
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -        select lg.goods_id,sp.img_url,sp.product_name,sp.price,lg.stock,sp.sales,lg.status,sp.product_id,sp.ot_price,sp.store_id, case when lg.is_show = 1 then true else false end as is_show
 | 
	
		
			
				|  |  | +        select lg.goods_id,sp.img_url,sp.product_name,sp.price,lg.stock,lg.sales,lg.status,sp.product_id,sp.ot_price,sp.store_id, case when lg.is_show = 1 then true else false end as is_show,sp.is_show as fs_status
 | 
	
		
			
				|  |  |          from live_goods lg
 | 
	
		
			
				|  |  |          left join fs_store_product sp
 | 
	
		
			
				|  |  |          ON lg.store_id = sp.store_id AND lg.product_id = sp.product_id
 | 
	
	
		
			
				|  | @@ -209,7 +216,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      <select id="selectLiveGoodsVoByGoodsId"  resultType="com.fs.live.vo.LiveGoodsVo">
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -        select lg.goods_id,sp.img_url,sp.product_name,sp.price,lg.stock,sp.sales,lg.status,sp.product_id,sp.ot_price,sp.store_id, case when lg.is_show = 1 then true else false end as is_show
 | 
	
		
			
				|  |  | +        select lg.goods_id,sp.img_url,sp.product_name,sp.price,lg.stock,lg.sales,lg.status,sp.product_id,sp.ot_price,sp.store_id, case when lg.is_show = 1 then true else false end as is_show,sp.is_show as fs_status
 | 
	
		
			
				|  |  |          from live_goods lg
 | 
	
		
			
				|  |  |          left join fs_store_product sp
 | 
	
		
			
				|  |  |          ON lg.store_id = sp.store_id AND lg.product_id = sp.product_id
 | 
	
	
		
			
				|  | @@ -221,7 +228,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      <select id="showGoods"  resultType="com.fs.live.vo.LiveGoodsVo">
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -        select lg.goods_id,sp.img_url,sp.product_name,sp.price,lg.stock,sp.sales,lg.status,sp.product_id,sp.ot_price,sp.store_id, case when lg.is_show = 1 then true else false end as is_show
 | 
	
		
			
				|  |  | +        select lg.goods_id,sp.img_url,sp.product_name,sp.price,lg.stock,lg.sales,lg.status,sp.product_id,sp.ot_price,sp.store_id, case when lg.is_show = 1 then true else false end as is_show,sp.is_show as fs_status
 | 
	
		
			
				|  |  |          from live_goods lg
 | 
	
		
			
				|  |  |          left join fs_store_product sp
 | 
	
		
			
				|  |  |          ON lg.store_id = sp.store_id AND lg.product_id = sp.product_id
 | 
	
	
		
			
				|  | @@ -248,7 +255,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      <select id="selectProductListByOrder" parameterType="com.fs.live.domain.LiveOrder" resultType="com.fs.live.vo.LiveGoodsVo">
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -        select sp.img_url,sp.product_name,sp.price,lg.stock,sp.sales,sp.product_id,sp.ot_price, sp.store_id
 | 
	
		
			
				|  |  | +        select sp.img_url,sp.product_name,sp.price,sp.stock,sp.sales,sp.product_id,sp.ot_price, sp.store_id,sp.is_show as fs_status
 | 
	
		
			
				|  |  |          from fs_store_product sp
 | 
	
		
			
				|  |  |          <where>
 | 
	
		
			
				|  |  |              sp.product_id = #{productId}
 | 
	
	
		
			
				|  | @@ -259,7 +266,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 | 
	
		
			
				|  |  |          select
 | 
	
		
			
				|  |  |              g.*,
 | 
	
		
			
				|  |  |              if(uf.favorite_id is not null, true, false) isFavorite,
 | 
	
		
			
				|  |  | -            p.img_url, p.product_name, p.price, p.sales, p.ot_price
 | 
	
		
			
				|  |  | +            p.img_url, p.product_name, p.price, g.sales, p.ot_price,p.is_show as fs_status
 | 
	
		
			
				|  |  |          from live_goods g
 | 
	
		
			
				|  |  |          left join fs_store_product p on p.product_id = g.product_id and p.is_show = 1
 | 
	
		
			
				|  |  |          left join live_user_favorite uf on uf.product_id = g.goods_id and uf.user_id = #{params.userId}
 |