java110
2020-10-12 0fe7faa4395a8f3e2dfcc41818de5fa715c57518
java110-db/src/main/resources/mapper/goods/ProductSpecValueServiceDaoImplMapper.xml
@@ -19,8 +19,9 @@
    <select id="getProductSpecValueInfo" parameterType="Map" resultType="Map">
        select t.spec_id,t.spec_id specId,t.value_id,t.value_id valueId,t.product_id,t.product_id
        productId,t.price,t.ot_price,t.ot_price otPrice,t.cost_price,t.cost_price costPrice,t.vip_price,t.vip_price
        vipPrice,t.status_cd,t.status_cd statusCd,t.store_id,t.store_id storeId,t.stock,t.sales
        vipPrice,t.status_cd,t.status_cd statusCd,t.store_id,t.store_id storeId,t.stock,t.sales,ps.spec_name specName
        from product_spec_value t
        left join product_spec ps on t.spec_id = ps.spec_id and ps.store_id = t.store_id and ps.status_cd = '0'
        where 1 =1
        <if test="specId !=null and specId != ''">
            and t.spec_id= #{specId}
@@ -63,6 +64,27 @@
    </select>
    <!-- 查询产品库存和销量 add by wuxw 2018-07-03 -->
    <select id="queryProductStockAndSales" parameterType="Map" resultType="Map">
        select t.product_id productId,sum(t.stock) stock,SUM(t.sales) sales
        from product_spec_value t
        where 1 =1
        and t.status_cd= '0'
        <if test="productId !=null and productId != ''">
            and t.product_id= #{productId}
        </if>
        <if test="productIds != null">
            and t.product_id in
            <foreach collection="productIds" item="item" open="(" close=")" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="storeId !=null and storeId != ''">
            and t.store_id= #{storeId}
        </if>
        group by t.product_id
    </select>
    <!-- 修改产品规格值信息 add by wuxw 2018-07-03 -->
    <update id="updateProductSpecValueInfo" parameterType="Map">
        update product_spec_value t set t.status_cd = #{statusCd}
@@ -72,9 +94,7 @@
        <if test="specId !=null and specId != ''">
            , t.spec_id= #{specId}
        </if>
        <if test="productId !=null and productId != ''">
            , t.product_id= #{productId}
        </if>
        <if test="price !=null and price != ''">
            , t.price= #{price}
        </if>
@@ -100,6 +120,9 @@
        <if test="valueId !=null and valueId != ''">
            and t.value_id= #{valueId}
        </if>
        <if test="productId !=null and productId != ''">
            and t.product_id= #{productId}
        </if>
    </update>