|
|
|
|
<?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="cc.hiver.mall.productpicture.mapper.ProductPictureMapper">
|
|
|
|
|
<resultMap id="BaseResultMap" type="cc.hiver.mall.productpicture.entity.ProductPicture">
|
|
|
|
|
<id column="id" jdbcType="VARCHAR" property="id" />
|
|
|
|
|
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
|
|
|
|
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
|
|
|
|
<result column="del_flag" jdbcType="INTEGER" property="delFlag" />
|
|
|
|
|
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
|
|
|
|
|
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
|
|
|
|
<result column="product_id" jdbcType="VARCHAR" property="productId" />
|
|
|
|
|
<result column="product_picture" jdbcType="VARCHAR" property="productPicture" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="Base_Column_List">
|
|
|
|
|
id, create_by, create_time, del_flag, update_by, update_time,product_id, product_picture
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<!--根据商品id查询商品子图-->
|
|
|
|
|
<select id="getProductPictureByProductId" parameterType="java.lang.String" resultMap="BaseResultMap">
|
|
|
|
|
select
|
|
|
|
|
<include refid="Base_Column_List"/>
|
|
|
|
|
from t_product_picture
|
|
|
|
|
where del_flag = 0
|
|
|
|
|
and product_id = #{productId,jdbcType=VARCHAR}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<!--根据商品id查询商品子图-->
|
|
|
|
|
<select id="getProductPictureByProductIds" resultMap="BaseResultMap">
|
|
|
|
|
select
|
|
|
|
|
<include refid="Base_Column_List"/>
|
|
|
|
|
from t_product_picture
|
|
|
|
|
where del_flag = 0
|
|
|
|
|
and product_id in
|
|
|
|
|
<foreach close=")" collection="productIds" item="listItem" open="(" separator=",">
|
|
|
|
|
#{listItem}
|
|
|
|
|
</foreach>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<!--批量新增商品子图-->
|
|
|
|
|
<insert id="batchSaveProductPicture" parameterType="java.util.List">
|
|
|
|
|
insert into t_product_picture (id, create_by, create_time, del_flag, update_by, update_time,product_id, product_picture) values
|
|
|
|
|
<foreach item="productPicture" collection="productPictures" index="index" separator=",">
|
|
|
|
|
(#{productPicture.id,jdbcType=VARCHAR},#{productPicture.createBy,jdbcType=VARCHAR},
|
|
|
|
|
#{productPicture.createTime,jdbcType=TIMESTAMP},#{productPicture.delFlag,jdbcType=INTEGER},
|
|
|
|
|
#{productPicture.updateBy,jdbcType=VARCHAR},#{productPicture.updateTime,jdbcType=TIMESTAMP},
|
|
|
|
|
#{productPicture.productId,jdbcType=VARCHAR},#{productPicture.productPicture,jdbcType=VARCHAR})
|
|
|
|
|
</foreach>
|
|
|
|
|
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteByProductId" parameterType="java.lang.String">
|
|
|
|
|
delete from t_product_picture
|
|
|
|
|
where product_id = #{productId,jdbcType=VARCHAR}
|
|
|
|
|
</delete>
|
|
|
|
|
</mapper>
|