Files
lilishop/framework/src/main/resources/mapper/SpecificationMapper.xml
2021-05-13 10:41:46 +08:00

19 lines
763 B
XML

<?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="cn.lili.modules.goods.mapper.SpecificationMapper">
<select id="findSpecList" resultType="cn.lili.modules.goods.entity.vos.SpecificationVO" parameterType="map">
SELECT s.id, s.spec_name,s.create_time ,GROUP_CONCAT(sv.spec_value SEPARATOR ',') AS spec_value
FROM li_specification s
LEFT JOIN li_spec_values sv
ON s.id = sv.spec_id
WHERE 1=1
<if test="specName != null and specName!=''">
and s.spec_name like concat('%',#{specName},'%')
</if>
GROUP BY s.id
ORDER BY s.create_time desc
</select>
</mapper>