<?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.CollectionElementMapper">

    <select id="selectDeleteList" resultType="com.ai.da.mapper.primary.entity.CollectionElement">
        SELECT * FROM t_collection_element
        WHERE collection_id not IN
              (SELECT collection_id FROM t_user_like_group
               WHERE collection_id != 0
        GROUP BY collection_id)
    </select>

    <select id="selectByProject" resultType="com.ai.da.mapper.primary.entity.CollectionElementRelModel">
        SELECT cerm.*
        FROM t_collection_element ce
        LEFT JOIN collection_element_rel_model cerm ON ce.id = cerm.collection_element_id
        WHERE ce.project_id = #{projectId} AND ce.level1_type = "Models"
    </select>
</mapper>
