select count(*) from customers where cName = #{cName}
select count(*) from customers where cName = '隔壁老王'
</select>
//$会报错
<select id="getCustomersCount" resultType="int">
select count(*) from customers where cName = ${cName}
select count(*) from customers where cName = 隔壁老王
</select>
//在模糊查询 like的时候用${}
<select id="Count" resultType="int">
select count(*) from customers where DEL_FLG='0'
<if test=" cName !=null and cName !='' ">
and cName like '%${cName}%'
and cName like '%王%'
</if>
</select>
//用#{}模糊查询会这样 这时候会报错
<select id="Count" resultType="int">
select count(*) from customers where DEL_FLG='0'
<if test=" cName !=null and cName !='' ">
and cName like '%#{cName}%'
and cName like “%‘王‘%”
</if>
</select>