There is no getter for property named 'pro' in 'class java.lang.String'

Sql语句错误示例:

<select id="getbusinessPermitTotal" resultType="integer">
	SELECT IFNULL(SUM(ISNULL(ALLOW_RECORD_NUM,0)),0)
	FROM FOODS_DWS.FACT_MANAGE_ALLOW_RECORD AS F1
	<if test="pro!=null">
		 WHERE F1.REGION_KEY IN (SELECT REGION_KEY FROM FOODS_DWS.DIM_REGION WHERE PROVINCE_NAME= #{pro})
	</if>
</select>

解决办法:
把pro换成_parameter 就可以了

<select id="getbusinessPermitTotal" resultType="integer">
	SELECT IFNULL(SUM(ISNULL(ALLOW_RECORD_NUM,0)),0)
	FROM FOODS_DWS.FACT_MANAGE_ALLOW_RECORD AS F1
	<if test="_parameter!=null">
		 WHERE F1.REGION_KEY IN (SELECT REGION_KEY FROM FOODS_DWS.DIM_REGION WHERE PROVINCE_NAME= #{_parameter })
	</if>
</select>
上一篇:MySQL教程69-LIMIT 限制查询结果的条数


下一篇:Web-开发技术请参见-HTTP请参见-HTTP-HeadersAccess-Control-Allow-Origin