cloudroam
2025-06-06 70f642c9a5090f051814d46c8f5bbce5e366ba89
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?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.mzl.flower.mapper.film.FilmWorksMapper">
 
    <select id="queryPage" resultType="com.mzl.flower.dto.response.film.FilmWorksVO">
        SELECT
        t.*,
        c.name AS  nickname,
        c.cover AS  avatar
        FROM
        film_works t
        LEFT JOIN
        t_customer_info c
        ON
        t.create_by = c.user_id
        WHERE
        t.deleted = 0
        <if test="dto.nameCn != null and dto.nameCn != ''">
            AND t.name_cn LIKE CONCAT('%', #{dto.nameCn}, '%')
        </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.classify != null and dto.classify != ''">
            AND t.classify = #{dto.classify}
        </if>
        <if test="dto.createDateBegin != null">
            <![CDATA[
               AND t.create_time >= #{dto.createDateBegin}
            ]]>
        </if>
        <if test="dto.createDateEnd != null">
            <![CDATA[
               AND t.create_time <= #{dto.createDateEnd}
            ]]>
        </if>
        <if test="dto.keywords != null and dto.keywords != ''">
            AND (t.name_cn LIKE CONCAT('%', #{dto.keywords}, '%')
            OR t.name_en LIKE CONCAT('%', #{dto.keywords}, '%')
            OR t.keywords LIKE CONCAT('%', #{dto.keywords}, '%')
            OR t.synopsis LIKE CONCAT('%', #{dto.keywords}, '%')
            OR t.director LIKE CONCAT('%', #{dto.keywords}, '%'))
        </if>
        ORDER BY
        t.update_time DESC
    </select>
 
</mapper>