Mybatis sql报错Parameter index out of range (3 > number of parameters, which is 2).
<selectid="selectChildBaseCount"parameterType="map"resultType="int">selectcount(*)fro...
<select id="selectChildBaseCount" parameterType="map" resultType="int">
select count(*) from lx_operate_info_log ts
<where>
<if test="schoolId !=null and schoolId !=''">
ts.school_id=#{schoolId}
</if>
<if test="operateName !=null and operateName !=''">
and ts.user_name like '%#{operateName}%'
</if>
<if test="targetType !=null and targetType !=''">
and ts.target_type = #{targetType}
</if>
</where>
</select> 展开
select count(*) from lx_operate_info_log ts
<where>
<if test="schoolId !=null and schoolId !=''">
ts.school_id=#{schoolId}
</if>
<if test="operateName !=null and operateName !=''">
and ts.user_name like '%#{operateName}%'
</if>
<if test="targetType !=null and targetType !=''">
and ts.target_type = #{targetType}
</if>
</where>
</select> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询