Commit 0ce6d7b0 by java-温文海

模糊查询

parent 1302072a
......@@ -193,12 +193,56 @@
foc_airline_sta favt
WHERE
favt.del_flag = #{DEL_FLAG_NORMAL}
<if test="depIata != null and depIata != ''">
and (favt.dep_iata = #{depIata} or favt.arr_iata= #{depIata})
</if>
<if test="arrIata != null and arrIata != ''">
and (favt.arr_iata = #{arrIata} or favt.arr_iata = #{depIata})
</if>
<choose>
<!--当出发地不为空,目的地不为空 -->
<when test="(depIata != null and depIata != '') and (arrIata != null and arrIata != '')">
AND ( favt.dep_iata LIKE
<if test="dbName == 'oracle'">'%'||#{depIata}||'%'</if>
<if test="dbName == 'mssql'">'%'+#{depIata}+'%'</if>
<if test="dbName == 'mysql'">CONCAT('%', #{depIata}, '%')</if>
or favt.arr_iata LIKE
<if test="dbName == 'oracle'">'%'||#{depIata}||'%'</if>
<if test="dbName == 'mssql'">'%'+#{depIata}+'%'</if>
<if test="dbName == 'mysql'">CONCAT('%', #{depIata}, '%')</if>
)
or ( favt.dep_iata LIKE
<if test="dbName == 'oracle'">'%'||#{arrIata}||'%'</if>
<if test="dbName == 'mssql'">'%'+#{arrIata}+'%'</if>
<if test="dbName == 'mysql'">CONCAT('%', #{arrIata}, '%')</if>
or favt.arr_iata LIKE
<if test="dbName == 'oracle'">'%'||#{arrIata}||'%'</if>
<if test="dbName == 'mssql'">'%'+#{arrIata}+'%'</if>
<if test="dbName == 'mysql'">CONCAT('%', #{arrIata}, '%')</if>
)
</when>
<!--当出发地不为空,目的地为空 -->
<when test="(depIata != null and depIata != '') and (arrIata == null and arrIata == '')">
AND ( favt.dep_iata LIKE
<if test="dbName == 'oracle'">'%'||#{depIata}||'%'</if>
<if test="dbName == 'mssql'">'%'+#{depIata}+'%'</if>
<if test="dbName == 'mysql'">CONCAT('%', #{depIata}, '%')</if>
or favt.arr_iata LIKE
<if test="dbName == 'oracle'">'%'||#{depIata}||'%'</if>
<if test="dbName == 'mssql'">'%'+#{depIata}+'%'</if>
<if test="dbName == 'mysql'">CONCAT('%', #{depIata}, '%')</if>
)
</when>
<!--当出发地为空,目的地不为空 -->
<when test="(depIata == null and depIata == '') and (arrIata != null and arrIata != '')">
and ( favt.dep_iata LIKE
<if test="dbName == 'oracle'">'%'||#{arrIata}||'%'</if>
<if test="dbName == 'mssql'">'%'+#{arrIata}+'%'</if>
<if test="dbName == 'mysql'">CONCAT('%', #{arrIata}, '%')</if>
or favt.arr_iata LIKE
<if test="dbName == 'oracle'">'%'||#{arrIata}||'%'</if>
<if test="dbName == 'mssql'">'%'+#{arrIata}+'%'</if>
<if test="dbName == 'mysql'">CONCAT('%', #{arrIata}, '%')</if>
)
</when>
<otherwise>
</otherwise>
</choose>
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment