111 lines
2.9 KiB
XML
111 lines
2.9 KiB
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.UserLikeMapper">
|
|
<select id="getHistoryLikeWithoutGradient" resultType="java.util.Map">
|
|
/* 逻辑修改前
|
|
SELECT
|
|
a.id,
|
|
a.design_item_id,
|
|
a.design_outfit_id,
|
|
b.account_id
|
|
FROM
|
|
t_user_like a
|
|
INNER JOIN
|
|
t_design_item_detail b
|
|
ON
|
|
a.design_item_id = b.design_item_id
|
|
WHERE
|
|
b.gradient_string IS NULL
|
|
AND b.is_deleted = 0
|
|
AND b.account_id = 87
|
|
AND a.converted = 0
|
|
GROUP BY
|
|
a.design_item_id,
|
|
a.design_outfit_id,
|
|
b.account_id;*/
|
|
SELECT
|
|
a.id,
|
|
a.design_item_id,
|
|
a.design_outfit_id,
|
|
b.account_id
|
|
FROM
|
|
t_user_like a
|
|
INNER JOIN
|
|
t_design_item_detail b
|
|
ON
|
|
a.design_item_id = b.design_item_id
|
|
WHERE
|
|
b.is_deleted = 0
|
|
AND NOT EXISTS (
|
|
SELECT 1
|
|
FROM t_design_item_detail b2
|
|
WHERE
|
|
b2.design_item_id = a.design_item_id
|
|
AND b2.gradient_string IS NOT NULL
|
|
AND b2.is_deleted = 0
|
|
)
|
|
GROUP BY
|
|
a.design_item_id,
|
|
a.design_outfit_id,
|
|
b.account_id
|
|
ORDER BY
|
|
a.design_item_id,
|
|
a.design_outfit_id;
|
|
</select>
|
|
|
|
<select id="getHistoryLikeWithGradient" resultType="java.util.Map">
|
|
/*SELECT
|
|
a.id,
|
|
a.design_item_id,
|
|
a.design_outfit_id,
|
|
b.account_id
|
|
FROM
|
|
t_user_like a
|
|
INNER JOIN
|
|
t_design_item_detail b
|
|
ON
|
|
a.design_item_id = b.design_item_id
|
|
WHERE
|
|
b.gradient_string IS NOT NULL
|
|
AND b.is_deleted = 0
|
|
AND a.converted = 0
|
|
GROUP BY
|
|
a.design_item_id,
|
|
a.design_outfit_id,
|
|
b.account_id;*/
|
|
SELECT
|
|
a.id,
|
|
a.design_item_id,
|
|
a.design_outfit_id,
|
|
b.account_id
|
|
FROM
|
|
t_user_like a
|
|
INNER JOIN
|
|
t_design_item_detail b
|
|
ON
|
|
a.design_item_id = b.design_item_id
|
|
WHERE
|
|
b.is_deleted = 0
|
|
AND EXISTS (
|
|
SELECT 1
|
|
FROM t_design_item_detail b2
|
|
WHERE
|
|
b2.design_item_id = a.design_item_id
|
|
AND b2.gradient_string IS NOT NULL
|
|
AND b2.is_deleted = 0
|
|
)
|
|
GROUP BY
|
|
a.design_item_id,
|
|
a.design_outfit_id,
|
|
b.account_id
|
|
ORDER BY
|
|
a.design_item_id,
|
|
a.design_outfit_id;
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
</mapper>
|