34,590
社区成员
发帖
与我相关
我的任务
分享
select
*
from activity
where 1=1
<if test="city != null and city!=''">
and city =#{city,jdbcType=VARCHAR}
</if>
<if test="contentType != null and contentType >0">
and content_type =#{contentType,jdbcType=INTEGER}
</if>
and status =1
order by create_time desc
limit #{start,jdbcType=INTEGER},#{limit,jdbcType=INTEGER}
参数名称,类型,值
city,VARCHAR,?
contentType,INTEGER,?
start,INTEGER,80
limit,INTEGER,10
select
*
from activity
where 1=1
and status =1
order by create_time desc
limit 80,10
select
*
from activity
where 1=1
and city ='abc'
and content_type =3
and status =1
order by create_time desc
limit 80,10