SelfSizeUidMapper.xml 1.4 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="com.yoho.product.dal.SelfSizeUidMapper" >
  <resultMap id="BaseResultMap" type="com.yoho.product.model.SelfSizeUid" >
    <id column="id" property="id" jdbcType="INTEGER" />
    <result column="product_id" property="productId" jdbcType="INTEGER" />
    <result column="goods_id" property="goodsId" jdbcType="INTEGER" />
    <result column="size_id" property="sizeId" jdbcType="INTEGER" />
    <result column="uid" property="uid" jdbcType="INTEGER" />
  </resultMap>
  <sql id="Base_Column_List" >
    id, product_id, goods_id, size_id, uid
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
    select 
    <include refid="Base_Column_List" />
    from self_size_uid
    where id = #{id,jdbcType=INTEGER}
  </select>
  
  <select id="selectUidByProductIdAndSizeId" resultType="java.lang.Integer">
    select uid from self_size_uid 
    where product_id=#{productId} and size_id=#{sizeId}
  </select>
  
    <select id="selectByPrdIdList" resultMap="BaseResultMap">
    select <include refid="Base_Column_List"></include>
    from self_size_uid 
    where product_id in 
    <foreach collection="prdIdList" item="prdId" open="(" close=")" separator=",">
        #{prdId}
    </foreach>
  </select>   
</mapper>