zoukankan      html  css  js  c++  java
  • MyBatis中只传一个String参数时要注意的事项

    参数名为_parameter,不需要指定成传入的参数名,参考代码如下:

    <select id="getLoop" resultMap="AAA" parameterType="String">     
        SELECT *, ROWNUM RN from tablename
            <where>    
                <choose>    
                    <when test="_parameter != null and _parameter == '1'.toString()">    
                        RN &lt;=100000  and RN &gt;=1   
                    </when>   
                    <when test="_parameter != null and _parameter == '2'.toString()">    
                        RN &lt;=200000  and RN &gt;=100001   
                    </when>
                    <when test="_parameter != null and _parameter == '3'.toString()">    
                        RN &lt;=300000  and RN &gt;=200001   
                    </when>        
                    <otherwise>    
                        RN &lt;=1  and RN &gt;=1     
                    </otherwise>    
                </choose>    
            </where>   
    </select>
  • 相关阅读:
    1004. Counting Leaves (30)
    51Nod 1272 最大距离 (栈或贪心)
    D
    M
    N
    F
    E
    L
    A. Office Keys ( Codeforces Round #424 (Div. 1, rated, based on VK Cup Finals) )
    K
  • 原文地址:https://www.cnblogs.com/xsl1995/p/10213405.html
Copyright © 2011-2022 走看看