<?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.panzhihua.service_community.dao.ConvenientProductSpecificationDAO">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="com.panzhihua.service_community.model.dos.ConvenientProductSpecificationDO">
|
<id column="id" property="id" />
|
<id column="name" property="name" />
|
<id column="price" property="price" />
|
<id column="image" property="image" />
|
<id column="product_id" property="productId" />
|
<id column="is_del" property="isDel" />
|
<id column="created_at" property="createdAt" />
|
<id column="created_by" property="createdBy" />
|
<id column="updated_at" property="updatedAt" />
|
<id column="updated_by" property="updatedBy" />
|
</resultMap>
|
|
<!-- 通用查询结果列 -->
|
<sql id="Base_Column_List">
|
id,`name`,price,image,product_id,is_del,created_at,created_by,updated_at,updated_by
|
</sql>
|
<insert id="batchInsert">
|
INSERT INTO `com_convenient_product_specifications`(name,price,image,product_id,created_at,created_by)
|
VALUES
|
<foreach collection="productSpecificationDOList" item="item" index="index" separator="," >
|
(#{item.name}, #{item.price}, #{item.image}, #{item.productId}, #{item.createdAt}, #{item.createdBy})
|
</foreach>
|
</insert>
|
<update id="deleteLoseRelationSpecifications" parameterType="java.util.List">
|
UPDATE com_convenient_product_specifications SET is_del = 1
|
WHERE product_id = #{productId} AND id NOT IN
|
<foreach collection="notNeedDelIds" open="(" separator="," close=")" index="index" item="item">
|
#{item}
|
</foreach>
|
</update>
|
<update id="batchDeleteByProductIds">
|
UPDATE com_convenient_product_specifications SET is_del = 1
|
WHERE id IN
|
<foreach collection="needDelProductIds" open="(" separator="," close=")" index="index" item="item">
|
#{item}
|
</foreach>
|
</update>
|
|
|
</mapper>
|