Files
aida_back/src/main/resources/mapper/primary/ToProductImageResultMapper.xml

19 lines
869 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="com.ai.da.mapper.primary.ToProductImageResultMapper">
<select id="getByTypeAndTime" resultType="java.util.Map">
select count(a.id) as count, a.result_type type
from to_product_image_result as a
left join t_user_like_group as b
on a.user_like_group_id = b.id
where a.create_time >= #{startTime}
and a.create_time &lt;= #{endTime}
<if test="accountIdList != null and accountIdList.size() > 0">
AND account_id IN
<foreach item="item" index="index" collection="accountIdList" open="(" separator="," close=")">
#{item}
</foreach>
</if>
GROUP BY type;
</select>
</mapper>