<select id="showShop" resultType="com.qcby.demo1107.entity.Shop">
select * from shop
<where>
<if test="shop.shopName">
shop_name like CONCAT('%',#{shop.shopName},'%')
</if>
and flag = 1
</where>
</select>
Mapper层:
Service层:
Controller层: