Oracle學習筆記04:timestamp時間大小比較


Oracle學習筆記04:timestamp時間大小比較

 

Oracel時間比較和Mysql不太一樣,一開始還折騰了下

其中一種方式如下:

        select
            a.*,
            b."name" as "maintain_sup_type_name"
        from S_MAINTAIN_ORDER a
        LEFT JOIN S_MAINTAIN_CATEGORY b on b."id" = a."maintain_sup_type"
        where a."del_flag"=0
        <if test="orderCode != null and orderCode != ''">
            and  a."order_code" like concat(concat('%',#{orderCode}),'%')
        </if>
        <if test="appointTimeStart != null "> and "TO_CHAR"(a."appoint_time_start",'yyyy-mm-dd' ) &gt; #{appointTimeStart} </if>
        <if test="appointTimeEnd != null"> and "TO_CHAR"(a."appoint_time_end",'yyyy-mm-dd' ) &lt; #{appointTimeEnd} </if>
        <if test="maintainSupType != null and maintainSupType != ''">
            and  a."maintain_sup_type" = #{maintainSupType}
        </if>
        <if test="orderStatus != null">
            and  a."order_status" = #{orderStatus}
        </if>
        <if test="memberMobile != null and memberMobile != ''">
            and a."member_mobile" like concat(concat('%',#{memberMobile}),'%')
        </if>
        order by a."order_code" desc

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM