<?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.MemberLevelMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.mall.member.domain.entity.MemberLevel">
            <id column="id" property="id"/>
            <id column="name" property="name"/>
            <id column="growth_point" property="growthPoint"/>
            <id column="default_status" property="defaultStatus"/>
            <id column="free_freight_point" property="freeFreightPoint"/>
            <id column="comment_growth_point" property="commentGrowthPoint"/>
            <id column="priviledge_free_freight" property="priviledgeFreeFreight"/>
            <id column="priviledge_member_price" property="priviledgeMemberPrice"/>
            <id column="priviledge_birthday" property="priviledgeBirthday"/>
            <id column="note" property="note"/>
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id,name,growth_point,default_status,free_freight_point,comment_growth_point,priviledge_free_freight,priviledge_member_price,priviledge_birthday,note
    </sql>

    <!-- 分页查询会员等级内容 -->
    <select id="selectListByPage" resultType="com.mall.member.domain.vo.MemberLevelVo">
        select
        <include refid="Base_Column_List"/>
        from ums_member_level
        <where>
                <if test="dto.id != null and dto.id != ''">
                    and id like CONCAT('%',#{dto.id},'%')
                </if>
                <if test="dto.name != null and dto.name != ''">
                    and name like CONCAT('%',#{dto.name},'%')
                </if>
                <if test="dto.growthPoint != null and dto.growthPoint != ''">
                    and growth_point like CONCAT('%',#{dto.growthPoint},'%')
                </if>
                <if test="dto.defaultStatus != null and dto.defaultStatus != ''">
                    and default_status like CONCAT('%',#{dto.defaultStatus},'%')
                </if>
                <if test="dto.freeFreightPoint != null and dto.freeFreightPoint != ''">
                    and free_freight_point like CONCAT('%',#{dto.freeFreightPoint},'%')
                </if>
                <if test="dto.commentGrowthPoint != null and dto.commentGrowthPoint != ''">
                    and comment_growth_point like CONCAT('%',#{dto.commentGrowthPoint},'%')
                </if>
                <if test="dto.priviledgeFreeFreight != null and dto.priviledgeFreeFreight != ''">
                    and priviledge_free_freight like CONCAT('%',#{dto.priviledgeFreeFreight},'%')
                </if>
                <if test="dto.priviledgeMemberPrice != null and dto.priviledgeMemberPrice != ''">
                    and priviledge_member_price like CONCAT('%',#{dto.priviledgeMemberPrice},'%')
                </if>
                <if test="dto.priviledgeBirthday != null and dto.priviledgeBirthday != ''">
                    and priviledge_birthday like CONCAT('%',#{dto.priviledgeBirthday},'%')
                </if>
                <if test="dto.note != null and dto.note != ''">
                    and note like CONCAT('%',#{dto.note},'%')
                </if>
        </where>
    </select>

</mapper>
