edit | blame | history | raw

queryByCondition

select 
@pageTag(){
t.*
@}
from xzx_order_batch_info t
where 1=1  
@//数据权限,该sql语句功能点,如果不考虑数据权限,可以删除此行  
and #function("xzxOrderBatchInfo")#

batchDelXzxOrderBatchInfoByIds

  • 批量逻辑删除
    update xzx_order_batch_info set del_flag = 1 where bacth_no in( #join(ids)#)

queryBatchInfoDetailList

select a.create_time as createtime,a.weight as cweight,(select c.weight from xzx_user_vehicle_info c where c.id = #vehicleId# ) as vweight,'0' as orderId 
from xzx_order_clock_in_info a where a.user_id =#userId# and a.vehicle_id=#vehicleId#
 @if(!isEmpty(weightError)){
     AND a.weight-(select c.weight from xzx_user_vehicle_info c where c.id = #vehicleId#)>=#weightError#
 @}
 @if(!isEmpty(startTime)){
          AND a.create_time>=#startTime#
 @}
 @if(!isEmpty(endTime)){
          AND a.create_time<=#endTime#
 @}    
union all
select b.create_time as createtime, b.weight as bweight,(select c.weight from xzx_user_vehicle_info c where c.id = #vehicleId# ) as vweight,
         b.order_id as orderId from xzx_order_batch_info b where b.user_id=#userId# and b.vehicle_id=#vehicleId#
          @if(!isEmpty(weightError)){
                  AND b.weight-(select c.weight from xzx_user_vehicle_info c where c.id = #vehicleId#)>=#weightError#
              @}
              @if(!isEmpty(startTime)){
                       AND b.create_time>=#startTime#
              @}
              @if(!isEmpty(endTime)){
                       AND b.create_time<=#endTime#
              @}    
limit #page#, #limit#

queryBatchInfoDetailCount

select sum(count) from(
select count(1) as count
from xzx_order_clock_in_info a where a.user_id =#userId# and a.vehicle_id=#vehicleId#
 @if(!isEmpty(weightError)){
         AND a.weight-(select c.weight from xzx_user_vehicle_info c where c.id = #vehicleId#)>=#weightError#
     @}
     @if(!isEmpty(startTime)){
              AND a.create_time>=#startTime#
     @}
     @if(!isEmpty(endTime)){
              AND a.create_time<=#endTime#
     @}
union all
select count(1) as count from xzx_order_batch_info b where b.user_id=#userId# and b.vehicle_id=#vehicleId# 
 @if(!isEmpty(weightError)){
         AND b.weight-(select c.weight from xzx_user_vehicle_info c where c.id = #vehicleId#)>=#weightError#
     @}
     @if(!isEmpty(startTime)){
              AND b.create_time>=#startTime#
     @}
     @if(!isEmpty(endTime)){
              AND b.create_time<=#endTime#
     @}
     ) c

queryClockDetailList

select a.create_time as createtime,a.weight as cweight,(select c.weight from xzx_user_vehicle_info c where c.id = #vehicleId# ) as vweight,'0' as orderId 
from xzx_order_clock_in_info a where a.user_id =#userId# and a.vehicle_id=#vehicleId#
 @if(!isEmpty(weightError)){
     AND b.weight-(select c.weight from xzx_user_vehicle_info c where c.id = #vehicleId#)>=#weightError#
 @}
 @if(!isEmpty(startTime)){
          AND a.create_time>=#startTime#
 @}
 @if(!isEmpty(endTime)){
          AND a.create_time<=#endTime#
 @}        
limit #page#, #limit#

queryBatchDetailList

select b.create_time as createtime, b.weight as bweight,(select c.weight from xzx_user_vehicle_info c where c.id = #vehicleId# ) as vweight,
             b.order_id as orderId from xzx_order_batch_info b where b.user_id=#userId# and b.vehicle_id=#vehicleId#
              @if(!isEmpty(weightError)){
                      AND b.weight-(select c.weight from xzx_user_vehicle_info c where c.id = #vehicleId#)>=#weightError#
                  @}
                  @if(!isEmpty(startTime)){
                           AND b.create_time>=#startTime#
                  @}
                  @if(!isEmpty(endTime)){
                           AND b.create_time<=#endTime#
                  @}        
limit #page#, #limit#

queryClockDetailCount

select sum(count) from(
select count(1) as count from xzx_order_batch_info b where b.user_id=#userId# and b.vehicle_id=#vehicleId# 
     @if(!isEmpty(weightError)){
             AND b.weight-(select c.weight from xzx_user_vehicle_info c where c.id = #vehicleId#)>=#weightError#
         @}
         @if(!isEmpty(startTime)){
                  AND b.create_time>=#startTime#
         @}
         @if(!isEmpty(endTime)){
                  AND b.create_time<=#endTime#
         @}
     ) c   

queryBatchDetailCount

select sum(count) from(
select count(1) as count
from xzx_order_clock_in_info a where a.user_id =#userId# and a.vehicle_id=#vehicleId#
 @if(!isEmpty(weightError)){
         AND b.weight-(select c.weight from xzx_user_vehicle_info c where c.id = #vehicleId#)>=#weightError#
     @}
     @if(!isEmpty(startTime)){
              AND a.create_time>=#startTime#
     @}
     @if(!isEmpty(endTime)){
              AND a.create_time<=#endTime#
     @}
     ) c  

queryEmptyWeight

select a.create_time as createtime,a.weight as cweight,(select c.weight from xzx_user_vehicle_info c where c.id = #vehicleId# ) as vweight,'0' as orderId 
    from xzx_order_clock_in_info a where a.user_id =#userId# and a.vehicle_id=#vehicleId#
     @if(!isEmpty(weightError)){
         AND a.weight-(select c.weight from xzx_user_vehicle_info c where c.id = #vehicleId#)>=#weightError#
     @}
     @if(!isEmpty(startTime)){
              AND a.create_time>=#startTime#
     @}
     @if(!isEmpty(endTime)){
              AND a.create_time<=#endTime#
     @}
     LIMIT 1