| | |
| | | <if test="dto.nameCn != null and dto.nameCn != ''"> |
| | | AND t.name_cn LIKE CONCAT('%', #{dto.nameCn}, '%') |
| | | </if> |
| | | <if test="dto.nameEn != null and dto.nameEn != ''"> |
| | | AND t.name_en LIKE CONCAT('%', #{dto.nameEn}, '%') |
| | | </if> |
| | | <if test="dto.status != null and dto.status != ''"> |
| | | AND t.status = #{dto.status} |
| | | </if> |
| | | <if test="dto.type != null and dto.type != ''"> |
| | | AND t.type = #{dto.type} |
| | | </if> |
| | | <if test="dto.userType != null and dto.userType != ''"> |
| | | AND t.user_type = #{dto.userType} |
| | | </if> |
| | | <if test="dto.releaseYear != null and dto.releaseYear != ''"> |
| | | AND t.release_year = #{dto.releaseYear} |
| | | </if> |
| | | <if test="dto.classify != null and dto.classify != ''"> |
| | | AND t.classify = #{dto.classify} |
| | | </if> |
| | | <if test="dto.category != null and dto.category != ''"> |
| | | AND t.keywords LIKE CONCAT('%', #{dto.category}, '%') |
| | | </if> |
| | | <if test="dto.createDateBegin != null"> |
| | | <![CDATA[ |
| | |
| | | OR t.director LIKE CONCAT('%', #{dto.keywords}, '%')) |
| | | </if> |
| | | ORDER BY |
| | | t.update_time DESC |
| | | t.sticky_weight DESC |
| | | </select> |
| | | |
| | | |
| | |
| | | t.update_time DESC |
| | | </select> |
| | | |
| | | |
| | | <select id="getFilmWorksCollectList" resultType="com.mzl.flower.dto.response.film.FilmWorksVO"> |
| | | SELECT fw.*, |
| | | c.name AS nickname, |
| | | c.cover AS avatar, |
| | | COALESCE(l.like_count, 0) AS vo_like_count |
| | | FROM film_works fw |
| | | JOIN ( |
| | | SELECT DISTINCT film_id |
| | | FROM film_collects |
| | | WHERE 1=1 |
| | | AND create_by = #{dto.userId} and status = '1' |
| | | ) fc ON fw.id = fc.film_id |
| | | LEFT JOIN |
| | | t_customer_info c |
| | | ON |
| | | fw.create_by = c.user_id |
| | | LEFT JOIN ( |
| | | SELECT film_id, COUNT(*) AS like_count |
| | | FROM film_likes |
| | | WHERE status = 1 |
| | | GROUP BY film_id |
| | | ) l ON fw.id = l.film_id |
| | | WHERE fw.deleted = '0' |
| | | AND fw.`status` = 'published' |
| | | </select> |
| | | |
| | | <select id="getFilmWorksLikeList" resultType="com.mzl.flower.dto.response.film.FilmWorksVO"> |
| | | SELECT fw.*, |
| | | c.name AS nickname, |
| | | c.cover AS avatar, |
| | | COALESCE(l.like_count, 0) AS vo_like_count |
| | | FROM film_works fw |
| | | JOIN ( |
| | | SELECT DISTINCT film_id |
| | | FROM film_likes |
| | | WHERE 1=1 |
| | | AND create_by = #{dto.userId} and status = '1' |
| | | ) fc ON fw.id = fc.film_id |
| | | LEFT JOIN |
| | | t_customer_info c |
| | | ON |
| | | fw.create_by = c.user_id |
| | | LEFT JOIN ( |
| | | SELECT film_id, COUNT(*) AS like_count |
| | | FROM film_likes |
| | | WHERE status = 1 |
| | | GROUP BY film_id |
| | | ) l ON fw.id = l.film_id |
| | | WHERE fw.deleted = '0' |
| | | AND fw.`status` = 'published' |
| | | </select> |
| | | |
| | | </mapper> |