| | |
| | | o.recipient_phone, |
| | | o.order_status, |
| | | o.order_time, |
| | | o.rating, |
| | | e.rating, |
| | | o.courier_id, |
| | | c.name, |
| | | c.phone |
| | | c.name courierName, |
| | | c.phone courierPhone |
| | | from t_order o |
| | | left join t_courier c on o.courier_id = c.id |
| | | left join t_courier c on c.id = o.courier_id |
| | | left join t_evaluation e on o.id = e.order_id and e.type =0 |
| | | where |
| | | o.del_flag=0 |
| | | and o.order_status != 3 |
| | | and o.pay_status=2 |
| | | and o.app_user_id = #{appUserId} |
| | | <if test="orderStatus!=null and orderStatus!=0"> |
| | | and o.order_status = #{orderStatus} |
| | | </if> |
| | | order by o.order_time desc |
| | | </select> |
| | | <select id="getOrderDetail" resultType="com.ruoyi.errand.object.vo.app.OrderDetailVO"> |
| | | select |
| | |
| | | o.order_time as orderTime, |
| | | o.pay_method as payMethod, |
| | | o.payment_amount as paymentAmount, |
| | | c.courier_name as courierName, |
| | | c.courier_phone as courierPhone, |
| | | c.name as courierName, |
| | | c.phone as courierPhone, |
| | | e.id as evaluationId, |
| | | e.rating as rating, |
| | | e.content as content |
| | | e.content as content, |
| | | e2.rating as courierRating, |
| | | e2.content as courierContent |
| | | from t_order o |
| | | left join t_courier c on o.courier_id = c.id |
| | | left join t_evaluation e on o.id = e.order_id |
| | | left join t_evaluation e on o.id = e.order_id and e.type = 0 |
| | | left join t_evaluation e2 on o.id = e2.order_id and e2.type = 1 |
| | | where |
| | | o.id=#{id} |
| | | and o.del_flag=0 |
| | | and e.type = 0 |
| | | </select> |
| | | |
| | | <select id="getOrderTopInfoByDate" resultType="java.util.Map"> |
| | |
| | | t_order |
| | | where |
| | | del_flag=0 |
| | | and pay_status = 2 |
| | | and |
| | | order_status in (4,5) |
| | | <if test="communityId!=null and communityId!=0"> |
| | | and communityId =#{communityId} |
| | | and community_id =#{communityId} |
| | | </if> |
| | | <if test="start!=null and end!=null"> |
| | | and order_time BETWEEN #{start} AND #{end} |
| | |
| | | COALESCE(SUM(payment_amount), 0.00) AS amount |
| | | FROM t_order |
| | | WHERE order_time BETWEEN #{start} AND #{end} |
| | | and del_flag=0 and order_status in (4,5) |
| | | and del_flag=0 and order_status in (4,5)and pay_status = 2 |
| | | <if test="communityId!=null and 0!= communityId"> |
| | | and community_id =#{communityId} |
| | | </if> |
| | | GROUP BY |
| | | CASE #{datePattern} |
| | | WHEN 'HH时' THEN DATE_FORMAT(order_time, '%H时') |
| | |
| | | and tau.phone like concat('%',#{dto.phone},'%') |
| | | </if> |
| | | |
| | | <if test="dto.orderStatus!=null and 0!=dto.orderStatus and dto.orderStatus !=4"> |
| | | <if test="dto.orderStatus!=null and 0!=dto.orderStatus "> |
| | | and t.order_status = #{dto.orderStatus} |
| | | </if> |
| | | <if test="dto.orderStatus ==4"> |
| | | and t.order_status in(4,5) |
| | | <if test="dto.startTime!=null and dto.endTime != null"> |
| | | and t.order_time between #{dto.startTime} and #{dto.endTime} |
| | | </if> |
| | | <if test="dto.startTime!=null and dto.endTime != null"> |
| | | and t.order_time between #{dto.startTime} and #{dto.endTime} |
| | | </if> |
| | | ) t |
| | | where |
| | | 1=1 |
| | |
| | | <select id="financeStatistics" resultType="com.ruoyi.errand.object.vo.sys.FinanceStatisticsVO"> |
| | | select * from ( |
| | | SELECT t.id as id, |
| | | t.order_amount as money, |
| | | t.order_time as orderTime, |
| | | 1 as type, |
| | | t.pay_method as payMethod, |
| | | t.order_number as orderNumber, |
| | | tau.name as appUserName, |
| | | tau.phone as phone, |
| | |
| | | <if test="dto.orderStatus!=null and 0!=dto.orderStatus and dto.orderStatus !=4"> |
| | | and t.order_status = #{dto.orderStatus} |
| | | </if> |
| | | <if test="dto.orderStatus ==4"> |
| | | and t.order_status in(4,5) |
| | | </if> |
| | | <if test="dto.startTime!=null and dto.endTime != null"> |
| | | and t.order_time between #{dto.startTime} and #{dto.endTime} |
| | | </if> |
| | | UNION ALL |
| | | SELECT t.id as id, |
| | | t.order_time as orderTime, |
| | | 2 as type, |
| | | t.order_number as orderNumber, |
| | | tau.name as appUserName, |
| | | tau.phone as phone, |
| | | t.order_status as orderStatus |
| | | FROM t_vip_order t |
| | | INNER JOIN t_app_user tau ON t.app_user_id = tau.id |
| | | WHERE t.del_flag=0 |
| | | and t.pay_status=2 |
| | | <if test="dto.appUserName!=null and ''!=dto.appUserName"> |
| | | and tau.name like concat('%',#{dto.appUserName},'%') |
| | | </if> |
| | | |
| | | <if test="dto.phone!=null and ''!=dto.phone"> |
| | | and tau.phone like concat('%',#{dto.phone},'%') |
| | | </if> |
| | | |
| | | <if test="dto.orderStatus!=null and 0!=dto.orderStatus and dto.orderStatus !=4"> |
| | | and t.order_status = #{dto.orderStatus} |
| | | </if> |
| | | <if test="dto.orderStatus ==4"> |
| | | and t.order_status in(4,5) |
| | | </if> |
| | | |
| | | <if test="dto.startTime!=null and dto.endTime != null"> |
| | | and t.order_time between #{dto.startTime} and #{dto.endTime} |
| | | </if> |
| | | <if test="dto.payMethod!=null"> |
| | | and t.pay_method = #{dto.payMethod} |
| | | </if> |
| | | |
| | | <if test="dto.payMethod==null || dto.payMethod==0"> |
| | | UNION ALL |
| | | SELECT t.id as id, |
| | | t.order_amount as money, |
| | | t.order_time as orderTime, |
| | | 2 as type, |
| | | 0 as payMethod, |
| | | t.order_number as orderNumber, |
| | | tau.name as appUserName, |
| | | tau.phone as phone, |
| | | t.order_status as orderStatus |
| | | FROM t_vip_order t |
| | | INNER JOIN t_app_user tau ON t.app_user_id = tau.id |
| | | WHERE t.del_flag=0 |
| | | and t.pay_status=2 |
| | | <if test="dto.appUserName!=null and ''!=dto.appUserName"> |
| | | and tau.name like concat('%',#{dto.appUserName},'%') |
| | | </if> |
| | | |
| | | <if test="dto.phone!=null and ''!=dto.phone"> |
| | | and tau.phone like concat('%',#{dto.phone},'%') |
| | | </if> |
| | | |
| | | <if test="dto.orderStatus!=null and 0!=dto.orderStatus "> |
| | | and t.order_status = #{dto.orderStatus} |
| | | </if> |
| | | <if test="dto.startTime!=null and dto.endTime != null"> |
| | | and t.order_time between #{dto.startTime} and #{dto.endTime} |
| | | </if> |
| | | </if> |
| | | ) t |
| | | where |
| | |
| | | and o.order_time between #{dto.orderStartTime} and #{dto.orderEndTime} |
| | | </if> |
| | | <if test="dto.finishStartTime!=null and dto.finishEndTime != null"> |
| | | and o.finishTime between #{dto.finishStartTime} and #{dto.finishEndTime} |
| | | and o.finish_time between #{dto.finishStartTime} and #{dto.finishEndTime} |
| | | </if> |
| | | <if test="dto.orderStatus!=null and 0!=dto.orderStatus and dto.orderStatus !=4"> |
| | | <if test="dto.orderStatus!=null and 0!=dto.orderStatus"> |
| | | and o.order_status = #{dto.orderStatus} |
| | | </if> |
| | | <if test="dto.orderStatus ==4"> |
| | | and o.order_status in(4,5) |
| | | </if> |
| | | |
| | | order by o.order_time desc |
| | | </select> |
| | | <select id="detail" resultType="com.ruoyi.errand.object.vo.sys.OrderSysDetailVO"> |
| | | select |
| | |
| | | inner join t_app_user tau on o.app_user_id = tau.id |
| | | left join t_courier tc on o.courier_id = tc.id |
| | | left join t_evaluation teu on o.id = teu.order_id and teu.type=0 |
| | | left join t_evaluation tec on o.id = teu.order_id and teu.type=1 |
| | | left join t_evaluation tec on o.id = tec.order_id and tec.type=1 |
| | | where |
| | | o.id=#{id} |
| | | </select> |
| | |
| | | select * from ( |
| | | SELECT t.id as id, |
| | | t.order_time as orderTime, |
| | | t.order_amount as money, |
| | | 1 as type, |
| | | t.pay_method as payMethod, |
| | | t.order_number as orderNumber, |
| | | tau.name as appUserName, |
| | | tau.phone as phone, |
| | |
| | | <if test="dto.startTime!=null and dto.endTime != null"> |
| | | and t.order_time between #{dto.startTime} and #{dto.endTime} |
| | | </if> |
| | | <if test="dto.payMethod!=null"> |
| | | and t.pay_method = #{dto.payMethod} |
| | | </if> |
| | | |
| | | <if test="dto.payMethod==null || dto.payMethod==0"> |
| | | UNION ALL |
| | | SELECT t.id as id, |
| | | t.order_time as orderTime, |
| | | t.order_amount as money, |
| | | 2 as type, |
| | | 0 as payMethod, |
| | | t.order_number as orderNumber, |
| | | tau.name as appUserName, |
| | | tau.phone as phone, |
| | |
| | | and tau.phone like concat('%',#{dto.phone},'%') |
| | | </if> |
| | | |
| | | <if test="dto.orderStatus!=null and 0!=dto.orderStatus and dto.orderStatus !=4"> |
| | | <if test="dto.orderStatus!=null and 0!=dto.orderStatus "> |
| | | and t.order_status = #{dto.orderStatus} |
| | | </if> |
| | | <if test="dto.orderStatus ==4"> |
| | | and t.order_status in(4,5) |
| | | </if> |
| | | |
| | | |
| | | <if test="dto.startTime!=null and dto.endTime != null"> |
| | | and t.order_time between #{dto.startTime} and #{dto.endTime} |
| | | </if> |
| | | </if> |
| | | ) t |
| | | where |
| | |
| | | and o.order_time between #{dto.orderStartTime} and #{dto.orderEndTime} |
| | | </if> |
| | | <if test="dto.finishStartTime!=null and dto.finishEndTime != null"> |
| | | and o.finishTime between #{dto.finishStartTime} and #{dto.finishEndTime} |
| | | and o.finish_time between #{dto.finishStartTime} and #{dto.finishEndTime} |
| | | </if> |
| | | <if test="dto.orderStatus!=null and 0!=dto.orderStatus and dto.orderStatus !=4"> |
| | | and o.order_status = #{dto.orderStatus} |
| | |
| | | <if test="dto.orderStatus ==4"> |
| | | and o.order_status in(4,5) |
| | | </if> |
| | | order by o.order_time desc |
| | | </select> |
| | | </mapper> |