需求:根据用户输入的关键字(中英文区别,)然后根据关键字进行匹配,根据匹配度高低进行排序;
<!-- 根据搜索字符模糊查询,根据匹配度进行排序 -->
<select id="getPOIListByName" parameterType="entity.poi.Poi" resultMap="poiResultMap">
SELECT * FROM gt_poi
<if test="id != null" >AND id=#{id}</if>
<if test="cnName != null and cnName != ''">AND cn_name like CONCAT('%','${cnName}','%' ) </if>
<if test="enName != null and enName != ''">AND en_name like CONCAT('%','${enName}','%' ) </if>
<if test="online != null">AND online=#{online}</if>
<if test="approve != null">AND approve=#{approve}</if>
<if test="stat