From 9a2a33d79619aaf2ad91add2567723da1dc0e82f Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期一, 10 十二月 2018 14:38:08 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 fanli/src/main/java/com/yeshi/fanli/mapping/user/UserGoodsStorageMapper.xml |   50 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 50 insertions(+), 0 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/mapping/user/UserGoodsStorageMapper.xml b/fanli/src/main/java/com/yeshi/fanli/mapping/user/UserGoodsStorageMapper.xml
index 0d704e4..804fb63 100644
--- a/fanli/src/main/java/com/yeshi/fanli/mapping/user/UserGoodsStorageMapper.xml
+++ b/fanli/src/main/java/com/yeshi/fanli/mapping/user/UserGoodsStorageMapper.xml
@@ -51,6 +51,50 @@
     </set> where guc_id = #{id,jdbcType=BIGINT}
   </update>
   
+   <insert id="insertBatch"  useGeneratedKeys="true" keyProperty="id"  parameterType="java.util.List">
+  		insert into yeshi_ec_user_goods_storage
+	     (<include refid="Base_Column_List" />)
+	    values
+  		
+  		<foreach collection="list" item="item" separator=",">
+		      (
+		 		#{item.id,jdbcType=BIGINT},
+		 		#{item.commonGoods.id,jdbcType=BIGINT},
+		 		#{item.uid,jdbcType=BIGINT},
+		 		#{item.state,jdbcType=INTEGER},
+		 		#{item.createTime.id,jdbcType=TIMESTAMP},
+		 		#{item.updateTime,jdbcType=TIMESTAMP}
+		     )
+		   
+  		</foreach>
+  </insert>
+  
+  	<update id="updateBatchSelective" parameterType="java.util.List">
+        update yeshi_ec_user_goods_storage 
+        <trim prefix="set" suffixOverrides=",">
+             <trim prefix="guc_state =case" suffix="end,">
+                <foreach collection="list" item="item" index="index">
+               	 	<if test="item.state !=null">
+                     when guc_id=#{item.id} then #{item.state}
+                     </if>
+                </foreach>
+            </trim>
+             <trim prefix="guc_updatetime =case" suffix="end,">
+                <foreach collection="list" item="item" index="index">
+               	 	<if test="item.updateTime !=null">
+                     when guc_id=#{item.id} then #{item.updateTime}
+                     </if>
+                </foreach>
+            </trim>
+        </trim>
+        where guc_id in
+        <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
+            #{item.id,jdbcType=BIGINT}
+        </foreach>
+ 	</update>
+   
+  
+  
   <select id="listQueryByUid" resultMap="BaseResultMap">
 	 SELECT * FROM yeshi_ec_user_goods_storage  tg
 	 LEFT JOIN  `yeshi_ec_common_goods` cg ON tg.`guc_common_id` = cg.`cg_id`
@@ -88,4 +132,10 @@
 		WHERE g.`guc_uid` = #{uid} AND c.`cg_goods_id`= #{auctionId}  
    </select>
 	
+   <select id="listQueryByIds" resultMap="BaseResultMap" parameterType="java.util.List">
+		SELECT * FROM `yeshi_ec_user_goods_storage` g 
+		LEFT JOIN  `yeshi_ec_common_goods` c ON g.`guc_common_id` = c.`cg_id`
+		WHERE g.guc_id IN <foreach collection="list" item="item" open="(" close=")"
+			separator=",">#{item}</foreach>
+   </select>
 </mapper>

--
Gitblit v1.8.0