<?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.xrtygis.custom.mapper.CustomDmatableflowviewMapper">

    <select id="getListInfo" resultType="map">
        select b.sch_name,flow_rate,total_flow,to_char(collect_time,'yyyy-mm-dd hh24:mi:ss') collect_time
             ,to_char(a.create_time,'yyyy-mm-dd hh24:mi:ss') create_time
        from tf_ywpn_dmatableflow_w_view a,tf_ywpn_dmatable_w b
        where a.TABLE_ID=b.id
        <if test="table_ids != null">
          and table_id in(${table_ids})
        </if>
        <if test="start_time != null and end_time != null">
            and collect_time between #{start_time} and #{end_time}
        </if>
        order by collect_time desc
    </select>
</mapper>