"and (a.order_item_id is null or (a.order_item_id is not null && a.order_item_id = #{orderItemId})) ",
"<when test = 'orderItemIdList != null && orderItemIdList.size() > 0'>",
"and (a.details->>'$.orderItemId' is null or (a.details->>'$.orderItemId' is not null && a.details->>'$.orderItemId' in <foreach item='orderItemId' index='index' collection='orderItemIdList' open='(' separator=',' close=')'>#{orderItemId}</foreach>)) ",
"<when test = 'orderItemIdList != null && orderItemIdList.size() > 0'>",
"and (a.order_item_id is null or (a.order_item_id is not null && a.order_item_id in <foreach item='orderItemId' index='index' collection='orderItemIdList' open='(' separator=',' close=')'>#{orderItemId}</foreach>)) ",