|
|
<?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.search.dal.ProductColorsMapper">
|
|
|
<resultMap id="ProductColors" type="com.yoho.search.dal.model.ProductColors">
|
|
|
<result column="product_id" property="productId" jdbcType="INTEGER"/>
|
|
|
<result column="color_ids" property="colorIds" jdbcType="VARCHAR"/>
|
|
|
<result column="color_names" property="colorNames" jdbcType="VARCHAR"/>
|
|
|
</resultMap>
|
|
|
<select id="getProductColors" resultMap="ProductColors" timeout="20000">
|
|
|
<![CDATA[
|
|
|
SELECT
|
|
|
`a`.`product_id` AS `product_id`,
|
|
|
group_concat(`a`.`color_id` SEPARATOR ',') AS `color_ids`,
|
|
|
group_concat(
|
|
|
`a`.`color_name` SEPARATOR ','
|
|
|
) AS `color_names`
|
|
|
FROM
|
|
|
`goods` `a` where product_id in]]>
|
|
|
<foreach item="item" index="index" collection="list"
|
|
|
open="(" separator="," close=")">
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
GROUP BY
|
|
|
`a`.`product_id`
|
|
|
</select>
|
|
|
</mapper> |
|
|
\ No newline at end of file |
...
|
...
|
|