|
@@ -0,0 +1,123 @@
|
|
|
|
|
+<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
|
|
+<!DOCTYPE mapper
|
|
|
|
|
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
|
|
+<mapper namespace="com.ruoyi.base.mapper.MallMapper">
|
|
|
|
|
+
|
|
|
|
|
+ <resultMap type="Mall" id="MallResult">
|
|
|
|
|
+ <result property="id" column="id" />
|
|
|
|
|
+ <result property="productCategory" column="product_category" />
|
|
|
|
|
+ <result property="title" column="title" />
|
|
|
|
|
+ <result property="description" column="description" />
|
|
|
|
|
+ <result property="price" column="price" />
|
|
|
|
|
+ <result property="originalPrice" column="original_price" />
|
|
|
|
|
+ <result property="specifications" column="specifications" />
|
|
|
|
|
+ <result column="features" property="features"
|
|
|
|
|
+ typeHandler="com.ruoyi.common.core.utils.JsonListTypeHandler"/>
|
|
|
|
|
+ <result property="usageGuide" column="usage_guide" />
|
|
|
|
|
+ <result property="swiperImages" column="swiper_images" />
|
|
|
|
|
+ <result property="detailImages" column="detail_images" />
|
|
|
|
|
+ <result property="status" column="status" />
|
|
|
|
|
+ <result property="createBy" column="create_by" />
|
|
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
|
|
+ <result property="updateBy" column="update_by" />
|
|
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
|
|
+ </resultMap>
|
|
|
|
|
+
|
|
|
|
|
+ <sql id="selectMallVo">
|
|
|
|
|
+ select id, product_category, title, description, price, original_price, specifications, features, usage_guide, swiper_images, detail_images, status, create_by, create_time, update_by, update_time from mall
|
|
|
|
|
+ </sql>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="selectMallList" parameterType="Mall" resultMap="MallResult">
|
|
|
|
|
+ <include refid="selectMallVo"/>
|
|
|
|
|
+ <where>
|
|
|
|
|
+ <if test="productCategory != null "> and product_category = #{productCategory}</if>
|
|
|
|
|
+ <if test="title != null and title != ''"> and title = #{title}</if>
|
|
|
|
|
+ <if test="description != null and description != ''"> and description = #{description}</if>
|
|
|
|
|
+ <if test="price != null "> and price = #{price}</if>
|
|
|
|
|
+ <if test="originalPrice != null "> and original_price = #{originalPrice}</if>
|
|
|
|
|
+ <if test="specifications != null and specifications != ''"> and specifications = #{specifications}</if>
|
|
|
|
|
+ <if test="features != null and features != ''"> and features = #{features}</if>
|
|
|
|
|
+ <if test="usageGuide != null and usageGuide != ''"> and usage_guide = #{usageGuide}</if>
|
|
|
|
|
+ <if test="swiperImages != null and swiperImages != ''"> and swiper_images = #{swiperImages}</if>
|
|
|
|
|
+ <if test="detailImages != null and detailImages != ''"> and detail_images = #{detailImages}</if>
|
|
|
|
|
+ <if test="status != null "> and status = #{status}</if>
|
|
|
|
|
+ </where>
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="selectMallById" parameterType="String" resultMap="MallResult">
|
|
|
|
|
+ <include refid="selectMallVo"/>
|
|
|
|
|
+ where id = #{id}
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+ <insert id="insertMall" parameterType="Mall" useGeneratedKeys="true" keyProperty="id">
|
|
|
|
|
+ insert into mall
|
|
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
+ <if test="productCategory != null">product_category,</if>
|
|
|
|
|
+ <if test="title != null and title != ''">title,</if>
|
|
|
|
|
+ <if test="description != null and description != ''">description,</if>
|
|
|
|
|
+ <if test="price != null">price,</if>
|
|
|
|
|
+ <if test="originalPrice != null">original_price,</if>
|
|
|
|
|
+ <if test="specifications != null and specifications != ''">specifications,</if>
|
|
|
|
|
+ <if test="features != null and features != ''">features,</if>
|
|
|
|
|
+ <if test="usageGuide != null and usageGuide != ''">usage_guide,</if>
|
|
|
|
|
+ <if test="swiperImages != null and swiperImages != ''">swiper_images,</if>
|
|
|
|
|
+ <if test="detailImages != null">detail_images,</if>
|
|
|
|
|
+ <if test="status != null">status,</if>
|
|
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
|
|
+ <if test="updateBy != null">update_by,</if>
|
|
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
|
|
+ </trim>
|
|
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
+ <if test="productCategory != null">#{productCategory},</if>
|
|
|
|
|
+ <if test="title != null and title != ''">#{title},</if>
|
|
|
|
|
+ <if test="description != null and description != ''">#{description},</if>
|
|
|
|
|
+ <if test="price != null">#{price},</if>
|
|
|
|
|
+ <if test="originalPrice != null">#{originalPrice},</if>
|
|
|
|
|
+ <if test="specifications != null and specifications != ''">#{specifications},</if>
|
|
|
|
|
+ <if test="features != null and features != ''">#{features},</if>
|
|
|
|
|
+ <if test="usageGuide != null and usageGuide != ''">#{usageGuide},</if>
|
|
|
|
|
+ <if test="swiperImages != null and swiperImages != ''">#{swiperImages},</if>
|
|
|
|
|
+ <if test="detailImages != null">#{detailImages},</if>
|
|
|
|
|
+ <if test="status != null">#{status},</if>
|
|
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
|
|
+ <if test="updateBy != null">#{updateBy},</if>
|
|
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
|
|
+ </trim>
|
|
|
|
|
+ </insert>
|
|
|
|
|
+
|
|
|
|
|
+ <update id="updateMall" parameterType="Mall">
|
|
|
|
|
+ update mall
|
|
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
|
|
+ <if test="productCategory != null">product_category = #{productCategory},</if>
|
|
|
|
|
+ <if test="title != null and title != ''">title = #{title},</if>
|
|
|
|
|
+ <if test="description != null and description != ''">description = #{description},</if>
|
|
|
|
|
+ <if test="price != null">price = #{price},</if>
|
|
|
|
|
+ <if test="originalPrice != null">original_price = #{originalPrice},</if>
|
|
|
|
|
+ <if test="specifications != null and specifications != ''">specifications = #{specifications},</if>
|
|
|
|
|
+ <if test="features != null and features != ''">features = #{features},</if>
|
|
|
|
|
+ <if test="usageGuide != null and usageGuide != ''">usage_guide = #{usageGuide},</if>
|
|
|
|
|
+ <if test="swiperImages != null and swiperImages != ''">swiper_images = #{swiperImages},</if>
|
|
|
|
|
+ <if test="detailImages != null">detail_images = #{detailImages},</if>
|
|
|
|
|
+ <if test="status != null">status = #{status},</if>
|
|
|
|
|
+ <if test="createBy != null">create_by = #{createBy},</if>
|
|
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
|
|
+ <if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
|
|
+ </trim>
|
|
|
|
|
+ where id = #{id}
|
|
|
|
|
+ </update>
|
|
|
|
|
+
|
|
|
|
|
+ <delete id="deleteMallById" parameterType="String">
|
|
|
|
|
+ delete from mall where id = #{id}
|
|
|
|
|
+ </delete>
|
|
|
|
|
+
|
|
|
|
|
+ <delete id="deleteMallByIds" parameterType="String">
|
|
|
|
|
+ delete from mall where id in
|
|
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
|
+ #{id}
|
|
|
|
|
+ </foreach>
|
|
|
|
|
+ </delete>
|
|
|
|
|
+</mapper>
|