zhangyuewww пре 2 година
родитељ
комит
4c674cd9c9

+ 23 - 14
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/WarehousingOrderMapper.xml

@@ -11,9 +11,15 @@
         LEFT JOIN warehousing_order_record wor on wor.order_id = w.id and wor.delete_flag = '0'
         LEFT JOIN warehouse_base_info wbi on wbi.id=w.base_id and wbi.delete_flag = '0'
         LEFT JOIN contract_management_info cmi on cmi.contract_no = w.contract_no and cmi.comp_id=wbi.comp_id and cmi.delete_flag = '0'
-        WHERE
-        w.comp_id = #{compId}
-        and w.delete_flag = '0'
+        WHERE 1=1
+        <if test="compId != null and compId != ''">
+            and w.comp_id = #{compId}
+        </if>
+        <if test="compId == null or compId == ''">
+            and w.comp_id = '2710b21efc1e4393930c5dc800010dc4'
+        </if>
+        and
+        w.delete_flag = '0'
         <if test="startDate != null">
             AND (DATE_FORMAT(w.create_date,"%Y%m%d") &gt;=
             DATE_FORMAT(#{startDate},"%Y%m%d"))
@@ -49,22 +55,22 @@
         <if test="batchId != null and batchId != ''">
             AND w.batch_id= #{batchId}
         </if>
-        <if test="goodsName != null and goodsName != ''">
-            AND w.goods_name= #{goodsName}
-        </if>
-        <if test="warehouseName != null and warehouseName != ''">
-            AND w.warehouse_name= #{warehouseName}
-        </if>
-        <if test="goodsSource != null and goodsSource != ''">
-            AND w.goods_source= #{goodsSource}
-        </if>
         <if test="searchKeyWord != null and searchKeyWord != ''">
             AND (lower(w.goods_source) like lower(CONCAT('%',#{searchKeyWord},'%'))
-            OR lower(w.contract_no) like lower(CONCAT('%',#{searchKeyWord},'%')))
+            OR lower( w.contract_no) like lower(CONCAT('%',#{searchKeyWord},'%')))
         </if>
         <if test="baseId != null and baseId != ''">
             AND w.base_id= #{baseId}
         </if>
+        <if test="warehouseName != null and warehouseName != ''">
+            AND w.warehouse_name= #{warehouseName}
+        </if>
+        <if test="goodsName != null and goodsName != ''">
+            AND goods_name= #{goodsName}
+        </if>
+        <if test="goodsSource != null and goodsSource != ''">
+            AND goods_source= #{goodsSource}
+        </if>
         <if test="businessKeys != null and businessKeys.size > 0">
             and(
             <foreach collection="businessKeys" item="businessValue" open="(" close=")" separator="or">
@@ -72,7 +78,10 @@
             </foreach>
             )
         </if>
-        group BY w.base_id,DATE_FORMAT(w.issuing_time,"%Y%m%d") )tt
+        <if test="appFlag == null">
+            group BY w.base_id,DATE_FORMAT(w.issuing_time,"%Y%m%d %H")
+        </if>
+            )tt
     </select>
     <!-- 入库单列表查询 -->
     <select id="getListByCondition" parameterType="Map"