|
@@ -9,6 +9,8 @@
|
|
|
<result property="goodsSn" column="goods_sn"/>
|
|
|
<result property="name" column="name"/>
|
|
|
<result property="brandId" column="brand_id"/>
|
|
|
+ <result property="freightId" column="freight_id"/>
|
|
|
+ <result property="brand" column="brand"/>
|
|
|
<result property="goodsNumber" column="goods_number"/>
|
|
|
<result property="keywords" column="keywords"/>
|
|
|
<result property="goodsBrief" column="goods_brief"/>
|
|
@@ -43,10 +45,18 @@
|
|
|
<result column="moder_sn" property="moderSn" jdbcType="VARCHAR" />
|
|
|
<result column="mod_time" property="modTime" jdbcType="TIMESTAMP" />
|
|
|
<result column="tstm" property="tstm" jdbcType="TIMESTAMP" />
|
|
|
+ <result property="prodBarcode" column="prod_barcode"/>
|
|
|
+ <result property="unitCode" column="unit_code"/>
|
|
|
+ <result property="goodsDesc" column="goods_desc"/>
|
|
|
+ <result property="cusGoodsCode" column="cus_goods_code"/>
|
|
|
+ <result property="ciqProdModel" column="ciq_prod_model"/>
|
|
|
+ <result property="oriCntCode" column="ori_cnt_code"/>
|
|
|
+ <result property="cusDeclEle" column="cus_decl_ele"/>
|
|
|
+ <result property="cusRecCode" column="cus_rec_code"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<select id="queryObject" resultType="com.kmall.admin.entity.GoodsEntity">
|
|
|
- SELECT
|
|
|
+ SELECT
|
|
|
a.*, CASE
|
|
|
when g.id > 0 then 2 else 0 end as goodsType
|
|
|
FROM
|
|
@@ -69,46 +79,18 @@
|
|
|
|
|
|
<select id="queryList" resultType="com.kmall.admin.entity.GoodsEntity">
|
|
|
select
|
|
|
- mall_goods.id,
|
|
|
- mall_goods.category_id,
|
|
|
- mall_goods.goods_sn,
|
|
|
- mall_goods.name,
|
|
|
- mall_goods.brand_id,
|
|
|
- mall_goods.goods_number,
|
|
|
- mall_goods.keywords,
|
|
|
- mall_goods.goods_brief,
|
|
|
- mall_goods.is_on_sale,
|
|
|
- mall_goods.add_time,
|
|
|
- mall_goods.sort_order,
|
|
|
- mall_goods.is_delete,
|
|
|
- mall_goods.attribute_category,
|
|
|
- mall_goods.counter_price,
|
|
|
- mall_goods.extra_price,
|
|
|
- mall_goods.is_new,
|
|
|
- mall_goods.goods_unit,
|
|
|
- mall_goods.primary_pic_url,
|
|
|
- mall_goods.list_pic_url,
|
|
|
- mall_goods.retail_price,
|
|
|
- mall_goods.sell_volume,
|
|
|
- mall_goods.primary_product_id,
|
|
|
- mall_goods.unit_price,
|
|
|
- mall_goods.promotion_desc,
|
|
|
- mall_goods.promotion_tag,
|
|
|
- mall_goods.app_exclusive_price,
|
|
|
- mall_goods.is_app_exclusive,
|
|
|
- mall_goods.is_limited,
|
|
|
- mall_goods.is_hot,
|
|
|
- mall_goods.market_price,
|
|
|
+ mall_goods.*,
|
|
|
mall_category.name category_name,
|
|
|
mall_attribute_category.name attribute_category_name,
|
|
|
mall_brand.name brand_name,
|
|
|
+ mall_freight.name freight_name,
|
|
|
case when mall_goods_group.id > 0 then 2 else 0 end as goodsType
|
|
|
from mall_goods
|
|
|
- LEFT JOIN mall_category
|
|
|
- ON mall_goods.category_id = mall_category.id
|
|
|
+ LEFT JOIN mall_category ON mall_goods.category_id = mall_category.id
|
|
|
LEFT JOIN mall_attribute_category ON mall_goods.attribute_category = mall_attribute_category.id
|
|
|
LEFT JOIN mall_brand ON mall_brand.id = mall_goods.brand_id
|
|
|
left join mall_goods_group on mall_goods_group.goods_id = mall_goods.id and mall_goods_group.open_status != 3
|
|
|
+ left join mall_freight on mall_goods.freight_id = mall_freight.id
|
|
|
WHERE 1=1
|
|
|
<!-- 数据过滤 -->
|
|
|
${filterSql}
|
|
@@ -118,13 +100,21 @@
|
|
|
<if test="name != null and name != ''">
|
|
|
AND mall_goods.name LIKE concat('%',#{name},'%')
|
|
|
</if>
|
|
|
+ <if test="freightId != null and freightId != ''">
|
|
|
+ AND mall_goods.freight_id = #{freightId}
|
|
|
+ </if>
|
|
|
+ <if test="sku != null and sku != ''">
|
|
|
+ AND mall_goods.sku LIKE concat('%',#{sku},'%')
|
|
|
+ </if>
|
|
|
<if test="category != null and category != ''">
|
|
|
AND mall_goods.category_id IN (select id from mall_category where parent_id = #{category})
|
|
|
</if>
|
|
|
<if test="categoryTwo != null and categoryTwo != ''">
|
|
|
AND mall_goods.category_id = #{categoryTwo}
|
|
|
</if>
|
|
|
- AND mall_goods.is_Delete = #{isDelete}
|
|
|
+ <if test="isDelete != null and isDelete != ''">
|
|
|
+ AND mall_goods.is_Delete = #{isDelete}
|
|
|
+ </if>
|
|
|
<choose>
|
|
|
<when test="sidx != null and sidx.trim() != ''">
|
|
|
order by ${sidx} ${order}
|
|
@@ -146,150 +136,163 @@
|
|
|
AND mall_goods.goods_sn like concat('%',#{goodsSn},'%')
|
|
|
</if>
|
|
|
<if test="name != null and name != ''">
|
|
|
- AND name LIKE concat('%',#{name},'%')
|
|
|
+ AND mall_goods.name LIKE concat('%',#{name},'%')
|
|
|
+ </if>
|
|
|
+ <if test="sku != null and sku != ''">
|
|
|
+ AND mall_goods.sku LIKE concat('%',#{sku},'%')
|
|
|
</if>
|
|
|
AND mall_goods.is_Delete = #{isDelete}
|
|
|
</select>
|
|
|
|
|
|
<insert id="save" parameterType="com.kmall.admin.entity.GoodsEntity">
|
|
|
- insert into mall_goods
|
|
|
- (
|
|
|
- `id`,
|
|
|
- `category_id`,
|
|
|
- `goods_sn`,
|
|
|
- `name`,
|
|
|
- `brand_id`,
|
|
|
- `goods_number`,
|
|
|
- `keywords`,
|
|
|
- `goods_brief`,
|
|
|
- `goods_desc`,
|
|
|
- `is_on_sale`,
|
|
|
- `add_time`,
|
|
|
- `sort_order`,
|
|
|
- `is_delete`,
|
|
|
- `attribute_category`,
|
|
|
- `counter_price`,
|
|
|
- `extra_price`,
|
|
|
- `is_new`,
|
|
|
- `goods_unit`,
|
|
|
- `primary_pic_url`,
|
|
|
- `list_pic_url`,
|
|
|
- `retail_price`,
|
|
|
- `sell_volume`,
|
|
|
- `primary_product_id`,
|
|
|
- `unit_price`,
|
|
|
- `promotion_desc`,
|
|
|
- `promotion_tag`,
|
|
|
- `app_exclusive_price`,
|
|
|
- `is_app_exclusive`,
|
|
|
- `is_limited`,
|
|
|
- `is_hot`,
|
|
|
- `market_price`,
|
|
|
- `sku`,
|
|
|
- `goods_biz_type`,
|
|
|
- `create_sn`,
|
|
|
- `create_time`,
|
|
|
- `moder_sn`,
|
|
|
- `mod_time`,
|
|
|
- `tstm`
|
|
|
- )
|
|
|
- values
|
|
|
- (
|
|
|
- #{id},
|
|
|
- #{categoryId},
|
|
|
- #{goodsSn},
|
|
|
- #{name},
|
|
|
- #{brandId},
|
|
|
- #{goodsNumber},
|
|
|
- #{keywords},
|
|
|
- #{goodsBrief},
|
|
|
- #{goodsDesc},
|
|
|
- #{isOnSale},
|
|
|
- #{addTime},
|
|
|
- #{sortOrder},
|
|
|
- #{isDelete},
|
|
|
- #{attributeCategory},
|
|
|
- #{counterPrice},
|
|
|
- #{extraPrice},
|
|
|
- #{isNew},
|
|
|
- #{goodsUnit},
|
|
|
- #{primaryPicUrl},
|
|
|
- #{listPicUrl},
|
|
|
- #{retailPrice},
|
|
|
- #{sellVolume},
|
|
|
- #{primaryProductId},
|
|
|
- #{unitPrice},
|
|
|
- #{promotionDesc},
|
|
|
- #{promotionTag},
|
|
|
- #{appExclusivePrice},
|
|
|
- #{isAppExclusive},
|
|
|
- #{isLimited},
|
|
|
- #{isHot},
|
|
|
- #{marketPrice},
|
|
|
- #{sku},
|
|
|
- #{goodsBizType},
|
|
|
- #{createrSn},
|
|
|
- #{createTime},
|
|
|
- #{moderSn},
|
|
|
- #{modTime},
|
|
|
- #{tstm}
|
|
|
- )
|
|
|
+ insert into mall_goods(
|
|
|
+ `category_id`,
|
|
|
+ `goods_sn`,
|
|
|
+ `prod_barcode`,
|
|
|
+ `sku`,
|
|
|
+ `goods_biz_type`,
|
|
|
+ `name`,
|
|
|
+ `unit_code`,
|
|
|
+ `brand_id`,
|
|
|
+ `brand`,
|
|
|
+ `freight_id`,
|
|
|
+ `goods_number`,
|
|
|
+ `keywords`,
|
|
|
+ `goods_brief`,
|
|
|
+ `goods_desc`,
|
|
|
+ `cus_goods_code`,
|
|
|
+ `ciq_prod_model`,
|
|
|
+ `ori_cnt_code`,
|
|
|
+ `cus_decl_ele`,
|
|
|
+ `cus_rec_code`,
|
|
|
+ `is_on_sale`,
|
|
|
+ `add_time`,
|
|
|
+ `sort_order`,
|
|
|
+ `is_delete`,
|
|
|
+ `attribute_category`,
|
|
|
+ `counter_price`,
|
|
|
+ `extra_price`,
|
|
|
+ `is_new`,
|
|
|
+ `goods_unit`,
|
|
|
+ `primary_pic_url`,
|
|
|
+ `list_pic_url`,
|
|
|
+ `goods_rate`,
|
|
|
+ `retail_price`,
|
|
|
+ `sell_volume`,
|
|
|
+ `primary_product_id`,
|
|
|
+ `unit_price`,
|
|
|
+ `promotion_desc`,
|
|
|
+ `promotion_tag`,
|
|
|
+ `app_exclusive_price`,
|
|
|
+ `is_app_exclusive`,
|
|
|
+ `is_limited`,
|
|
|
+ `is_hot`,
|
|
|
+ `market_price`,
|
|
|
+ `creater_sn`,
|
|
|
+ `create_time`,
|
|
|
+ `moder_sn`,
|
|
|
+ `mod_time`,
|
|
|
+ `tstm`)
|
|
|
+ values(
|
|
|
+ #{categoryId},
|
|
|
+ #{goodsSn},
|
|
|
+ #{prodBarcode},
|
|
|
+ #{sku},
|
|
|
+ #{goodsBizType},
|
|
|
+ #{name},
|
|
|
+ #{unitCode},
|
|
|
+ #{brandId},
|
|
|
+ #{brand},
|
|
|
+ #{freightId},
|
|
|
+ #{goodsNumber},
|
|
|
+ #{keywords},
|
|
|
+ #{goodsBrief},
|
|
|
+ #{goodsDesc},
|
|
|
+ #{cusGoodsCode},
|
|
|
+ #{ciqProdModel},
|
|
|
+ #{oriCntCode},
|
|
|
+ #{cusDeclEle},
|
|
|
+ #{cusRecCode},
|
|
|
+ #{isOnSale},
|
|
|
+ #{addTime},
|
|
|
+ #{sortOrder},
|
|
|
+ #{isDelete},
|
|
|
+ #{attributeCategory},
|
|
|
+ #{counterPrice},
|
|
|
+ #{extraPrice},
|
|
|
+ #{isNew},
|
|
|
+ #{goodsUnit},
|
|
|
+ #{primaryPicUrl},
|
|
|
+ #{listPicUrl},
|
|
|
+ #{goodsRate},
|
|
|
+ #{retailPrice},
|
|
|
+ #{sellVolume},
|
|
|
+ #{primaryProductId},
|
|
|
+ #{unitPrice},
|
|
|
+ #{promotionDesc},
|
|
|
+ #{promotionTag},
|
|
|
+ #{appExclusivePrice},
|
|
|
+ #{isAppExclusive},
|
|
|
+ #{isLimited},
|
|
|
+ #{isHot},
|
|
|
+ #{marketPrice},
|
|
|
+ #{createrSn},
|
|
|
+ #{createTime},
|
|
|
+ #{moderSn},
|
|
|
+ #{modTime},
|
|
|
+ #{tstm})
|
|
|
</insert>
|
|
|
|
|
|
<update id="update" parameterType="com.kmall.admin.entity.GoodsEntity">
|
|
|
update mall_goods
|
|
|
<set>
|
|
|
- <if test="categoryId != null">`category_id` = #{categoryId},</if>
|
|
|
- <if test="goodsSn != null">`goods_sn` = #{goodsSn},</if>
|
|
|
- <if test="name != null">`name` = #{name},</if>
|
|
|
- <if test="brandId != null">`brand_id` = #{brandId},</if>
|
|
|
- <if test="goodsNumber != null">`goods_number` = #{goodsNumber},</if>
|
|
|
- <if test="keywords != null">`keywords` = #{keywords},</if>
|
|
|
- <if test="goodsBrief != null">`goods_brief` = #{goodsBrief},</if>
|
|
|
- <if test="goodsDesc != null">`goods_desc` = #{goodsDesc},</if>
|
|
|
- <if test="isOnSale != null">`is_on_sale` = #{isOnSale},</if>
|
|
|
- <if test="addTime != null">`add_time` = #{addTime},</if>
|
|
|
- <if test="sortOrder != null">`sort_order` = #{sortOrder},</if>
|
|
|
- <if test="isDelete != null">`is_delete` = #{isDelete},</if>
|
|
|
- <if test="attributeCategory != null">`attribute_category` = #{attributeCategory},</if>
|
|
|
- <if test="counterPrice != null">`counter_price` = #{counterPrice},</if>
|
|
|
- <if test="extraPrice != null">`extra_price` = #{extraPrice},</if>
|
|
|
- <if test="isNew != null">`is_new` = #{isNew},</if>
|
|
|
- <if test="goodsUnit != null">`goods_unit` = #{goodsUnit},</if>
|
|
|
- <if test="primaryPicUrl != null">`primary_pic_url` = #{primaryPicUrl},</if>
|
|
|
- <if test="listPicUrl != null">`list_pic_url` = #{listPicUrl},</if>
|
|
|
- <if test="retailPrice != null">`retail_price` = #{retailPrice},</if>
|
|
|
- <if test="sellVolume != null">`sell_volume` = #{sellVolume},</if>
|
|
|
- <if test="primaryProductId != null">`primary_product_id` = #{primaryProductId},</if>
|
|
|
- <if test="unitPrice != null">`unit_price` = #{unitPrice},</if>
|
|
|
- <if test="promotionDesc != null">`promotion_desc` = #{promotionDesc},</if>
|
|
|
- <if test="promotionTag != null">`promotion_tag` = #{promotionTag},</if>
|
|
|
- <if test="appExclusivePrice != null">`app_exclusive_price` = #{appExclusivePrice},</if>
|
|
|
- <if test="isAppExclusive != null">`is_app_exclusive` = #{isAppExclusive},</if>
|
|
|
- <if test="isLimited != null">`is_limited` = #{isLimited},</if>
|
|
|
- <if test="isHot != null">`is_hot` = #{isHot},</if>
|
|
|
- <if test="marketPrice != null">`market_price` = #{marketPrice},</if>
|
|
|
- <if test="sku != null" >
|
|
|
- sku = #{sku,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="goodsBizType != null" >
|
|
|
- goods_biz_type = #{goodsBizType,jdbcType=CHAR},
|
|
|
- </if>
|
|
|
- <if test="createrSn != null" >
|
|
|
- creater_sn = #{createrSn,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="createTime != null" >
|
|
|
- create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
- </if>
|
|
|
- <if test="moderSn != null" >
|
|
|
- moder_sn = #{moderSn,jdbcType=VARCHAR},
|
|
|
- </if>
|
|
|
- <if test="modTime != null" >
|
|
|
- mod_time = #{modTime,jdbcType=TIMESTAMP},
|
|
|
- </if>
|
|
|
- <if test="tstm != null" >
|
|
|
- tstm = #{tstm,jdbcType=TIMESTAMP},
|
|
|
- </if>
|
|
|
+ <if test="categoryId != null">`category_id` = #{categoryId}, </if>
|
|
|
+ <if test="goodsSn != null">`goods_sn` = #{goodsSn}, </if>
|
|
|
+ <if test="prodBarcode != null">`prod_barcode` = #{prodBarcode}, </if>
|
|
|
+ <if test="sku != null">`sku` = #{sku}, </if>
|
|
|
+ <if test="goodsBizType != null">`goods_biz_type` = #{goodsBizType}, </if>
|
|
|
+ <if test="name != null">`name` = #{name}, </if>
|
|
|
+ <if test="unitCode != null">`unit_code` = #{unitCode}, </if>
|
|
|
+ <if test="brandId != null">`brand_id` = #{brandId}, </if>
|
|
|
+ <if test="brand != null">`brand` = #{brand}, </if>
|
|
|
+ <if test="freightId != null">`freight_id` = #{freightId}, </if>
|
|
|
+ <if test="goodsNumber != null">`goods_number` = #{goodsNumber}, </if>
|
|
|
+ <if test="keywords != null">`keywords` = #{keywords}, </if>
|
|
|
+ <if test="goodsBrief != null">`goods_brief` = #{goodsBrief}, </if>
|
|
|
+ <if test="goodsDesc != null">`goods_desc` = #{goodsDesc}, </if>
|
|
|
+ <if test="cusGoodsCode != null">`cus_goods_code` = #{cusGoodsCode}, </if>
|
|
|
+ <if test="ciqProdModel != null">`ciq_prod_model` = #{ciqProdModel}, </if>
|
|
|
+ <if test="oriCntCode != null">`ori_cnt_code` = #{oriCntCode}, </if>
|
|
|
+ <if test="cusDeclEle != null">`cus_decl_ele` = #{cusDeclEle}, </if>
|
|
|
+ <if test="cusRecCode != null">`cus_rec_code` = #{cusRecCode}, </if>
|
|
|
+ <if test="isOnSale != null">`is_on_sale` = #{isOnSale}, </if>
|
|
|
+ <if test="addTime != null">`add_time` = #{addTime}, </if>
|
|
|
+ <if test="sortOrder != null">`sort_order` = #{sortOrder}, </if>
|
|
|
+ <if test="isDelete != null">`is_delete` = #{isDelete}, </if>
|
|
|
+ <if test="attributeCategory != null">`attribute_category` = #{attributeCategory}, </if>
|
|
|
+ <if test="counterPrice != null">`counter_price` = #{counterPrice}, </if>
|
|
|
+ <if test="extraPrice != null">`extra_price` = #{extraPrice}, </if>
|
|
|
+ <if test="isNew != null">`is_new` = #{isNew}, </if>
|
|
|
+ <if test="goodsUnit != null">`goods_unit` = #{goodsUnit}, </if>
|
|
|
+ <if test="primaryPicUrl != null">`primary_pic_url` = #{primaryPicUrl}, </if>
|
|
|
+ <if test="listPicUrl != null">`list_pic_url` = #{listPicUrl}, </if>
|
|
|
+ <if test="goodsRate != null">`goods_rate` = #{goodsRate}, </if>
|
|
|
+ <if test="retailPrice != null">`retail_price` = #{retailPrice}, </if>
|
|
|
+ <if test="sellVolume != null">`sell_volume` = #{sellVolume}, </if>
|
|
|
+ <if test="primaryProductId != null">`primary_product_id` = #{primaryProductId}, </if>
|
|
|
+ <if test="unitPrice != null">`unit_price` = #{unitPrice}, </if>
|
|
|
+ <if test="promotionDesc != null">`promotion_desc` = #{promotionDesc}, </if>
|
|
|
+ <if test="promotionTag != null">`promotion_tag` = #{promotionTag}, </if>
|
|
|
+ <if test="appExclusivePrice != null">`app_exclusive_price` = #{appExclusivePrice}, </if>
|
|
|
+ <if test="isAppExclusive != null">`is_app_exclusive` = #{isAppExclusive}, </if>
|
|
|
+ <if test="isLimited != null">`is_limited` = #{isLimited}, </if>
|
|
|
+ <if test="isHot != null">`is_hot` = #{isHot}, </if>
|
|
|
+ <if test="marketPrice != null">`market_price` = #{marketPrice}, </if>
|
|
|
+ <if test="createrSn != null">`creater_sn` = #{createrSn}, </if>
|
|
|
+ <if test="createTime != null">`create_time` = #{createTime}, </if>
|
|
|
+ <if test="moderSn != null">`moder_sn` = #{moderSn}, </if>
|
|
|
+ <if test="modTime != null">`mod_time` = #{modTime}, </if>
|
|
|
+ <if test="tstm != null">`tstm` = #{tstm}</if>
|
|
|
</set>
|
|
|
where id = #{id}
|
|
|
</update>
|