模糊查询: LIKE CONCAT('%',#{参数},'%')<select id="getTeacherCount" resultType="int" parameterType="teacher">SELECT COUNT(1) from teacher_info where 1=1 <if test="name!=null">AND tname LIKE CONCAT('%',#{name},'%')</if></select>比较大小: <![CDATA[ time <= #{endTime} ]]><select id="selCcourseCount" resultType="int">SELECT count(1) FROM classcourse_info as ccourse where 1=1<if test="ccourse.beginTime==null and ccourse.endTime!=null">AND <![CDATA[ time <= #{ccourse.endTime} ]]></if></select>