| | |
| | | order by o.id desc |
| | | </select> |
| | | |
| | | <!--根据快车订单ID获取小件物流订单详情--> |
| | | <!--根据专车订单ID获取小件物流订单详情--> |
| | | <select id="getLogisticsOrderDetailById" resultType="map"> |
| | | SELECT |
| | | DATE_FORMAT(ot.insertTime,'%Y-%m-%d %H:%i') as insertTimeStr, |
| | |
| | | where ot.id = #{orderId} |
| | | </select> |
| | | |
| | | |
| | | <select id="getTimeOutOrderList" resultType="map" parameterType="com.baomidou.mybatisplus.plugins.Page"> |
| | | SELECT |
| | | l.id, |
| | | l.type, |
| | | timeOutMoney, |
| | | endServiceTime,d.phone,d.`name`, |
| | | (SELECT sum(money) FROM t_income WHERE userType=1 AND incomeId=l.id AND orderType=l.type and type = 7)-ifnull(a.returnMoney,0) companyMoney, |
| | | a.createTime, |
| | | ifnull(a.returnMoney,0) returnMoney |
| | | FROM |
| | | t_order_logistics l |
| | | LEFT JOIN t_driver d ON l.driverId=d.id |
| | | LEFT JOIN t_timeout_appeal a ON a.orderId=l.id AND a.state=2 |
| | | WHERE |
| | | l.timeOutMoney > 0 |
| | | AND l.isDelete = 1 and d.companyId=#{companyId} |
| | | <if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''"> |
| | | AND ( |
| | | (l.insertTime between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59')) |
| | | or |
| | | (a.createTime between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59')) |
| | | ) |
| | | </if> |
| | | <if test="phone != null and phone != ''"> |
| | | and d.phone LIKE CONCAT('%',#{phone},'%') |
| | | </if> |
| | | <if test="name != null and name != ''"> |
| | | and d.name LIKE CONCAT('%',#{name},'%') |
| | | </if> |
| | | <if test="id != null and id != ''"> |
| | | and l.id LIKE CONCAT('%',#{id},'%') |
| | | </if> |
| | | <if test="null != orderType"> |
| | | and l.type = #{orderType} |
| | | </if> |
| | | order by l.insertTime desc |
| | | </select> |
| | | |
| | | <select id="getTimeOutOrderListEx" resultType="map"> |
| | | SELECT |
| | | l.id, |
| | | l.type, |
| | | timeOutMoney, |
| | | endServiceTime,d.phone,d.`name`, |
| | | (SELECT sum(money) FROM t_income WHERE userType=1 AND incomeId=l.id AND orderType=l.type and type = 7)-ifnull(a.returnMoney,0) companyMoney, |
| | | a.createTime, |
| | | ifnull(a.returnMoney,0) returnMoney |
| | | FROM |
| | | t_order_logistics l |
| | | LEFT JOIN t_driver d ON l.driverId=d.id |
| | | LEFT JOIN t_timeout_appeal a ON a.orderId=l.id AND a.state=2 |
| | | WHERE |
| | | l.timeOutMoney > 0 |
| | | AND l.isDelete = 1 and d.companyId=#{companyId} |
| | | <if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''"> |
| | | AND ( |
| | | (l.insertTime between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59')) |
| | | or |
| | | (a.createTime between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59')) |
| | | ) |
| | | </if> |
| | | <if test="phone != null and phone != ''"> |
| | | and d.phone LIKE CONCAT('%',#{phone},'%') |
| | | </if> |
| | | <if test="name != null and name != ''"> |
| | | and d.name LIKE CONCAT('%',#{name},'%') |
| | | </if> |
| | | <if test="id != null and id != ''"> |
| | | and l.id LIKE CONCAT('%',#{id},'%') |
| | | </if> |
| | | <if test="null != orderType"> |
| | | and l.type = #{orderType} |
| | | </if> |
| | | order by l.insertTime desc |
| | | </select> |
| | | |
| | | <select id="getTimeOutOrderSumMoney" resultType="map"> |
| | | SELECT |
| | | IFNULL(SUM(timeOutMoney),0) timeOutMoney, |
| | | IFNULL(SUM(a.returnMoney),0) returnMoney |
| | | FROM |
| | | t_order_logistics l |
| | | LEFT JOIN t_driver d ON l.driverId=d.id |
| | | LEFT JOIN t_timeout_appeal a ON a.orderId=l.id AND a.state=2 |
| | | WHERE |
| | | l.timeOutMoney > 0 |
| | | AND l.isDelete = 1 |
| | | <if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''"> |
| | | AND ( |
| | | (l.insertTime between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59')) |
| | | or |
| | | (a.createTime between CONCAT(#{beginTime},' 00:00:00') and CONCAT(#{endTime},' 23:59:59')) |
| | | ) |
| | | </if> |
| | | <if test="phone != null and phone != ''"> |
| | | and d.phone LIKE CONCAT('%',#{phone},'%') |
| | | </if> |
| | | <if test="name != null and name != ''"> |
| | | and d.name LIKE CONCAT('%',#{name},'%') |
| | | </if> |
| | | <if test="id != null and id != ''"> |
| | | and l.id LIKE CONCAT('%',#{id},'%') |
| | | </if> |
| | | <if test="null != orderType"> |
| | | and l.type = #{orderType} |
| | | </if> |
| | | </select> |
| | | </mapper> |