原因:接口中传入了多个参数如:
接口:fusePlanCaseEntities=planInter.selectPlanCaseInfoByPlanId(planId,sSearch);//获取用例返回结果集
映射:@RequestParam(value="planId",required=false) int planId,HttpServletRequest request)
mybatis映射xml: <resultMap id="PlanCaseResultMap" type="**.FusePlanCaseEntity">
<id column="id" property="id" jdbcType="INTEGER" />
<result column="planId" property="planId" jdbcType="INTEGER"/>
<result column="projectName" property="projectName" jdbcType="VARCHAR"/>
<result column="planCaseDec" property="planCaseDec" jdbcType="VARCHAR"/>
<result column="sfSendMail" property="sfSendMail" jdbcType="VARCHAR"/>
<result column="creater" property="creater" jdbcType="VARCHAR"/>
<result column="planCase" property="planCase" jdbcType="VARCHAR"/>
</resultMap>
<sql id="PlanCase_List">
id,planId,projectName,planCaseDec,sfSendMail,creater,planCase
</sql>
<select id="selectPlanCaseInfoByPlanId" parameterType="java.lang.Integer" resultMap="PlanCaseResultMap">
select <include refid="PlanCase_List"/>
from tfci_fuseplan_case where planId= #{planId}
</select>
解决方案:
方法一:使用#{arg0}和#{arg1}确认使用哪个参数的值
<select id="selectPlanCaseInfoByPlanId" parameterType="java.lang.Integer" resultMap="PlanCaseResultMap">
select <include refid="PlanCase_List"/>
from tfci_fuseplan_case where planId= #{arg0}
</select>
补充说明:接口存在多个参数,但是业务需求只需映射一个planId,这时只需要通过尝试使用#{arg0}、或者#{arg1}代替#{planId},最终成功获取期望值