先上代碼:
<choose> <when test="BEGINTIME != null and BEGINTIME != '' and ENDTIME != null and ENDTIME != ''"> AND time BETWEEN #{BEGINTIME, jdbcType=VARCHAR} AND #{ENDTIME, jdbcType=VARCHAR} </when> <when test="BEGINTIME != null and BEGINTIME != ''"> <![CDATA[ AND time > #{BEGINTIME, jdbcType=TIMESTAMP} ]]> </when> <when test="ENDTIME != null and ENDTIME != ''"> <![CDATA[ AND time < #{ENDTIME, jdbcType=TIMESTAMP} ]]> </when> <otherwise></otherwise> </choose> choose標(biāo)簽與if標(biāo)簽不同,前者之間是或(or)的關(guān)系,后者之間是與(and)的關(guān)系,choose標(biāo)簽類似于java中的switch語句choose-switch
when-case
otherwise-default
新聞熱點(diǎn)
疑難解答
圖片精選
網(wǎng)友關(guān)注