zoukankan      html  css  js  c++  java
  • 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>
  • 相关阅读:
    Python day43 :pymysql模块/查询,插入,删除操作/SQL注入完全问题/事务/模拟登录注册服务器/视图/函数/存储过程
    docker
    Linux 05
    Linux04
    Linux 03
    Linux 02
    go语言
    go语言
    go语言
    Linux
  • 原文地址:https://www.cnblogs.com/yangjinwang/p/6046761.html
Copyright © 2011-2022 走看看