优化BUG
This commit is contained in:
@@ -233,8 +233,25 @@
|
||||
|
||||
|
||||
|
||||
<select id="getProdPageList" resultType="com.tashow.cloud.productapi.api.product.dto.ProdDO" >
|
||||
select * from tz_prod
|
||||
<select id="getProdPageList" resultType="com.tashow.cloud.productapi.api.product.dto.ProdDO">
|
||||
SELECT * FROM tz_prod
|
||||
where deleted = 0
|
||||
<if test="createTime != null and createTime.length == 2">
|
||||
AND create_time BETWEEN #{createTime[0]} AND #{createTime[1]}
|
||||
</if>
|
||||
<if test="prodName != null">
|
||||
AND prod_name = #{prodName}
|
||||
</if>
|
||||
<if test="shopId != null">
|
||||
AND shop_id = #{shopId}
|
||||
</if>
|
||||
<if test="status != null">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
<if test="categoryId != null">
|
||||
AND category_id = #{categoryId}
|
||||
</if>
|
||||
ORDER by create_time DESC
|
||||
</select>
|
||||
|
||||
|
||||
@@ -502,4 +519,15 @@
|
||||
ORDER BY p.prod_id
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getProdRecycleBinPageList" resultType="com.tashow.cloud.productapi.api.product.vo.sku.SkuRecycleBinVO" >
|
||||
select * from tz_prod where deleted = 1
|
||||
<if test="properties != null and properties != ''">
|
||||
and properties like concat('%', #{prodName}, '%')
|
||||
</if>
|
||||
<if test="deleteTime != null and deleteTime.length == 2">
|
||||
AND delete_time BETWEEN #{deleteTime[0]} AND #{deleteTime[1]}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -14,4 +14,47 @@
|
||||
(#{propId},#{prodPropValue.propValue})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
|
||||
|
||||
<!-- ProdPropValueMapper.xml -->
|
||||
<select id="selectSalesValuesByProdId" resultType="com.tashow.cloud.productapi.api.product.dto.ProdPropValueDO">
|
||||
SELECT
|
||||
pp.id AS propId,
|
||||
pp.prop_name,
|
||||
ppv.id AS valueId,
|
||||
ppv.prop_value
|
||||
FROM tz_prod_prop pp
|
||||
JOIN tz_prod_prop_value ppv ON pp.id = ppv.prop_id
|
||||
WHERE pp.prod_id = #{prodId}
|
||||
AND pp.rule = 1
|
||||
AND ppv.is_expire = 0
|
||||
</select>
|
||||
|
||||
<select id="selectSalesValuesByState" resultType="com.tashow.cloud.productapi.api.product.dto.ProdPropValueDO">
|
||||
SELECT
|
||||
pp.id AS propId,
|
||||
pp.prop_name,
|
||||
ppv.id AS valueId,
|
||||
ppv.prop_value
|
||||
FROM tz_prod_prop pp
|
||||
JOIN tz_prod_prop_value ppv ON pp.id = ppv.prop_id
|
||||
WHERE pp.prod_id = #{prodId}
|
||||
AND pp.rule = 1
|
||||
AND ppv.state = 1
|
||||
AND ppv.is_expire = 0
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
<update id="batchMarkDeleted">
|
||||
UPDATE tz_prod_prop_value
|
||||
SET is_expire = 1, delete_time = NOW()
|
||||
WHERE id IN
|
||||
<foreach item="id" collection="ids" open="(" separator="," close=")">
|
||||
#{ids}
|
||||
</foreach>
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -17,6 +17,20 @@
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getSkuPageList" resultType="com.tashow.cloud.productapi.api.product.dto.SkuDO">
|
||||
Select * from tz_sku where deleted = 0
|
||||
<if test="prodId != null and prodId != ''">
|
||||
and prod_id = #{prodId}
|
||||
</if>
|
||||
<if test="skuId != null and skuId != ''">
|
||||
and sku_id = #{skuId}
|
||||
</if>
|
||||
<if test="properties != null and properties != ''">
|
||||
and properties like concat('%', #{propertiesName}, '%')
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getSkuListByName" resultType="com.tashow.cloud.productapi.api.product.dto.SkuDO" >
|
||||
select sku_id, properties, delete_time,deleted from tz_sku
|
||||
<if test="properties != null and properties != ''">
|
||||
@@ -24,4 +38,22 @@
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- SkuMapper.xml -->
|
||||
<select id="selectPropertiesByProdIdAndNotDeleted" resultType="string">
|
||||
SELECT properties
|
||||
FROM tz_sku
|
||||
WHERE prod_id = #{prodId}
|
||||
AND deleted = 0
|
||||
</select>
|
||||
|
||||
<!-- SkuMapper.xml -->
|
||||
<select id="selectPropertiesByProdIdShelf" resultType="string">
|
||||
SELECT properties
|
||||
FROM tz_sku
|
||||
WHERE prod_id = #{prodId}
|
||||
AND deleted = 0
|
||||
and is_shelf =0
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user