Passing multiple arguments into a SELECT without using a complex object

后端 未结 5 2096
轻奢々
轻奢々 2020-12-15 11:39

I am trying to pass in startSequenceId, stopSequenceId, orderNumber into the SQL map, however, i don\'t wish to use a typed object, i.

5条回答
  •  没有蜡笔的小新
    2020-12-15 12:24

    In MyBatis 3, you can use @Param annotation in your mapper class(interface) method:

    public getSequenceIdByOrderNumber(@Param("seqId") int sequenceId,@Param("orderId") int orderNo);
    

    Then you can use #{seqId}, #{orderId} in the SQL without using parameterType attribute.

提交回复
热议问题