<select id="queryBookInfo" parameterType="com.ths.platform.entity.BookInfo" resultType="java.lang.Integer">selectcount(id) from t_book t where 1=1<if test="title !=null and title !='' "> AND title = #{title} </if> <if test="author !=null and author !='' "> AND author = #{author}</if> </select>
<select id="queryBookInfo" parameterType="com.ths.platform.entity.BookInfo" resultType="java.lang.Integer">selectcount(*) from t_book t<where><if test="title !=null and title !='' "> title = #{title} </if><if test="author !=null and author !='' "> AND author = #{author}</if></where> </select>