增加 user 端的商品分类接口
增加 user 端的商品 spu 接口
This commit is contained in:
@@ -93,4 +93,38 @@
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectByAttrIdAndName" resultType="ProductAttrValueDO">
|
||||
SELECT
|
||||
<include refid="FIELDS" />
|
||||
FROM product_attr_value
|
||||
WHERE name = #{name}
|
||||
AND deleted = 0
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
<insert id="insert" parameterType="ProductAttrValueDO" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
|
||||
INSERT INTO product_attr_value (
|
||||
attr_id, name, status, create_time, deleted
|
||||
) VALUES (
|
||||
#{attrId}, #{name}, #{status}, #{createTime}, #{deleted}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="update" parameterType="ProductAttrValueDO">
|
||||
UPDATE product_attr_value
|
||||
<set>
|
||||
<if test="name != null">
|
||||
name = #{name},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status = #{status},
|
||||
</if>
|
||||
<if test="deleted != null">
|
||||
deleted = #{deleted}
|
||||
</if>
|
||||
</set>
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -4,7 +4,8 @@
|
||||
|
||||
<sql id="FIELDS">
|
||||
id, name, sell_point, description, cid,
|
||||
pic_urls, visible, sort, create_time
|
||||
pic_urls, visible, sort, price, quantity,
|
||||
create_time
|
||||
</sql>
|
||||
|
||||
<select id="selectById" parameterType="Integer" resultType="ProductSpuDO">
|
||||
@@ -18,10 +19,12 @@
|
||||
<insert id="insert" parameterType="ProductSpuDO" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
|
||||
INSERT INTO product_spu (
|
||||
name, sell_point, description, cid, pic_urls,
|
||||
visible, sort, deleted, create_time
|
||||
visible, sort, price, quantity,
|
||||
deleted, create_time
|
||||
) VALUES (
|
||||
#{name}, #{sellPoint}, #{description}, #{cid}, #{picUrls},
|
||||
#{visible}, #{sort}, #{deleted}, #{createTime}
|
||||
#{visible}, #{sort}, #{price}, #{quantity},
|
||||
#{deleted}, #{createTime}
|
||||
)
|
||||
</insert>
|
||||
|
||||
@@ -46,6 +49,12 @@
|
||||
<if test="visible != null">
|
||||
visible = #{visible},
|
||||
</if>
|
||||
<if test="price != null">
|
||||
price = #{price},
|
||||
</if>
|
||||
<if test="quantity != null">
|
||||
quantity = #{quantity},
|
||||
</if>
|
||||
<if test="sort != null">
|
||||
sort = #{sort},
|
||||
</if>
|
||||
@@ -64,6 +73,12 @@
|
||||
<if test="name != null">
|
||||
name LIKE "%"#{name}"%"
|
||||
</if>
|
||||
<if test="cid != null">
|
||||
AND cid = #{cid}
|
||||
</if>
|
||||
<if test="visible != null">
|
||||
AND visible = #{visible}
|
||||
</if>
|
||||
AND deleted = 0
|
||||
</where>
|
||||
ORDER BY sort ASC
|
||||
@@ -78,6 +93,12 @@
|
||||
<if test="name != null">
|
||||
name LIKE "%"#{name}"%"
|
||||
</if>
|
||||
<if test="cid != null">
|
||||
AND cid = #{cid}
|
||||
</if>
|
||||
<if test="visible != null">
|
||||
AND visible = #{visible}
|
||||
</if>
|
||||
AND deleted = 0
|
||||
</where>
|
||||
</select>
|
||||
|
||||
Reference in New Issue
Block a user