340 lines
12 KiB
XML
340 lines
12 KiB
XML
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
|
<mapper namespace="com.haitongauto.mapper.admin.StatisticsAdminMapper">
|
|
<!--已预约车辆数 -->
|
|
<select id="getAppointmentedCount" resultType="Integer">
|
|
select
|
|
count(*) as count
|
|
from applet_appointment
|
|
where is_del=0
|
|
and appointment_state=1
|
|
<if test="start_time!=null and start_time!=''">
|
|
and applet_appointment.create_time >= #{start_time}::date
|
|
</if>
|
|
<if test="end_time!=null and end_time!=''">
|
|
and applet_appointment.create_time <= #{end_time}::date
|
|
</if>
|
|
<if test=" port_area_id!=null and port_area_id!=''">
|
|
and port_area_id = #{port_area_id}
|
|
</if>
|
|
</select>
|
|
<!--取消约车辆数 -->
|
|
<select id="getAppointmentCancelCount" resultType="Integer">
|
|
select
|
|
count(*) as count
|
|
from applet_appointment
|
|
where is_del=0
|
|
and appointment_state=4
|
|
<if test="start_time!=null and start_time!=''">
|
|
and create_time >= #{start_time}::date
|
|
</if>
|
|
<if test="end_time!=null and end_time!=''">
|
|
and create_time <= #{end_time}::date
|
|
</if>
|
|
<if test=" port_area_id!=null and port_area_id!=''">
|
|
and port_area_id = #{port_area_id}
|
|
</if>
|
|
</select>
|
|
<!--已签到车辆数 -->
|
|
<select id="getAppointmentSignInCount" resultType="Integer">
|
|
select
|
|
count(*) as count
|
|
from applet_appointment
|
|
where is_del=0
|
|
and appointment_state=2
|
|
<if test="start_time!=null and start_time!=''">
|
|
and create_time >= #{start_time}::date
|
|
</if>
|
|
<if test="end_time!=null and end_time!=''">
|
|
and create_time <= #{end_time}::date
|
|
</if>
|
|
<if test=" port_area_id!=null and port_area_id!=''">
|
|
and port_area_id = #{port_area_id}
|
|
</if>
|
|
</select>
|
|
<!--完成打卡车辆数 -->
|
|
<select id="getPunchClockOverCount" resultType="Integer">
|
|
select
|
|
count(*) as count
|
|
from applet_appointment
|
|
where is_del=0
|
|
and appointment_state <> 4
|
|
and appointment_state <> 9
|
|
and appointment_state >=6
|
|
<if test="start_time!=null and start_time!=''">
|
|
and create_time >= #{start_time}::date
|
|
</if>
|
|
<if test="end_time!=null and end_time!=''">
|
|
and create_time <= #{end_time}::date
|
|
</if>
|
|
<if test=" port_area_id!=null and port_area_id!=''">
|
|
and port_area_id = #{port_area_id}
|
|
</if>
|
|
</select>
|
|
<!--已发送指令板车数-->
|
|
<select id="getInstructHavaSendCount" resultType="Integer">
|
|
select
|
|
count(*) as count
|
|
from applet_appointment
|
|
where is_del=0
|
|
and instruct_state =1
|
|
<if test="start_time!=null and start_time!=''">
|
|
and create_time >= #{start_time}::date
|
|
</if>
|
|
<if test="end_time!=null and end_time!=''">
|
|
and create_time <= #{end_time}::date
|
|
</if>
|
|
<if test=" port_area_id!=null and port_area_id!=''">
|
|
and port_area_id = #{port_area_id}
|
|
</if>
|
|
</select>
|
|
<!--外贸出口板车辆数 -->
|
|
<select id="getForeignTradeExportsCount" resultType="Integer">
|
|
select
|
|
count(*) as count
|
|
from applet_appointment
|
|
where is_del=0
|
|
and appointment_state <> 4
|
|
and appointment_state <> 9
|
|
and enter_type ='WE'
|
|
<if test="start_time!=null and start_time!=''">
|
|
and create_time >= #{start_time}::date
|
|
</if>
|
|
<if test="end_time!=null and end_time!=''">
|
|
and create_time <= #{end_time}::date
|
|
</if>
|
|
<if test=" port_area_id!=null and port_area_id!=''">
|
|
and port_area_id = #{port_area_id}
|
|
</if>
|
|
</select>
|
|
<!--外贸进口板车数 -->
|
|
<select id="getForeignTradeImportsCount" resultType="Integer">
|
|
select
|
|
count(*) as count
|
|
from applet_appointment
|
|
where is_del=0
|
|
and appointment_state <> 4
|
|
and appointment_state <> 9
|
|
and enter_type ='WI'
|
|
<if test="start_time!=null and start_time!=''">
|
|
and create_time >= #{start_time}::date
|
|
</if>
|
|
<if test="end_time!=null and end_time!=''">
|
|
and create_time <= #{end_time}::date
|
|
</if>
|
|
<if test=" port_area_id!=null and port_area_id!=''">
|
|
and port_area_id = #{port_area_id}
|
|
</if>
|
|
</select>
|
|
<!--内贸出口板车数 -->
|
|
<select id="getDomesticTradeExportCount" resultType="Integer">
|
|
select
|
|
count(*) as count
|
|
from applet_appointment
|
|
where is_del=0
|
|
and appointment_state <> 4
|
|
and appointment_state <> 9
|
|
and enter_type ='NE'
|
|
<if test="start_time!=null and start_time!=''">
|
|
and create_time >= #{start_time}::date
|
|
</if>
|
|
<if test="end_time!=null and end_time!=''">
|
|
and create_time <= #{end_time}::date
|
|
</if>
|
|
<if test=" port_area_id!=null and port_area_id!=''">
|
|
and port_area_id = #{port_area_id}
|
|
</if>
|
|
</select>
|
|
<!--内贸进口板车数 -->
|
|
<select id="getDomesticImportsExportCount" resultType="Integer">
|
|
select
|
|
count(*) as count
|
|
from applet_appointment
|
|
where is_del=0
|
|
and appointment_state <> 4
|
|
and appointment_state <> 9
|
|
and enter_type ='NI'
|
|
<if test="start_time!=null and start_time!=''">
|
|
and create_time >= #{start_time}::date
|
|
</if>
|
|
<if test="end_time!=null and end_time!=''">
|
|
and create_time <= #{end_time}::date
|
|
</if>
|
|
<if test=" port_area_id!=null and port_area_id!=''">
|
|
and port_area_id = #{port_area_id}
|
|
</if>
|
|
</select>
|
|
|
|
<!--某进道口的辆数 -->
|
|
<select id="getInGateCanalCodeCount" resultType="Integer">
|
|
select
|
|
count(*) as count
|
|
from applet_appointment
|
|
where is_del=0
|
|
and gate_canal_in =#{gate_canal_in}
|
|
<if test="start_time!=null and start_time!=''">
|
|
and create_time >= #{start_time}::date
|
|
</if>
|
|
<if test="end_time!=null and end_time!=''">
|
|
and create_time <= #{end_time}::date
|
|
</if>
|
|
<if test=" port_area_id!=null and port_area_id!=''">
|
|
and port_area_id = #{port_area_id}
|
|
</if>
|
|
</select>
|
|
<!--某出道口的辆数 -->
|
|
<select id="getOutGateCanalCodeCount" resultType="Integer">
|
|
select
|
|
count(*) as count
|
|
from applet_appointment
|
|
where is_del=0
|
|
and gate_canal_out =#{gate_canal_out}
|
|
<if test="start_time!=null and start_time!=''">
|
|
and create_time >= #{start_time}::date
|
|
</if>
|
|
<if test="end_time!=null and end_time!=''">
|
|
and create_time <= #{end_time}::date
|
|
</if>
|
|
<if test=" port_area_id!=null and port_area_id!=''">
|
|
and port_area_id = #{port_area_id}
|
|
</if>
|
|
</select>
|
|
|
|
<!--自动进闸口板车数 -->
|
|
<select id="getConventionalityInGateCount" resultType="Integer">
|
|
select
|
|
count(*) as count
|
|
from applet_appointment
|
|
where is_del=0
|
|
and is_conventionality_in =0
|
|
<if test="start_time!=null and start_time!=''">
|
|
and create_time >= #{start_time}::date
|
|
</if>
|
|
<if test="end_time!=null and end_time!=''">
|
|
and create_time <= #{end_time}::date
|
|
</if>
|
|
<if test=" port_area_id!=null and port_area_id!=''">
|
|
and port_area_id = #{port_area_id}
|
|
</if>
|
|
</select>
|
|
<!--人工抬杆进闸口板车数 -->
|
|
<select id="getUnConventionalityInGateCount" resultType="Integer">
|
|
select
|
|
count(*) as count
|
|
from applet_appointment
|
|
where is_del=0
|
|
and is_conventionality_in =1
|
|
<if test="start_time!=null and start_time!=''">
|
|
and create_time >= #{start_time}::date
|
|
</if>
|
|
<if test="end_time!=null and end_time!=''">
|
|
and create_time <= #{end_time}::date
|
|
</if>
|
|
<if test=" port_area_id!=null and port_area_id!=''">
|
|
and port_area_id = #{port_area_id}
|
|
</if>
|
|
</select>
|
|
<!--待进港通行板车数 (已签到未进港的)-->
|
|
<select id="getWellInGateCount" resultType="Integer">
|
|
select
|
|
count(*) as count
|
|
from applet_appointment
|
|
where is_del=0
|
|
and appointment_state =2
|
|
and appointment_state <> 4
|
|
and appointment_state <> 9
|
|
<if test="start_time!=null and start_time!=''">
|
|
and create_time >= #{start_time}::date
|
|
</if>
|
|
<if test="end_time!=null and end_time!=''">
|
|
and create_time <= #{end_time}::date
|
|
</if>
|
|
<if test=" port_area_id!=null and port_area_id!=''">
|
|
and port_area_id = #{port_area_id}
|
|
</if>
|
|
</select>
|
|
<!--已进港板车数 (已进港但未完成-离港的)-->
|
|
<select id="getHaveInGateCount" resultType="Integer">
|
|
select
|
|
count(*) as count
|
|
from applet_appointment
|
|
where is_del=0
|
|
and appointment_state >=3
|
|
and appointment_state <6
|
|
and appointment_state <> 4
|
|
and appointment_state <> 9
|
|
<if test="start_time!=null and start_time!=''">
|
|
and create_time >= #{start_time}::date
|
|
</if>
|
|
<if test="end_time!=null and end_time!=''">
|
|
and create_time <= #{end_time}::date
|
|
</if>
|
|
<if test=" port_area_id!=null and port_area_id!=''">
|
|
and port_area_id = #{port_area_id}
|
|
</if>
|
|
</select>
|
|
<!--已离港板车数-->
|
|
<select id="getHavaOutGateCount" resultType="Integer">
|
|
select
|
|
count(*) as count
|
|
from applet_appointment
|
|
where is_del=0
|
|
and appointment_state >=6
|
|
and appointment_state <> 4
|
|
and appointment_state <> 9
|
|
<if test="start_time!=null and start_time!=''">
|
|
and create_time >= #{start_time}::date
|
|
</if>
|
|
<if test="end_time!=null and end_time!=''">
|
|
and create_time <= #{end_time}::date
|
|
</if>
|
|
<if test=" port_area_id!=null and port_area_id!=''">
|
|
and port_area_id = #{port_area_id}
|
|
</if>
|
|
</select>
|
|
|
|
|
|
|
|
<select id="AppointmentListForCondition" resultType="com.haitongauto.models.pojo.Appointment">
|
|
select
|
|
applet_appointment.id,
|
|
users_id,
|
|
transport_type,
|
|
truck_number,
|
|
applet_appointment.tel_number,
|
|
head_frame_number,
|
|
vehicle_weight,
|
|
vehicle_frame_weight,
|
|
driving_license,
|
|
approach_date,
|
|
port_area_id,
|
|
pam_id,
|
|
enter_type,
|
|
goods_type,
|
|
goods_Quantity,
|
|
biz_type,
|
|
appointment_state,
|
|
applet_appointment.create_time,
|
|
applet_appointment.update_time,
|
|
applet_appointment.is_del,
|
|
Yard,
|
|
gate_canal_in,
|
|
gate_canal_out,
|
|
instruct_state,
|
|
send_time,
|
|
sender
|
|
from applet_appointment join applet_users on applet_appointment.users_id=applet_users.id
|
|
where applet_appointment.is_del=0
|
|
<if test="pam_id!=null and pam_id!=''" >and pam_id=#{pam_id}</if>
|
|
<if test="keywords!=null and keywords!=''">and (applet_users.users_name like concat('%',#{keywords},'%') or truck_number like concat('%',#{keywords},'%') or applet_appointment.tel_number like concat('%',#{keywords},'%'))</if>
|
|
<if test="start_date!=null and start_date!='' and end_date!=null and end_date!=''">and approach_date >= #{start_date}::date and approach_date <= #{end_date}::date</if>
|
|
<if test="enter_type!=null and enter_type!=''">and enter_type=#{enter_type}</if>
|
|
<if test="appointment_state==0">and appointment_state = 4</if>
|
|
<if test="appointment_state==1">and appointment_state <>4 and appointment_state<>9</if>
|
|
<if test="transport_type!=null and transport_type!=''">and transport_type=#{transport_type}</if>
|
|
order by applet_appointment.create_time desc
|
|
</select>
|
|
|
|
</mapper> |