cloudroam
2025-05-26 25f83d7e36573da46bade5f54315797aa9c9e6cb
src/main/resources/mapper/film/FilmWorksMapper.xml
@@ -1,33 +1,31 @@
<?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.filmwork.FilmWorksMapper">
<mapper namespace="com.mzl.flower.mapper.film.FilmWorksMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.mzl.flower.entity.film.FilmWorks">
        <id column="id" property="id" />
        <result column="create_time" property="createTime" />
        <result column="update_time" property="updateTime" />
        <result column="name_cn" property="nameCn" />
        <result column="name_en" property="nameEn" />
        <result column="type" property="type" />
        <result column="release_year" property="releaseYear" />
        <result column="director" property="director" />
        <result column="producer" property="producer" />
        <result column="actors" property="actors" />
        <result column="keywords" property="keywords" />
        <result column="synopsis" property="synopsis" />
        <result column="cover_url" property="coverUrl" />
        <result column="cover_alt" property="coverAlt" />
        <result column="user_type" property="userType" />
        <result column="sticky_weight" property="stickyWeight" />
        <result column="status" property="status" />
        <result column="deleted" property="deleted" />
        <result column="create_by" property="createBy" />
        <result column="update_by" property="updateBy" />
        <result column="collect_count" property="collectCount" />
        <result column="like_count" property="likeCount" />
        <result column="comment_count" property="commentCount" />
        <result column="share_count" property="shareCount" />
    </resultMap>
    <select id="queryPage" resultType="com.mzl.flower.dto.response.film.FilmWorksVO">
        select t.* from film_works t 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>
        order by t.update_time desc
    </select>
</mapper>