<?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.ylx.giftCard.mapper.GiftCardMapper">

    <select id="selectManageList" resultType="com.ylx.giftCard.domain.GiftCard">
        select *
        from gift_card
        <where>
            is_delete = 0
            <if test="dto != null and dto.name != null and dto.name != ''">
                and name like concat('%', #{dto.name}, '%')
            </if>
            <if test="dto != null and dto.isPublished != null">
                and is_published = #{dto.isPublished}
            </if>
            <if test="beginCreateTime != null">
                and create_time &gt;= #{beginCreateTime}
            </if>
            <if test="endCreateTime != null">
                and create_time &lt;= #{endCreateTime}
            </if>
        </where>
        order by create_time desc
    </select>
</mapper>
