Is there a way to test the existence of a parameter in the parameter map?
mybatis
Solution
You can use this test:
<if test="_parameter.containsKey('forUpdate')">your code....</if>
Problem
Is there a way in mybatis to test if a certain parameter is contained in the query parameter map? I'm looking for something like this: ``` <select id="selectByKey" resultMap="MyObjectMap" parameterType="map"> select obj.* from obj where obj.id=#{id:VARCHAR} <!-- I'm looking for a method like that below --> <if test="parameterExists('forUpdate')"> <if test="forUpdate == 1"> for update </if> </if> </select> ```