我丢失了 MyBaits 参数

I lost MyBaits parameter

系统架构
NginX - Tomcat7(Spring & MyBatis)

<select id="countDeptEmpMember" parameterType="my.model.DeptInfoVo" resultType="int">
    SELECT COUNT(epId) 
      FROM empMemberInfo 
     WHERE deptId = #{deptId}
</select>

我通过 Ajax 传递了 orgId。 但是deptId丢失了。

结果为“0”。

你能告诉我丢失 MyBatis 参数的任何原因吗?

为 my.model.DeptInfoVo 添加 getter。 或者您可以像这样指定参数:

int countDeptEmpMember(@Param(value = "vo") my.model.DeptInfoVo vo);
<select id="countDeptEmpMember" parameterType="my.model.DeptInfoVo" resultType="int">
    SELECT COUNT(epId) 
      FROM empMemberInfo 
     WHERE deptId = #{vo.deptId}
</select>