TASK:企业、教育版library元素共享、作品广场作品发布到公共gallery

This commit is contained in:
2025-05-19 14:02:42 +08:00
parent bf92edb267
commit aeb372bc17
22 changed files with 389 additions and 8 deletions

View File

@@ -0,0 +1,42 @@
<?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.LibraryMapper">
<select id="selectCommonLib" resultType="com.ai.da.mapper.primary.entity.Library">
SELECT l.*
FROM `t_enterprise_library` e
LEFT JOIN t_library l on e.library_id = l.id
WHERE e.enterprise_id = #{organizationId}
ORDER BY id ${sort == 'DESC' ? 'DESC' : 'ASC'}
LIMIT ${limit} OFFSET ${offset}
</select>
<select id="selectCommonLibCount" resultType="java.lang.Long">
SELECT COUNT(l.id)
FROM `t_enterprise_library` e
LEFT JOIN t_library l on e.library_id = l.id
WHERE e.enterprise_id = #{organizationId}
</select>
<select id="selectAllSubAccLib" resultType="com.ai.da.mapper.primary.entity.Library">
SELECT *
FROM t_library
WHERE account_id IN (
SELECT id
FROM t_account
WHERE organization_id = #{organizationId}
)
ORDER BY id ${sort == 'DESC' ? 'DESC' : 'ASC'}
LIMIT ${limit} OFFSET ${offset}
</select>
<select id="selectAllSubAccLibCount" resultType="java.lang.Long">
SELECT COUNT(*)
FROM t_library
WHERE account_id IN (
SELECT id
FROM t_account
WHERE organization_id = #{organizationId}
)
</select>
</mapper>