<?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.yonge.cooleshow.biz.dal.mapper.TenantAlbumCategoryMapper">



    <!-- 表字段 -->
    <sql id="baseColumns">
        t.id_ AS id
        , t.name_ AS name
        , t.category_type_ AS categoryType
        , t.del_flag_ AS delFlag
        , t.create_by_ AS createBy
        , t.create_time_ AS createTime
        , t.update_by_ AS updateBy
        , t.update_time_ AS updateTime
    </sql>

    <select id="selectPage" resultType="com.yonge.cooleshow.biz.dal.entity.TenantAlbumCategory">
        SELECT
        <include refid="baseColumns" />
        FROM tenant_album_category t
        <where>
            t.del_flag_ = 0
            <if test="param.keyword != null and param.keyword.trim() != ''">
                AND t.name_ LIKE concat('%',#{param.keyword},'%')
            </if>
            <if test="param.categoryType != null">
                AND t.category_type_ = #{param.categoryType}
            </if>
        </where>
        ORDER BY t.id_ DESC

    </select>

</mapper>