114 lines
6.5 KiB
XML
114 lines
6.5 KiB
XML
<?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.sf.goods.mapper.GoodsMessagesMapper">
|
|
|
|
<resultMap type="GoodsMessages" id="GoodsMessagesResult">
|
|
<result property="id" column="id" />
|
|
<result property="goodsCode" column="goods_code" />
|
|
<result property="stockId" column="stock_id" />
|
|
<result property="reviewStatus" column="review_status" />
|
|
<result property="productTitle" column="product_title" />
|
|
<result property="productPicture" column="product_picture" />
|
|
<result property="originalPrice" column="original_price" />
|
|
<result property="productDesc" column="product_desc" />
|
|
<result property="orderNum" column="order_num" />
|
|
<result property="isDelete" column="is_delete" />
|
|
<result property="created" column="created" />
|
|
<result property="modified" column="modified" />
|
|
<result property="createTime" column="create_time" />
|
|
<result property="updateTime" column="update_time" />
|
|
<result property="goodsType" column="goods_type" />
|
|
<result property="goodsSpec" column="goods_spec" />
|
|
</resultMap>
|
|
|
|
<sql id="selectGoodsMessagesVo">
|
|
select id, goods_code, stock_id, review_status, product_title, product_picture, original_price, product_desc, order_num, is_delete, created, modified, create_time, update_time, goods_type, goods_spec from GOODS_MESSAGES
|
|
</sql>
|
|
|
|
<select id="selectGoodsMessagesList" parameterType="GoodsMessages" resultMap="GoodsMessagesResult">
|
|
<include refid="selectGoodsMessagesVo"/>
|
|
<where>
|
|
<if test="goodsCode != null and goodsCode != ''"> and goods_code = #{goodsCode}</if>
|
|
<if test="productTitle != null and productTitle != ''"> and product_title like concat('%', #{productTitle}, '%')</if>
|
|
<if test="goodsType != null and goodsType != ''"> and goods_type = #{goodsType}</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectGoodsMessagesById" parameterType="Long" resultMap="GoodsMessagesResult">
|
|
<include refid="selectGoodsMessagesVo"/>
|
|
where id = #{id}
|
|
</select>
|
|
|
|
<insert id="insertGoodsMessages" parameterType="GoodsMessages" useGeneratedKeys="true" keyProperty="id">
|
|
insert into GOODS_MESSAGES
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="goodsCode != null and goodsCode != ''">goods_code,</if>
|
|
<if test="stockId != null">stock_id,</if>
|
|
<if test="reviewStatus != null">review_status,</if>
|
|
<if test="productTitle != null and productTitle != ''">product_title,</if>
|
|
<if test="productPicture != null and productPicture != ''">product_picture,</if>
|
|
<if test="originalPrice != null">original_price,</if>
|
|
<if test="productDesc != null">product_desc,</if>
|
|
<if test="orderNum != null">order_num,</if>
|
|
<if test="isDelete != null">is_delete,</if>
|
|
<if test="created != null">created,</if>
|
|
<if test="modified != null">modified,</if>
|
|
<if test="createTime != null">create_time,</if>
|
|
<if test="updateTime != null">update_time,</if>
|
|
<if test="goodsType != null and goodsType != ''">goods_type,</if>
|
|
<if test="goodsSpec != null and goodsSpec != ''">goods_spec,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="goodsCode != null and goodsCode != ''">#{goodsCode},</if>
|
|
<if test="stockId != null">#{stockId},</if>
|
|
<if test="reviewStatus != null">#{reviewStatus},</if>
|
|
<if test="productTitle != null and productTitle != ''">#{productTitle},</if>
|
|
<if test="productPicture != null and productPicture != ''">#{productPicture},</if>
|
|
<if test="originalPrice != null">#{originalPrice},</if>
|
|
<if test="productDesc != null">#{productDesc},</if>
|
|
<if test="orderNum != null">#{orderNum},</if>
|
|
<if test="isDelete != null">#{isDelete},</if>
|
|
<if test="created != null">#{created},</if>
|
|
<if test="modified != null">#{modified},</if>
|
|
<if test="createTime != null">#{createTime},</if>
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
<if test="goodsType != null and goodsType != ''">#{goodsType},</if>
|
|
<if test="goodsSpec != null and goodsSpec != ''">#{goodsSpec},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateGoodsMessages" parameterType="GoodsMessages">
|
|
update GOODS_MESSAGES
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="goodsCode != null and goodsCode != ''">goods_code = #{goodsCode},</if>
|
|
<if test="stockId != null">stock_id = #{stockId},</if>
|
|
<if test="reviewStatus != null">review_status = #{reviewStatus},</if>
|
|
<if test="productTitle != null and productTitle != ''">product_title = #{productTitle},</if>
|
|
<if test="productPicture != null and productPicture != ''">product_picture = #{productPicture},</if>
|
|
<if test="originalPrice != null">original_price = #{originalPrice},</if>
|
|
<if test="productDesc != null">product_desc = #{productDesc},</if>
|
|
<if test="orderNum != null">order_num = #{orderNum},</if>
|
|
<if test="isDelete != null">is_delete = #{isDelete},</if>
|
|
<if test="created != null">created = #{created},</if>
|
|
<if test="modified != null">modified = #{modified},</if>
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
<if test="goodsType != null and goodsType != ''">goods_type = #{goodsType},</if>
|
|
<if test="goodsSpec != null and goodsSpec != ''">goods_spec = #{goodsSpec},</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<delete id="deleteGoodsMessagesById" parameterType="Long">
|
|
delete from GOODS_MESSAGES where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteGoodsMessagesByIds" parameterType="String">
|
|
delete from GOODS_MESSAGES where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
</mapper> |