添加
flushCache=“true”
例:
<select id="findByStartAndEndTime" flushCache="true" parameterType="hashmap" resultMap="WtspStatusMap">
select t.* from T_WTSP_STATUS t
<where>
<if test="stationId != null">and t.C_STATION_ID = #{stationId, jdbcType=NUMERIC}</if>
<if test="feederCode != null and feederCode != '' ">and t.C_FEEDER_LINE_NO = #{feederCode, jdbcType=VARCHAR}</if>
</where>
</select>