Skip to content

Commit

Permalink
select update to fix 2067
Browse files Browse the repository at this point in the history
  • Loading branch information
yzlucas committed Oct 31, 2024
1 parent 119a893 commit 324acaa
Showing 1 changed file with 21 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -327,22 +327,28 @@
RESPONSE_TYPE_DETAIL
FROM WFNEWS.PUBLISHED_INCIDENT_DETAIL
WHERE stage_of_control_code IS NOT NULL
<if test="stageOfControlList != null &amp;&amp; !stageOfControlList.isEmpty() &amp;&amp; stageOfControlList.contains('OUT')">
AND (stage_of_control_code = 'OUT' AND fire_year = #{currentFireYear, javaType=java.lang.Integer, jdbcType=NUMERIC, mode=IN})
<if test="stageOfControlList != null &amp;&amp; !stageOfControlList.isEmpty() &amp;&amp; stageOfControlList.size() &gt; 1">
OR stage_of_control_code IN
<foreach item="soc" collection="stageOfControlList" separator="," open="(" close=")">
<if test="soc != 'OUT'">
<if test="stageOfControlList != null &amp;&amp; !stageOfControlList.isEmpty()">
<choose>
<when test="stageOfControlList.contains('OUT')">
AND (
(stage_of_control_code = 'OUT' AND fire_year = #{currentFireYear})
<if test="stageOfControlList.size() > 1">
OR stage_of_control_code IN
<foreach item="soc" collection="stageOfControlList" separator="," open="(" close=")">
<if test="soc != 'OUT'">
#{soc}
</if>
</foreach>
</if>
)
</when>
<otherwise>
AND stage_of_control_code IN
<foreach item="soc" collection="stageOfControlList" separator="," open="(" close=")">
#{soc}
</if>
</foreach>
</if>
</if>
<if test="stageOfControlList != null &amp;&amp; !stageOfControlList.isEmpty() &amp;&amp; !stageOfControlList.contains('OUT')">
AND stage_of_control_code IN
<foreach item="soc" collection="stageOfControlList" separator="," open="(" close=")">
#{soc}
</foreach>
</foreach>
</otherwise>
</choose>
</if>
<if test="xmin != null &amp;&amp; ymin != null &amp;&amp; xmax != null &amp;&amp; ymax != null">
AND geometry &amp;&amp; ST_MakeEnvelope (#{xmin, javaType=java.lang.Double, jdbcType=DOUBLE, mode=IN}, #{ymin, javaType=java.lang.Double, jdbcType=DOUBLE, mode=IN}, #{xmax, javaType=java.lang.Double, jdbcType=DOUBLE, mode=IN}, #{ymax, javaType=java.lang.Double, jdbcType=DOUBLE, mode=IN}, <include refid="latLonSrid"/>)
Expand Down

0 comments on commit 324acaa

Please sign in to comment.