<select id="selectAllMatchActivity" parameterType="map" resultMap="BaseResultMap">
select a.id id,
from tbl_activity a
join tbl_user u1 on a.owner = u1.id
join tbl_user u2 on a.create_by = u2.id
left join tbl_user u3 on a.edit_by = u3.id
<where>
<if test="name != null and name != ''">
and a.name like '%'#{name}'%'
</if>
</where>
可以查出数据的代码
<select id="selectAllMatchActivity" parameterType="map" resultMap="BaseResultMap">
select a.id id,
from tbl_activity a
join tbl_user u1 on a.owner = u1.id
join tbl_user u2 on a.create_by = u2.id
left join tbl_user u3 on a.edit_by = u3.id
<where>
<if test="name != null and name != ''">
and a.name like '%' #{name} '%'
</if>
</where>
Mybatis用 #{} 查不到数据查不出数据的代码<select id="selectAllMatchActivity" parameterType="map" resultMap="BaseResultMap"> select a.id id, from tbl_activity a join tbl_user u1 on a.owner = u1.id join tbl_user u2 on a.create_by =