<?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="org.dromara.zjk.mapper.ZjkCreditRewardMapper">
    <select id="getAbleReward" resultType="org.dromara.zjk.domain.ZjkCreditReward">
        select * from zjk_credit_reward where status=1 and (is_forever=1 or reward_until >= CURRENT_DATE)
    </select>

    <select id="selectRuleList"  resultType="org.dromara.zjk.domain.vo.ZjkCreditRuleVo">
        select * from zjk_credit_rule
        <where>
            <if test="startTime!=null">
                and CREATE_TIME >= #{startTime}
            </if>
            <if test="startTime != null">
                and CREATE_TIME &lt; #{endTime}
            </if>
            <if test="name!=null and name !=''">
                and rule_name like '%' || #{name} || '%'
            </if>
        </where>
    </select>
</mapper>
