فهرست منبع

2021年12月1日09:06:01修改bug

txf 3 سال پیش
والد
کامیت
f99f1f0a50

+ 0 - 59
src/main/java/com/steerinfo/dil/controller/TmstrainPleaseApproveResultController.java

@@ -318,65 +318,6 @@ public class TmstrainPleaseApproveResultController extends BaseRESTfulController
         return success(i);
     }
 
-    /**
-     * 内转查询请车实绩
-     *
-     * @return
-     */
-
-    @ApiOperation(value = "查询请车作业")
-    @ApiImplicitParams({
-            @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
-            @ApiImplicitParam(name = "apiId(199)", value = "动态表头", required = false, dataType = "Integer"),
-            @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
-            @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
-            @ApiImplicitParam(name = "status", value = "状态码", required = false, dataType = "Integer"),
-    })
-    @PostMapping("/getAllWagonPleaseForConverted")
-    public RESTfulResult getAllWagonPleaseForConverted(@RequestBody(required = false) Map<String, Object> mapValue,
-                                                       Integer apiId,
-                                                       Integer pageNum,
-                                                       Integer pageSize,
-                                                       Integer status,
-                                                       String con) {
-        if (con != null) {
-            if (!"undefined".equals(con)) {
-                //设置要查询的索引名称
-                String index = "get_tmstrain_wagon_load";
-                //获取查询结果
-                return success(esFeign.getConResult(mapValue, index, apiId, pageNum, pageSize, con));
-            }
-        }
-        mapValue.put("status", status);
-        //初始化过滤
-        List<Map<String, Object>> wagonPleaseConvertedList = null;
-        //如果有条件查询则跳过初始化,和创建索引
-        if (mapValue.size() == 1) {
-            //将查询结果存入索引中
-            wagonPleaseConvertedList = tmstrainPleaseApproveResultService.selectPleaseApprovePlanForConverted(mapValue);
-            Map<String, Object> map = new HashMap<>();
-            //添加索引
-            map.put("index", "get_tmstrain_wagon_load");
-            //添加id
-            map.put("indexId", "resultId5");
-            wagonPleaseConvertedList.add(map);
-            //新建索引
-            String s = JSON.toJSONString(wagonPleaseConvertedList);
-            esFeign.insertIndex(wagonPleaseConvertedList);
-            //删除
-            wagonPleaseConvertedList.remove(wagonPleaseConvertedList.size() - 1);
-        }
-        if (wagonPleaseConvertedList == null) {
-            wagonPleaseConvertedList = tmstrainPleaseApproveResultService.selectPleaseApprovePlanForConverted(mapValue);
-        }
-        PageHelper.startPage(pageNum, pageSize);
-        //分页数据
-        List<Map<String, Object>> wagonPlease = tmstrainPleaseApproveResultService.selectPleaseApprovePlanForConverted(mapValue);
-        DataChange.changeDateToDayDate(wagonPlease, "resultPleaseDate", "resultPlanDate");
-        PageListAdd pageList = columnDataUtil.tableColumnData(apiId, wagonPleaseConvertedList, wagonPlease);
-        return success(pageList);
-    }
-
     /**
      * 通过id查询请车作业
      *

+ 109 - 27
src/main/resources/com/steerinfo/dil/mapper/TmstrainLoadingResultMapper.xml

@@ -903,33 +903,115 @@
   </select>
 <!-- 内转物流查询装车作业 -->
   <select id="selectLoadedForConverted" parameterType="java.util.Map" resultType="java.util.Map">
-    select
-           TLR.RESULT_ID                    "resultId",
-           TLR.RESULT_BILLABLE_TONNAGE      "resultBillableTonnage",
-           AROD.DAYPLAN_NO                  "dayplanNo",
-           TLR.RESULT_CLASS                 "resultClass",
-           TLR.INSERT_UPDATE_REMARK         "insertUpdateRemark",
-           TO_CHAR(TLR.RESULT_LOADING_DATE, 'yyyy-mm-dd')    "resultLoadingDate",
-           TLR.RESULT_WAGON_NO              "resultWagonNo",
-           RAS.ARRIVAL_NAME                 "dayplanSendStationName",
-           RAS2.ARRIVAL_NAME                "dayplanToTheStationName",
-           AROD.DAYPLAN_CONSIGNEE_NAME      "dayplanConsigneeName",
-           AROD.DAYPLAN_CONSIGNEE_TEL       "dayplanConsigneeTel",
-           RAS2.DAYPLAN_DEDICATED_LINE      "dayplanDedicatedLine",
-           RS.SHIPPER_NAME                  "shipperName",
-           RC.CONSIGNEE_COMPANY_NAME        "consigneeCompanyName"
-    from TMSTRAIN_LOADING_RESULT TLR
-           LEFT JOIN AMS_RAIL_OFFSET_DAYPLAN AROD
-                     ON AROD.DAYPLAN_ID = TLR.PURCHASE_ORDER_RAIL_PLAN_ID
-           LEFT JOIN RMSTRAIN_ARRIVAL_SEND RAS
-                     ON RAS.ARRIVAL_ID = AROD.DAYPLAN_SEND_STATION_ID
-           LEFT JOIN RMSTRAIN_ARRIVAL_SEND RAS2
-                     ON AROD.DAYPLAN_TO_THE_STATION_ID = RAS2.ARRIVAL_ID
-           LEFT JOIN RMS_CONSIGNEE RC
-                     ON RC.CONSIGNEE_ID = AROD.RECEIVING_UNIT_ID
-           LEFT JOIN RMS_SHIPPER RS
-                     ON RS.SHIPPER_ID = AROD.SHIPPER_ID
-    WHERE TLR.DELETED = 0 AND TLR.RESULT_TYPE = 4
+    select *
+    from (
+           select TLR.RESULT_ID                                  "resultId",
+                  TLR.RESULT_BILLABLE_TONNAGE                    "resultBillableTonnage",
+                  AROD.DAYPLAN_NO                                "dayplanNo",
+                  TLR.RESULT_CLASS                               "resultClass",
+                  TLR.INSERT_UPDATE_REMARK                       "insertUpdateRemark",
+                  TO_CHAR(TLR.RESULT_LOADING_DATE, 'yyyy-mm-dd') "resultLoadingDate",
+                  TLR.RESULT_LOADING_DATE                        "loadDate",
+                  TLR.RESULT_WAGON_NO                            "resultWagonNo",
+                  RAS.ARRIVAL_NAME                               "dayplanSendStationName",
+                  RAS2.ARRIVAL_NAME                              "dayplanToTheStationName",
+                  AROD.DAYPLAN_CONSIGNEE_NAME                    "dayplanConsigneeName",
+                  AROD.DAYPLAN_CONSIGNEE_TEL                     "dayplanConsigneeTel",
+                  RAS2.DAYPLAN_DEDICATED_LINE                    "dayplanDedicatedLine",
+                  RS.SHIPPER_NAME                                "shipperName",
+                  RC.CONSIGNEE_COMPANY_NAME                      "consigneeCompanyName"
+           from TMSTRAIN_LOADING_RESULT TLR
+                  LEFT JOIN AMS_RAIL_OFFSET_DAYPLAN AROD
+                            ON AROD.DAYPLAN_ID = TLR.PURCHASE_ORDER_RAIL_PLAN_ID
+                  LEFT JOIN RMSTRAIN_ARRIVAL_SEND RAS
+                            ON RAS.ARRIVAL_ID = AROD.DAYPLAN_SEND_STATION_ID
+                  LEFT JOIN RMSTRAIN_ARRIVAL_SEND RAS2
+                            ON AROD.DAYPLAN_TO_THE_STATION_ID = RAS2.ARRIVAL_ID
+                  LEFT JOIN RMS_CONSIGNEE RC
+                            ON RC.CONSIGNEE_ID = AROD.RECEIVING_UNIT_ID
+                  LEFT JOIN RMS_SHIPPER RS
+                            ON RS.SHIPPER_ID = AROD.SHIPPER_ID
+           WHERE TLR.DELETED = 0
+             AND TLR.RESULT_TYPE = 4
+         )
+    <where>
+      <if test="resultBillableTonnage != null">
+        and
+        <foreach collection="resultBillableTonnage" item="item" open="(" separator="or" close=")">
+          "resultBillableTonnage" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="dayplanNo != null">
+        and
+        <foreach collection="dayplanNo" item="item" open="(" separator="or" close=")">
+          "dayplanNo" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="resultClass != null">
+        and
+        <foreach collection="resultClass" item="item" open="(" separator="or" close=")">
+          "resultClass" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="insertUpdateRemark != null">
+        and
+        <foreach collection="insertUpdateRemark" item="item" open="(" separator="or" close=")">
+          "insertUpdateRemark" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="resultLoadingDate != null">
+        and
+        <foreach collection="resultLoadingDate" item="item" open="(" separator="or" close=")">
+          "resultLoadingDate" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="resultWagonNo != null">
+        and
+        <foreach collection="resultWagonNo" item="item" open="(" separator="or" close=")">
+          "resultWagonNo" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="dayplanSendStationName != null">
+        and
+        <foreach collection="dayplanSendStationName" item="item" open="(" separator="or" close=")">
+          "dayplanSendStationName" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="dayplanToTheStationName != null">
+        and
+        <foreach collection="dayplanToTheStationName" item="item" open="(" separator="or" close=")">
+          "dayplanToTheStationName" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="dayplanConsigneeName != null">
+        and
+        <foreach collection="dayplanConsigneeName" item="item" open="(" separator="or" close=")">
+          "dayplanConsigneeName" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="dayplanConsigneeTel != null">
+        and
+        <foreach collection="dayplanConsigneeTel" item="item" open="(" separator="or" close=")">
+          "dayplanConsigneeTel" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="shipperName != null">
+        and
+        <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
+          "shipperName" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="consigneeCompanyName != null">
+        and
+        <foreach collection="consigneeCompanyName" item="item" open="(" separator="or" close=")">
+          "consigneeCompanyName" like '%${item}%'
+        </foreach>
+      </if>
+    </where>
+    <include refid="orderBy"></include>
+    <if test="orderField == null  ">
+      order by "loadDate" desc
+    </if>
   </select>
 
   <select id="selectLoadByResultId" parameterType="java.math.BigDecimal" resultType="java.util.LinkedHashMap">

+ 104 - 0
src/main/resources/com/steerinfo/dil/mapper/TmstrainPleaseApproveResultMapper.xml

@@ -851,13 +851,18 @@
 
     <!--内转物流查询请车计划-->
     <select id="selectPleaseApprovePlanForConverted" parameterType="java.util.Map" resultType="java.util.Map">
+    SELECT
+        *
+    FROM(
         SELECT
                TPAR.RESULT_ID "resultId",
                AROD.DAYPLAN_ID "dayplanId",
                TPAR.RESULT_PLEASE_PLAN_NO "resultPleasePlanNo",
                TPAR.RESULT_PLEASE_NUMBER "resultPleaseNumber",
                TPAR.INSERT_USERNAME "insertUsername",
+               TPAR.INSERT_TIME     "insertTime",
                TO_CHAR(TPAR.RESULT_PLEASE_DATE, 'yyyy-mm-dd') "resultPleaseDate",
+               TPAR.RESULT_PLEASE_DATE   "pleaseDate",
                AROD.DAYPLAN_NO             "dayplanNo",
                RS.SHIPPER_NAME             "shipperName",
                TO_CHAR(AROD.DAYPLAN_DATE,'yyyy-mm-dd')  "dayplanDate",
@@ -868,6 +873,7 @@
                AROD.DAYPLAN_CONSIGNEE_TEL  "dayplanConsigneeTel",
                AROD.DAYPLAN_CONSIGNEE_NAME "dayplanConsigneeName",
                TO_char(TPAR.RESULT_APPROVE_DATE, 'yyyy-mm-dd') "resultApproveDate",
+               TPAR.RESULT_APPROVE_DATE "approveDate",
                TPAR.RESULT_APPROVE_NUMBER "resultApproveNumber",
                TO_CHAR(AROD.DAYPLAN_DELIVERY_DATE, 'yyyy-mm-dd') "dayplanDeliveryDate"
         FROM TMSTRAIN_PLEASE_APPROVE_RESULT TPAR
@@ -889,6 +895,104 @@
               <if test="resultId != null">
                 AND TPAR.RESULT_ID = #{resultId}
               </if>
+        )
+    <where>
+        <if test="resultPleasePlanNo != null">
+            <foreach collection="resultPleasePlanNo" item="item" open="(" separator="or" close=")">
+                "resultPleasePlanNo" like '%${item}%'
+            </foreach>
+        </if>
+        <if test="resultPleaseNumber != null">
+            and
+            <foreach collection="resultPleaseNumber" item="item" open="(" separator="or" close=")">
+                "resultPleaseNumber" like '%${item}%'
+            </foreach>
+        </if>
+        <if test="resultPleaseDate != null">
+            and
+            <foreach collection="resultPleaseDate" item="item" open="(" separator="or" close=")">
+                "resultPleaseDate" like '%${item}%'
+            </foreach>
+        </if>
+        <if test="dayplanNo != null">
+            and
+            <foreach collection="dayplanNo" item="item" open="(" separator="or" close=")">
+                "dayplanNo" like '%${item}%'
+            </foreach>
+        </if>
+        <if test="shipperName != null">
+            and
+            <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
+                "shipperName" like '%${item}%'
+            </foreach>
+        </if>
+        <if test="dayplanDate != null">
+            and
+            <foreach collection="dayplanDate" item="item" open="(" separator="or" close=")">
+                "dayplanDate" like '%${item}%'
+            </foreach>
+        </if>
+        <if test="dayplanSendStationName != null">
+            and
+            <foreach collection="dayplanSendStationName" item="item" open="(" separator="or" close=")">
+                "dayplanSendStationName" like '%${item}%'
+            </foreach>
+        </if>
+        <if test="dayplanToTheStationName != null">
+            and
+            <foreach collection="dayplanToTheStationName" item="item" open="(" separator="or" close=")">
+                "dayplanToTheStationName" like '%${item}%'
+            </foreach>
+        </if>
+        <if test="dayPlanDedicatedLine != null">
+            and
+            <foreach collection="dayPlanDedicatedLine" item="item" open="(" separator="or" close=")">
+                "dayPlanDedicatedLine" like '%${item}%'
+            </foreach>
+        </if>
+        <if test="consigneeCompanyName != null">
+            and
+            <foreach collection="consigneeCompanyName" item="item" open="(" separator="or" close=")">
+                "consigneeCompanyName" like '%${item}%'
+            </foreach>
+        </if>
+        <if test="dayplanConsigneeTel != null">
+            and
+            <foreach collection="dayplanConsigneeTel" item="item" open="(" separator="or" close=")">
+                "dayplanConsigneeTel" like '%${item}%'
+            </foreach>
+        </if>
+        <if test="dayplanConsigneeName != null">
+            and
+            <foreach collection="dayplanConsigneeName" item="item" open="(" separator="or" close=")">
+                "dayplanConsigneeName" like '%${item}%'
+            </foreach>
+        </if><if test="resultApproveDate != null">
+            and
+            <foreach collection="resultApproveDate" item="item" open="(" separator="or" close=")">
+                "resultApproveDate" like '%${item}%'
+            </foreach>
+        </if>
+        <if test="resultApproveNumber != null">
+            and
+            <foreach collection="resultApproveNumber" item="item" open="(" separator="or" close=")">
+                "resultApproveNumber" like '%${item}%'
+            </foreach>
+        </if>
+        <if test="dayplanDeliveryDate != null">
+            and
+            <foreach collection="dayplanDeliveryDate" item="item" open="(" separator="or" close=")">
+                "dayplanDeliveryDate" like '%${item}%'
+            </foreach>
+        </if>
+    </where>
+    <include refid="orderBy">
+    </include>
+    <if test="orderField == null  ">
+        order by
+        "pleaseDate"
+        desc
+    </if>
     </select>
 
     <!-- 发站/到站下拉框 -->