zoukankan      html  css  js  c++  java
  • mybatis xml文件时间的比较

    <select id="getWorkOrderPageList" resultType="cn.com.gdt.ciems.om.biz.backend.workorder.model.WorkOrderPageDto">
            SELECT
            t.*,
            tfr.faultLevelName,
            tfr.fault_description,
            tfr.fault_location,
            tfr.repair_time,
            tmp.maintain_name,
            tmp.device_name,
            tmp.start_time,
            tmp.maintain_cycle,
            a.`name` orderTypeName,
            b.`name` statusName,
            tro.receiver,
            tro.receiverphone
            FROM
            `t_om_workorder` t
            LEFT JOIN (
            SELECT
            tf.*,
            ta.`name` faultLevelName
            FROM
            t_om_fault_record tf
            LEFT JOIN t_om_common_code ta ON tf.fault_level = ta.`value`
            WHERE
            ta.classification = 200
            ) tfr ON t.source_id = tfr.id
            LEFT JOIN t_om_maintenance_plan tmp ON t.source_id = tmp.id and tmp.flag is not null and tmp.flag != 1
            LEFT JOIN t_om_common_code a ON t.order_type = a.`value`
            LEFT JOIN t_om_common_code b ON t.`status` = b.`value`
            left join t_om_receive_order tro on t.id = tro.work_order_id
        <where>
            <if test="map.orderType != null">
                t.order_type = #{map.orderType}
            </if>
            <if test="map.status != null">
               and t.status = #{map.status}
            </if>
            <if test="map.doneTime != null">
                <![CDATA[   and DATE_FORMAT(t.done_time , '%Y-%m-%d')=  DATE_FORMAT(#{map.doneTime}, '%Y-%m-%d')  ]]>
            </if>
            <if test="map.workOrderNo != null">
                and t.work_order_no like '%${map.workOrderNo}%'
            </if>
        </where>
            GROUP BY t.id
      </select>

    注意红色的部分,必须要有
    <![CDATA[ ]]>

     <select id="shouldOverListByDate" resultType="cn.com.gdt.ciems.om.biz.backend.maintenance.entity.MaintenancePlan">
            SELECT t.* FROM t_om_maintenance_plan t WHERE  #{date}  <![CDATA[ >= ]]> t.end_time and t.plan_status='3';
        </select>
    
    
  • 相关阅读:
    深入理解PHP原理之变量作用域
    深入理解PHP原理之变量分离/引用
    关于哈希表
    foreach 相关
    Scrapyd-Client的安装
    Scrapyd API的安装
    scrapyd的安装
    快手的小视频爬取
    实现单例模式的几种方式
    京东图书分布式爬虫
  • 原文地址:https://www.cnblogs.com/zhangshitong/p/12634376.html
Copyright © 2011-2022 走看看