<?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="top.continew.admin.business.mapper.InviteRewardsRuleMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="top.continew.admin.business.model.entity.InviteRewardsRule">
        <id column="id" property="id"/>
        <result column="rewards_name" property="rewardsName"/>
        <result column="rewards_describe" property="rewardsDescribe"/>
        <result column="invite_num" property="inviteNum"/>
        <result column="gold_coin_num" property="goldCoinNum"/>
        <result column="rewards_level" property="rewardsLevel"/>
        <result column="created_by" property="createdBy"/>
        <result column="created_time" property="createdTime"/>
        <result column="updated_by" property="updatedBy"/>
        <result column="updated_time" property="updatedTime"/>
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, rewards_name, rewards_describe, invit_num, gold_coin_num, rewards_level, created_by, created_time, updated_by, updated_time
    </sql>
    
    <select id="getMaxLevel" resultType="int">
        select ifnull(max(r.rewards_level), 0) as n
        from b_invite_rewards_rule r
    </select>
</mapper>
