|
@@ -0,0 +1,111 @@
|
|
|
+<?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.system.mapper.MallGoodsMapper">
|
|
|
+
|
|
|
+ <resultMap type="MallGoods" id="MallGoodsResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="appId" column="app_id" />
|
|
|
+ <result property="goodsId" column="goods_id" />
|
|
|
+ <result property="cover" column="cover" />
|
|
|
+ <result property="name" column="name" />
|
|
|
+ <result property="needPoint" column="need_point" />
|
|
|
+ <result property="realStockNum" column="real_stock_num" />
|
|
|
+ <result property="virtualStockNum" column="virtual_stock_num" />
|
|
|
+ <result property="exchangeNum" column="exchange_num" />
|
|
|
+ <result property="status" column="status" />
|
|
|
+ <result property="isDelete" column="is_delete" />
|
|
|
+ <result property="createdAt" column="created_at" />
|
|
|
+ <result property="updatedAt" column="updated_at" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectMallGoodsVo">
|
|
|
+ select id, app_id, goods_id, cover, name, need_point, real_stock_num, virtual_stock_num, exchange_num, status, is_delete, created_at, updated_at from mall_goods
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectMallGoodsList" parameterType="MallGoods" resultMap="MallGoodsResult">
|
|
|
+ <include refid="selectMallGoodsVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="appId != null and appId != ''"> and app_id = #{appId}</if>
|
|
|
+ <if test="goodsId != null and goodsId != ''"> and goods_id = #{goodsId}</if>
|
|
|
+ <if test="cover != null and cover != ''"> and cover = #{cover}</if>
|
|
|
+ <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
|
|
+ <if test="needPoint != null "> and need_point = #{needPoint}</if>
|
|
|
+ <if test="realStockNum != null "> and real_stock_num = #{realStockNum}</if>
|
|
|
+ <if test="virtualStockNum != null "> and virtual_stock_num = #{virtualStockNum}</if>
|
|
|
+ <if test="exchangeNum != null "> and exchange_num = #{exchangeNum}</if>
|
|
|
+ <if test="status != null "> and status = #{status}</if>
|
|
|
+ <if test="isDelete != null "> and is_delete = #{isDelete}</if>
|
|
|
+ <if test="createdAt != null "> and created_at = #{createdAt}</if>
|
|
|
+ <if test="updatedAt != null "> and updated_at = #{updatedAt}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectMallGoodsById" parameterType="Integer" resultMap="MallGoodsResult">
|
|
|
+ <include refid="selectMallGoodsVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertMallGoods" parameterType="MallGoods" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into mall_goods
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="appId != null and appId != ''">app_id,</if>
|
|
|
+ <if test="goodsId != null and goodsId != ''">goods_id,</if>
|
|
|
+ <if test="cover != null and cover != ''">cover,</if>
|
|
|
+ <if test="name != null and name != ''">name,</if>
|
|
|
+ <if test="needPoint != null">need_point,</if>
|
|
|
+ <if test="realStockNum != null">real_stock_num,</if>
|
|
|
+ <if test="virtualStockNum != null">virtual_stock_num,</if>
|
|
|
+ <if test="exchangeNum != null">exchange_num,</if>
|
|
|
+ <if test="status != null">status,</if>
|
|
|
+ <if test="isDelete != null">is_delete,</if>
|
|
|
+ <if test="createdAt != null">created_at,</if>
|
|
|
+ <if test="updatedAt != null">updated_at,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="appId != null and appId != ''">#{appId},</if>
|
|
|
+ <if test="goodsId != null and goodsId != ''">#{goodsId},</if>
|
|
|
+ <if test="cover != null and cover != ''">#{cover},</if>
|
|
|
+ <if test="name != null and name != ''">#{name},</if>
|
|
|
+ <if test="needPoint != null">#{needPoint},</if>
|
|
|
+ <if test="realStockNum != null">#{realStockNum},</if>
|
|
|
+ <if test="virtualStockNum != null">#{virtualStockNum},</if>
|
|
|
+ <if test="exchangeNum != null">#{exchangeNum},</if>
|
|
|
+ <if test="status != null">#{status},</if>
|
|
|
+ <if test="isDelete != null">#{isDelete},</if>
|
|
|
+ <if test="createdAt != null">#{createdAt},</if>
|
|
|
+ <if test="updatedAt != null">#{updatedAt},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateMallGoods" parameterType="MallGoods">
|
|
|
+ update mall_goods
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="appId != null and appId != ''">app_id = #{appId},</if>
|
|
|
+ <if test="goodsId != null and goodsId != ''">goods_id = #{goodsId},</if>
|
|
|
+ <if test="cover != null and cover != ''">cover = #{cover},</if>
|
|
|
+ <if test="name != null and name != ''">name = #{name},</if>
|
|
|
+ <if test="needPoint != null">need_point = #{needPoint},</if>
|
|
|
+ <if test="realStockNum != null">real_stock_num = #{realStockNum},</if>
|
|
|
+ <if test="virtualStockNum != null">virtual_stock_num = #{virtualStockNum},</if>
|
|
|
+ <if test="exchangeNum != null">exchange_num = #{exchangeNum},</if>
|
|
|
+ <if test="status != null">status = #{status},</if>
|
|
|
+ <if test="isDelete != null">is_delete = #{isDelete},</if>
|
|
|
+ <if test="createdAt != null">created_at = #{createdAt},</if>
|
|
|
+ <if test="updatedAt != null">updated_at = #{updatedAt},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteMallGoodsById" parameterType="Integer">
|
|
|
+ delete from mall_goods where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteMallGoodsByIds" parameterType="String">
|
|
|
+ delete from mall_goods where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|