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>
    
    
  • 相关阅读:
    sed 搜索并替换
    error: call of overloaded ‘sqrt(double&)’ is ambiguous
    C++数组读入MATLAB数据
    Ubuntu 18.04 安装 Octave 5.1
    Ubuntu 18.04 安装 CUDA 9.0
    LSTM 神经网络输入输出层
    tf.nn.rnn_cell.MultiRNNCell
    w = tf.Variable(<initial-value>, name=<optional-name>)
    linux下修改环境变量
    linux内核编程学习——草稿
  • 原文地址:https://www.cnblogs.com/zhangshitong/p/12634376.html
Copyright © 2011-2022 走看看