CZT
2023-11-27 c206acfaedc69c390fb67daa81bc686f58a212ef
igds-inout/src/main/resources/mapper/InoutCommonMapper.xml
@@ -142,9 +142,9 @@
    <!-- 获取编码最大的单位 -->
    <select id="getMaxCustomerId" parameterType="java.lang.String"
            resultType="java.lang.String">
      select ID_ from D_INOUT_CUSTOMER
      where
      COMPANY_ID_ = #{companyId}
        select ID_
        from D_INOUT_CUSTOMER
        where COMPANY_ID_ = #{companyId}
      order by ID_ DESC limit 1
   </select>
@@ -156,7 +156,6 @@
        COMPANY_ID_ as companyId,
        DEPT_ID_ as deptId,
        PLAN_ID_ as planId,
        PLAN_NAME_ as planName,
        CONTRACT_ID_ as contractId,
        CONTRACT_NAME_ as contractName,
        NAME_ as name,
@@ -173,6 +172,7 @@
        CREATE_TIME_ as createTime,
        CREATE_USER_ as createUser,
        COMPLETE_TIME_ as completeTime,
        DEPOT_ID_ as depotId,
        REMARK_ as remark
        from
        D_INOUT_NOTICE_IN
@@ -198,9 +198,7 @@
    <!-- 新增入库通知单 -->
    <insert id="addNoticeIn" parameterType="com.ld.igds.models.InoutNoticeIn">
      insert into
      D_INOUT_NOTICE_IN (
      ID_,
        insert into D_INOUT_NOTICE_IN (ID_,
      COMPANY_ID_,
      DEPT_ID_,
      PLAN_ID_,
@@ -219,9 +217,8 @@
      CREATE_TIME_,
      CREATE_USER_,
      UPDATE_TIME_,
      REMARK_
      )values (
      #{param.id},
                                       REMARK_)
        values (#{param.id},
      #{param.companyId},
      #{param.deptId},
      #{param.planId},
@@ -240,8 +237,7 @@
      #{param.createTime},
      #{param.createUser},
      #{param.updateTime},
      #{param.remark}
      )
                #{param.remark})
   </insert>
    <!--更新入库通知单-->
@@ -267,8 +263,7 @@
    <!-- 获取所有未完成状态入库通知单 -->
    <select id="getUnComNoticeIn" resultType="com.ld.igds.models.InoutNoticeIn">
      select
      ID_ as id,
        select ID_            as id,
      COMPANY_ID_ as companyId,
      DEPT_ID_ as deptId,
      PLAN_ID_ as planId,
@@ -299,14 +294,12 @@
    <update id="reSumNoticeInComplete" parameterType="com.ld.igds.m.dto.NoticeParam">
      update D_INOUT_NOTICE_IN t,(
      SELECT
      r.CUSTOMER_ID_,
      r.FOOD_VARIETY_,
      r.NOTICE_ID_,
      sum(r.RECORD_WEIGHT_) as COMPLETE_NUMBER_
      from d_inout_record r
      where r.COMPANY_ID_ = #{param.companyId}
      and r.DEPT_ID_ = #{param.deptId}
      and r.CUSTOMER_ID_ = #{param.customerId}
      and r.FOOD_VARIETY_ = #{param.foodVariety}
      and r.NOTICE_ID_ = #{param.id}
      and r.RECORD_STATUS_ != 'DEL'
@@ -314,8 +307,8 @@
      GROUP BY r.FOOD_VARIETY_
      ) b
      SET t.COMPLETE_NUMBER_ = b.COMPLETE_NUMBER_
      WHERE t.CUSTOMER_ID_ = b.CUSTOMER_ID_
      AND t.FOOD_VARIETY_ = b.FOOD_VARIETY_
        WHERE
          t.FOOD_VARIETY_ = b.FOOD_VARIETY_
      AND t.ID_ = b.NOTICE_ID_
   </update>
@@ -387,7 +380,6 @@
        COMPANY_ID_ as companyId,
        DEPT_ID_ as deptId,
        PLAN_ID_ as planId,
        PLAN_NAME_ as planName,
        CONTRACT_ID_ as contractId,
        CONTRACT_NAME_ as contractName,
        NAME_ as name,
@@ -437,8 +429,7 @@
    <!-- 获取所有未完成状态出库通知单 -->
    <select id="getUnComNoticeOut" resultType="com.ld.igds.models.InoutNoticeOut">
      select
      ID_ as id,
        select ID_            as id,
      COMPANY_ID_ as companyId,
      DEPT_ID_ as deptId,
      PLAN_ID_ as planId,
@@ -473,7 +464,6 @@
    <update id="reSumNoticeOutComplete" parameterType="com.ld.igds.m.dto.NoticeParam">
      update D_INOUT_NOTICE_OUT t,(
      SELECT
      r.CUSTOMER_ID_,
      r.FOOD_VARIETY_,
      r.DEPOT_ID_,
      r.NOTICE_ID_,
@@ -481,7 +471,6 @@
      from d_inout_record r
      where r.COMPANY_ID_ = #{param.companyId}
      AND r.DEPT_ID_ = #{param.deptId}
      and r.CUSTOMER_ID_ = #{param.customerId}
      and r.DEPOT_ID_ = #{param.depotId}
      and r.FOOD_VARIETY_ = #{param.foodVariety}
      and r.RECORD_STATUS_ != 'DEL'
@@ -489,8 +478,7 @@
      GROUP BY r.DEPOT_ID_
      ) b
      SET t.COMPLETE_NUMBER_ = b.COMPLETE_NUMBER_
      WHERE t.CUSTOMER_ID_ = b.CUSTOMER_ID_
      AND t.FOOD_VARIETY_ = b.FOOD_VARIETY_
        WHERE  t.FOOD_VARIETY_ = b.FOOD_VARIETY_
      AND t.DEPOT_ID_ = b.DEPOT_ID_
      AND t.ID_ = b.NOTICE_ID_
   </update>