查询指定用户各功能使用情况

This commit is contained in:
2024-08-01 10:00:26 +08:00
parent 71e6abd816
commit 1093ac68b6
19 changed files with 2569 additions and 2170 deletions

View File

@@ -0,0 +1,46 @@
<?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.GenerateMapper">
<select id="getByTypeAndTime" resultType="java.util.Map">
-- 查询level1_type的记录
SELECT
level1_type as type,
count(id) as count
FROM
t_generate
WHERE
level1_type IN ('Moodboard', 'Printboard', 'Sketchboard')
AND create_date >= #{startTime}
AND create_date &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
level1_type
UNION ALL
-- 查询level2_type的记录
SELECT
level2_type as type,
count(id) as count
FROM
t_generate
WHERE
level2_type IN ('Pattern', 'Logo', 'Slogan')
AND create_date > #{startTime}
AND create_date &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
level2_type;
</select>
</mapper>