select *
from applet_appointment
where is_del=0
and users_id=#{users_id}
and appointment_state=#{appointment_state}
order by create_time desc
select *
from applet_appointment
where is_del=0
and users_id=#{users_id}
order by create_time desc
select *
from applet_appointment
where is_del=0
and users_id=#{users_id}
and approach_date=#{approach_date}
order by create_time desc
SELECT *
from applet_appointment
WHERE is_del=0 and users_id=#{users_id} and id IN
#{id}
order by create_time desc
select *
from applet_appointment
where is_del=0
and users_id=#{users_id}
and appointment_state <> 4
and appointment_state < 6
order by create_time desc
limit 1
select *
from applet_appointment
where is_del=0
and (truck_number=#{truck_number} or id_code=#{truck_number})
and appointment_state <> 4
and appointment_state <> 9
and appointment_state < 6
order by create_time desc
limit 1
select *
from applet_appointment
where is_del=0
and (truck_number=#{truck_number} or id_code=#{truck_number})
and appointment_state <> 4
and appointment_state <> 9
and appointment_state < 6
order by create_time desc
limit 1
update applet_appointment
set
cancel_time = #{cancel_time}::timestamp,
appointment_state=4
where id=#{appointment_id}
update applet_appointment_detail
set is_del=1
where id=#{appointment_id}
select *
from applet_appointment
where is_del=0
and users_id=#{users_id}
and appointment_state <= 3
order by create_time desc
limit 1
select
appointment_id
from applet_appointment_detail
where is_del=0
and (ship_name like concat('%',#{keywords},'%') or voy_number like concat('%',#{keywords},'%'))
order by create_time desc
select *
from applet_appointment
where is_del=0
and appointment_state <> 4
and appointment_state < 6
and users_id=#{users_id}
and truck_number=#{truck_number}
order by create_time desc
limit 1
select *
from applet_appointment
where is_del=0
and users_id=#{users_id}
and (truck_number like concat('%',#{keywords},'%') or id_code like concat('%',#{keywords},'%'))
and to_char(approach_date,'YYYY-MM-DD') = #{approach_date}
order by create_time desc