@Select("<script> SELECT * from jf_gift" +
"<where>"+
"<if test='cityId != null'>and city_id = #{cityId}</if> "+
" <if test='periodId != null'>and period_id = #{periodId}</if> "+
" <if test='activityId != null'>and activity_id = #{activityId}</if> and is_deleted = 1 order by update_time desc" +
"</where>"+
"</script>")
List<JFGift> findGiftList (@Param("cityId") Integer cityId,
@Param("periodId") Integer periodId,
@Param("activityId") Integer activityId);
參考 https://blog.csdn.net/qq_36537546/article/details/88577221