<?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.mall.member.mapper.MemberCollectSubjectMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.mall.member.domain.entity.MemberCollectSubject">
            <id column="id" property="id"/>
            <id column="subject_id" property="subjectId"/>
            <id column="subject_name" property="subjectName"/>
            <id column="subject_img" property="subjectImg"/>
            <id column="subject_urll" property="subjectUrll"/>
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id,subject_id,subject_name,subject_img,subject_urll
    </sql>

    <!-- 分页查询会员收藏的专题活动内容 -->
    <select id="selectListByPage" resultType="com.mall.member.domain.vo.MemberCollectSubjectVo">
        select
        <include refid="Base_Column_List"/>
        from ums_member_collect_subject
        <where>
                <if test="dto.id != null and dto.id != ''">
                    and id like CONCAT('%',#{dto.id},'%')
                </if>
                <if test="dto.subjectId != null and dto.subjectId != ''">
                    and subject_id like CONCAT('%',#{dto.subjectId},'%')
                </if>
                <if test="dto.subjectName != null and dto.subjectName != ''">
                    and subject_name like CONCAT('%',#{dto.subjectName},'%')
                </if>
                <if test="dto.subjectImg != null and dto.subjectImg != ''">
                    and subject_img like CONCAT('%',#{dto.subjectImg},'%')
                </if>
                <if test="dto.subjectUrll != null and dto.subjectUrll != ''">
                    and subject_urll like CONCAT('%',#{dto.subjectUrll},'%')
                </if>
        </where>
    </select>

</mapper>
