`id`,`tenant_id`,`parent_tenant_id`,`vendor_type`,`cmd_type`,`create_date`,`update_date`,`cmd_json`
where 1 = 1
and `id` = #{id}
and `tenant_id` = #{tenantId}
and `parent_tenant_id` = #{parentTenantId}
and `vendor_type` = #{vendorType}
and `cmd_type` = #{cmdType}
and `create_date` = #{createDate}
and `update_date` = #{updateDate}
and `cmd_json` like concat('%', #{cmdJson},'%')
and id in
#{idItem}
order by ${sortColumns}
select from wx_car_cmd_log where id = #{id} and tenant_id = #{tenantId}
delete from wx_car_cmd_log where id = #{id} and tenant_id = #{tenantId}
select
from wx_car_cmd_log
select count(c.id) carcount,c.create_date from (
select id,DATE_FORMAT(create_date,'%Y-%m-%d') create_date
from wx_car_cmd_log where cmd_type=#{cmdType}
and `tenant_id` = #{tenantId}
and `parent_tenant_id` = #{parentTenantId}
and create_date BETWEEN #{startdate} and #{enddate}
) c
group by c.create_date
select count(id)
from wx_car_cmd_log
where cmd_type in
#{cmdTypeItem}
and `tenant_id` = #{tenantId}
and `parent_tenant_id` = #{parentTenantId}
and create_date BETWEEN #{startdate} and #{enddate}
select DATE_FORMAT(DATE_ADD(create_date,INTERVAL 1 HOUR),'%H:00') create_time,count(id) carcount
from wx_car_cmd_log where cmd_type in
#{cmdTypeItem}
and `tenant_id` = #{tenantId}
and `parent_tenant_id` = #{parentTenantId}
and create_date BETWEEN #{startdate} and #{enddate}
group by create_time order by create_time
select sum(CONVERT(JSON_EXTRACT(cmd_json,'$.fee'), Decimal(16,2))) fee
from wx_car_cmd_log
where cmd_type in
#{cmdTypeItem}
and `tenant_id` = #{tenantId}
and `parent_tenant_id` = #{parentTenantId}
and REPLACE (JSON_EXTRACT(cmd_json,'$.time'),'"','') BETWEEN #{startdate} and #{enddate}
select sum(fee) fee,c.create_time from (
select id,DATE_FORMAT(create_date,'%m/%d') create_time,CONVERT(JSON_EXTRACT(cmd_json,'$.fee'), Decimal(16,2)) fee
from (
SELECT * from wx_car_cmd_log${tenantEntity.shardTableSuffix}
) wx_car_cmd_log where cmd_type=#{cmdType}
and `tenant_id` = #{tenantId}
and `parent_tenant_id` = #{parentTenantId}
and REPLACE (JSON_EXTRACT(cmd_json,'$.time'),'"','') BETWEEN #{startdate} and #{enddate}
) c group by c.create_time order by c.create_time
select DATE_FORMAT(create_date,'%Y-%m-%d') xTime, count(id) triggerCount
from wx_car_cmd_log
where cmd_type in
#{cmdTypeItem}
and `tenant_id` = #{tenantId}
and `parent_tenant_id` = #{parentTenantId}
and create_date BETWEEN #{startTime} and #{endTime}
group by xTime
select `tenant_id`,`parent_tenant_id` from wx_car_cmd_log
where cmd_type = #{cmdType} and syn_id = #{synId}
and plateNumber = #{plateNumber}
select *
from wx_car_cmd_log
where 1=1
and `tenant_id` = #{tenantId}
and `parent_tenant_id` = #{parentTenantId}
and `cmd_type` = #{cmdType}
and `plateNumber` = #{plateNumber}
and `order_id` = #{orderId}
and JSON_EXTRACT(cmd_json,'$.fee') = #{fee}
and TIMESTAMPDIFF(MINUTE, `fee_time`, #{feeTime}) <= 15
select *
from wx_car_cmd_log
where 1=1
and `tenant_id` = #{tenantId}
and `parent_tenant_id` = #{parentTenantId}
and plateNumber = #{plateNumber}
and cmd_type = #{cmdType}
and syn_id = #{synId}
limit 1