|
@@ -1,34 +1,34 @@
|
|
|
<?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">
|
|
|
+ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.ruoyi.shipping.mapper.TVoyageMapper">
|
|
|
|
|
|
<resultMap type="TVoyage" id="TVoyageResult">
|
|
|
- <result property="fId" column="f_id" />
|
|
|
- <result property="fPid" column="f_pid" />
|
|
|
- <result property="fNo" column="f_no" />
|
|
|
- <result property="fPortofloadid" column="f_portofloadid" />
|
|
|
- <result property="fPortofdischargeid" column="f_portofdischargeid" />
|
|
|
- <result property="fDistinationid" column="f_distinationid" />
|
|
|
- <result property="fPortoftransshipment" column="f_portoftransshipment" />
|
|
|
- <result property="fEtd" column="f_ETD" />
|
|
|
- <result property="fAtd" column="f_ATD" />
|
|
|
- <result property="fEta" column="f_ETA" />
|
|
|
- <result property="fAta" column="f_ATA" />
|
|
|
- <result property="fDays" column="f_days" />
|
|
|
- <result property="fDucomentrayoffdate" column="f_ducomentrayoffdate" />
|
|
|
- <result property="fCutoffdate" column="f_cutoffdate" />
|
|
|
- <result property="fTeu" column="f_teu" />
|
|
|
- <result property="fManageid" column="f_manageid" />
|
|
|
- <result property="fTel" column="f_tel" />
|
|
|
- <result property="fStatus" column="f_status" />
|
|
|
- <result property="createBy" column="create_by" />
|
|
|
- <result property="createTime" column="create_time" />
|
|
|
- <result property="updateBy" column="update_by" />
|
|
|
- <result property="updateTime" column="update_time" />
|
|
|
- <result property="remark" column="remark" />
|
|
|
- <result property="fLaneid" column="f_laneid" />
|
|
|
+ <result property="fId" column="f_id"/>
|
|
|
+ <result property="fPid" column="f_pid"/>
|
|
|
+ <result property="fNo" column="f_no"/>
|
|
|
+ <result property="fPortofloadid" column="f_portofloadid"/>
|
|
|
+ <result property="fPortofdischargeid" column="f_portofdischargeid"/>
|
|
|
+ <result property="fDistinationid" column="f_distinationid"/>
|
|
|
+ <result property="fPortoftransshipment" column="f_portoftransshipment"/>
|
|
|
+ <result property="fEtd" column="f_ETD"/>
|
|
|
+ <result property="fAtd" column="f_ATD"/>
|
|
|
+ <result property="fEta" column="f_ETA"/>
|
|
|
+ <result property="fAta" column="f_ATA"/>
|
|
|
+ <result property="fDays" column="f_days"/>
|
|
|
+ <result property="fDucomentrayoffdate" column="f_ducomentrayoffdate"/>
|
|
|
+ <result property="fCutoffdate" column="f_cutoffdate"/>
|
|
|
+ <result property="fTeu" column="f_teu"/>
|
|
|
+ <result property="fManageid" column="f_manageid"/>
|
|
|
+ <result property="fTel" column="f_tel"/>
|
|
|
+ <result property="fStatus" column="f_status"/>
|
|
|
+ <result property="createBy" column="create_by"/>
|
|
|
+ <result property="createTime" column="create_time"/>
|
|
|
+ <result property="updateBy" column="update_by"/>
|
|
|
+ <result property="updateTime" column="update_time"/>
|
|
|
+ <result property="remark" column="remark"/>
|
|
|
+ <result property="fLaneid" column="f_laneid"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectTVoyageVo">
|
|
@@ -81,42 +81,46 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
LEFT JOIN t_address td ON tv.f_portofdischargeid = td.f_id
|
|
|
LEFT JOIN t_address tr ON tv.f_distinationid = tr.f_id
|
|
|
LEFT JOIN t_address ts ON tv.f_portoftransshipment = ts.f_id
|
|
|
- LEFT JOIN sys_user su ON tv.f_manageid = su.user_id
|
|
|
+ LEFT JOIN sys_user su ON tv.f_manageid = su.user_id
|
|
|
LEFT JOIN t_address tes ON tv.f_laneid = tes.f_id
|
|
|
<where>
|
|
|
tv.f_status = 'T'
|
|
|
- <if test="fPid != null "> and tv.f_pid = #{fPid}</if>
|
|
|
- <if test="fNo != null and fNo != ''"> and tv.f_no = #{fNo}</if>
|
|
|
- <if test="fPortofloadid != null "> and tv.f_portofloadid = #{fPortofloadid}</if>
|
|
|
- <if test="fPortofdischargeid != null "> and tv.f_portofdischargeid = #{fPortofdischargeid}</if>
|
|
|
- <if test="fDistinationid != null "> and tv.f_distinationid = #{fDistinationid}</if>
|
|
|
- <if test="fPortoftransshipment != null "> and tv.f_portoftransshipment = #{fPortoftransshipment}</if>
|
|
|
- <if test="fPortoftransshipment == null and empty != null"> and tv.f_portoftransshipment IS NULL</if>
|
|
|
- <if test="fEtd != null "> and tv.f_ETD = #{fEtd}</if>
|
|
|
- <if test="fAtd != null "> and tv.f_ATD = #{fAtd}</if>
|
|
|
- <if test="fEta != null "> and tv.f_ETA = #{fEta}</if>
|
|
|
- <if test="fAta != null "> and tv.f_ATA = #{fAta}</if>
|
|
|
- <if test="fDays != null "> and tv.f_days = #{fDays}</if>
|
|
|
- <if test="fDucomentrayoffdate != null "> and tv.f_ducomentrayoffdate = #{fDucomentrayoffdate}</if>
|
|
|
- <if test="fCutoffdate != null "> and tv.f_cutoffdate = #{fCutoffdate}</if>
|
|
|
- <if test="fTeu != null and fTeu != ''"> and tv.f_teu = #{fTeu}</if>
|
|
|
- <if test="fManageid != null "> and tv.f_manageid = #{fManageid}</if>
|
|
|
- <if test="fTel != null and fTel != ''"> and tv.f_tel = #{fTel}</if>
|
|
|
- <if test="fStatus != null and fStatus != ''"> and tv.f_status = #{fStatus}</if>
|
|
|
+ <if test="fPid != null ">and tv.f_pid = #{fPid}</if>
|
|
|
+ <if test="fNo != null and fNo != ''">and tv.f_no = #{fNo}</if>
|
|
|
+ <if test="fPortofloadid != null ">and tv.f_portofloadid = #{fPortofloadid}</if>
|
|
|
+ <if test="fPortofdischargeid != null ">and tv.f_portofdischargeid = #{fPortofdischargeid}</if>
|
|
|
+ <if test="fDistinationid != null ">and tv.f_distinationid = #{fDistinationid}</if>
|
|
|
+ <if test="fPortoftransshipment != null ">and tv.f_portoftransshipment = #{fPortoftransshipment}</if>
|
|
|
+ <if test="fPortoftransshipment == null and empty != null">and tv.f_portoftransshipment IS NULL</if>
|
|
|
+ <if test="fEtd != null ">and tv.f_ETD = #{fEtd}</if>
|
|
|
+ <if test="fAtd != null ">and tv.f_ATD = #{fAtd}</if>
|
|
|
+ <if test="fEta != null ">and tv.f_ETA = #{fEta}</if>
|
|
|
+ <if test="fAta != null ">and tv.f_ATA = #{fAta}</if>
|
|
|
+ <if test="fDays != null ">and tv.f_days = #{fDays}</if>
|
|
|
+ <if test="fDucomentrayoffdate != null ">and tv.f_ducomentrayoffdate = #{fDucomentrayoffdate}</if>
|
|
|
+ <if test="fCutoffdate != null ">and tv.f_cutoffdate = #{fCutoffdate}</if>
|
|
|
+ <if test="fTeu != null and fTeu != ''">and tv.f_teu = #{fTeu}</if>
|
|
|
+ <if test="fManageid != null ">and tv.f_manageid = #{fManageid}</if>
|
|
|
+ <if test="fTel != null and fTel != ''">and tv.f_tel = #{fTel}</if>
|
|
|
+ <if test="fStatus != null and fStatus != ''">and tv.f_status = #{fStatus}</if>
|
|
|
<if test="createBy != null and createBy != ''">and tv.create_by like concat('%', #{createBy}, '%')</if>
|
|
|
<if test="remark != null and remark != ''">and tv.remark like concat('%', #{remark}, '%')</if>
|
|
|
- <if test="pidName != null and pidName != ''"> and te.f_name = #{pidName}</if>
|
|
|
- <if test="portofloadidName != null and portofloadidName != ''"> and ta.f_name = #{portofloadidName}</if>
|
|
|
- <if test="portofdischargeidName != null and portofdischargeidName != ''"> and td.f_name = #{portofdischargeidName}</if>
|
|
|
- <if test="distinationidName != null and distinationidName != ''"> and tr.f_name = #{distinationidName}</if>
|
|
|
- <if test="portoftransshipmentName != null and portoftransshipmentName != ''"> and ts.f_name = #{portoftransshipmentName}</if>
|
|
|
+ <if test="pidName != null and pidName != ''">and te.f_name = #{pidName}</if>
|
|
|
+ <if test="portofloadidName != null and portofloadidName != ''">and ta.f_name = #{portofloadidName}</if>
|
|
|
+ <if test="portofdischargeidName != null and portofdischargeidName != ''">and td.f_name =
|
|
|
+ #{portofdischargeidName}
|
|
|
+ </if>
|
|
|
+ <if test="distinationidName != null and distinationidName != ''">and tr.f_name = #{distinationidName}</if>
|
|
|
+ <if test="portoftransshipmentName != null and portoftransshipmentName != ''">and ts.f_name =
|
|
|
+ #{portoftransshipmentName}
|
|
|
+ </if>
|
|
|
<if test='cLoadDate != null and cLoadDate[0] != null and cLoadDate[0]!= ""'>
|
|
|
and tv.create_time >= #{cLoadDate[0]}
|
|
|
</if>
|
|
|
<if test='cLoadDate != null and cLoadDate[1] != null and cLoadDate[1]!= ""'>
|
|
|
and tv.create_time <= #{cLoadDate[1]}
|
|
|
</if>
|
|
|
- <if test="fLaneid != null "> and f_laneid = #{fLaneid}</if>
|
|
|
+ <if test="fLaneid != null ">and f_laneid = #{fLaneid}</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
<select id="selectMessage" parameterType="TVoyage" resultMap="TVoyageResult">
|
|
@@ -163,44 +167,48 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
LEFT JOIN t_address td ON tv.f_portofdischargeid = td.f_id
|
|
|
LEFT JOIN t_address tr ON tv.f_distinationid = tr.f_id
|
|
|
LEFT JOIN t_address ts ON tv.f_portoftransshipment = ts.f_id
|
|
|
- LEFT JOIN sys_user su ON tv.f_manageid = su.user_id
|
|
|
+ LEFT JOIN sys_user su ON tv.f_manageid = su.user_id
|
|
|
<where>
|
|
|
tv.f_status = 'T'
|
|
|
AND (date(tv.f_ATD) >= DATE_SUB(CURDATE(), INTERVAL 2 DAY)
|
|
|
OR tv.f_ATD IS NULL)
|
|
|
- <if test="fId != null "> and tv.f_id = #{fId}</if>
|
|
|
- <if test="fPid != null "> and tv.f_pid = #{fPid}</if>
|
|
|
- <if test="fNo != null and fNo != ''"> and tv.f_no = #{fNo}</if>
|
|
|
- <if test="fPortofloadid != null "> and tv.f_portofloadid = #{fPortofloadid}</if>
|
|
|
- <if test="fPortofdischargeid != null "> and tv.f_portofdischargeid = #{fPortofdischargeid}</if>
|
|
|
- <if test="fDistinationid != null "> and tv.f_distinationid = #{fDistinationid}</if>
|
|
|
- <if test="fPortoftransshipment != null "> and tv.f_portoftransshipment = #{fPortoftransshipment}</if>
|
|
|
- <if test="fPortoftransshipment == null and empty != null"> and tv.f_portoftransshipment IS NULL</if>
|
|
|
- <if test="fEtd != null "> and tv.f_ETD = #{fEtd}</if>
|
|
|
- <if test="fAtd != null "> and tv.f_ATD = #{fAtd}</if>
|
|
|
- <if test="fEta != null "> and tv.f_ETA = #{fEta}</if>
|
|
|
- <if test="fAta != null "> and tv.f_ATA = #{fAta}</if>
|
|
|
- <if test="fDays != null "> and tv.f_days = #{fDays}</if>
|
|
|
- <if test="fDucomentrayoffdate != null "> and tv.f_ducomentrayoffdate = #{fDucomentrayoffdate}</if>
|
|
|
- <if test="fCutoffdate != null "> and tv.f_cutoffdate = #{fCutoffdate}</if>
|
|
|
- <if test="fTeu != null and fTeu != ''"> and tv.f_teu = #{fTeu}</if>
|
|
|
- <if test="fManageid != null "> and tv.f_manageid = #{fManageid}</if>
|
|
|
- <if test="fTel != null and fTel != ''"> and tv.f_tel = #{fTel}</if>
|
|
|
- <if test="fStatus != null and fStatus != ''"> and tv.f_status = #{fStatus}</if>
|
|
|
+ <if test="fId != null ">and tv.f_id = #{fId}</if>
|
|
|
+ <if test="fPid != null ">and tv.f_pid = #{fPid}</if>
|
|
|
+ <if test="fNo != null and fNo != ''">and tv.f_no = #{fNo}</if>
|
|
|
+ <if test="fPortofloadid != null ">and tv.f_portofloadid = #{fPortofloadid}</if>
|
|
|
+ <if test="fPortofdischargeid != null ">and tv.f_portofdischargeid = #{fPortofdischargeid}</if>
|
|
|
+ <if test="fDistinationid != null ">and tv.f_distinationid = #{fDistinationid}</if>
|
|
|
+ <if test="fPortoftransshipment != null ">and tv.f_portoftransshipment = #{fPortoftransshipment}</if>
|
|
|
+ <if test="fPortoftransshipment == null and empty != null">and tv.f_portoftransshipment IS NULL</if>
|
|
|
+ <if test="fEtd != null ">and tv.f_ETD = #{fEtd}</if>
|
|
|
+ <if test="fAtd != null ">and tv.f_ATD = #{fAtd}</if>
|
|
|
+ <if test="fEta != null ">and tv.f_ETA = #{fEta}</if>
|
|
|
+ <if test="fAta != null ">and tv.f_ATA = #{fAta}</if>
|
|
|
+ <if test="fDays != null ">and tv.f_days = #{fDays}</if>
|
|
|
+ <if test="fDucomentrayoffdate != null ">and tv.f_ducomentrayoffdate = #{fDucomentrayoffdate}</if>
|
|
|
+ <if test="fCutoffdate != null ">and tv.f_cutoffdate = #{fCutoffdate}</if>
|
|
|
+ <if test="fTeu != null and fTeu != ''">and tv.f_teu = #{fTeu}</if>
|
|
|
+ <if test="fManageid != null ">and tv.f_manageid = #{fManageid}</if>
|
|
|
+ <if test="fTel != null and fTel != ''">and tv.f_tel = #{fTel}</if>
|
|
|
+ <if test="fStatus != null and fStatus != ''">and tv.f_status = #{fStatus}</if>
|
|
|
<if test="createBy != null and createBy != ''">and tv.create_by like concat('%', #{createBy}, '%')</if>
|
|
|
<if test="remark != null and remark != ''">and tv.remark like concat('%', #{remark}, '%')</if>
|
|
|
- <if test="pidName != null and pidName != ''"> and te.f_name = #{pidName}</if>
|
|
|
- <if test="portofloadidName != null and portofloadidName != ''"> and ta.f_name = #{portofloadidName}</if>
|
|
|
- <if test="portofdischargeidName != null and portofdischargeidName != ''"> and td.f_name = #{portofdischargeidName}</if>
|
|
|
- <if test="distinationidName != null and distinationidName != ''"> and tr.f_name = #{distinationidName}</if>
|
|
|
- <if test="portoftransshipmentName != null and portoftransshipmentName != ''"> and ts.f_name = #{portoftransshipmentName}</if>
|
|
|
+ <if test="pidName != null and pidName != ''">and te.f_name = #{pidName}</if>
|
|
|
+ <if test="portofloadidName != null and portofloadidName != ''">and ta.f_name = #{portofloadidName}</if>
|
|
|
+ <if test="portofdischargeidName != null and portofdischargeidName != ''">and td.f_name =
|
|
|
+ #{portofdischargeidName}
|
|
|
+ </if>
|
|
|
+ <if test="distinationidName != null and distinationidName != ''">and tr.f_name = #{distinationidName}</if>
|
|
|
+ <if test="portoftransshipmentName != null and portoftransshipmentName != ''">and ts.f_name =
|
|
|
+ #{portoftransshipmentName}
|
|
|
+ </if>
|
|
|
<if test='cLoadDate != null and cLoadDate[0] != null and cLoadDate[0]!= ""'>
|
|
|
and tv.create_time >= #{cLoadDate[0]}
|
|
|
</if>
|
|
|
<if test='cLoadDate != null and cLoadDate[1] != null and cLoadDate[1]!= ""'>
|
|
|
and tv.create_time <= #{cLoadDate[1]}
|
|
|
</if>
|
|
|
- <if test="fLaneid != null "> and f_laneid = #{fLaneid}</if>
|
|
|
+ <if test="fLaneid != null ">and f_laneid = #{fLaneid}</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
<select id="selectTVoyageListNew" parameterType="TVoyage" resultMap="TVoyageResult">
|
|
@@ -247,43 +255,47 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
LEFT JOIN t_address td ON tv.f_portofdischargeid = td.f_id
|
|
|
LEFT JOIN t_address tr ON tv.f_distinationid = tr.f_id
|
|
|
LEFT JOIN t_address ts ON tv.f_portoftransshipment = ts.f_id
|
|
|
- LEFT JOIN sys_user su ON tv.f_manageid = su.user_id
|
|
|
+ LEFT JOIN sys_user su ON tv.f_manageid = su.user_id
|
|
|
<where>
|
|
|
tv.f_status = 'T'
|
|
|
AND (date(tv.f_ATD) >= DATE_SUB(CURDATE(), INTERVAL 2 DAY)
|
|
|
OR tv.f_ATD IS NULL)
|
|
|
- <if test="fPid != null "> and tv.f_pid = #{fPid}</if>
|
|
|
- <if test="fNo != null and fNo != ''"> and tv.f_no = #{fNo}</if>
|
|
|
- <if test="fPortofloadid != null "> and tv.f_portofloadid = #{fPortofloadid}</if>
|
|
|
- <if test="fPortofdischargeid != null "> and tv.f_portofdischargeid = #{fPortofdischargeid}</if>
|
|
|
- <if test="fDistinationid != null "> and tv.f_distinationid = #{fDistinationid}</if>
|
|
|
- <if test="fPortoftransshipment != null "> and tv.f_portoftransshipment = #{fPortoftransshipment}</if>
|
|
|
- <if test="fPortoftransshipment == null and empty != null"> and tv.f_portoftransshipment IS NULL</if>
|
|
|
- <if test="fEtd != null "> and tv.f_ETD = #{fEtd}</if>
|
|
|
- <if test="fAtd != null "> and tv.f_ATD = #{fAtd}</if>
|
|
|
- <if test="fEta != null "> and tv.f_ETA = #{fEta}</if>
|
|
|
- <if test="fAta != null "> and tv.f_ATA = #{fAta}</if>
|
|
|
- <if test="fDays != null "> and tv.f_days = #{fDays}</if>
|
|
|
- <if test="fDucomentrayoffdate != null "> and tv.f_ducomentrayoffdate = #{fDucomentrayoffdate}</if>
|
|
|
- <if test="fCutoffdate != null "> and tv.f_cutoffdate = #{fCutoffdate}</if>
|
|
|
- <if test="fTeu != null and fTeu != ''"> and tv.f_teu = #{fTeu}</if>
|
|
|
- <if test="fManageid != null "> and tv.f_manageid = #{fManageid}</if>
|
|
|
- <if test="fTel != null and fTel != ''"> and tv.f_tel = #{fTel}</if>
|
|
|
- <if test="fStatus != null and fStatus != ''"> and tv.f_status = #{fStatus}</if>
|
|
|
+ <if test="fPid != null ">and tv.f_pid = #{fPid}</if>
|
|
|
+ <if test="fNo != null and fNo != ''">and tv.f_no = #{fNo}</if>
|
|
|
+ <if test="fPortofloadid != null ">and tv.f_portofloadid = #{fPortofloadid}</if>
|
|
|
+ <if test="fPortofdischargeid != null ">and tv.f_portofdischargeid = #{fPortofdischargeid}</if>
|
|
|
+ <if test="fDistinationid != null ">and tv.f_distinationid = #{fDistinationid}</if>
|
|
|
+ <if test="fPortoftransshipment != null ">and tv.f_portoftransshipment = #{fPortoftransshipment}</if>
|
|
|
+ <if test="fPortoftransshipment == null and empty != null">and tv.f_portoftransshipment IS NULL</if>
|
|
|
+ <if test="fEtd != null ">and tv.f_ETD = #{fEtd}</if>
|
|
|
+ <if test="fAtd != null ">and tv.f_ATD = #{fAtd}</if>
|
|
|
+ <if test="fEta != null ">and tv.f_ETA = #{fEta}</if>
|
|
|
+ <if test="fAta != null ">and tv.f_ATA = #{fAta}</if>
|
|
|
+ <if test="fDays != null ">and tv.f_days = #{fDays}</if>
|
|
|
+ <if test="fDucomentrayoffdate != null ">and tv.f_ducomentrayoffdate = #{fDucomentrayoffdate}</if>
|
|
|
+ <if test="fCutoffdate != null ">and tv.f_cutoffdate = #{fCutoffdate}</if>
|
|
|
+ <if test="fTeu != null and fTeu != ''">and tv.f_teu = #{fTeu}</if>
|
|
|
+ <if test="fManageid != null ">and tv.f_manageid = #{fManageid}</if>
|
|
|
+ <if test="fTel != null and fTel != ''">and tv.f_tel = #{fTel}</if>
|
|
|
+ <if test="fStatus != null and fStatus != ''">and tv.f_status = #{fStatus}</if>
|
|
|
<if test="createBy != null and createBy != ''">and tv.create_by like concat('%', #{createBy}, '%')</if>
|
|
|
<if test="remark != null and remark != ''">and tv.remark like concat('%', #{remark}, '%')</if>
|
|
|
- <if test="pidName != null and pidName != ''"> and te.f_name = #{pidName}</if>
|
|
|
- <if test="portofloadidName != null and portofloadidName != ''"> and ta.f_name = #{portofloadidName}</if>
|
|
|
- <if test="portofdischargeidName != null and portofdischargeidName != ''"> and td.f_name = #{portofdischargeidName}</if>
|
|
|
- <if test="distinationidName != null and distinationidName != ''"> and tr.f_name = #{distinationidName}</if>
|
|
|
- <if test="portoftransshipmentName != null and portoftransshipmentName != ''"> and ts.f_name = #{portoftransshipmentName}</if>
|
|
|
+ <if test="pidName != null and pidName != ''">and te.f_name = #{pidName}</if>
|
|
|
+ <if test="portofloadidName != null and portofloadidName != ''">and ta.f_name = #{portofloadidName}</if>
|
|
|
+ <if test="portofdischargeidName != null and portofdischargeidName != ''">and td.f_name =
|
|
|
+ #{portofdischargeidName}
|
|
|
+ </if>
|
|
|
+ <if test="distinationidName != null and distinationidName != ''">and tr.f_name = #{distinationidName}</if>
|
|
|
+ <if test="portoftransshipmentName != null and portoftransshipmentName != ''">and ts.f_name =
|
|
|
+ #{portoftransshipmentName}
|
|
|
+ </if>
|
|
|
<if test='cLoadDate != null and cLoadDate[0] != null and cLoadDate[0]!= ""'>
|
|
|
and tv.create_time >= #{cLoadDate[0]}
|
|
|
</if>
|
|
|
<if test='cLoadDate != null and cLoadDate[1] != null and cLoadDate[1]!= ""'>
|
|
|
and tv.create_time <= #{cLoadDate[1]}
|
|
|
</if>
|
|
|
- <if test="fLaneid != null "> and f_laneid = #{fLaneid}</if>
|
|
|
+ <if test="fLaneid != null ">and f_laneid = #{fLaneid}</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
@@ -361,7 +373,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="updateTime != null">update_time,</if>
|
|
|
<if test="remark != null">remark,</if>
|
|
|
<if test="fLaneid != null">f_laneid,</if>
|
|
|
- </trim>
|
|
|
+ </trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="fPid != null">#{fPid},</if>
|
|
|
<if test="fNo != null and fNo != ''">#{fNo},</if>
|
|
@@ -386,7 +398,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
|
<if test="remark != null">#{remark},</if>
|
|
|
<if test="fLaneid != null">#{fLaneid},</if>
|
|
|
- </trim>
|
|
|
+ </trim>
|
|
|
</insert>
|
|
|
|
|
|
<update id="updateTVoyage" parameterType="TVoyage">
|
|
@@ -440,32 +452,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
WHERE
|
|
|
f_no = #{fNo}
|
|
|
</select>
|
|
|
- <select id="selectTVoyagefNumber" resultType="map">
|
|
|
+ <select id="selectTVoyagefNumber" resultType="map">
|
|
|
SELECT
|
|
|
- f_id fId,
|
|
|
- f_no fNo
|
|
|
+ f_id fId,
|
|
|
+ f_no fNo
|
|
|
FROM
|
|
|
- t_voyage
|
|
|
+ t_voyage
|
|
|
WHERE
|
|
|
- f_status = 'T'
|
|
|
- <if test="fPid != null "> and f_pid = #{fPid}</if>
|
|
|
- <if test="fNo != null and fNo != ''"> and f_no = #{fNo}</if>
|
|
|
- <if test="fPortofloadid != null "> and f_portofloadid = #{fPortofloadid}</if>
|
|
|
- <if test="fPortofdischargeid != null "> and f_portofdischargeid = #{fPortofdischargeid}</if>
|
|
|
- <if test="fDistinationid != null "> and f_distinationid = #{fDistinationid}</if>
|
|
|
- <if test="fPortoftransshipment != null "> and f_portoftransshipment = #{fPortoftransshipment}</if>
|
|
|
- <if test="fEtd != null "> and f_ETD = #{fEtd}</if>
|
|
|
- <if test="fAtd != null "> and f_ATD = #{fAtd}</if>
|
|
|
- <if test="fEta != null "> and f_ETA = #{fEta}</if>
|
|
|
- <if test="fAta != null "> and f_ATA = #{fAta}</if>
|
|
|
- <if test="fDays != null "> and f_days = #{fDays}</if>
|
|
|
- <if test="fDucomentrayoffdate != null "> and f_ducomentrayoffdate = #{fDucomentrayoffdate}</if>
|
|
|
- <if test="fCutoffdate != null "> and f_cutoffdate = #{fCutoffdate}</if>
|
|
|
- <if test="fTeu != null and fTeu != ''"> and f_teu = #{fTeu}</if>
|
|
|
- <if test="fManageid != null "> and f_manageid = #{fManageid}</if>
|
|
|
- <if test="fTel != null and fTel != ''"> and f_tel = #{fTel}</if>
|
|
|
- <if test="fStatus != null and fStatus != ''"> and f_status = #{fStatus}</if>
|
|
|
- <if test="fLaneid != null "> and f_laneid = #{fLaneid}</if>
|
|
|
+ f_status = 'T'
|
|
|
+ <if test="fPid != null ">and f_pid = #{fPid}</if>
|
|
|
+ <if test="fNo != null and fNo != ''">and f_no = #{fNo}</if>
|
|
|
+ <if test="fPortofloadid != null ">and f_portofloadid = #{fPortofloadid}</if>
|
|
|
+ <if test="fPortofdischargeid != null ">and f_portofdischargeid = #{fPortofdischargeid}</if>
|
|
|
+ <if test="fDistinationid != null ">and f_distinationid = #{fDistinationid}</if>
|
|
|
+ <if test="fPortoftransshipment != null ">and f_portoftransshipment = #{fPortoftransshipment}</if>
|
|
|
+ <if test="fEtd != null ">and f_ETD = #{fEtd}</if>
|
|
|
+ <if test="fAtd != null ">and f_ATD = #{fAtd}</if>
|
|
|
+ <if test="fEta != null ">and f_ETA = #{fEta}</if>
|
|
|
+ <if test="fAta != null ">and f_ATA = #{fAta}</if>
|
|
|
+ <if test="fDays != null ">and f_days = #{fDays}</if>
|
|
|
+ <if test="fDucomentrayoffdate != null ">and f_ducomentrayoffdate = #{fDucomentrayoffdate}</if>
|
|
|
+ <if test="fCutoffdate != null ">and f_cutoffdate = #{fCutoffdate}</if>
|
|
|
+ <if test="fTeu != null and fTeu != ''">and f_teu = #{fTeu}</if>
|
|
|
+ <if test="fManageid != null ">and f_manageid = #{fManageid}</if>
|
|
|
+ <if test="fTel != null and fTel != ''">and f_tel = #{fTel}</if>
|
|
|
+ <if test="fStatus != null and fStatus != ''">and f_status = #{fStatus}</if>
|
|
|
+ <if test="fLaneid != null ">and f_laneid = #{fLaneid}</if>
|
|
|
</select>
|
|
|
<!--查询航次信息是否重复-->
|
|
|
<select id="selectTVoyageMessage" parameterType="Long" resultMap="TVoyageResult">
|
|
@@ -474,8 +486,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
and f_portofloadid = #{fPortofloadid}
|
|
|
and f_distinationid = #{fDistinationid}
|
|
|
and f_ETD = #{fEtd}
|
|
|
- <if test="fPortoftransshipment != null "> and f_portoftransshipment = #{fPortoftransshipment}</if>
|
|
|
- <if test="fPortoftransshipment == null "> and f_portoftransshipment IS NULL</if>
|
|
|
+ <if test="fPortoftransshipment != null ">and f_portoftransshipment = #{fPortoftransshipment}</if>
|
|
|
+ <if test="fPortoftransshipment == null ">and f_portoftransshipment IS NULL</if>
|
|
|
</select>
|
|
|
<select id="selectTVoyageIds" parameterType="TVoyage" resultType="long">
|
|
|
SELECT
|
|
@@ -486,10 +498,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
tv.f_status = 'T'
|
|
|
AND (date(tv.f_ATD) >= DATE_SUB(CURDATE(), INTERVAL 2 DAY)
|
|
|
OR tv.f_ATD IS NULL)
|
|
|
- <if test="fPortofloadid != null "> and tv.f_portofloadid = #{fPortofloadid}</if>
|
|
|
- <if test="fDistinationid != null "> and tv.f_distinationid = #{fDistinationid}</if>
|
|
|
- <if test="fPortoftransshipment != null "> and tv.f_portoftransshipment = #{fPortoftransshipment}</if>
|
|
|
- <if test="fPortoftransshipment == null"> and tv.f_portoftransshipment IS NULL</if>
|
|
|
+ <if test="fPortofloadid != null ">and tv.f_portofloadid = #{fPortofloadid}</if>
|
|
|
+ <if test="fDistinationid != null ">and tv.f_distinationid = #{fDistinationid}</if>
|
|
|
+ <if test="fPortoftransshipment != null ">and tv.f_portoftransshipment = #{fPortoftransshipment}</if>
|
|
|
+ <if test="fPortoftransshipment == null">and tv.f_portoftransshipment IS NULL</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
<select id="selectTVoyageByFid" parameterType="TVoyage" resultMap="TVoyageResult">
|
|
@@ -560,5 +572,68 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
AND tv.f_id = #{fId}
|
|
|
</where>
|
|
|
</select>
|
|
|
+ <select id="shipDynamic" resultType="map">
|
|
|
+ SELECT
|
|
|
+ta.fName fName, /*船名*/
|
|
|
+ta.fNo fNo,/*航次*/
|
|
|
+ta.portofloadName portofloadName,/*起运港*/
|
|
|
+ta.distinationName distinationName,/*目的港*/
|
|
|
+IFNULL(ta.fWeight,0) fWeight,/*容量*/
|
|
|
+IFNULL(tb.boxNumber,0) boxNumber,/*实际容量*/
|
|
|
+ta.fETD fETD,/*预计开船*/
|
|
|
+ta.fETA fETA,/*预计到港*/
|
|
|
+ta.fATD fATD,/*实际开船*/
|
|
|
+ta.fATA fATA,/*实际到港*/
|
|
|
+ta.fDays fDays/*航程*/
|
|
|
+FROM
|
|
|
+(
|
|
|
+SELECT
|
|
|
+tv.f_name fName, /*船名*/
|
|
|
+ty.f_no fNo,/*航次*/
|
|
|
+ta.f_name portofloadName,/*起运港*/
|
|
|
+tr.f_name distinationName,/*目的港*/
|
|
|
+tv.f_weight fWeight,/*容量*/
|
|
|
+ty.f_ETD fETD,/*预计开船*/
|
|
|
+ty.f_ETA fETA,/*预计到港*/
|
|
|
+ty.f_ATD fATD,/*实际开船*/
|
|
|
+ty.f_ATA fATA,/*实际到港*/
|
|
|
+ty.f_days fDays,/*航程*/
|
|
|
+ty.f_id voyid,/*航线ID*/
|
|
|
+tv.f_id vslid/*航ID*/
|
|
|
+FROM
|
|
|
+t_voyage ty
|
|
|
+LEFT JOIN t_vessel tv ON ty.f_pid = tv.f_id
|
|
|
+LEFT JOIN t_address ta ON ty.f_portofloadid = ta.f_id
|
|
|
+LEFT JOIN t_address tr ON ty.f_distinationid = tr.f_id
|
|
|
+)ta
|
|
|
+LEFT JOIN
|
|
|
+(
|
|
|
+SELECT
|
|
|
+tc.vesselName,
|
|
|
+tc.voyageName,
|
|
|
+SUM(tc.boxNumber)boxNumber
|
|
|
+FROM
|
|
|
+(
|
|
|
+SELECT
|
|
|
+tc.f_cntrno fCntrno,
|
|
|
+tr.f_no fNo,
|
|
|
+tw.f_vslid vesselName,
|
|
|
+tw.f_voyid voyageName,
|
|
|
+CASE
|
|
|
+ WHEN SUBSTR(tr.f_no,1,2) = '20' THEN 1
|
|
|
+ WHEN SUBSTR(tr.f_no,1,2) ='40' THEN 2
|
|
|
+ ELSE 0
|
|
|
+ END AS boxNumber
|
|
|
+FROM
|
|
|
+t_warehousebills_cntritems tc
|
|
|
+LEFT JOIN t_cntrno tn ON tn.f_no = tc.f_cntrno
|
|
|
+LEFT JOIN t_cntr tr ON tn.f_typeid = tr.f_id
|
|
|
+LEFT JOIN t_warehousebills tw ON tw.f_id = tc.f_pid
|
|
|
+WHERE tr.f_no IS NOT NULL
|
|
|
+)tc
|
|
|
+GROUP BY tc.vesselName,tc.voyageName
|
|
|
+)tb
|
|
|
+ON ta.voyid = tb.voyageName AND ta.vslid = tb.vesselName
|
|
|
+ </select>
|
|
|
|
|
|
</mapper>
|