Files
wuhan-saga/server/target/classes/mapper/ProductMediaMapper.xml

22 lines
865 B
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.wuhansaga.server.mapper.ProductMediaMapper">
<select id="selectByProductId" resultType="com.wuhansaga.server.entity.ProductMedia">
SELECT * FROM f_product_media WHERE product_id = #{productId} ORDER BY sort_order ASC
</select>
<insert id="insert">
INSERT INTO f_product_media (product_id, media_id, sort_order)
VALUES (#{productId}, #{mediaId}, #{sortOrder})
</insert>
<delete id="deleteByProductId">
DELETE FROM f_product_media WHERE product_id = #{productId}
</delete>
<delete id="deleteByProductIdAndMediaId">
DELETE FROM f_product_media WHERE product_id = #{productId} AND media_id = #{mediaId}
</delete>
</mapper>