<?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.tofly.xrtymis.mapper.GdhftjMapper">

  <resultMap id="gdhftjMap" type="com.tofly.xrtymis.entity.Gdhftj">
                <id property="id" column="ID"/>
      <result property="dateTime" column="DATE_TIME"/>
                      <result property="sum" column="SUM"/>
                      <result property="proportion" column="PROPORTION"/>
                      <result property="shouldReturn" column="SHOULD_RETURN"/>
                      <result property="noReturn" column="NO_RETURN"/>
                      <result property="createTime" column="CREATE_TIME"/>
                      <result property="updateTime" column="UPDATE_TIME"/>
                      <result property="statusFlag" column="STATUS_FLAG"/>
      <result property="isOver" column="IS_OVER"/>
  </resultMap>

    <select id="proportionStatistics" resultType="Gdhftj" databaseId="oracle">
        SELECT * FROM "TF_YWPN_GDHFTJ_W"
        where
        1=1
        <if test="map.StartAuditTime != null and map.StartAuditTime.trim() != ''">
            and to_char(CREATE_TIME,'yyyy-MM-dd hh:mm:ss') >= #{map.StartAuditTime}
        </if>
        <if test="map.endAuditTime != null and map.endAuditTime.trim() != ''">
            <![CDATA[ and to_char(CREATE_TIME,'yyyy-MM-dd hh:mm:ss') <= #{map.endAuditTime}   ]]>
        </if>
    </select>
                                                        
</mapper>
