标签:size hit ima lis -- res 返回 _id resultmap
<!-- NOTE:internal_name_trim使用的是伪列,而不是数据库返回的数据 -->
<select id="listByStoreIdAndPartsNoTrimAndBrandName" resultMap="productMap"> SELECT product_id, internal_name_trim FROM ( <foreach collection="productQuerys" item="productQuery" separator="UNION ALL" index="index"> (SELECT product_id, @myInternalName#{index} as internal_name_trim FROM product,(SELECT @myInternalName#{index}:= #{productQuery.internalNameTrim}) r WHERE product_store_id = #{productStoreId} AND partsno_trim = #{productQuery.partsNoTrim} AND brand_name = #{productQuery.brandName} LIMIT 1) </foreach> ) p </select>
标签:size hit ima lis -- res 返回 _id resultmap
原文地址:http://www.cnblogs.com/ontheway365/p/6965275.html