|
@ -71,6 +71,7 @@ |
|
|
SELECT <include refid="goodsSkuSql"/> FROM `goods_sku` `goods_sku` |
|
|
SELECT <include refid="goodsSkuSql"/> FROM `goods_sku` `goods_sku` |
|
|
<where> |
|
|
<where> |
|
|
<if test="query.id != null"> and `goods_sku`.`id` = #{query.id}</if> |
|
|
<if test="query.id != null"> and `goods_sku`.`id` = #{query.id}</if> |
|
|
|
|
|
<if test="query.skuName != null and query.skuName != ''"> and `goods_sku`.`sku_name` = #{query.skuName}</if> |
|
|
<if test="query.skuCode != null and query.skuCode != ''"> and `goods_sku`.`sku_code` = #{query.skuCode}</if> |
|
|
<if test="query.skuCode != null and query.skuCode != ''"> and `goods_sku`.`sku_code` = #{query.skuCode}</if> |
|
|
<if test="query.spuId != null"> and `goods_sku`.`spu_id` = #{query.spuId}</if> |
|
|
<if test="query.spuId != null"> and `goods_sku`.`spu_id` = #{query.spuId}</if> |
|
|
<if test="query.salesPrice != null"> and `goods_sku`.`sales_price` = #{query.salesPrice}</if> |
|
|
<if test="query.salesPrice != null"> and `goods_sku`.`sales_price` = #{query.salesPrice}</if> |
|
@ -106,21 +107,28 @@ |
|
|
`goods_spu`.`name`, |
|
|
`goods_spu`.`name`, |
|
|
`goods_spu`.`spu_code`, |
|
|
`goods_spu`.`spu_code`, |
|
|
`goods_spu`.`shelf`, |
|
|
`goods_spu`.`shelf`, |
|
|
|
|
|
cate1.`name` as brandName, |
|
|
|
|
|
cate2.`name` as categoryName, |
|
|
|
|
|
cate3.`name` as seriesName, |
|
|
<include refid="goodsSkuSql"/> |
|
|
<include refid="goodsSkuSql"/> |
|
|
FROM `goods_sku` `goods_sku` |
|
|
FROM `goods_sku` `goods_sku` |
|
|
LEFT JOIN `goods_spu` ON `goods_sku`.`spu_id` = `goods_spu`.id |
|
|
LEFT JOIN `goods_spu` ON `goods_sku`.`spu_id` = `goods_spu`.id |
|
|
|
|
|
left join goods_category cate1 on goods_spu.category_first = cate1.id |
|
|
|
|
|
left join goods_category cate2 on goods_spu.category_second = cate2.id |
|
|
|
|
|
left join goods_category cate3 on goods_spu.category_third = cate3.id |
|
|
<where> |
|
|
<where> |
|
|
and `goods_sku`.`del_flag` = 0 |
|
|
and `goods_sku`.`del_flag` = 0 |
|
|
and `goods_spu`.`del_flag` = 0 |
|
|
and `goods_spu`.`del_flag` = 0 |
|
|
<if test="query.id != null"> and `goods_sku`.`id` = #{query.id}</if> |
|
|
<if test="query.id != null"> and `goods_sku`.`id` = #{query.id}</if> |
|
|
<if test="query.skuCode != null and query.skuCode != ''"> and `goods_sku`.`sku_code` = #{query.skuCode}</if> |
|
|
<if test="query.skuCode != null and query.skuCode != ''"> and `goods_sku`.`sku_code` like concat('%',#{query.skuCode},'%') </if> |
|
|
|
|
|
<if test="query.skuName != null and query.skuName != ''"> and `goods_sku`.`sku_name` like concat('%',#{query.skuName},'%') </if> |
|
|
<if test="query.spuId != null"> and `goods_sku`.`spu_id` = #{query.spuId}</if> |
|
|
<if test="query.spuId != null"> and `goods_sku`.`spu_id` = #{query.spuId}</if> |
|
|
<if test="query.salesPrice != null"> and `goods_sku`.`sales_price` = #{query.salesPrice}</if> |
|
|
<if test="query.salesPrice != null"> and `goods_sku`.`sales_price` = #{query.salesPrice}</if> |
|
|
<if test="query.marketPrice != null"> and `goods_sku`.`market_price` = #{query.marketPrice}</if> |
|
|
<if test="query.marketPrice != null"> and `goods_sku`.`market_price` = #{query.marketPrice}</if> |
|
|
<if test="query.costPrice != null"> and `goods_sku`.`cost_price` = #{query.costPrice}</if> |
|
|
<if test="query.costPrice != null"> and `goods_sku`.`cost_price` = #{query.costPrice}</if> |
|
|
<if test="query.specInfos != null and query.specInfos != ''"> and `goods_sku`.`spec_infos` = #{query.specInfos}</if> |
|
|
<if test="query.specInfos != null and query.specInfos != ''"> and `goods_sku`.`spec_infos` like concat('%',#{query.specInfos},'%') </if> |
|
|
<if test="query.stock != null"> and `goods_sku`.`stock` = #{query.stock}</if> |
|
|
<if test="query.stock != null"> and `goods_sku`.`stock` = #{query.stock}</if> |
|
|
<if test="query.belong != null"> and `goods_sku`.`belong` = #{query.belong}</if> |
|
|
<if test="query.belong != null"> and `goods_sku`.`belong` like concat('%',#{query.belong},'%') </if> |
|
|
<if test="query.unitId != null"> and `goods_sku`.`unit_id` = #{query.unitId}</if> |
|
|
<if test="query.unitId != null"> and `goods_sku`.`unit_id` = #{query.unitId}</if> |
|
|
<if test="query.unitName != null and query.unitName != ''"> and `goods_sku`.`unit_name` = #{query.unitName}</if> |
|
|
<if test="query.unitName != null and query.unitName != ''"> and `goods_sku`.`unit_name` = #{query.unitName}</if> |
|
|
<if test="query.weight != null"> and `goods_sku`.`weight` = #{query.weight}</if> |
|
|
<if test="query.weight != null"> and `goods_sku`.`weight` = #{query.weight}</if> |
|
@ -145,6 +153,11 @@ |
|
|
<if test="query.specialFlag != null"> and `goods_sku`.`special_flag` = #{query.specialFlag}</if> |
|
|
<if test="query.specialFlag != null"> and `goods_sku`.`special_flag` = #{query.specialFlag}</if> |
|
|
<if test="query.orderFlag != null"> and `goods_sku`.`order_flag` = #{query.orderFlag}</if> |
|
|
<if test="query.orderFlag != null"> and `goods_sku`.`order_flag` = #{query.orderFlag}</if> |
|
|
|
|
|
|
|
|
|
|
|
<if test="query.brandName != null and query.brandName != ''"> and `cate1`.`name` like concat('%',#{query.brandName},'%') </if> |
|
|
|
|
|
<if test="query.categoryName != null and query.categoryName != ''"> and `cate2`.`name` like concat('%',#{query.categoryName},'%') </if> |
|
|
|
|
|
<if test="query.seriesName != null and query.seriesName != ''"> and `cate3`.`name` like concat('%',#{query.seriesName},'%') </if> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</where> |
|
|
</where> |
|
|
ORDER BY `goods_sku`.`create_time` DESC |
|
|
ORDER BY `goods_sku`.`create_time` DESC |
|
|
</select> |
|
|
</select> |
|
|