mybatis 参数为String,if test读取该参数

mybatis 参数为String,if test读取该参数代码:

<select id="getMaxDepartId" parameterType="java.lang.String" resultType="java.lang.String">
        SELECT MAX(DEPART_ID) FROM T_P_DEPART
        <where>
            <if test="_parameter!=null and _parameter!=''">  
                AND DEPART_PID = #{departId,jdbcType=VARCHAR}
            </if>
            <if test="_parameter==null or _parameter==''">  
                AND DEPART_PID IS NULL
            </if>
        </where>
    </select>

你可能感兴趣的:(mybatis 参数为String,if test读取该参数)