<?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.unis.crk.report.mapper.ReporterMapper">

    <resultMap id="BaseResultMap" type="com.unis.crk.report.entity.ReportInfo">
        <id column="RptID" property="rptID" />
        <result column="RptName" property="rptName" />
        <result column="DymamicSQL" property="dymamicSQL" />
        <result column="GroupByFields" property="groupByFields" />
        <result column="OrderByFields" property="orderByFields" />
    </resultMap>

    <select id="getReportInfo" resultType="java.util.Map">
        select
               RptID as "rptID",
               RptName as "rptName",
               DymamicSQL as "dymamicSQL",
               ifnull(GroupByFields,'') as "groupByFields",
               ifnull(OrderByFields,'') as "orderByFields"
        from con_reportinfo
        where 1=1
        <if test="rptID != null and  rptID != ''">
            and RptID='${rptID}'
        </if>
    </select>

    <select id="superSelect" resultType="java.util.Map">
        <![CDATA[
        ${sql}
        ]]>
    </select>
</mapper>