luodangjia
2024-05-28 1e1f67ae130f9cb8f65c8f68ea2fcd0bc6929976
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderTapeMapper.xml
@@ -20,5 +20,35 @@
    <sql id="Base_Column_List">
        id,orderId,orderType,fileLink,fileName,fileFormat,fileSize,afterTime,insertTime,isDelete
    </sql>
    <select id="getOrderTapeList" resultType="java.util.Map">
        SELECT tot.id,tot.orderId,tot.orderType,tot.fileLink,tot.fileName,tot.fileFormat,tot.fileSize,tot.afterTime,tot.insertTime,tot.isDelete,o.orderNum,
            (case when tot.afterTime &lt;= now() then 2 when tot.afterTime &gt;= now() then 1 end) as state
        from t_order_tape tot
        LEFT JOIN
        (
        SELECT id,orderNum,isDelete,1 as orderType from t_order_private_car
        UNION ALL
        SELECT id,orderNum,isDelete,3 as orderType from t_order_cross_city
        UNION ALL
        SELECT id,orderNum,isDelete,7 as orderType from t_order_transfer
        ) o
        on tot.orderId = o.id
        where tot.isDelete = 1 and o.isDelete = 1 and tot.orderType = o.orderType
        <if test="beginTime != null and endTime != null">
            and tot.insertTime between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59')
        </if>
        <if test="fileName != null and fileName != ''">
            and tot.fileName like concat('%',#{fileName},'%')
        </if>
        <if test="orderNum != null and orderNum != ''">
            and o.orderNum like concat('%',#{orderNum},'%')
        </if>
        <if test="state != null and state == 1">
            and tot.afterTime &gt;= now()
        </if>
        <if test="state != null and state == 2">
            and tot.afterTime &lt;= now()
        </if>
    </select>
</mapper>