|
|
|
@ -92,89 +92,89 @@
|
|
|
|
|
<select id="selectOdsProcureOrderList" parameterType="OdsProcureOrder" resultMap="OdsProcureOrderResult">
|
|
|
|
|
<include refid="selectOdsProcureOrderVo"/>
|
|
|
|
|
<where>
|
|
|
|
|
<if test="siteCode != null and siteCode != ''">and Site_code = #{siteCode}</if>
|
|
|
|
|
<if test="ID != null and ID != ''">and ID = #{ID}</if>
|
|
|
|
|
<if test="procureCode != null and procureCode != ''">and Procure_Code = #{procureCode}</if>
|
|
|
|
|
<if test="materialCode != null and materialCode != ''">and Material_Code like concat('%', #{materialCode},
|
|
|
|
|
<if test="siteCode != null and siteCode != ''">and opo.Site_code = #{siteCode}</if>
|
|
|
|
|
<if test="ID != null and ID != ''">and opo.ID = #{ID}</if>
|
|
|
|
|
<if test="procureCode != null and procureCode != ''">and opo.Procure_Code = #{procureCode}</if>
|
|
|
|
|
<if test="materialCode != null and materialCode != ''">and opo.Material_Code like concat('%', #{materialCode},
|
|
|
|
|
'%') </if>
|
|
|
|
|
<if test="materialDesc != null and materialDesc != ''">and Material_Desc = #{materialDesc}</if>
|
|
|
|
|
<if test="planDate != null ">and Plan_Date = #{planDate}</if>
|
|
|
|
|
<if test="planNumber != null ">and Plan_Number = #{planNumber}</if>
|
|
|
|
|
<if test="Unit != null and Unit != ''">and Unit = #{Unit}</if>
|
|
|
|
|
<if test="realityNumber != null ">and Reality_Number = #{realityNumber}</if>
|
|
|
|
|
<if test="orderStatus != null and orderStatus != ''">and Order_Status = #{orderStatus}</if>
|
|
|
|
|
<if test="userDefined1 != null and userDefined1 != ''">and User_Defined1 = #{userDefined1}</if>
|
|
|
|
|
<if test="userDefined2 != null and userDefined2 != ''">and User_Defined2 = #{userDefined2}</if>
|
|
|
|
|
<if test="userDefined3 != null and userDefined3 != ''">and User_Defined3 = #{userDefined3}</if>
|
|
|
|
|
<if test="userDefined4 != null and userDefined4 != ''">and User_Defined4 = #{userDefined4}</if>
|
|
|
|
|
<if test="userDefined5 != null and userDefined5 != ''">and User_Defined5 = #{userDefined5}</if>
|
|
|
|
|
<if test="userDefined6 != null and userDefined6 != ''">and User_Defined6 = #{userDefined6}</if>
|
|
|
|
|
<if test="userDefined7 != null and userDefined7 != ''">and User_Defined7 = #{userDefined7}</if>
|
|
|
|
|
<if test="userDefined8 != null and userDefined8 != ''">and User_Defined8 = #{userDefined8}</if>
|
|
|
|
|
<if test="userDefined9 != null and userDefined9 != ''">and User_Defined9 = #{userDefined9}</if>
|
|
|
|
|
<if test="userDefined10 != null and userDefined10 != ''">and User_Defined10 = #{userDefined10}</if>
|
|
|
|
|
<if test="userDefined11 != null and userDefined11 != ''">and User_Defined11 = #{userDefined11}</if>
|
|
|
|
|
<if test="supplierCode != null and supplierCode != ''">and Supplier_Code = #{supplierCode}</if>
|
|
|
|
|
<if test="supplierName != null and supplierName != ''">and Supplier_Name like concat('%', #{supplierName},
|
|
|
|
|
<if test="materialDesc != null and materialDesc != ''">and opo.Material_Desc = #{materialDesc}</if>
|
|
|
|
|
<if test="planDate != null ">and opo.Plan_Date = #{planDate}</if>
|
|
|
|
|
<if test="planNumber != null ">and opo.Plan_Number = #{planNumber}</if>
|
|
|
|
|
<if test="Unit != null and Unit != ''">and opo.Unit = #{Unit}</if>
|
|
|
|
|
<if test="realityNumber != null ">and opo.Reality_Number = #{realityNumber}</if>
|
|
|
|
|
<if test="orderStatus != null and orderStatus != ''">and opo.Order_Status = #{orderStatus}</if>
|
|
|
|
|
<if test="userDefined1 != null and userDefined1 != ''">and opo.User_Defined1 = #{userDefined1}</if>
|
|
|
|
|
<if test="userDefined2 != null and userDefined2 != ''">and opo.User_Defined2 = #{userDefined2}</if>
|
|
|
|
|
<if test="userDefined3 != null and userDefined3 != ''">and opo.User_Defined3 = #{userDefined3}</if>
|
|
|
|
|
<if test="userDefined4 != null and userDefined4 != ''">and opo.User_Defined4 = #{userDefined4}</if>
|
|
|
|
|
<if test="userDefined5 != null and userDefined5 != ''">and opo.User_Defined5 = #{userDefined5}</if>
|
|
|
|
|
<if test="userDefined6 != null and userDefined6 != ''">and opo.User_Defined6 = #{userDefined6}</if>
|
|
|
|
|
<if test="userDefined7 != null and userDefined7 != ''">and opo.User_Defined7 = #{userDefined7}</if>
|
|
|
|
|
<if test="userDefined8 != null and userDefined8 != ''">and opo.User_Defined8 = #{userDefined8}</if>
|
|
|
|
|
<if test="userDefined9 != null and userDefined9 != ''">and opo.User_Defined9 = #{userDefined9}</if>
|
|
|
|
|
<if test="userDefined10 != null and userDefined10 != ''">and opo.User_Defined10 = #{userDefined10}</if>
|
|
|
|
|
<if test="userDefined11 != null and userDefined11 != ''">and opo.User_Defined11 = #{userDefined11}</if>
|
|
|
|
|
<if test="supplierCode != null and supplierCode != ''">and opo.Supplier_Code = #{supplierCode}</if>
|
|
|
|
|
<if test="supplierName != null and supplierName != ''">and opo.Supplier_Name like concat('%', #{supplierName},
|
|
|
|
|
'%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="Remark != null and Remark != ''">and Remark = #{Remark}</if>
|
|
|
|
|
<if test="createBy != null and createBy != ''">and Create_By = #{createBy}</if>
|
|
|
|
|
<if test="createDate != null ">and Create_Date = #{createDate}</if>
|
|
|
|
|
<if test="lastUpdateBy != null and lastUpdateBy != ''">and Last_Update_By = #{lastUpdateBy}</if>
|
|
|
|
|
<if test="lastUpdateDate != null ">and Last_Update_Date = #{lastUpdateDate}</if>
|
|
|
|
|
<if test="Active != null and Active != ''">and Active = #{Active}</if>
|
|
|
|
|
<if test="enterpriseId != null and enterpriseId != ''">and Enterprise_Id = #{enterpriseId}</if>
|
|
|
|
|
<if test="enterpriseCode != null and enterpriseCode != ''">and Enterprise_Code = #{enterpriseCode}</if>
|
|
|
|
|
<if test="palletNum != null and palletNum != ''">and pallet_num = #{palletNum}</if>
|
|
|
|
|
<if test="Remark != null and Remark != ''">and opo.Remark = #{Remark}</if>
|
|
|
|
|
<if test="createBy != null and createBy != ''">and opo.Create_By = #{createBy}</if>
|
|
|
|
|
<if test="createDate != null ">and opo.Create_Date = #{createDate}</if>
|
|
|
|
|
<if test="lastUpdateBy != null and lastUpdateBy != ''">and opo.Last_Update_By = #{lastUpdateBy}</if>
|
|
|
|
|
<if test="lastUpdateDate != null ">and opo.Last_Update_Date = #{lastUpdateDate}</if>
|
|
|
|
|
<if test="Active != null and Active != ''">and opo.Active = #{Active}</if>
|
|
|
|
|
<if test="enterpriseId != null and enterpriseId != ''">and opo.Enterprise_Id = #{enterpriseId}</if>
|
|
|
|
|
<if test="enterpriseCode != null and enterpriseCode != ''">and opo.Enterprise_Code = #{enterpriseCode}</if>
|
|
|
|
|
<if test="palletNum != null and palletNum != ''">and opo.pallet_num = #{palletNum}</if>
|
|
|
|
|
</where>
|
|
|
|
|
order by Create_Date desc
|
|
|
|
|
</select>
|
|
|
|
|
<select id="selectOdsProcureOrderListT" parameterType="OdsProcureOrder" resultMap="OdsProcureOrderResult">
|
|
|
|
|
<include refid="selectOdsProcureOrderVo"/>
|
|
|
|
|
<where>
|
|
|
|
|
<if test="siteCode != null and siteCode != ''">and Site_code = #{siteCode}</if>
|
|
|
|
|
<if test="ID != null and ID != ''">and ID = #{ID}</if>
|
|
|
|
|
<if test="procureCode != null and procureCode != ''">and Procure_Code = #{procureCode}</if>
|
|
|
|
|
<if test="materialCode != null and materialCode != ''">and Material_Code like concat('%', #{materialCode},
|
|
|
|
|
<if test="siteCode != null and siteCode != ''">and opo.Site_code = #{siteCode}</if>
|
|
|
|
|
<if test="ID != null and ID != ''">and opo.ID = #{ID}</if>
|
|
|
|
|
<if test="procureCode != null and procureCode != ''">and opo.Procure_Code = #{procureCode}</if>
|
|
|
|
|
<if test="materialCode != null and materialCode != ''">and opo.Material_Code like concat('%', #{materialCode},
|
|
|
|
|
'%') </if>
|
|
|
|
|
<if test="materialDesc != null and materialDesc != ''">and Material_Desc = #{materialDesc}</if>
|
|
|
|
|
<if test="planDate != null ">and Plan_Date = #{planDate}</if>
|
|
|
|
|
<if test="planNumber != null ">and Plan_Number = #{planNumber}</if>
|
|
|
|
|
<if test="Unit != null and Unit != ''">and Unit = #{Unit}</if>
|
|
|
|
|
<if test="realityNumber != null ">and Reality_Number = #{realityNumber}</if>
|
|
|
|
|
<if test="orderStatus != null and orderStatus != ''">and Order_Status = #{orderStatus}</if>
|
|
|
|
|
<if test="userDefined1 != null and userDefined1 != ''">and User_Defined1 = #{userDefined1}</if>
|
|
|
|
|
<if test="userDefined2 != null and userDefined2 != ''">and User_Defined2 = #{userDefined2}</if>
|
|
|
|
|
<if test="userDefined3 != null and userDefined3 != ''">and User_Defined3 = #{userDefined3}</if>
|
|
|
|
|
<if test="userDefined4 != null and userDefined4 != ''">and User_Defined4 = #{userDefined4}</if>
|
|
|
|
|
<if test="userDefined5 != null and userDefined5 != ''">and User_Defined5 = #{userDefined5}</if>
|
|
|
|
|
<if test="userDefined6 != null and userDefined6 != ''">and User_Defined6 = #{userDefined6}</if>
|
|
|
|
|
<if test="userDefined7 != null and userDefined7 != ''">and User_Defined7 = #{userDefined7}</if>
|
|
|
|
|
<if test="userDefined8 != null and userDefined8 != ''">and User_Defined8 = #{userDefined8}</if>
|
|
|
|
|
<if test="userDefined9 != null and userDefined9 != ''">and User_Defined9 = #{userDefined9}</if>
|
|
|
|
|
<if test="userDefined10 != null and userDefined10 != ''">and User_Defined10 = #{userDefined10}</if>
|
|
|
|
|
<if test="userDefined11 != null and userDefined11 != ''">and User_Defined11 = #{userDefined11}</if>
|
|
|
|
|
<if test="supplierCode != null and supplierCode != ''">and Supplier_Code = #{supplierCode}</if>
|
|
|
|
|
<if test="supplierName != null and supplierName != ''">and Supplier_Name like concat('%', #{supplierName},
|
|
|
|
|
<if test="materialDesc != null and materialDesc != ''">and opo.Material_Desc = #{materialDesc}</if>
|
|
|
|
|
<if test="planDate != null ">and opo.Plan_Date = #{planDate}</if>
|
|
|
|
|
<if test="planNumber != null ">and opo.Plan_Number = #{planNumber}</if>
|
|
|
|
|
<if test="Unit != null and Unit != ''">and opo.Unit = #{Unit}</if>
|
|
|
|
|
<if test="realityNumber != null ">and opo.Reality_Number = #{realityNumber}</if>
|
|
|
|
|
<if test="orderStatus != null and orderStatus != ''">and opo.Order_Status = #{orderStatus}</if>
|
|
|
|
|
<if test="userDefined1 != null and userDefined1 != ''">and opo.User_Defined1 = #{userDefined1}</if>
|
|
|
|
|
<if test="userDefined2 != null and userDefined2 != ''">and opo.User_Defined2 = #{userDefined2}</if>
|
|
|
|
|
<if test="userDefined3 != null and userDefined3 != ''">and opo.User_Defined3 = #{userDefined3}</if>
|
|
|
|
|
<if test="userDefined4 != null and userDefined4 != ''">and opo.User_Defined4 = #{userDefined4}</if>
|
|
|
|
|
<if test="userDefined5 != null and userDefined5 != ''">and opo.User_Defined5 = #{userDefined5}</if>
|
|
|
|
|
<if test="userDefined6 != null and userDefined6 != ''">and opo.User_Defined6 = #{userDefined6}</if>
|
|
|
|
|
<if test="userDefined7 != null and userDefined7 != ''">and opo.User_Defined7 = #{userDefined7}</if>
|
|
|
|
|
<if test="userDefined8 != null and userDefined8 != ''">and opo.User_Defined8 = #{userDefined8}</if>
|
|
|
|
|
<if test="userDefined9 != null and userDefined9 != ''">and opo.User_Defined9 = #{userDefined9}</if>
|
|
|
|
|
<if test="userDefined10 != null and userDefined10 != ''">and opo.User_Defined10 = #{userDefined10}</if>
|
|
|
|
|
<if test="userDefined11 != null and userDefined11 != ''">and opo.User_Defined11 = #{userDefined11}</if>
|
|
|
|
|
<if test="supplierCode != null and supplierCode != ''">and opo.Supplier_Code = #{supplierCode}</if>
|
|
|
|
|
<if test="supplierName != null and supplierName != ''">and opo.Supplier_Name like concat('%', #{supplierName},
|
|
|
|
|
'%')
|
|
|
|
|
</if>
|
|
|
|
|
<if test="Remark != null and Remark != ''">and Remark = #{Remark}</if>
|
|
|
|
|
<if test="createBy != null and createBy != ''">and Create_By = #{createBy}</if>
|
|
|
|
|
<if test="createDate != null ">and Create_Date = #{createDate}</if>
|
|
|
|
|
<if test="lastUpdateBy != null and lastUpdateBy != ''">and Last_Update_By = #{lastUpdateBy}</if>
|
|
|
|
|
<if test="lastUpdateDate != null ">and Last_Update_Date = #{lastUpdateDate}</if>
|
|
|
|
|
<if test="Active != null and Active != ''">and Active = #{Active}</if>
|
|
|
|
|
<if test="enterpriseId != null and enterpriseId != ''">and Enterprise_Id = #{enterpriseId}</if>
|
|
|
|
|
<if test="enterpriseCode != null and enterpriseCode != ''">and Enterprise_Code = #{enterpriseCode}</if>
|
|
|
|
|
<if test="palletNum != null and palletNum != ''">and pallet_num = #{palletNum}</if>
|
|
|
|
|
<if test="operationNumber != null and operationNumber != ''">and Operation_Number is not null </if>
|
|
|
|
|
<if test="Remark != null and Remark != ''">and opo.Remark = #{Remark}</if>
|
|
|
|
|
<if test="createBy != null and createBy != ''">and opo.Create_By = #{createBy}</if>
|
|
|
|
|
<if test="createDate != null ">and opo.Create_Date = #{createDate}</if>
|
|
|
|
|
<if test="lastUpdateBy != null and lastUpdateBy != ''">and opo.Last_Update_By = #{lastUpdateBy}</if>
|
|
|
|
|
<if test="lastUpdateDate != null ">and opo.Last_Update_Date = #{lastUpdateDate}</if>
|
|
|
|
|
<if test="Active != null and Active != ''">and opo.Active = #{Active}</if>
|
|
|
|
|
<if test="enterpriseId != null and enterpriseId != ''">and opo.Enterprise_Id = #{enterpriseId}</if>
|
|
|
|
|
<if test="enterpriseCode != null and enterpriseCode != ''">and opo.Enterprise_Code = #{enterpriseCode}</if>
|
|
|
|
|
<if test="palletNum != null and palletNum != ''">and opo.pallet_num = #{palletNum}</if>
|
|
|
|
|
<if test="operationNumber != null and operationNumber != ''">and opo.Operation_Number is not null </if>
|
|
|
|
|
</where>
|
|
|
|
|
order by Create_Date desc
|
|
|
|
|
</select>
|
|
|
|
|
<select id="selectOdsProcureOrderByID" parameterType="String" resultMap="OdsProcureOrderResult">
|
|
|
|
|
<include refid="selectOdsProcureOrderVo"/>
|
|
|
|
|
where ID = #{ID}
|
|
|
|
|
where opo.ID = #{ID}
|
|
|
|
|
</select>
|
|
|
|
|
<select id="selectWMSOdsProcureReturnOrderByID" parameterType="String" resultMap="OdsProcureOrderResult">
|
|
|
|
|
SELECT DISTINCT
|
|
|
|
@ -216,8 +216,8 @@
|
|
|
|
|
</select>
|
|
|
|
|
<select id="selectOdsProcureOrderByIDAndSap" parameterType="String" resultMap="OdsProcureOrderResult">
|
|
|
|
|
<include refid="selectOdsProcureOrderVo"/>
|
|
|
|
|
where ID = #{ID}
|
|
|
|
|
and ( Sap_Temp_Status!='1' OR Sap_Temp_Status is NULL)
|
|
|
|
|
where opo.ID = #{ID}
|
|
|
|
|
and ( opo.Sap_Temp_Status!='1' OR opo.Sap_Temp_Status is NULL)
|
|
|
|
|
</select>
|
|
|
|
|
<insert id="insertOdsProcureOrder" parameterType="OdsProcureOrder">
|
|
|
|
|
insert into ods_procure_order
|
|
|
|
@ -352,7 +352,7 @@
|
|
|
|
|
</select>
|
|
|
|
|
<select id="selectOdsProcureOrderAlreadyList" parameterType="OdsProcureOrder" resultMap="OdsProcureOrderResult">
|
|
|
|
|
<include refid="selectOdsProcureOrderVo"/>
|
|
|
|
|
<![CDATA[ where Procure_Code = #{procureCode} and Active='1' AND Order_Status <> 0 ]]>
|
|
|
|
|
<![CDATA[ where opo.Procure_Code = #{procureCode} and opo.Active='1' AND opo.Order_Status <> 0 ]]>
|
|
|
|
|
</select>
|
|
|
|
|
<update id="updateOdsProcureOrderAddOperationNumber" parameterType="OdsProcureOrder">
|
|
|
|
|
update ods_procure_order
|
|
|
|
@ -363,13 +363,13 @@
|
|
|
|
|
</update>
|
|
|
|
|
<select id="selectOdsProcureOrderAlreadyReaderList" parameterType="OdsProcureOrder" resultMap="OdsProcureOrderResult">
|
|
|
|
|
<include refid="selectOdsProcureOrderVo"/>
|
|
|
|
|
where Active='1'
|
|
|
|
|
AND Last_Update_Date IS NOT NULL
|
|
|
|
|
<if test="procureCode != null"> AND Procure_Code = #{procureCode}</if>
|
|
|
|
|
<if test="lastUpdateDateMIN != null ">AND CONVERT(date, Last_Update_Date, 23) >= #{lastUpdateDateMIN}</if>
|
|
|
|
|
<if test="lastUpdateDateMAX != null "> <![CDATA[ AND CONVERT(date, Last_Update_Date, 23) <= #{lastUpdateDateMAX} ]]></if>
|
|
|
|
|
<if test="materialCode != null and materialCode != ''">and Material_Code = #{materialCode}</if>
|
|
|
|
|
<if test="userDefined5 != null and userDefined5 != ''">and Material_Code = #{userDefined5}</if>
|
|
|
|
|
where opo.Active='1'
|
|
|
|
|
AND opo.Last_Update_Date IS NOT NULL
|
|
|
|
|
<if test="procureCode != null"> AND opo.Procure_Code = #{procureCode}</if>
|
|
|
|
|
<if test="lastUpdateDateMIN != null ">AND CONVERT(date, opo.Last_Update_Date, 23) >= #{lastUpdateDateMIN}</if>
|
|
|
|
|
<if test="lastUpdateDateMAX != null "> <![CDATA[ AND CONVERT(date, opo.Last_Update_Date, 23) <= #{lastUpdateDateMAX} ]]></if>
|
|
|
|
|
<if test="materialCode != null and materialCode != ''">and opo.Material_Code = #{materialCode}</if>
|
|
|
|
|
<if test="userDefined5 != null and userDefined5 != ''">and opo.Material_Code = #{userDefined5}</if>
|
|
|
|
|
</select>
|
|
|
|
|
<select id="updateOdsProcureOrderByProcureCode" parameterType="OdsProcureOrder">
|
|
|
|
|
update ods_procure_order
|
|
|
|
@ -895,9 +895,9 @@
|
|
|
|
|
|
|
|
|
|
<select id="selectOdsProcureOrderListSH" parameterType="OdsProcureOrder" resultMap="OdsProcureOrderResult">
|
|
|
|
|
<include refid="selectOdsProcureOrderVo"/>
|
|
|
|
|
where User_Defined5= #{userDefined5}
|
|
|
|
|
AND (Plan_Number-COALESCE ( Operation_Number, 0 ))>0
|
|
|
|
|
order by Create_Date desc
|
|
|
|
|
where opo.User_Defined5= #{userDefined5}
|
|
|
|
|
AND (opo.Plan_Number-COALESCE ( opo.Operation_Number, 0 ))>0
|
|
|
|
|
order by opo.Create_Date desc
|
|
|
|
|
</select>
|
|
|
|
|
<update id="updateOdsProcureOrderBy" >
|
|
|
|
|
update ods_procure_order
|
|
|
|
|