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
01-07 21:14