日期:2014-05-18 浏览次数:20658 次
<parameterMap type="java.util.HashMap" id="countParam">
<parameter property="A" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
<parameter property="B" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
<parameter property="C" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
<parameter property="D" javaType="java.lang.String" jdbcType="VARCHAR" mode="IN"/>
</parameterMap>
<select id="countByMap" parameterMap="countParam" resultType="java.lang.Integer">
select count(*) from T
where 1 = 1
<if test="A!= null" >
and T.A = #{A,jdbcType=VARCHAR}
</if>
<if test="B!= null" >
and T.B = #{B,jdbcType=VARCHAR}
</if>
<if test="C!= null" >
and T.C = #{C,jdbcType=VARCHAR}
</if>
<if test="D!= null" >
and T.D like #{D,jdbcType=VARCHAR}
</if>
</select>
<select id="countByMap" parameterMap="countParam" resultType="java.lang.Integer">
select count(*) from T
<where>
<if&n