Browse Source

凯和航次信息查询修改

lazhaoqian 4 years ago
parent
commit
a52049c662

+ 7 - 0
ruoyi-shipping/src/main/java/com/ruoyi/shipping/mapper/TVoyageMapper.java

@@ -28,6 +28,13 @@ public interface TVoyageMapper
      * @return 航次集合
      */
     public List<TVoyage> selectTVoyageList(TVoyage tVoyage);
+    /**
+     * 查询航次列表
+     *
+     * @param tVoyage 航次
+     * @return 航次集合
+     */
+    public List<TVoyage> selectTVoyageListNew(TVoyage tVoyage);
 
     /**
      * 新增航次

+ 2 - 2
ruoyi-shipping/src/main/java/com/ruoyi/shipping/service/impl/TVoyageServiceImpl.java

@@ -57,7 +57,7 @@ public class TVoyageServiceImpl implements ITVoyageService
 
     @Override
     public List<TVoyage> freightList(TVoyage tVoyage) {
-        List<TVoyage> tVoyages = tVoyageMapper.selectTVoyageList(tVoyage);
+        List<TVoyage> tVoyages = tVoyageMapper.selectTVoyageListNew(tVoyage);
         if (CollectionUtils.isNotEmpty(tVoyages)){
             for (TVoyage voyage : tVoyages) {
                 voyage.setTwenty(tCtnpriceItemsMapper.selectMoney(voyage.getfPortofloadid(), voyage.getfDistinationid(), "20GP"));
@@ -82,7 +82,7 @@ public class TVoyageServiceImpl implements ITVoyageService
 
     @Override
     public List<TVoyage> freightselect(TVoyage tVoyage) {
-        List<TVoyage> tVoyages = tVoyageMapper.selectTVoyageList(tVoyage);
+        List<TVoyage> tVoyages = tVoyageMapper.selectTVoyageListNew(tVoyage);
         List<TVoyage> tVoyagesList = new ArrayList<>();
         Long fPortoftransshipment = null;
         if (CollectionUtils.isNotEmpty(tVoyages)){

+ 81 - 0
ruoyi-shipping/src/main/resources/mapper/shipping/TVoyageMapper.xml

@@ -113,6 +113,87 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             </if>
         </where>
     </select>
+    <select id="selectTVoyageListNew" parameterType="TVoyage" resultMap="TVoyageResult">
+        SELECT
+        tv.f_id,
+        tv.f_pid,
+        te.f_name pidName,
+        tv.f_no,
+        tv.f_portofloadid,
+        ta.f_name portofloadidName,
+        tv.f_portofdischargeid,
+        td.f_name portofdischargeidName,
+        tv.f_distinationid,
+        tr.f_name distinationidName,
+        tv.f_portoftransshipment,
+        ts.f_name portoftransshipmentName,
+        tv.f_ETD,
+        tv.f_ATD,
+        tv.f_ETA,
+        tv.f_ATA,
+        tv.f_days,
+        tv.f_ducomentrayoffdate,
+        tv.f_cutoffdate,
+        tv.f_teu,
+        tv.f_manageid,
+        su.user_name manageidName,
+        tv.f_tel,
+        CASE
+
+        WHEN tv.f_status = 'T' THEN
+        '正常' ELSE '停用'
+        END AS f_status,
+        TIMESTAMPDIFF(DAY,tv.f_ETD,DATE_FORMAT(tv.f_ducomentrayoffdate, '%Y-%m-%d %H:%i:%S')) closing,
+        tv.create_by,
+        tv.create_time,
+        tv.update_by,
+        tv.update_time,
+        tv.remark
+        FROM
+        t_voyage tv
+        LEFT JOIN t_vessel te ON tv.f_pid = te.f_id
+        LEFT JOIN t_address ta ON tv.f_portofloadid = ta.f_id
+        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
+        <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="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='cLoadDate != null and cLoadDate[0] != null and cLoadDate[0]!= ""'>
+                and tv.create_time &gt;= #{cLoadDate[0]}
+            </if>
+            <if test='cLoadDate != null and cLoadDate[1] != null and cLoadDate[1]!= ""'>
+                and tv.create_time &lt;= #{cLoadDate[1]}
+            </if>
+        </where>
+    </select>
 
     <select id="selectTVoyageById" parameterType="Long" resultMap="TVoyageResult">
         SELECT