| | |
| | | <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 <= now() then 2 when tot.afterTime >= 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 >= now() |
| | | </if> |
| | | <if test="state != null and state == 2"> |
| | | and tot.afterTime <= now() |
| | | </if> |
| | | </select> |
| | | |
| | | </mapper> |