java mybatis 中sql 模糊查询

示例:

like  concat('%',#{groupName},'%')

//--------------

<select id="findList" resultType="com.thinkgem.jeesite.modules.rule.entity.RuleCombinationModel">
SELECT 
<include refid="cmsGuestbookColumns"/>
FROM t_zg_rule_group a
<where>
a.DELETE_STATUS = 0
<if test="groupNumber!='' and groupNumber!=null ">
and a.GROUP_NUMBER=#{groupNumber}
</if>
<if test="groupName!='' and groupName!=null ">
and a.GROUP_NAME like concat('%',#{groupName},'%')
<!-- concat('%',#{productName},'%') -->
</if>
<if test="groupStatus!='' and groupStatus!=null ">
and a.GROUP_STATUS=#{groupStatus}
</if>
</where>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
<otherwise>
ORDER BY a.CREATEDON DESC
</otherwise>
</choose>
</select>

 

posted @ 2016-11-09 14:10  秋香姑娘请你不要紧张  阅读(750)  评论(0编辑  收藏  举报