|
@@ -13,6 +13,7 @@
|
|
<result column="promotion_price" jdbcType="DECIMAL" property="promotionPrice" />
|
|
<result column="promotion_price" jdbcType="DECIMAL" property="promotionPrice" />
|
|
<result column="lock_stock" jdbcType="INTEGER" property="lockStock" />
|
|
<result column="lock_stock" jdbcType="INTEGER" property="lockStock" />
|
|
<result column="sp_data" jdbcType="VARCHAR" property="spData" />
|
|
<result column="sp_data" jdbcType="VARCHAR" property="spData" />
|
|
|
|
+ <result column="delete_status" jdbcType="INTEGER" property="deleteStatus" />
|
|
</resultMap>
|
|
</resultMap>
|
|
<sql id="Example_Where_Clause">
|
|
<sql id="Example_Where_Clause">
|
|
<where>
|
|
<where>
|
|
@@ -73,7 +74,7 @@
|
|
</where>
|
|
</where>
|
|
</sql>
|
|
</sql>
|
|
<sql id="Base_Column_List">
|
|
<sql id="Base_Column_List">
|
|
- id, product_id, sku_code, price, stock, low_stock, pic, sale, promotion_price, lock_stock,
|
|
|
|
|
|
+ id, product_id, sku_code, price, stock, low_stock, pic, sale, promotion_price, lock_stock, delete_status,
|
|
sp_data
|
|
sp_data
|
|
</sql>
|
|
</sql>
|
|
<select id="selectByExample" parameterType="com.yonge.cooleshow.mbg.model.PmsSkuStockExample" resultMap="BaseResultMap">
|
|
<select id="selectByExample" parameterType="com.yonge.cooleshow.mbg.model.PmsSkuStockExample" resultMap="BaseResultMap">
|
|
@@ -97,11 +98,11 @@
|
|
where id = #{id,jdbcType=BIGINT}
|
|
where id = #{id,jdbcType=BIGINT}
|
|
</select>
|
|
</select>
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
|
- delete from pms_sku_stock
|
|
|
|
|
|
+ update pms_sku_stock set delete_status = 1
|
|
where id = #{id,jdbcType=BIGINT}
|
|
where id = #{id,jdbcType=BIGINT}
|
|
</delete>
|
|
</delete>
|
|
<delete id="deleteByExample" parameterType="com.yonge.cooleshow.mbg.model.PmsSkuStockExample">
|
|
<delete id="deleteByExample" parameterType="com.yonge.cooleshow.mbg.model.PmsSkuStockExample">
|
|
- delete from pms_sku_stock
|
|
|
|
|
|
+ update pms_sku_stock set delete_status = 1
|
|
<if test="_parameter != null">
|
|
<if test="_parameter != null">
|
|
<include refid="Example_Where_Clause" />
|
|
<include refid="Example_Where_Clause" />
|
|
</if>
|
|
</if>
|
|
@@ -316,10 +317,12 @@
|
|
sum(t.internal_stock - t.internal_sale_stock) as internalStock,
|
|
sum(t.internal_stock - t.internal_sale_stock) as internalStock,
|
|
sum(t.tax_stock - t.tax_sale_stock) as taxStock
|
|
sum(t.tax_stock - t.tax_sale_stock) as taxStock
|
|
from pms_product_sku_stock_record t
|
|
from pms_product_sku_stock_record t
|
|
|
|
+ left join pms_sku_stock t1 on t1.id = t.product_sku_id
|
|
where t.product_id in
|
|
where t.product_id in
|
|
<foreach collection="productIds" item="productId" open="(" separator="," close=")">
|
|
<foreach collection="productIds" item="productId" open="(" separator="," close=")">
|
|
#{productId}
|
|
#{productId}
|
|
</foreach>
|
|
</foreach>
|
|
|
|
+ and t1.delete_status = 0
|
|
group by t.product_sku_id, t.product_id
|
|
group by t.product_sku_id, t.product_id
|
|
</select>
|
|
</select>
|
|
</mapper>
|
|
</mapper>
|