yujian
2019-07-11 e4a56b57d3e10b9b46eaefe5194bbf98fcc45698
fanli/src/main/java/com/yeshi/fanli/mapping/goods/CommonGoodsMapper.xml
@@ -41,12 +41,6 @@
      <include refid="Base_Column_List" />
      from yeshi_ec_common_goods where cg_id = #{id,jdbcType=BIGINT}
   </select>
   <select id="selectByGoodsIdAndGoodsType" resultMap="BaseResultMap">
      select
      <include refid="Base_Column_List" />
      from yeshi_ec_common_goods where cg_goods_id = #{goodsId} and
      cg_goods_type=#{goodsType}
   </select>
   <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
      yeshi_ec_common_goods where cg_id = #{id,jdbcType=BIGINT}</delete>
   <insert id="insert" parameterType="com.yeshi.fanli.entity.goods.CommonGoods"
@@ -169,20 +163,30 @@
      where cg_id = #{id,jdbcType=BIGINT}
   </update>
   
   <select id="selectByGoodsIdAndGoodsType" resultMap="BaseResultMap">
      select <include refid="Base_Column_List" /> from yeshi_ec_common_goods
      where cg_goods_id = #{goodsId} <if test="goodsType != null">AND cg_goods_type=#{goodsType}</if>
      LIMIT 1
   </select>
   <select id="listBySellerId" resultMap="BaseResultMap">
      SELECT * FROM  yeshi_ec_common_goods
      WHERE cg_seller_id = #{sellerId}
      WHERE cg_seller_id = #{sellerId} <if test="goodsType != null">AND cg_goods_type=#{goodsType}</if>
      ORDER BY cg_updatetime  DESC
      LIMIT 0,5
   </select>
   <select id="countBySellerIdAndHasCoupon" resultType="Long">
      SELECT IFNULL(COUNT(cg_id),0) FROM  yeshi_ec_common_goods
      WHERE <![CDATA[cg_coupon_amount > 0 AND cg_coupon_left_count > 1]]>  
         AND cg_seller_id = #{sellerId}
         AND cg_seller_id = #{sellerId}  <if test="goodsType != null">AND cg_goods_type=#{goodsType}</if>
   </select>
   
   <select id="getByListGoodsId" resultMap="BaseResultMap">
      SELECT * FROM  yeshi_ec_common_goods
      WHERE cg_goods_id IN <foreach collection="list" item="item" open="(" separator="," close=")">#{item}</foreach>
      WHERE 1=1 <if test="goodsType != null">AND cg_goods_type=#{goodsType}</if>
         AND cg_goods_id IN <foreach collection="list" item="item" open="(" separator="," close=")">#{item}</foreach>
   </select>
</mapper>