<?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.demo.externalinternalsite.mapper.ExternalInternalSiteMapper">


    <select id="pageGroupByWai"
            resultType="org.jeecg.modules.demo.externalinternalsite.entity.ExternalInternalSite">
        SELECT eis.id id,eis.url url,eis.type_url typeUrl,eis.state_url stateUrl,eis.message message,min(eis.save_time) saveTime,eis.update_time updateTime,count(url) mainUrl
        from
            external_internal_site eis
        <where>
            and eis.type_url = "外链"
            <if test="url != null and url != ''">
                and eis.URL =  #{url}
            </if>
            <if test="stateUrl != null and stateUrl != ''">
                and eis.STATE_URL =  #{stateUrl}
            </if>
            <if test="message != null and message != ''">
                and eis.message =  #{message}
            </if>
        </where>
        group by url
    </select>
</mapper>