SnapshotSku.xml 1.39 KB
<?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="SnapshotSkuDao">
	<!-- 插入snapshoot_pop_sku记录 -->
	<insert id="insert" parameterType="java.util.Map" >
		<![CDATA[
			INSERT INTO ${tableName} (sku,title,price,store,store_unit, mini_purchase, pid,
		sales, status, version, ctime, utime)
			VALUES (#{sku.sku},#{sku.title},#{sku.price},#{sku.store},#{sku.storeUnit},
			#{sku.miniPurchase},#{sku.pid},#{sku.sales},#{sku.status},#{sku.version},now(), now())
		]]>
	</insert>
	
	<select id="findBySku" parameterType="java.util.Map" resultType="productSku">
		SELECT sku,title,price,store,store_unit, mini_purchase, pid,
		sales, status, version, ctime
		FROM ${tableName}
		WHERE 
		<foreach collection="list" item="item" separator=" OR " open="(" close=")">
			sku = #{item.sku} AND version = #{item.version}
		</foreach>
	</select>
	
	<insert id="batchInsert" parameterType="java.util.Map">
		<![CDATA[
			INSERT INTO ${tableName} (sku,title,price,store,store_unit, mini_purchase, pid,
		sales, status, version, ctime, utime)
			VALUES 
		]]>
		<foreach collection="list" item ="sku" separator=",">
			(#{sku.sku},#{sku.title},#{sku.price},#{sku.store},#{sku.storeUnit},
			#{sku.miniPurchase},#{sku.pid},#{sku.sales},#{sku.status},#{sku.version},now(), now())
		</foreach>
	</insert>
</mapper>