<?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.jeecg.modules.adweb.common.mapper.CommonMapper">

    <select id="getMaxDate" resultType="java.util.Date">
        SELECT
        MAX(${fieldName})
        FROM
        ${tableName}
        <where>
            <if test="filter != null and filter != ''">
                AND ${filter}
            </if>
        </where>
    </select>

    <select id="getAdwebVipPermission" resultType="org.jeecg.modules.system.entity.SysPermission">
        SELECT t3.*
        FROM sys_role t1,
             sys_role_permission t2,
             sys_permission t3
        WHERE t1.role_code = 'adweb_vip'
          AND t1.id = t2.role_id
          AND t2.permission_id = t3.id
          AND t3.del_flag = 0
          AND t3.url NOT IN ('/enterprise', '/enterprise/enterpriseUser', '/inquery/rules', '/account', '/tools')
        ORDER BY t3.sort_no
    </select>

</mapper>
