MyBatisを使用する場合、多くの場合、さまざまなパラメーターが渡され、さまざまなタイプ、さまざまなパラメーターがあります。
最初に例を見てみましょう:
パブリックリスト<LifetouchRelease> findOfficelist(@param( "lifetouchRelease")lifetouchRelease lifetouchRelease、@param( "AdvertisementId")String AdvertisementId、@Param( "officeName")String officeName、@param( "isonline")integer isonline); <選択id = "findOfficelist" resultType = "lifetouchRelease"> select <include refid = "lifetouchreleasecolumns"/> from lifetouch_release a <from refid = "lifetouchreleasejoins"/> <where> <where> <if test = "lifetouchrelease.tepeidificatiact> 0"> and a.type_ #{lifetouchrelease.typeidentification} </if> <if> if test = "lifetouchRelease.category!= null and lifetouchRelease.id!= null and lifetouchRelease.id!= ''"> '"> and a.release_type_id =#{lifetouchReleease.category.idid} null and a.Advertisement_id lik '%$ {advertisementid}%'および(sys_officeの名前を選択します= a.office_id) AndlifetouchRelease.Orderby!= null and lifetouchRelease.page.orderby上記は、エンティティオブジェクト、通常のタイプ、および複数のパラメーターの合格です。
複数のパラメーター:注釈を使用して実装します
エンティティオブジェクト:エンティティオブジェクトは、通常のタイプパラメーターパッシングメソッドと同じです。使用された場合にのみ、オブジェクト名と(ポイント)オブジェクト属性名の形式で呼び出すことができます。
他のパスですが、非常に複雑なデータ型にも同じことが言えます。
上記は、編集者が紹介したMyBatisマルチパラメーターとエンティティオブジェクト配信の例です。それがあなたに役立つことを願っています。ご質問がある場合は、メッセージを残してください。編集者は時間内に返信します。 wulin.comのウェブサイトへのご支援ありがとうございます!