<?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="cn.gistack.sm.jcsb.mapper.DbReportMapper">
|
|
|
<select id="getPage" resultType="cn.gistack.sm.jcsb.vo.DbReportVO">
|
SELECT sdr.*,acb."cd_nm" as stationName FROM SM_DB_REPORT sdr
|
LEFT JOIN SJZT_MD."att_cd_base" acb ON sdr.reservoir_id = acb."res_cd" and sdr.station_id = acb."cd"
|
WHERE 1=1
|
<if test="db.reservoirName != null and db.reservoirName !='' ">
|
AND sdr.reservoir_name LIKE CONCAT('%',#{db.reservoirName},'%')
|
</if>
|
<if test="db.reservoirId != null and db.reservoirId !='' ">
|
AND sdr.reservoir_id = #{db.reservoirId}
|
</if>
|
<if test="db.stationId != null and db.station !='' ">
|
AND sdr.station_id = #{db.stationId}
|
</if>
|
<if test="db.startTime !=null and db.startTime !=''">
|
AND DATE_FORMAT(sdr.record_time,'%Y-%m-%d') >= #{db.startTime}
|
</if>
|
<if test="db.endTime !=null and db.endTime !=''">
|
AND DATE_FORMAT(sdr.record_time,'%Y-%m-%d') <= #{db.endTime}
|
</if>
|
ORDER BY sdr.create_time DESC
|
</select>
|
</mapper>
|